Skip to content

Commit 5aa3a46

Browse files
os-billclaude
andauthored
test(spec): the transactions tombstone pin discriminates its own subject (#19078)
Fixes #18996 Clause-②: no ## What was wrong `packages/spec/src/data/driver.test.ts` pinned the `transactions` retired-key prescription with a regex that required only that `METHOD PRESENCE` and `beginTransaction` appear *somewhere* in the thrown message: ``` DriverCapabilities\.transactions.*removed.*METHOD PRESENCE.*beginTransaction.*Delete the key ``` PR #18890 rewrote that prescription's opening from "Transaction use is gated on METHOD PRESENCE — `driver.beginTransaction` …" to "Transaction use is gated on the DRIVER'S DECLARATION, no longer on METHOD PRESENCE alone: `engine.transaction()` asks `driverSupportsTransactions(driver)` …". The old regex matches **both**, so reverting the prescription to the now-false sentence kept this test green: the pin could not fail on the one shape it exists to catch. Its title — "points at method presence" — was in the old world too. The shipped prose is true today; what was missing is the guard that keeps it that way. This is coverage debt, not a contract defect. ## What changed One regex and one title, in one test file. The new anchor is the pair of things #18890 made load-bearing — the **negation** (`no longer on METHOD PRESENCE`) and the **predicate that replaced presence** (`driverSupportsTransactions`): ``` DriverCapabilities\.transactions.*removed.*no longer on METHOD PRESENCE.*driverSupportsTransactions.*beginTransaction.*Delete the key ``` `beginTransaction` and `Delete the key` stay, so nothing the old pin covered is dropped. The card suggested anchoring on `DECLARATION`; both discriminate on the tree measured below, and the negation was chosen because it is the literal contradiction of the false claim — a future sentence cannot say "gated on METHOD PRESENCE" and "no longer on METHOD PRESENCE" at once, whereas a bare mention of a declaration can coexist with a presence-gated claim. **⛔ Deliberately not a ban on the phrase.** `driver.zod.ts` carries a *second* "gated on METHOD PRESENCE" sentence, for `schemaSync`, and that one is true of the runtime today. It is untouched, and so is `driver.zod.ts` as a whole — this PR's diff is one `.test.ts` file. ## Evidence — the acceptance leg is an ablation, not "the new pin passes" **1. Ablation (decisive).** `node scripts/ablation-replace.mjs` in WRAP mode over `packages/spec/src/data/driver.zod.ts`: the prescription's opening clause was replaced with the **verbatim** pre-#18890 false sentence, read out of history at `5ba2ec3ca4^:packages/spec/src/data/driver.zod.ts:266-267`, with the rest of the prescription left intact. - mutation landed, proven on disk, not by an exit code: anchor `1 -> 0`, replacement `0 -> 1`, blob `46daf837a26a -> 9268d7835908` - the new pin on that false tree: **RED** — `Tests 1 failed | 57 passed (58)`, the failing case being the one under repair - restore proven byte-for-byte: blob back to `46daf837a26a`, equal to the path's blob at HEAD, `git diff HEAD` empty - the new pin on the restored tree: **GREEN** — `Tests 58 passed (58)` **2. Lit control — the defect itself, measured first-hand, on that same false tree.** A probe that reads the thrown message and applies both regexes reported: ``` PROBE_REGEX_IN_SYNC_WITH_TEST_FILE: true PRESCRIPTION_OPENING: Transaction use is gated on METHOD PRESENCE — `driver.beginTransaction` (`engine.transaction()`, ADR-0034 ambient transactions). … OLD_REGEX_MATCHES: true NEW_REGEX_MATCHES: false ``` The OLD pin stays green on a tree whose prescription is false. That is the blindness this card names, reproduced here rather than quoted. **3. Dark control — the trap.** `driver.test.ts`: **58 passed before, 58 passed after**. `driver.zod.ts` is byte-identical to the base (`git hash-object` = `46daf837a26a…` = its blob at `0ec81857aa`), so `schemaSync`'s true sentence cannot have moved. One honest qualification: the `transactionsUnsupported.*NOT this key restored` assertion lives in the *same* `it()` block, so on the false tree it was **NOT MEASURED** — vitest aborts a case at its first failed assertion. It is green on the restored tree, inside the 58. ## Verification | leg | result | |:---|:---| | `pnpm --filter @objectstack/spec test` | `Test Files 491 passed (491)`, `Tests 14299 passed (14299)` | | `pnpm --filter @objectstack/spec typecheck` | exit 0 (`tsc --noEmit` + `check:scripts-typecheck` + `check:test-typecheck`) | | derived gate families | `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` → 76 commands; **72 exit 0**, 4 exit 3 | | gate reconciliation | `--ran` with exit codes recorded: 76 derived, 72 run, **4 NOT-MEASURED, 0 UNRUN** | | repo-wide lint | `eslint . --no-inline-config` exit 0 over **6866 files**, 0 errors / 0 warnings, at `bada58f3c2` | The four exit-3 gates each print `PREREQUISITE NOT MET … nothing was measured` — they read built output of packages this diff does not touch and need a full monorepo build: `check:doc-formula-expressions`, `check:dual-build-cjs-loads`, `check:lean-entry-closure`, `check:type-check-debt`. Not findings, not passes. CI builds fresh and runs them. No narrowing is claimed for lint: the population above is the whole repo, run at the final commit of this branch. ## Changeset — `skip-changeset` measured, not assumed `npm pack --dry-run --json` in `packages/spec` at this commit lists **2039** files. Positive control `src/data/driver.zod.ts` is **present**; `src/data/driver.test.ts` is **absent**, and **zero** `.test.ts` files ship at all (`files[]` publishes `src/**/*.zod.ts`, never `*.test.ts`). Nothing any released package actually ships moves, so this diff publishes nothing. `Clause-②: no`. ## Acceptance notes - The generic `it.each(RETIRED_BITS)` pin in the same block asserts only `DriverCapabilities.BIT` … `removed` … `Delete the key` (the bit name interpolated per case). That is weak **by design** — it pins that each tombstone exists and prescribes, not what any one sentence claims — so it is not a second instance of this defect. Noted, not filed. - The other two hand-written prescriptions in that block (`streaming`, `queryFilters`) anchor on content distinctive to their current sentences, and neither sentence has been rewritten. Noted, not filed. --- _Generated by [Claude Code](https://claude.ai/code/session_01JbZnqu8bt6YqfJsr9vaFb3)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent ed6c554 commit 5aa3a46

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎packages/spec/src/data/driver.test.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,16 @@ describe('[#4634] the 31 inert capability bits are tombstoned, not stripped', ()
121121
);
122122
});
123123

124-
it('the transactions prescription points at method presence, and says the live bit is not it restored', () => {
124+
it('the transactions prescription points at the DECLARATION gate, not method presence alone, and says the live bit is not it restored', () => {
125+
// [#18996] Anchored on what #18890 made load-bearing: the NEGATION and the
126+
// predicate that replaced method presence. An anchor on `METHOD PRESENCE`
127+
// alone matched this prescription's PREVIOUS, now-false opening ('gated on
128+
// METHOD PRESENCE — `driver.beginTransaction`') exactly as happily as the
129+
// true one, so it could not fail on the one shape it exists to catch. ⛔ Not
130+
// a ban on the phrase — `schemaSync`'s own 'gated on METHOD PRESENCE'
131+
// sentence is true of the runtime and stays.
125132
expect(() => DriverCapabilitiesSchema.parse({ transactions: true })).toThrow(
126-
/DriverCapabilities\.transactions.*removed.*METHOD PRESENCE.*beginTransaction.*Delete the key/s,
133+
/DriverCapabilities\.transactions.*removed.*no longer on METHOD PRESENCE.*driverSupportsTransactions.*beginTransaction.*Delete the key/s,
127134
);
128135
// [#18063] The trap this sentence exists to close: a reader who sees a live
129136
// `transactionsUnsupported` and concludes the retired key came back. It did

0 commit comments

Comments
 (0)