Uh oh!
There was an error while loading. Please reload this page.
test(spec): split key-mention.test.ts's conflated shipped-ledger case onto a witness pair - #12973
Merged
Merged
Conversation
`key-mention.baseline.json` declares itself a SHRINK-ONLY RATCHET (#11457) — a finite debt ledger that exists to be driven to zero — and its twin pinned the debt as PRESENT: `expect(doc.exemptions.length).toBeGreaterThan(0)` goes red on the commit that deletes the last exemption, i.e. exactly when the burn-down succeeds. Deleting the floor alone would not have been the repair either: the `for (const row of doc.exemptions)` one line later asserts nothing over an empty array, so it would trade a red for a silent no-op. Split into the two claims the case conflated, per the PR #12050 witness-pair idiom: * the parser + row-quality rule, carried on a SYNTHETIC witness pair (a conforming row the parser accepts and the rule holds for; a structurally valid row that only reassures, which the rule refuses) — so both halves keep discriminating once the ledger reaches zero; * the shipped ledger, held to the same rule CONDITIONALLY on rows existing, with the read asserted independently of the row count so an empty ledger cannot read as a file that was never read. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LpRNHxWZgSUgVnFT9mQQo4
…y-mention-witness-pair
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
os-trump
marked this pull request as ready for review
August 28, 2026 12:24
os-trump
enabled auto-merge
August 28, 2026 12:24
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Fixes#12462
packages/spec/scripts/liveness/key-mention.baseline.jsondeclares itself, in its own_note, aSHRINK-ONLY RATCHET (#11457)— a finite, enumerated debt ledger that exists to be driven to zero. Its twin pinned that debt as PRESENT.What was wrong
One case conflated two claims:
[].every(...)defect PR test(devx): sweep the shrink-only ratchet self-tests for baseline-presence pins — 33 derived, 1 repaired #12050's witness pair was introduced to prevent — so it would trade a red for a silent no-op.What this changes
The two claims are split, per the PR #12050 witness-pair idiom, which the triage grading (comment 5420740937) adopted as the route:
why: 'this is fine') — which the parser accepts and the rule refuses. Neither witness reads the shipped file, so both halves keep discriminating once the ledger reaches zero._notehas to come back naming the ratchet — so [finding] a shrink-only ratchet whose self-test asserts its own entries are PRESENT can never reach zero — one instance found and fixed, the class unswept #11694's carried rule holds: an empty ledger cannot become readable as an empty population or as a silent no-read. The row check is vacuous at zero by design and says so; claim 1 is where the rule keeps its teeth at that point.The rule itself (a
whylonger than 40 characters — the original threshold, carried over unchanged) is named once, so the pair and the shipped ledger cannot be held to two definitions of it that drift apart.Reverse verification
Five legs. Every mutation was confirmed on disk by anchor / injection occurrence counts before the run (the mutator refuses to write at all unless the anchor occurs exactly once, and re-counts after writing), and every restore is proved by
git diff HEADcoming back empty plus a blob-hash match against the HEAD blob — not by an exit code.whyshortened below the thresholdAssertionError: expected false to be trueon the witness-pair casewhylengthened past the thresholdAssertionError: expected true to be falseError: ENOENT ... key-mention.baseline.MUTATION-leg3-missing.jsonAssertionError: expected 0 to be greater than 0Legs 4 and 5 are the pair that matters: the shape this PR removes fails exactly when the #11457 burn-down succeeds, and the shape it installs does not — while legs 1 and 2 show the witness pair still discriminates at that point, since both witnesses are synthetic and the ledger's contents cannot reach them. Leg 3 is #11694's other half: a file that was never read still fails loudly, where the old vacuous loop would have been silent.
Verification
Union re-run after the final commit, at
aebe81bd6— which includes agit merge origin/mainbringing #12957 (scripts/check-type-check-coverage.mjsonly; no overlap with this diff).pnpm --filter @objectstack/spec exec vitest run scripts/liveness/— 10 files / 236 tests passed.key-mention.test.tsgoes 22 to 23 cases: one case split into two.pnpm --filter @objectstack/spec run check:liveness— green. This PR changes the gate's TWIN, not the gate:key-mention anchoring: 402 (entry, cited file) pair(s) asked, 401 anchored, 1 exempt.pnpm --filter @objectstack/spec run check:scripts-typecheck— green, andtsc --listFilesconfirmskey-mention.test.tsis genuinely in that program, so the green is a measurement of this edit rather than a program that never read it.check:engine-double-contract,check:where-matcher,check:objectql-double-limit,check:query-options-erasure,check:cross-package-test-inputs,check:type-check-coverage. The three ratchets re-verified their baseline key set against3404bd1with no files added.check:nul-bytes,check:test-source-alias,check:published-files,check:merge-driver, and speccheck:empty-state/check:strictness-ledger/check:variant-docs.Declared narrowing:
check:type-check-debt --re-measurewas not run locally — it needs the whole workspace closure built and refuses outright on an unbuilt worktree. This diff adds no file and no ledger entry,scripts/**enters the spec package's type-check with ZERO ledger entries, and a plaintsc --noEmit -p tsconfig.scripts.json(green above, with the edited file proved to be in the program) is the stricter gate for that layer. CI runs it either way.Scope
Exactly one file:
packages/spec/scripts/liveness/key-mention.test.ts.key-mention.baseline.jsonis untouched, and so are the other seven liveness twins and the three othertoBeGreaterThan(0)sites the filer measured as NOT this shape (empty-state.test.ts:273,proof-registry.test.ts:92,readme-table.test.ts:49,101) — the triage scope fence, no sweep-widening.Releases nothing
One internal-tooling test file inside a published package. No user-visible behaviour changes, no export moves, no schema or contract change — so there is no changeset. This repo routes that through the
skip-changesetlabel, whichpr-automation.ymlreads live to exempt the changeset check; the label is on this PR. Removing it restores the normal changeset requirement if the grading disagrees.Draft on purpose: this lands through the normal ready-then-queue path after review, not from here.
Generated by Claude Code