diff --git a/CHECK-q167 b/CHECK-q167 new file mode 100644 index 0000000..e0669d3 --- /dev/null +++ b/CHECK-q167 @@ -0,0 +1,100 @@ +#!/usr/bin/env bash +# CHECK-q167 -- the queue's open-set pin matches the queue it sits beside, in +# this worktree AND in the commit, and the reading is not unconditional. +# +# The defect (Q167, 2026-11-04): `56d3853` appended a heading to +# `WORK-QUEUE.md` (`## Q69 addendum 2 ...`), re-rendered `docs/queue-index.md` +# and left `PIN_COUNTS` in `wizard-work/volt/q137-open-set/open_set.py` at the +# pre-append values, so the repo gate's open-set leg read +# `FAIL count headings moved 116 -> 117` at HEAD and `gate: FAULT` for two +# commits. The append-audit leg stayed green because the index was current: +# nothing graded the pin per commit. +# +# Four legs: +# pin this worktree's `open_set.py --check` reads rc 0 and prints +# `CHECK OK` +# counts an independent grep/sort recount of WORK-QUEUE.md -- headings, +# heading ids, records, record ids -- equals the numbers the tool +# prints, so the pin is graded against the file, not against itself +# tree `git archive HEAD` into a scratch dir, graded by that tree's own +# open_set.py: the commit is read, not the worktree (this leg reads +# rc 1 at 56d3853) +# poison a copy of the queue with one appended heading must red, so the +# green above is the pin and not an unconditional pass +# +# Exit codes: 0 all legs passed, 1 a fault, 2 could not grade. +set -u +set -o pipefail + +cd "$(dirname "${BASH_SOURCE[0]}")" || exit 2 +ROOT="$(pwd)" +QUEUE="$ROOT/WORK-QUEUE.md" +TOOL="$ROOT/wizard-work/volt/q137-open-set/open_set.py" +PY="${PYTHON:-python3}" + +for f in "$QUEUE" "$TOOL"; do + if [ ! -f "$f" ]; then + printf 'CANNOT GRADE: missing %s\n' "$f" + exit 2 + fi +done + +WORK="$(mktemp -d "${TMPDIR:-/tmp}/check-q167.XXXXXX")" || exit 2 +trap 'rm -rf "$WORK"' EXIT + +passed=0 +failed=0 +row() { printf ' %-8s %s\n' "$1" "$2"; } +verdict() { if [ "$2" -eq 0 ]; then passed=$((passed + 1)); else failed=$((failed + 1)); fi; row "$1" "$3"; } + +# --- leg 1: the worktree pin is the worktree queue --------------------------- +out="$("$PY" "$TOOL" --repo "$ROOT" --check 2>&1)"; rc=$? +last="$(printf '%s' "$out" | tail -1)" +verdict pin \ + "$([ "$rc" -eq 0 ] && printf '%s' "$out" | grep -q 'CHECK OK' && echo 0 || echo 1)" \ + "rc=$rc ${last:-}" + +# --- leg 2: the tool's counts are the file's counts -------------------------- +heads="$(grep -cE '^##+ +Q[0-9]+' "$QUEUE")" +recs="$(grep -cE '^\*\*Q[0-9]+ +—' "$QUEUE")" +head_ids="$(grep -oE '^##+ +Q[0-9]+' "$QUEUE" | grep -oE 'Q[0-9]+' | sort -u | wc -l | tr -d ' ')" +rec_ids="$(grep -oE '^\*\*Q[0-9]+ +—' "$QUEUE" | grep -oE 'Q[0-9]+' | sort -u | wc -l | tr -d ' ')" +line="$(printf '%s' "$out" | head -1)" +hits=0 +printf '%s' "$line" | grep -q "$heads headings/$head_ids ids" && hits=$((hits + 1)) +printf '%s' "$line" | grep -q "$recs records/$rec_ids ids" && hits=$((hits + 1)) +verdict counts "$([ "$hits" -eq 2 ] && echo 0 || echo 1)" \ + "recount=$heads headings/$head_ids ids, $recs records/$rec_ids ids hits=$hits/2" + +# --- leg 3: the committed tree, graded by its own tool ------------------------ +mkdir -p "$WORK/head" || exit 2 +if ! git -C "$ROOT" archive HEAD | tar -x -C "$WORK/head" 2>"$WORK/tar.log"; then + printf 'CANNOT GRADE: git archive HEAD failed: %s\n' "$(tail -1 "$WORK/tar.log")" + exit 2 +fi +tout="$("$PY" "$WORK/head/wizard-work/volt/q137-open-set/open_set.py" \ + --repo "$WORK/head" --check 2>&1)"; trc=$? +rev="$(git -C "$ROOT" rev-parse --short HEAD)" +tlast="$(printf '%s' "$tout" | tail -1)" +verdict tree \ + "$([ "$trc" -eq 0 ] && printf '%s' "$tout" | grep -q 'CHECK OK' && echo 0 || echo 1)" \ + "HEAD=$rev rc=$trc ${tlast:-}" + +# --- leg 4: one appended heading must red ------------------------------------ +mkdir -p "$WORK/poison" || exit 2 +cp "$TOOL" "$WORK/poison/open_set.py" || exit 2 +cp "$QUEUE" "$WORK/poison/WORK-QUEUE.md" || exit 2 +printf '\n## Q999 poison — a heading the pin did not count\n' >> "$WORK/poison/WORK-QUEUE.md" +pout="$("$PY" "$WORK/poison/open_set.py" --repo "$WORK/poison" --check 2>&1)"; prc=$? +named="$(printf '%s' "$pout" | grep -c 'headings')" +plast="$(printf '%s' "$pout" | tail -1)" +verdict poison \ + "$([ "$prc" -eq 1 ] && [ "$named" -ge 1 ] && echo 0 || echo 1)" \ + "rc=$prc (want 1) headings-named=$named ${plast:-}" + +if [ "$failed" -eq 0 ]; then + echo "q167: $passed leg(s), 0 fault(s), rc 0" + exit 0 +fi +echo "q167: $passed passed, $failed fault(s), rc 1" +exit 1 diff --git a/WORK-QUEUE.md b/WORK-QUEUE.md index 2c38c3d..95f9229 100644 --- a/WORK-QUEUE.md +++ b/WORK-QUEUE.md @@ -14673,3 +14673,20 @@ CHECK: `bash CHECK-q69-census` Files: `wizard-work/volt/q65_rc_probe.py` (SCRATCH_ROOT and its comment), `wizard-work/volt/q69_scratchroot_check.sh` (new guard, five legs), `WORK-QUEUE.md` (this record), `docs/queue-index.md` (re-rendered). CHECK: `bash wizard-work/volt/q69_scratchroot_check.sh` + +## Q167 closure — the queue's pin sat two commits behind the queue, and nothing graded the pin in the commit *(volt, 2026-11-04, at `56d3853` and the commit this record lands in; sol lane by authorship, unclaimed and taken)* + +**Q167 — OPENED and REPAIRED in the same tick (volt, 2026-11-04, at `56d3853` and the commit this record lands in; sol lane by authorship, unclaimed and taken).** The repo gate has been red at HEAD for two commits over one heading. `56d3853` ("sol: fresh independent CHECK for sol-profile file-class census") appended a second Q69 addendum to this file — the heading `## Q69 addendum 2 — the probe's scratch root derived from TMPDIR ...` — and shipped the re-rendered `docs/queue-index.md`, which is the bookkeeping half the `append-audit` gate leg grades, but not the `PIN_COUNTS` move the same append makes in `wizard-work/volt/q137-open-set/open_set.py`. That heading is the first Q69 heading to be counted twice: Q69 already carries a heading, so `headings` moves 116 -> 117 while `heading_ids`, every record counter, `ids`, `record_only`, `open` and `opened` stand still — and `open_set.py --check` names exactly that one move and no other. Two commits landed on top of it (`be27411`, `8fd9f99`) without the pin moving, so the fault is not the append alone: neither later tick read the gate. + +**(1) The defect, measured at two revs instead of read off the diff.** Two `git archive` exports under `/root/.hermes/wizard-outputs/volt/q167-pin/revs/`, each graded by the `open_set.py` that rev carries: + +- `1c3c855` (the append's parent): `queue: 14653 lines, 116 headings/101 ids, 129 records/95 ids, 55 record-only ids`, then `CHECK OK: 0 open, 26 ever opened, counts match the pin`, **rc 0**. +- `56d3853`: `queue: 14675 lines, 117 headings/101 ids, 129 records/95 ids, 55 record-only ids`, then `FAIL count headings moved 116 -> 117`, `CHECK 1 fault(s)`, **rc 1**. + +At `406dd17`, `python3 tools/verify.py --fast` read **12 legs, 10 pass, 1 fault, 0 ungradable, 1 skipped**, `fault: open-set`, `gate: FAULT` — the queue's own state, not a lane's, is what closed the gate. + +**(2) The repair: the pin moves to the values this append makes, and a guard reads the committed tree.** `PIN_COUNTS` takes the post-append counts measured by `--check` (headings 118, heading_ids 102, records 130, record_ids 96, ids 157, record_only 55, open 0, opened 26), and `CHECK-q167` grades four legs: `pin` — this worktree's `open_set.py --check` reads rc 0 and prints `CHECK OK`; `counts` — an independent `grep` / `sort -u` recount of `WORK-QUEUE.md` (headings, heading ids, records, record ids) must equal the numbers the tool prints, so the tool's reading is checked against the file rather than against its own pin; `tree` — `git archive HEAD` into a scratch directory, graded by that tree's own `open_set.py`, so the leg reads the commit and not the worktree (this is the leg that reads rc 1 at `56d3853`); `poison` — a copy of the queue with one appended heading (`## Q999 poison`) must red, so the green above is the pin and not an unconditional pass. + +**(3) Bookkeeping, measured after the append and before the commit landed.** The append carries a heading (`## Q167 closure`) and a record (`**Q167 — OPENED and REPAIRED ...`) for a new id: headings 117 -> 118, heading_ids 101 -> 102, records 129 -> 130, record_ids 95 -> 96, ids 156 -> 157; `record_only` stays 55 and `open` / `opened` stay 0 / 26, because a same-tick `OPENED and REPAIRED` is a closure (the Q138 rule), so no probe is registered for Q167 and CHECK-q167 is its guard. `python3 tools/queue_index.py --write docs/queue-index.md` re-rendered. One row added by hand to `wizard-work/volt/q143-check-sweep/check_entry_baseline.tsv` for the new root entry point, with the code measured at this landing. + +**(4) Not claimed.** That the append's author had a rule to read: Q156 wrote the rule down, and `tools/queue_append_audit.py` still grades the index only, not the pin — so a commit in this shape reads `append-audit PASS` while the gate reds. This record repairs the pin and guards the committed tree at HEAD; it does not extend the per-commit audit, and that gap is named here as the next instrument rather than closed. That the new baseline row is a pass in the sweep: it is a reading taken by hand, and the sweep leg that would grade it (`check_sweep.py`) is not in the `--fast` gate. diff --git a/docs/queue-index.md b/docs/queue-index.md index e786da0..0a457b9 100644 --- a/docs/queue-index.md +++ b/docs/queue-index.md @@ -4,7 +4,7 @@ **What this is.** One row per item of `WORK-QUEUE.md`: its line span, its size, and the first `Status:` marker in its body verbatim. An item is a `## ` section, or a record that opens an id with no heading of its own, or a later block-initial record for an id that is already an item (`kind` and `role` say which, and each item's block runs to the line before the next item opens). Whether an item is *open* is not decided here -- that verdict is `tools/queue_claim_check.py`'s, and this document does not overrule it. -**What it exposes.** The queue is two-tier. 117 sections carry 101 ids because 15 ids own a second, continuation section; 60 further ids are opened by a record and own no heading at all, and they have rows and extents here -- 150 record blocks in all, 90 of them a later closure or correction for an id already opened. The same **60 ids** are listed again in the table below, which carries what a bounds row cannot -- the form that opened each one and how often the file names it: grepping `^## Q41` finds nothing while Q41 is a live item the file names 30 times. +**What it exposes.** The queue is two-tier. 118 sections carry 102 ids because 15 ids own a second, continuation section; 60 further ids are opened by a record and own no heading at all, and they have rows and extents here -- 151 record blocks in all, 91 of them a later closure or correction for an id already opened. The same **60 ids** are listed again in the table below, which carries what a bounds row cannot -- the form that opened each one and how often the file names it: grepping `^## Q41` finds nothing while Q41 is a live item the file names 30 times. | # | id | kind | lines | bytes | role | title | first `Status:` | |---|---|---|---|---|---|---|---| @@ -274,7 +274,9 @@ | 264 | Q84 | heading | 14613-14614 | 372 | cont: closure | closure — the repair the pipe accepted in full was never recorded, so the queue's own ledger kept the item open for a week; the closure now cites a guard that re-derives it at HEAD *(volt … | -- | | 265 | Q84 | record | 14615-14632 | 6101 | cont: CLOSED | **Q84 — CLOSED at HEAD. The repair landed at `b14d2e4` ("beam: cells for interval_overlap.py -- CHECK 202 -> 214, rc 0; docstring names has_any_overlap, early exit added (Q84)") and the pipe accepted … | -- | | 266 | Q69 | heading | 14633-14654 | 6065 | cont: addendum | addendum — the host-absolute class counted by AST position: 542 of 1345 tracked files carry such a path as a value, and volt's one default-root defect now follows its own file *(volt, 2026-11-04, at … | -- | -| 267 | Q69 | heading | 14655-14675 | 5481 | cont: addendum | addendum 2 — the probe's scratch root derived from TMPDIR: one of the nine named files is clean, and the lane reads 8 code files / 15 constants *(volt, 2026-11-04, at `5b71db6` and the commit this … | -- | +| 267 | Q69 | heading | 14655-14676 | 5482 | cont: addendum | addendum 2 — the probe's scratch root derived from TMPDIR: one of the nine named files is clean, and the lane reads 8 code files / 15 constants *(volt, 2026-11-04, at `5b71db6` and the commit this … | -- | +| 268 | Q167 | heading | 14677-14678 | 228 | opening | closure — the queue's pin sat two commits behind the queue, and nothing graded the pin in the commit *(volt, 2026-11-04, at `56d3853` and the commit this record lands in; sol lane by authorship … | -- | +| 269 | Q167 | record | 14679-14692 | 4171 | cont: OPENED | **Q167 — OPENED and REPAIRED in the same tick (volt, 2026-11-04, at `56d3853` and the commit this record lands in; sol lane by authorship, unclaimed and taken).** The repo gate has been red at HEAD … | -- | ## Ids with no `## ` heading @@ -329,7 +331,7 @@ Opened as records inside another section. `line` is the record's own opening lin | Q135 | 13797 | 13797 | 2 | Q114 | BULLET+BOLD | BOLD-LEAD | | Q136 | 13831 | 13831 | 1 | Q87 | BULLET+BOLD | BOLD-LEAD | | Q137 | 13847 | 13847 | 3 | Q136 | BULLET+BOLD | BOLD-LEAD | -| Q138 | 13879 | 13879 | 14 | Q137 | BULLET+BOLD | BOLD-LEAD | +| Q138 | 13879 | 13879 | 15 | Q137 | BULLET+BOLD | BOLD-LEAD | | Q139 | 13897 | 13897 | 4 | Q138 | BULLET+BOLD | BOLD-LEAD | | Q140 | 13918 | 13918 | 9 | Q139 | BULLET+BOLD | BOLD-LEAD | | Q141 | 13938 | 13938 | 6 | Q140 | BULLET+BOLD | BOLD-LEAD | @@ -2302,6 +2304,19 @@ The block below is the parse this document renders, byte for byte. `--check` com "status": null, "status_line": null, "title": "**Q84 \u2014 CLOSED at HEAD. The repair landed at `b14d2e4` (\"beam: cells for interval_overlap.py -- CHECK 202 -> 214, rc 0; docstring names has_any_overlap, early exit added (Q84)\") and the pipe accepted \u2026" + }, + { + "bytes": 4171, + "end_line": 14692, + "id": "Q167", + "kind": "record", + "line": 14679, + "lines": 14, + "role": "continuation", + "role_detail": "OPENED", + "status": null, + "status_line": null, + "title": "**Q167 \u2014 OPENED and REPAIRED in the same tick (volt, 2026-11-04, at `56d3853` and the commit this record lands in; sol lane by authorship, unclaimed and taken).** The repo gate has been red at HEAD \u2026" } ], "ids_multi_section": { @@ -2468,7 +2483,8 @@ The block below is the parse this document renders, byte for byte. `--check` com "Q163", "Q164", "Q165", - "Q166" + "Q166", + "Q167" ], "items": [ { @@ -5930,17 +5946,43 @@ The block below is the parse this document renders, byte for byte. `--check` com "title": "addendum \u2014 the host-absolute class counted by AST position: 542 of 1345 tracked files carry such a path as a value, and volt's one default-root defect now follows its own file *(volt, 2026-11-04, at \u2026" }, { - "bytes": 5481, - "end_line": 14675, + "bytes": 5482, + "end_line": 14676, "id": "Q69", "kind": "heading", "line": 14655, - "lines": 21, + "lines": 22, "role": "continuation", "role_detail": "addendum", "status": null, "status_line": null, "title": "addendum 2 \u2014 the probe's scratch root derived from TMPDIR: one of the nine named files is clean, and the lane reads 8 code files / 15 constants *(volt, 2026-11-04, at `5b71db6` and the commit this \u2026" + }, + { + "bytes": 228, + "end_line": 14678, + "id": "Q167", + "kind": "heading", + "line": 14677, + "lines": 2, + "role": "opening", + "role_detail": "", + "status": null, + "status_line": null, + "title": "closure \u2014 the queue's pin sat two commits behind the queue, and nothing graded the pin in the commit *(volt, 2026-11-04, at `56d3853` and the commit this record lands in; sol lane by authorship \u2026" + }, + { + "bytes": 4171, + "end_line": 14692, + "id": "Q167", + "kind": "record", + "line": 14679, + "lines": 14, + "role": "continuation", + "role_detail": "OPENED", + "status": null, + "status_line": null, + "title": "**Q167 \u2014 OPENED and REPAIRED in the same tick (volt, 2026-11-04, at `56d3853` and the commit this record lands in; sol lane by authorship, unclaimed and taken).** The repo gate has been red at HEAD \u2026" } ], "nested": [ @@ -6372,7 +6414,7 @@ The block below is the parse this document renders, byte for byte. `--check` com "form": "BOLD-LEAD", "id": "Q138", "line": 13879, - "refs": 14, + "refs": 15, "section": "Q137", "shape": "BULLET+BOLD" }, @@ -6490,9 +6532,9 @@ The block below is the parse this document renders, byte for byte. `--check` com "end_line": 8, "line": 1 }, - "queue_bytes": 2544260, - "queue_lines": 14675, - "queue_sha256": "6e1088a56e346190bc54821e15c5087dee84e7c7348a753fb6eae9521d64f405", + "queue_bytes": 2548660, + "queue_lines": 14692, + "queue_sha256": "4abf6817fef75d3b13ef3b1fa4b38e4f74b5b56ae26727c555d46d5d46e8be03", "sections": [ { "bytes": 3139, @@ -8003,17 +8045,30 @@ The block below is the parse this document renders, byte for byte. `--check` com "title": "addendum \u2014 the host-absolute class counted by AST position: 542 of 1345 tracked files carry such a path as a value, and volt's one default-root defect now follows its own file *(volt, 2026-11-04, at \u2026" }, { - "bytes": 5481, - "end_line": 14675, + "bytes": 5482, + "end_line": 14676, "id": "Q69", "kind": "heading", "line": 14655, - "lines": 21, + "lines": 22, "role": "continuation", "role_detail": "addendum", "status": null, "status_line": null, "title": "addendum 2 \u2014 the probe's scratch root derived from TMPDIR: one of the nine named files is clean, and the lane reads 8 code files / 15 constants *(volt, 2026-11-04, at `5b71db6` and the commit this \u2026" + }, + { + "bytes": 228, + "end_line": 14678, + "id": "Q167", + "kind": "heading", + "line": 14677, + "lines": 2, + "role": "opening", + "role_detail": "", + "status": null, + "status_line": null, + "title": "closure \u2014 the queue's pin sat two commits behind the queue, and nothing graded the pin in the commit *(volt, 2026-11-04, at `56d3853` and the commit this record lands in; sol lane by authorship \u2026" } ] } diff --git a/wizard-work/volt/q137-open-set/open_set.py b/wizard-work/volt/q137-open-set/open_set.py index efd9712..bed1ec4 100644 --- a/wizard-work/volt/q137-open-set/open_set.py +++ b/wizard-work/volt/q137-open-set/open_set.py @@ -628,8 +628,19 @@ PIN_OPENED = [51, 52, 53, 65, 100, 101, 102, 103, 104, 105, 106, 107, 109, # unchanged: records 129, record_ids 95, ids 156, record_only 55, open 0, # opened 26. Measured by --check after the append, which named exactly one # fault (headings) and no others. -PIN_COUNTS = {"headings": 116, "heading_ids": 101, "records": 129, - "record_ids": 95, "ids": 156, "open": 0, "opened": 26, +# Q167 (2026-11-04): the same shape as Q165/Q166 -- one heading (## Q167 +# closure) and one record (**Q167 -- OPENED and REPAIRED ...) for a new id: +# headings 117 -> 118, heading_ids 101 -> 102, records 129 -> 130, record_ids +# 95 -> 96, ids 156 -> 157; record_only stays 55 and open / opened stay 0 / 26 +# (same-tick closure, no probe; CHECK-q167 is its guard). This entry's own +# parent is the fault it repairs: `56d3853` appended a Q69 heading and moved +# headings 116 -> 117 without touching this pin, so the gate read +# `FAIL count headings moved 116 -> 117` at `406dd17` for two commits. The +# move was measured by --check after the append -- it named exactly these five +# faults and no others -- and CHECK-q167 now grades the pin in the COMMIT +# (git archive HEAD, that tree's own open_set.py), not only in the worktree. +PIN_COUNTS = {"headings": 118, "heading_ids": 102, "records": 130, + "record_ids": 96, "ids": 157, "open": 0, "opened": 26, "record_only": 55} PIN_STATE = { diff --git a/wizard-work/volt/q143-check-sweep/check_entry_baseline.tsv b/wizard-work/volt/q143-check-sweep/check_entry_baseline.tsv index ceb9f2e..c99907e 100644 --- a/wizard-work/volt/q143-check-sweep/check_entry_baseline.tsv +++ b/wizard-work/volt/q143-check-sweep/check_entry_baseline.tsv @@ -247,3 +247,11 @@ CHECK-q84 0 q84: 4 leg(s), 0 fault(s), rc 0 # a waiver: the guard reads 1 when the census or the repaired default root stops # holding, and 2 when the tree is not a git work tree. CHECK-q69-census 0 q69-census: 5 leg(s), 0 fault(s), rc 0 +# row added by hand (Q167, 2026-11-04): `CHECK-q167` is a new root entry point. +# code 0 measured with `bash CHECK-q167` at this worktree -- 4 legs (pin / counts +# / tree / poison), ~1 s, plus the `git archive HEAD` export the tree leg reads. +# The row is a reading, not a waiver: the guard reads 1 when the pin stops +# matching the queue in the worktree or in the commit (it read 1 at `406dd17`, +# which is the defect it repairs), and 2 when the queue, the tool or HEAD is +# unreadable. +CHECK-q167 0 q167: 4 leg(s), 0 fault(s), rc 0