test(scripts): batch 7a — floor five table-driven self-tests on their own row labels - #15288
Merged
Merged
Conversation
…bels (#13799 batch 7a) Recipe A, as settled by the batch 7 pilot: each row's own label in the literal `cases` table becomes a declared battery with a floor of 1, `registerCase()` is the FIRST statement of the driving loop body, and the roster is a LITERAL the table is checked against with its own size pinned at the row count. Files and batteries: check-refd-timer-probe 11, check-skill-compatibility-version 18, check-skill-frame-sync 13, check-skills-token-ratchet 64, check-widget-option-census 16. No assertion condition touched, no control flow rewritten, no comment promoted to a section head, the verdict handshake kept as landed per file. The red-run failure line now reads `N failure(s) (cases and floor)`; the green line is unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
This was referenced Sep 4, 2026
baozhoutao
marked this pull request as ready for review
September 4, 2026 09:02
baozhoutao
enabled auto-merge
September 4, 2026 09:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #13799
Batch 7a — five table-driven
scripts/**self-tests, under recipe A exactly as the batch 7 pilot settled it (PR #15271, ACCEPT5537827823). Dispatched by the PM claim5537845785; dev claim5537877110. Baseorigin/main=4dd5041bd.Each of these five had a zero failure count as its ONLY success condition, so "every case held" and "the cases never ran" printed the same line.
The shape, copied from the pilot
registerCase()is the FIRST statement of the driving loop body — the row is the battery, attribution is the loop variable, nobattery()opener. It stays first in all five even though four of the loop bodies carrycontinue: the floor asserts REACH, and placing it after a guard reintroduces the inversion recipe A exists to avoid.N failure(s) (cases and floor); the green line is byte-identical tomain's in all five.Row labels are not label-first in four of the five: the label sits in the row object's own
labelkey, so the battery name is derived from that field (registerCase(c.label), cross-checkcases.map((c) => c.label)).check-skills-token-ratchetis label-first ([name, actual, expected]) and readsregisterCase(name)/cases.map(([name]) => name).⛔ No assertion condition touched. ⛔ No control flow rewritten — no
continuetoreturn, no thunk around a loop body, no comment promoted to a section head. The verdict handshake is kept exactly as landed, and its spelling differs per file: four carry the module-levelselfTestReachedVerdictflag,check-skills-token-ratchetcarries theSELF_TEST_VERDICTreturned-sentinel variant. Sink spelling likewise:failed += 1in four,failed++incheck-skills-token-ratchet.Per file: rows, batteries, floors
continuescripts/check-refd-timer-probe.mjslabelkeyscripts/check-skill-compatibility-version.mjslabelkeyscripts/check-skill-frame-sync.mjslabelkeyscripts/check-skills-token-ratchet.mjsscripts/check-widget-option-census.mjslabelkeyNo duplicate label in any of the five (measured: the symmetric difference of roster keys against row labels is empty in all five, and no label repeats within a table).
Deferrals
None. The dispatch's deferral trigger (a file with TWO tables, or no per-row label at all) is discussed for
check-widget-option-censusin the note below; it was floored rather than deferred, and the reasoning is recorded for review.check-widget-option-census— the two-table question, decided and recordedThat file carries its
casestable (16 rows, floored here) and a second literal arraycheckswith its own driving loop — the four "instrument checks against the REAL tree". Two measurements decided it rather than a judgement call:checksrows carry no stable literal label: their second element is a template string interpolating live tree contents (real tree: ${SCHEMA_NAME} in ${SPEC_FILE} reads as ${JSON.stringify(realDeclared.keys)}). A LITERAL roster key cannot match a label that moves with the tree, so recipe A is structurally inapplicable to that array — it is not a second cases table.casestable unfloored to avoid a shape question about four unfloorable rows would have cost the whole file its floor. The pilot's own shape already floors the table and nothing else:check-refd-timer-probe(3 discovery assertions),check-skill-compatibility-version(6declcases) andcheck-skill-frame-sync(5decl+ 3 population cases) all keep non-table assertions outside the roster in this PR, exactly as the pilot leftcheck-sdui-manifest.Recorded as an open question in the
os-dev-reportrather than decided silently.Verification record
Base worktree installed at the dispatch pin
4dd5041bdfor the byte comparisons. Exit codes captured by redirect before any pipe; verdicts quoted from each gate's own line.scripts/**, +637/-5 (three-dot vsorigin/main);skip-changeset(ascripts/**gate publishes from no package)cmpsilent): normal mode and--self-test, stdout and stderr, for each of the five, base vs head, every run exit 0extractWatchHints/^[\w.@][\w.@/*-]*$/over the raw literal and every label contains spaces — checked directly against all 122 labels, all rejected);check:watch-hint-literalgreennode scripts/measure-self-test-floor.mjs --json: NONE 35 to 31, COUNT 2 to 1, ROSTER 132 to 137. The five movers are exactly this PR's five files, symmetric difference against the worklist empty. NONE drops by 4 rather than 5 becausecheck-refd-timer-probewas the COUNT-class file at base, as the dispatch predictedcheck-refd-timer-probe's printed count${cases.length}, DERIVED, not a stale literal, so the #15231 class does not apply to itAblations. The implementation was committed before any leg, so every restore had a real reference point. Every mutation is proven on disk by an anchored before/after count plus the blob hash moving off the HEAD blob; every restore by
git checkout HEAD -- <absolute path>then hash equality against the HEAD blob and an emptygit diff HEAD; every leg carries atraprestore on EXIT/INT/TERM with absolute paths, and an emptygit hash-objectresult is read as FAILURE rather than "nothing to compare". Legs: row deleted, row renamed,registerCase()removed, and the roster size pin made unreachable — on all five files; plus a duplicate label in the TABLE and a duplicate key in the ROSTER oncheck-refd-timer-probe. Every leg exit 1 with the expected line. One leg (dup-table-label) was refused by its own landing check on a miscounted anchor and re-run — a non-measurement, reported as such, not as a pass.The per-leg lines, and the full gate record, are in the
os-dev-reportcomment on #13799.Gates
All run in the FOREGROUND at the final commit
124d27115, exit codes captured by redirect BEFORE any pipe. Derived family fromnode scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack(which read the change set from git itself: 5 paths vs merge base4dd5041bd) — 26 commands, all exit 0. Always-runs tail beyond that family:check-self-test-workflow-commands.mjsand its--self-test,check:declared-population-live— all exit 0 (check:pm-dispatch-gates,check:self-test-wired+--self-test,check:ratchet-remedy-authority,check:watch-hint-literal,check:nul-bytesare already in the derived family and ran there). Each edited script also owes its own suite regardless of the family: normal mode AND--self-testagainst the tree, run for all five, all exit 0.Beyond the derived family: repo-wide
pnpm lint(eslint . --no-inline-config) exit 0 — the whole farm, not a narrowed run. A control-byte scan of all five files and of every body posted to GitHub is clean. The only test suite in the repo naming any of these five ispackages/sdui-parser/src/__tests__/dashboard-widget-options.test.ts(prose references only, no import) — run anyway through the shared verify lock: 21 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
Generated by Claude Code
Generated by Claude Code