Commit Graph
140 Commits
Author SHA1 Message Date
beam f2300a8ebb beam: add semver parser/comparator with tests 2026-10-30 05:37:10 +00:00
beam 03f41830e0 beam: add rotated binary search with tests 2026-10-30 05:37:09 +00:00
beam c20c6bb821 beam: fix LRU cache get() missing-key return (None -> -1 to match spec/tests) 2026-10-30 05:37:09 +00:00
beam d50b413363 beam: verify_toposort_gen probe for one-shot iterator materialisation 2026-10-29 22:55:10 +00:00
beam 9a5367be0b beam: hardened thread-safe LRU cache (sentinel + RLock) 2026-10-29 20:49:39 +00:00
beam 6fe684f8c0 beam: MinHash near-duplicate line detector with tests 2026-10-29 18:46:59 +00:00
beam 5d10c3f6f6 beam: add FenwickRange (range add/range sum) with tests 2026-10-29 16:45:54 +00:00
ledger 4e14101d50 volt: majority() distinguishes empty, no-majority and a None/NaN majority (Q102) 2026-10-29 15:38:20 +00:00
beam a9bc1f7080 beam: convert retry_jitter tests to TestCase + mutant-killing assertions (Q59) 2026-10-29 14:38:19 +00:00
beam 0b4f7db6ba beam: minimum window substring (sliding window) + property tests 2026-10-29 12:36:27 +00:00
beam 56231707ad beam: median of two sorted arrays (binary partition) + fuzz tests 2026-10-29 10:35:08 +00:00
beam ed208eb34b beam: guard module-level sys.exit in two test files so pytest collection succeeds 2026-10-29 08:33:58 +00:00
beam 890ad3ade2 beam: add Manacher longest-palindromic-substring O(n) with tests 2026-10-29 06:16:21 +00:00
beam b485a2e7dd beam: add Hopcroft-Karp bipartite matching with brute-force-verified tests 2026-10-29 04:14:32 +00:00
beam 1a8e9968e7 beam: add bisect_bounds (lower/upper bound) with randomized tests 2026-10-29 02:12:43 +00:00
beam 367d66e574 beam: URL canonicalization utility with tests 2026-10-29 00:11:17 +00:00
beam 6fb2b4c6f3 beam: A* shortest-path with admissible heuristic + randomized cross-check vs Dijkstra 2026-10-28 22:09:31 +00:00
beam 8ffa56db47 beam: LRU cache with per-entry TTL (beam variant) + tests 2026-10-28 20:07:31 +00:00
Volt bab4431884 volt: Q95 -- find_duplicate gets a declared dead branch and 12 collected cells
The module had no cell in any gate, and read two ways: its docstring promised
ValueError for 'no duplicate present' while its self-test said it does not
promise detection at all. Measured at 95e4962: every array of length n+1 over
1..n for n=1..4 (1,114 inputs) returns a value occurring at least twice, 0
ValueErrors, and the no-duplicate guard's raise never fires (its condition is
evaluated on all 1,114 and is never true). The nearest no-duplicate shape,
[1,2,3,4], is refused by the RANGE gate: 'value 4 out of range [1, 3]'.

- find_duplicate.py: docstring edge case states the pigeonhole argument and
  that the branch is unreachable; the 'exactly one value appearing twice' claim
  (contradicted by the file's own [2,2,2] case) corrected; the guard moved into
  _no_duplicate_guard() with the reason it is kept -- with phase 2's loop
  deleted it fires on 272 of the same 1,114 arrays, first [1,2,1]; self-test
  paragraph replaced and it now asserts the range-gate message.
- test_find_duplicate.py: 12 cells / 1,133 subtests, including the exhaustive
  domain (pinned at 1,114 and 'the return occurs twice') and a dead-branch cell
  that traces the module and asserts the AST-located no-duplicate raise is the
  only unexecuted statement.
- Falsified: 9 named mutants, 9 killed, control green; beam CHECK 446 passed /
  2,007 subtests -> 458 / 3,140.
2026-10-28 19:23:04 +00:00
beam 86238b639b beam: add test_task_scheduler.py (11 tests) covering exact-vs-critical-path and validation 2026-10-28 18:05:57 +00:00
beam afdc563a9d beam: token-bucket rate limiter with injectable clock + tests 2026-10-28 16:02:19 +00:00
ledger 2f1187b6dd volt: Q111 correction -- 11ms control was 19/20 red (20ms now, 30/30) + test_shadow fixture race (10/10 red concurrent -> 0/10) 2026-10-28 14:35:29 +00:00
ledger 960469db33 beam: token_bucket blocking cell measures from the refill origin
WHY: test_acquire_blocks_and_returns took t0 after the drain, so the cell timed
only the part of the 0.05 s refill that happened after the scheduler returned to
it. Observed red in a loaded full-suite run at 7c36185:
'assert 0.03909331373870373 >= 0.04' -- 10.9 ms of untimed prefix. Deterministic
repro: pre-fix cell + 11 ms injected gap -> 0.03897/0.03912, rc 1.

FIX: t0 now precedes try_acquire(1.0), which is where the bucket sets _last, so
dt is >= 0.05 by construction (acquire cannot return before the refill origin is
1/rate old) and the 0.04 floor has ~10 ms of margin instead of 1 ms.

MEASURED: repo cell 9 passed; pre control rc 1 dt 0.03897-0.03912; post control
rc 0; same-gap in-process dt pre 0.039119 / post 0.050253; non-blocking-acquire
mutant rc 1 (2 failed: blocks + timeout cells); controls/post 15/15 green under
4-CPU saturation; bash wizard-work/beam/CHECK rc 0 twice, 423 passed / 2007
subtests.

CHECK: python3 /root/.hermes/wizard-outputs/volt/2026-10-28-q122/verify.py
2026-10-28 14:14:46 +00:00
ledger a6491d724a volt: Q111 -- weighted_interval_scheduling handles zero-length intervals, rejects reversed input; new test_*.py cell collected by beam CHECK (rc 0, 415 passed / 2007 subtests) 2026-10-28 14:00:59 +00:00
beam df7a972b25 beam: Dinic max-flow implementation with randomized cross-check vs Edmonds-Karp (8 tests pass) 2026-10-28 14:00:34 +00:00
beam 2b080cfca9 beam: fix path_sandbox root="/" containment (was requiring "//" prefix) 2026-10-28 11:58:49 +00:00
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