fix(wake): three-valued grep verdicts — has_match/count_lines across all ten suites (closes #973) #983

Merged
Mos merged 7 commits from mos-dt-0/stack:feat/973-has-match into main 2026-07-31 08:39:05 +00:00
7 Commits
Author SHA1 Message Date
Jason WoltjeandClaude Fable 5 68bdeba758 style(wake): prettier-normalize denominator artifact — whitespace-only (#973)
ci/woodpecker/pr/ci Pipeline was successful
Pipeline 2136's sole red step: pnpm format:check flags the frozen
denominator JSON (Python-emitted formatting vs prettier style). Reformat
with the repo-pinned prettier 3.9.6. Verified before commit: git diff -w
empty across the whole commit (whitespace-only), json.load before/after
compare EQUAL AS OBJECTS (A1 consumes the parsed object, never the
bytes), check-973.py expected==static still 261/261, no other path
touched. test step at prior head 5e98419d was green — all ten wake
suites ran converted and passed in CI.

Written-by: pepper (sb-it-1-dt)
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsKce8iZuSuRnu3gVMCBKB
2026-07-31 03:24:39 -05:00
Jason WoltjeandClaude Fable 5 5e98419d0e chore(wake): manifest 0.7.2 — #973 three-valued grep verdicts
ci/woodpecker/pr/ci Pipeline failed
Written-by: pepper (sb-it-1-dt)
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsKce8iZuSuRnu3gVMCBKB
2026-07-31 02:14:47 -05:00
Jason WoltjeandClaude Fable 5 bd57ef0c74 test(wake): #973 validation harness — trace/inventory/arm evidence chain
validate-973.sh produces the complete evidence chain in one run:

  0  instrument self-test (microtest, now C1-C11) before any evidence
  1  expected set: 261 coordinates from the frozen denominator artifact
     (+3 header shift), count declared BEFORE any suite runs
  2  static inventory re-derived from SOURCE TEXT == expected set — the
     ledger is an execution trace, not an inventory, so the inventory leg
     comes from the text (mos-dt amendment ONE)
  3  green instrumented run: ten suites, per-suite pinned sentinels
     (preimage's divergent format included), exit codes reported per file
  4  trace arithmetic on coordinate SETS: trace-minus-expected must be
     empty; expected-minus-trace (converted-but-never-executed) is
     enumerated and every entry must match a row in the committed
     unexecuted-sites-dispositions.txt, with stale dispositions rejected
     symmetrically
  5  21 forced-error arms (19 denominator canaries + E-form store-ack:736,
     the A6 $(count_lines) shape + F-form quarantine:563, the multi-grep
     pipeline capture): each must emit ARMED, abort naming the site, exit
     non-zero, emit NO sentinel, and have its ledger row already landed
  6  residual sweep with the denominator's own classifier: zero unconverted
     verdict greps, six per-form plants found in the same run

The nine unexecuted sites are the FAILED-branch summary lines, structurally
unreachable in a green run; microtest C11 executes the exact template on a
deterministically red mini-suite so their dispositions cite a measured
execution, not an inference.

First full run: OK — 252 executed + 9 dispositioned = 261, all arms fired,
sweep clean.

Written-by: pepper (sb-it-1-dt)
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsKce8iZuSuRnu3gVMCBKB
2026-07-31 02:13:23 -05:00
Jason WoltjeandClaude Fable 5 8cb5866a3d test(wake): pin the BASH_LINENO continuation convention at runtime (#973)
The denominator artifact's site coordinates assume a backslash-continuation
helper call reports at its FIRST physical line. That convention was measured
on a developer bash (5.3.x, Fedora); CI runs the bash baked into ci-base
(node:24-alpine), which rebuilds only on push-to-main or tag — so the CI bash
version floats silently between rebuilds, and an artifact validated only
against a developer bash is unverified in the place the gate actually runs.

wake_assert_init now runs a probe under the SAME bash binary executing the
suite (subshell + continuation, the real call shape) and aborts loudly if the
convention does not hold, instead of letting coordinates skew by one line
under everyone. Microtest C10 proves the pin's abort arm fires, via a
test-only WAKE_ASSERT_PIN_BASH interpreter override ($BASH itself cannot be
spoofed — bash resets it at startup): a pin whose failure arm was never seen
firing is an undertaking, not a control.

Prompted by mos-dt's CI-bash-float finding (prereg addendum 4, ddea1bc7b).

Written-by: pepper (sb-it-1-dt)
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsKce8iZuSuRnu3gVMCBKB
2026-07-31 02:04:56 -05:00
Jason WoltjeandClaude Fable 5 10a7fe43c5 wake/#973: convert all 261 grep-verdict sites to has_match/count_lines
Mechanical conversion driven by the frozen denominator artifact
(validate-973/convert-973.py, committed for auditability): every row is
byte-verified against the worktree BEFORE any edit — a conversion applied to
a line the denominator did not measure would be the umbrella defect wearing
the converter's clothes — then 233 sites become has_match and 28 grep -c
sites become count_lines, and each suite gains three header lines (source
_wake-common.sh + wake_assert_init) directly after its SCRIPT_DIR line, a
uniform +3 shift for every site coordinate.

Env prefixes are kept (LC_ALL=C has_match — the prefix reaches the grep
child, microtest C8). The two multi-grep pipeline sites
(digest-quarantine:560, install:420) convert BOTH greps: each element is
measurement-bearing, and under pipefail an rc=2 on the left is masked by an
rc=1 on the right — the same defect one pipe deeper. Call-site 2>/dev/null
redirects (the preimage canaries) are kept: ordinary grep noise stays
suppressed, while an abort writes to the wake_assert_init-saved real stderr.

Diff arithmetic: +291/-261 = 261 one-for-one line replacements + 30 header
lines (10 suites x 3). Nothing in this commit is not the conversion.

All ten suites run green after conversion. Per the review pre-registration
(A9) that green is NON-EVIDENCE for this change: a suite that was green
before conversion and green after witnesses nothing about whether the sites
were converted — the counted-ledger equality in the validation harness is
the evidence.

Written-by: pepper (sb-it-1-dt)
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsKce8iZuSuRnu3gVMCBKB
2026-07-31 01:58:26 -05:00
Jason WoltjeandClaude Fable 5 6109f81769 wake/#973: three-valued grep assertion helpers + instrument micro-test
has_match/count_lines in _wake-common.sh: rc 0 -> match, rc 1 -> no-match,
anything else -> loud abort naming the call site, the raw exit code, and the
arguments — an error never becomes a verdict. The abort escapes subshells,
pipelines, and $() substitutions by signalling the suite's main shell, so
the suite dies verdict-less; loudness survives call-site 2>/dev/null via a
wake_assert_init-saved stderr fd (dynamically allocated >= 10, no collision
with the wake lock fd 8 or detector run-loop fd 9).

Validate instrumentation (evidence only, inert in production):
WAKE_ASSERT_LEDGER appends "<helper> <file>:<line>" BEFORE the grep runs, so
an aborting site's row has already landed and the counted ledger can never
go quiet in the one condition it exists to report.
WAKE_ASSERT_FORCE_GREP_ERROR_AT=<file>:<line> routes exactly that call site
through a REAL grep driven onto its real error path (rc 2) and emits a
positive ARMED confirmation first, so arm-never-matched (no ARMED line) and
error-path-broken (ARMED line, no abort) are separable on stderr alone.

validate-973/microtest-wake-assert.sh: nine checks (C1..C9) proving the
instrument before any conversion trusts it — ledger set equality across two
files, truncation detection behind an early exit, per-shape abort proofs
(subshell, 2>/dev/null canary shape, $() count capture, pipeline tail),
count-of-zero on grep rc 1, env-prefix reaching the grep child, and a
no-match arm loud by omission. All nine pass; C1 pins BASH_LINENO's
first-physical-line convention for backslash continuations, matching the
denominator artifact's coordinates.

Production tools (store.sh, ack.sh) source this file but call none of the
new helpers.

Written-by: pepper (sb-it-1-dt)
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsKce8iZuSuRnu3gVMCBKB
2026-07-31 01:52:56 -05:00
Jason WoltjeandClaude Fable 5 7833ddbf4e chore(wake): #973 frozen denominator at branch base — 261 grep-verdict sites, 19 credential canaries
The conversion target, frozen BEFORE any conversion so completeness can be
asserted by set equality against a list that predates the batch (a control
keyed on the post-fix source can only agree with it). Derived per the amended
charter A1: frozen 257 @ 8d1d6e5 forward-mapped with per-row drift disposition
(214 unchanged / 43 moved / 0 deleted / 0 text-changed, byte-verified) UNION a
fresh six-form derivation at 089615f (self-checked by exact 257 reproduction at
8d1d6e5). Delta = exactly the four T17 sites introduced by 47f8689 (#967),
independently derived twice. A 204 (167 OR / 37 AND-inverted), count-capture 28,
B 6, C 10, D-if 9, F 4. Canaries 19 (9 same-line, 3 continuation, 7 if-form),
all AND-polarity: every one fails toward GREEN on grep error.

Charter: jarvis-brain docs/journal/fleet/charter-973-has-match__mos-dt.md @ fa551c2d0.

Written-by: pepper (sb-it-1-dt)
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NsKce8iZuSuRnu3gVMCBKB
2026-07-31 01:28:43 -05:00