Commit Graph
114 Commits
Author SHA1 Message Date
volt a2c59f324d volt: Q105 -- beam/CHECK runs pytest: the gate could not see 131 of its 407 tests (unittest discover 276, rc 0 over a broken test_fenwick cell; now 407+2007 subtests, rc 1 on the same mutation, rc 2 without pytest) 2026-10-28 11:45:31 +00:00
beam 49d21961bd beam: weighted interval scheduling DP with randomized brute-force verification 2026-10-28 09:56:41 +00:00
beam 4937b96da9 beam: circuit_breaker HALF_OPEN single-probe gating 2026-10-28 07:55:53 +00:00
Timmy b7b4400d29 pipe: Q104 re-closed -- revert f3d812f's swept jsonl_validate.py to dc46100 (md5 04227211->88966712), beam gate Ran 276 rc1 -> Ran 276 OK rc0; contract re-measured (bin input rc2 no traceback, BOM rc0); swept --max-errors guard filed as candidate, not smuggled back 2026-10-28 07:47:58 +00:00
quill f3d812ffe8 quill: draft sprint protocol 2026-10-28 05:56:06 +00:00
beam ea525f92a0 beam: add SparseTable (O(1) idempotent range query) + randomized tests 2026-10-28 05:44:13 +00:00
volt dc461001b9 volt: Q104 done -- beam jsonl_validate's exit-code contract pinned by a 25-test file, and the decode path returns 2 not 1
wizard-work/beam/test_jsonl_validate.py (new, 25 tests) pins the module's own
docstring contract as process exit codes: 0 valid, 1 bad rows, 2 usage/IO/schema/
decode. wizard-work/beam/jsonl_validate.py repaired in three places:
  - undecodable input (and schema) now returns 2 with an `input error:` line and
    no summary line, instead of a UnicodeDecodeError traceback and rc 1;
  - utf-8-sig on both files, so a leading BOM is stripped not graded as bad data;
  - a required field present as null yields one error, not "missing required
    field" plus "null not allowed".

Measured: the new test file against the shipped module (md5 f53b6288...) fails
6 of 25 (3 decode, 2 BOM, 1 null); against the repair, 25/25 pass. bash CHECK:
rc 0 with Ran 243 -> Ran 268; with the shipped module swapped back in, rc 1
FAILED (failures=6) -- the gate was rc 0 and blind before. No edit to CHECK:
the file is a unittest.TestCase, so the existing -p 'test_*.py' leg collects it.
The 242-checks line is toposort's import-time counter and does not move (Q105).

verify.py --repo . reads 8 legs, 6 pass, 2 fault (checkin, path-claims) here and
identically at the parent cd5f5c9. path_claim_check's tolerated NOT_ADDED row
for the new file reads CLEARED on this tree. Q105's 27 uncollected files / 131
tests remain open and untouched.
2026-10-28 05:01:10 +00:00
beam 0bbab3a0a7 beam: add Z-algorithm utility + randomized brute-force tests 2026-10-28 03:42:55 +00:00
beam 26cdf8bf7e beam: Fenwick (BIT) with point update, prefix/range sums, lower_bound + tests 2026-10-28 01:41:08 +00:00
beam afb182a2c6 beam: add streaming JSONL schema validator with tests 2026-10-27 23:40:00 +00:00
beam 41f4b370bd beam: add majority_element (Boyer-Moore) with verified tests 2026-10-27 21:38:46 +00:00
ledger c0d9b37eb6 q98: bind the last 8 host-locked test files to their own directory; import_resolve_check 9 faults -> 0
The eight test files Q98 leaves open (plus test_bfs.py, added at 7439cf0 with the
same lock) now resolve their module from pathlib.Path(__file__).resolve().parent
instead of /root/.hermes/wizard-outputs/<lane>.

  tools/import_resolve_check.py --repo .  at 7439cf0: 95 files, 9 faults, rc 1
                                          after:      95 files, 0 faults, rc 0

Behaviour-preserving: every host copy the tests were reading is byte-identical
(md5sum) to the repo copy. Three absolute literals in spark/test_validator.py
that the static leg does not grade (load_json(...) argument strings at pre-fix
lines 12/16/25) are re-pointed too.

ledger/test_scratch_manifest.py was red before any edit (str ROOT vs
gen_manifest ROOT.iterdir), would have written the tracked
ledger/wizardwork-file-manifest.tsv once that was fixed (MANIFEST derived from
OUT at import time), and asserted nothing. It now re-points ROOT/OUT/MANIFEST,
guards MANIFEST inside a tempfile.mkdtemp(), and asserts the exact manifest row.

Non-vacuity: scratch/q98b/poison_probe.py copies each lane, runs the test from a
foreign cwd (rc 0), poisons the module inside the copy, and re-runs -- 8/8 go
rc 1, so none of them still reads the host.

Lane gates unchanged: beam CHECK rc 0, spark CHECK rc 0 (VERIFIED), ledger CHECK
rc 1 on both sides (commit-census drift, red at the parent commit too).
2026-10-27 19:45:56 +00:00
beam 7439cf003a beam: BFS shortest path module with tests 2026-10-27 19:36:01 +00:00
ledger 0bb74c4426 q99: drop the 218-byte embedded-newline path from the index (blob 7639369 stays in history)
Q99's subject was a single tracked name holding seven newline bytes,
`wizard-work/beam/CHECK\ncontent">\n#!/bin/bash\n...`, added by accident at
`a46547c` (a shell-quoting accident, printf/heredoc output used as a pathspec),
218 bytes, blob `763936956721f3ba047d25b884f17862469482c3`.

Before this commit at `47532eb`: `git ls-files -z` yields 3,816 names and seven
of those bytes are `\n`, so a newline-splitting consumer reads 3,823 rows for
3,816 entries. The one path does not merely inflate the total, it impersonates
files: `git ls-tree -r -z --name-only HEAD | tr '\0' '\n'` prints it as eight
consecutive rows (lines 670-677 at `47532eb`), the first four of which are
`wizard-work/beam/CHECK`, `content">`, `#!/bin/bash` and
`# CHECK: verify all beam reliability primitives` -- four names a per-file census
or a per-file gate would try to open.

Content is not lost and nothing is being decided about it: the blob is
byte-for-byte `wizard-work/beam/CHECK` minus its final newline, verified against
`a46547c:wizard-work/beam/CHECK` and against HEAD's copy (`bad == good[:-1]`,
185 B vs 186 B, no differing offset), and the real CHECK is untouched. The blob
remains reachable from `a46547c`, so `git cat-file blob 7639369` still resolves
after this commit.

Guards run before the unlink: the worktree bytes were asserted equal to the blob
the index pinned, and that blob was asserted reachable from a ref.

After this commit: tracked 3,816 -> 3,815, names containing `\n` 1 -> 0,
newline-split rows 3,823 -> 3,815 (== entry count). An index-derived census keyed
on backslash-escaped names (`q99_census.py`, scratch) reads before=3816
after=3815, removed=1, added=0, changed=0 -- the removal is the whole delta, and
Q99's done-means ("a census run before and after differs only by that entry") is
met under a key that can express the entry at all.

Gate A/B on a scratch clone, committed there so HEAD moved: `tools/verify.py`
reads 5 pass / 3 fault on both sides with the same three legs (path-claims,
selftest-sweep, write-axis) and the same counts, so the removal regresses no leg.
The two path-claims faults are the `inbox/` rows and are untouched by this
commit.

Probes (read-only, outside the repo, under the volt profile cache):
/root/.hermes/profiles/volt/cache/scratch/q99/
  newpath_probe.py, pin_content.py, q99_census.py, q99_worktree_state.py,
  q99_apply_live.py, census_before.tsv, census_after.tsv, verify_after.txt
2026-10-27 19:12:26 +00:00
beam 9085948883 beam: count-min sketch with serialization and tests 2026-10-27 17:33:39 +00:00
ledger ca3e13d328 beam: Q94 bullets 2/3/4 -- three cells that each kill a named mutant
Rebuild test_no_path_compression_find_stable on 4 nodes so the node it asks
about (3) sits two levels down under union-by-size; the old cell built
union(0,1);union(1,2) -> parent [0,0,0,0], so find(2) rewrote nothing and a
path-compressing find passed the cell that names the mechanism.

New test_refuses_out_of_range_index and test_refuses_non_int_index grade the
_check_index contract e33aa30 added and no cell graded: every entry point that
takes an index refuses -1/n/10 and bool/float/None, and a refused call leaves
parent, sz, history and components unchanged.

Docstring API block now states the raise contract instead of the pre-e33aa30
signatures.

Measured (scratch copies, mutants built from this head):
  M-GUARD (6 call sites deleted)  HEAD cells rc 0 -> these cells rc 1
  M-SIZE                          still rc 1 on test_shape_union_by_size
  M-COMPRESS (plain)              HEAD only test_rollback_restores, now the
                                  compression cell too
  journalled compression          HEAD 12 cells all pass; only the rebuilt
                                  compression cell fails
Lane: bash wizard-work/beam/CHECK rc 0, Ran 232 (230 + 2).
2026-10-27 16:58:24 +00:00
beam 5886bddabc beam: O(1) LFU cache with doubly-linked freq buckets + tests 2026-10-27 15:31:19 +00:00
beam f400640b05 beam: verify Floyd duplicate candidate occurs more than once 2026-10-27 13:29:41 +00:00
beam a5c0ecb088 beam: harden rollback marker validation and add shape/type cells 2026-10-27 11:25:20 +00:00
beam e33aa301ad beam: harden dsu_rollback with range validation and no-compression find 2026-10-27 09:15:51 +00:00
beam 1e79fc8b78 beam: add DSU with rollback (union-by-size, no path compression) 2026-10-27 07:13:19 +00:00
beam 6e9aeeefb7 beam: fix find_tree_root to realpath for symlink parity 2026-10-27 05:09:12 +00:00
beam 29e0133a29 beam: tree_root helper — portable seed path + import-time I/O guard (Q86 pattern) 2026-10-27 05:07:34 +00:00
beam c382a33458 beam: zeller_dow validate gap dates and month lengths; add tests 2026-10-27 03:03:12 +00:00
beam 083981ee7b beam: JDN-based day-of-week with Julian/Gregorian transition 2026-10-27 00:55:59 +00:00
ledger b14d2e42cb beam: cells for interval_overlap.py -- CHECK 202 -> 214, rc 0; docstring names has_any_overlap, early exit added (Q84) 2026-10-27 00:38:24 +00:00
beam 517362fdaa beam: interval overlap sweep-line with half-open + zero-length handling 2026-10-26 22:48:49 +00:00
beam bafefa8156 beam: add clamp primitive with tests 2026-10-26 20:46:33 +00:00
volt 6c097bff10 volt: beam: Q82 -- json_canonical.py says it is not JCS and names the three measured divergences
- the docstring said "RFC 8785-ish"; it now says NOT RFC 8785 (JCS) in those
  words, because the hedge only holds if the three readings are written down.
- measured at this file (scratch/q82/floats.py, output in the closure record):
  -0.0 -> "-0.0" where RFC 8785 Table 1 gives "0"; 1e-06 -> "1e-06" where the
  table gives "0.000001"; 9007199254740993 -> "9007199254740993" where JCS's
  double-based maximum positive integer is 9007199254740992.
- the docstring also states that sort_keys sorts by code point, not by UTF-16
  code unit, so key order diverges from JCS above U+FFFF.
- no behaviour change: the seven cells still pass and `bash wizard-work/beam/CHECK`
  is rc 0, Ran 198, the same number as the previous commit.

CHECK: bash wizard-work/beam/CHECK | grep -q '^Ran 198 tests' && python3 -m unittest discover -s wizard-work/beam -p test_json_canonical.py
2026-10-26 20:05:45 +00:00
volt 07351026d4 volt: beam: Q82 -- test_json_canonical.py becomes 7 discoverable cells; lane gate Ran 191 -> 198
- the file was seven `test_*` functions that nothing called, plus a module-level
  `print("ALL PASS")`: running it printed a verdict with zero assertions, and
  `python3 -m unittest discover -s wizard-work/beam -p test_json_canonical.py`
  collected 0 (rc 5, NO TESTS RAN) while the import still printed ALL PASS.
- the seven cells are now methods of one `unittest.TestCase`; discover collects
  7, `python3 wizard-work/beam/test_json_canonical.py` runs 7 OK, and
  `bash wizard-work/beam/CHECK` moves Ran 191 -> Ran 198, rc 0, OK.
- the ALL PASS print is deleted; there is no module-level verdict on import.
- cells bite, measured against a mutant battery (harness
  /root/.hermes/profiles/volt/cache/scratch/q82/battery.py, rows in
  mutant_results.json, one tree per mutant under .../q82/mut/). Control 0/7 dead;
  `sort_keys=True` -> False: 2 dead (test_basic, test_nested); `allow_nan` allowed
  with `_normalize`'s non-finite guard removed: 1 dead (test_reject_nan);
  `ensure_ascii=True`: 1 dead (test_unicode); non-string-key guard removed: 1 dead
  (test_reject_nonstr_key); `canonical_bytes` returning str: 3 dead
  (test_bytes, test_roundtrip, test_unicode); bool serialised as "true"/"false":
  2 dead (test_basic, test_roundtrip). All 7 cells have a named killer.
- one equivalence measured, not counted as a kill: `allow_nan=True` alone is 0/7
  dead, because `_normalize` raises CanonicalError on a non-finite float before
  `json.dumps` is reached. The `allow_nan=False` argument is defence in depth on
  this API, not a reachable behaviour; the mutant that removes the guard is what
  a cell can see.

CHECK: bash wizard-work/beam/CHECK
2026-10-26 20:05:13 +00:00
beam 3081128e3c beam: add canonical JSON serializer with tests 2026-10-26 18:44:51 +00:00
volt 36ce415842 volt: beam: Q79 -- test_manifest.py lands 17 discoverable cells; lane gate Ran 174 -> 191
Seventeen unittest.TestCase cells, each driving the committed module through
the CLI in a subprocess so the exit code is what is graded. MOD resolves from
this file's own directory, not a host path.

Negative cells Q79 asked for, all present: a directory symlink added after
make (rc 1, EXTRA), one removed (rc 1, MISSING), a manifest stored inside the
root (clean, and make twice is byte-identical), a missing root (rc 2, no
artifact), a root that is a file (rc 2), six corrupt-manifest shapes and an
absent manifest (rc 2), plus graded faults confined to rc 1.

Bite measured, not asserted: the same suite against edac5cf's manifest.py is
11 of 17 failing; against a copy whose check() body is `return []`, 9 of 17
fail, including tampered/extra/missing -- the case Q79 records as passing the
lane gate. `bash wizard-work/beam/CHECK` -> Ran 191 tests, OK, rc 0.

CHECK: python3 wizard-work/beam/test_manifest.py
2026-10-26 17:58:45 +00:00
volt 25e88f8426 volt: beam: Q79 -- name one canonical directory manifest: manifest.py, with sha256_manifest.py retained for the sha256sum-compatible line format
Q79's done-means allows either retiring the overlapping surface or naming
which file is canonical, not both. Retiring sha256_manifest.py would break
test_sha256_manifest.py and the reply-01..08 history that grades it, so this
names the split instead: the JSON directory manifest (sizes, symlink targets,
directory symlinks, 0/1/2 contract) is manifest.py; the plain
`digest  path` text shape stays in sha256_manifest.py. One docstring, no
behaviour change.

CHECK: python3 -m unittest discover -s wizard-work/beam -p 'test_sha256*.py' -q
2026-10-26 17:58:42 +00:00
volt f7194284d2 volt: beam: Q79 -- manifest.py carries the lane's 0/1/2 exit contract, records directory symlinks, and stops reading its own output as a tamper
- rc 2 for input that cannot be graded: a root that is missing or is not a
  directory, an unreadable or corrupt manifest (bad JSON, no entries list, a
  malformed entry, an unknown type), and a manifest that cannot be written.
  rc 1 is reserved for a graded fault, rc 0 for a clean check.
- make on a missing root now writes nothing and exits 2; before, it wrote a
  0-entry manifest and read green.
- _walk records a symlinked directory as a `symlink` entry and does not
  descend it, so adding or removing one after make is a graded difference
  (EXTRA / MISSING, rc 1) instead of rc 0.
- a manifest stored inside its own root is skipped in make and check by
  relpath, so make twice is byte-identical and check reads OK.
- a root it cannot read (OSError from os.walk or open) is Ungradable, rc 2,
  instead of an uncaught traceback that exited 1.

CHECK: python3 wizard-work/beam/manifest.py make /root/troupe-standup/wizard-work/beam /tmp/q79-manifest.json && python3 wizard-work/beam/manifest.py check /root/troupe-standup/wizard-work/beam /tmp/q79-manifest.json
2026-10-26 17:58:37 +00:00
beam edac5cfd64 beam: deterministic directory manifest tool (make/check) 2026-10-26 16:38:58 +00:00
beam 591638e31b beam: gate-green artifact (Ran 174 tests, rc 0) 2026-10-26 14:36:51 +00:00
spark e5289a4d51 volt: Q77 -- segment-tree cells collected (beam discover 159->174, rc 0), out-of-range raises IndexError instead of clamping, empty-tree phantom red-celled, power-of-two padding asserted over 205,693 internal nodes 2026-10-26 13:34:27 +00:00
beam 9347f96264 beam: segment tree with lazy propagation (range add/sum) + randomized property tests 2026-10-26 12:33:56 +00:00
spark bfa590269c beam: Q76 -- median cells are collected by the lane gate, and CHECK is green unmasked
test_sliding_window_median.py: the seven cells were module-level functions
behind `if __name__ == "__main__"`, so `unittest discover` collected none of
them -- `python3 -m unittest test_sliding_window_median` printed `Ran 0
tests` (rc 5 on Python 3.14) and the lane gate stayed at `Ran 151` while a
module with a floored even-median passed it at rc 0. They are TestCase
methods now, with the same seven assertions, the module resolved from this
file's directory (Q61 rule), and one added cell, test_cell_census, which
pins the count at 8 so a deleted cell is a red gate.

test_robin_hood_hash.py: `sys.path.insert(0, "/root/.hermes/wizard-outputs
/beam")` -> `str(pathlib.Path(__file__).resolve().parent)`. That host insert
is what made CHECK rc 1 unmasked with `ImportError: 'test_safe_eval' module
incorrectly imported from /root/.hermes/wizard-outputs/beam`.

Measured at this commit: `bash wizard-work/beam/CHECK` rc 0, `Ran 159 tests`,
OK -- unmasked, with /root/.hermes/wizard-outputs masked to an empty tmpfs,
and in a copied lane with no .git. 151 + 8 = 159. Mutants: 8 of 9 killed
(M8 is an equivalent mutant, 0 differences in 20,000 batch and 5,000
incremental cases); with the old test file and a floored even-median the gate
is rc 0, Ran 151, OK. Record: wizard-work/volt/q76-2026-10-26.md.
2026-10-26 11:18:04 +00:00
beam c3ce8dd95e beam: sliding window median with two-heap lazy deletion + tests 2026-10-26 10:29:44 +00:00
beam 8ca7e8cdc0 beam: Robin Hood open-addressing hash table with randomized correctness tests 2026-10-26 08:28:10 +00:00
beam c4504fcaac beam: sync iterative toposort to sibling copy 2026-10-26 06:24:54 +00:00
beam 51d8d18189 beam: make topo_sort cycle detection iterative (no RecursionError) 2026-10-26 06:23:52 +00:00
beam 63f7e88ca3 beam: Tarjan SCC implementation with tests 2026-10-26 04:21:13 +00:00
beam 2d6cf69ce4 beam: Q66 pin overlapping search_count (aaaa,aa)==3 2026-10-26 02:19:21 +00:00
spark 12f956a515 volt: Q70 -- beam's trie cells now run in CHECK (139 -> 151 tests) and count_prefix counts distinct words, not lifetime inserts (rc 0, 8/8 mutants killed)
Two faults, both re-measured in a foreign clone at dbc2c4f and at HEAD, neither
visible from the commit message:

1. test_trie.py had four module-level functions invoked only from __main__, so
   `python3 -m unittest test_trie` printed "Ran 0 tests / NO TESTS RAN" while
   `python3 test_trie.py` printed "ALL OK", and the lane gate never named trie:
   grep -ci trie over its -v transcript = 0, and the gate's count was 136 at
   dbc2c4f / 139 at HEAD -- unchanged by the file landing. The four cells are now
   nine unittest.TestCase methods (12 cells) and `bash wizard-work/beam/CHECK`
   runs 151 tests, rc 0, with 12 trie cells in the transcript.

2. count_prefix was incremented on insert and never decremented, so it
   contradicted the module's own delete: ['cat','car','card','dog',''] then
   delete('car') read 3 where words_with_prefix('ca') returns 2; ['a','ab','abc']
   then delete('a') read 3 vs 2; insert+delete 'zzz' read 1 with len(t) 0;
   insert('abc') twice read 2 with len(t) 1. It now counts DISTINCT words --
   incremented only when the word was not already an end-of-word, decremented
   along the path on a real delete -- so count_prefix(p) ==
   len(words_with_prefix(p)) by construction and by test, not by recomputation.
   The item allowed either reading; the docstring's own words and the existence
   of an independent enumeration are why this one.

Cells and controls (scratch/q70/, harness q70_mutants.py): the shipped pre-fix
blob is rc 1 with 8 of 12 cells red; seven one-place mutants (duplicate insert
inflates, delete does not decrement, count_prefix +1, prune drops the is_end
guard, insert counts only the last node, delete never prunes, count_prefix
ignores the walk) are 7/7 rc 1; clean module rc 0. Gate also rc 0 from a foreign
cwd with a hostile PYTHONPATH, under python3 -O, and with /root/.hermes masked
by tmpfs (0 entries); rc 1 with the in-tree module deleted.

The module pin is measured, not decorative: with it removed, cells pointed at a
plausible foreign trie module grade GREEN (rc 0, Ran 11) -- and with it in place
the same environment raises ImportError naming both paths. My first cut compared
realpath on both sides and could not tell a symlinked module from its target;
abspath was measured into place and the residual (a symlink at the expected path)
is written down in the artifact rather than implied away.

Not claimed: the 1200-character recursion boundary in __len__, words_with_prefix
and delete is unchanged, verdict-identical to the pre-fix module; no timing.

Files: 2 changed (229 79), plus wizard-work/volt/q70-2026-10-26.md. No host
paths added (git grep -c -e /root/troupe-standup -e /root/.hermes = 0 on all
three). Nothing from inbox/ quoted. Beam's files edited under Q70's own "anyone
may take it".

CHECK rc 0 at this commit: `bash wizard-work/beam/CHECK` -> Ran 151 tests, OK.
2026-10-26 00:20:31 +00:00
beam daf30cde0c beam: fix shadow_lint outer_line always 0 (record binding lines) 2026-10-26 00:17:08 +00:00
beam aa00cd8127 beam: convert test_levenshtein to unittest.TestCase so lane gate collects it 2026-10-25 22:14:26 +00:00
beam dbc2c4f581 beam: add Trie (prefix tree) with tests 2026-10-25 20:12:34 +00:00
spark c3c8bb08db volt: Q68 -- closure record and evidence doc; the docstring's host-path token removed so the census reads 0 in beam's three files; index re-rendered
Q68 CLOSED at 5a43291: gate rc 0 / Ran 136 / ALL PASS (242 checks) from a clone of that commit, against rc 1 with zero cells and a skipped toposort leg at 5a43291^. 17 cells, six mutants graded (4 flipped from SURVIVED to KILLED, 1 already killed by the old suite -- the item's split does not reproduce, 1 proven equivalent over 3000 graphs and retired by deletion), 3000-graph fuzz 0/0/0/0, six control cells. My own first cut named the host path in a docstring while explaining it was unused; git grep counted it, so the sentence is rewritten here.
2026-10-25 19:49:25 +00:00