Skip to content

Commit a2d8cd2

Browse files
claude[bot]claude
andauthored
fix(devx): stop the test-typecheck ledger regenerating a refuted cause over its own prose (#12809)
* fix(devx): stop the test-typecheck ledger regenerating a refuted cause `LEDGER_COMMENT` named the #5478/#5543 OUTPUT-vs-INPUT conflation as the cause of every ledgered error. PR #6786 fixed that on 2026-08-08; `packages/rest`'s ledger was created 18 days later and stamped with it in the present tense. Measured on 2026-08-27, both packages with a ledger that has entries: rest — 0 `z.infer` occurrences across its ledgered files spec — 8 across its 55 ledgered files, 5 of them inside prose comments; of its 263 errors, 9 are of the missing-properties shape at all, and none of those 9 sits in a file that contains a `z.infer` So the clause is dropped rather than made per-package: the mechanism sentences (EXACT ratchet, the three red directions, the regenerate command) are the part that is true everywhere, and the comment now tells the reader to measure the classes instead of handing them one. The second half of the defect is that `--update` rebuilds `_comment` from the constant, so a correction written into a ledger survives only until the next `gen:test-typecheck-debt` — which the ratchet requires on every repair. That is not hypothetical: `packages/client`'s `_comment` carries an appended AUTHORED paragraph recording that ADR-0122 phase 2 (#6083) emptied its ledger, and the next regeneration would have deleted it. The generated and authored halves are now separate keys: `_comment` is regenerated and says so, `_note` is authored and is preserved verbatim. No ledger NUMBER moves: `entries` is byte-identical to its parent in all three files (spec 55/263, rest 3/6, client 0/0), and spec's was rewritten by the real regenerator, not by hand. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PfaSTikked61BkcsB5Rn69 * fix(devx): keep the new self-test off Object.hasOwn (root lib is ES2020) `scripts/**` is inside the ROOT tsc program, whose `lib` is ES2020, so `Object.hasOwn` is a TS2550 there and every use is a raw error the check:type-check-debt ratchet counts. The file already spends one in `evaluate()`; a second, added by the new `_note` pin, put the root program one over. Measured single-file under the root config: 29 diagnostics at the parent commit, 30 with `Object.hasOwn`, 29 with `in` — and the diagnostic SET is identical to the parent, not merely the count. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PfaSTikked61BkcsB5Rn69 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2a5c1cd commit a2d8cd2

4 files changed

Lines changed: 204 additions & 17 deletions

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"_comment": "Per-file tsc error debt of the @objectstack/client TEST layer (#5286). `tsconfig.test.json` compiles `src/**/*.test.ts` — which `tsconfig.json` excludes and therefore no gate ever read — and every file below still carries errors from before that gate existed, almost all of them fixture literals annotated with a schema OUTPUT type (`z.infer`) while holding an authored INPUT literal. EXACT ratchet, judged by re-running tsc: a file that gains errors is red, a file that loses them is red until its number is re-recorded, a file that reaches zero is red until its entry is deleted, and a file NOT listed here may have no errors at all. Regenerate with: pnpm --filter @objectstack/client gen:test-typecheck-debt ADR-0122 phase 2 (#6083) emptied this ledger: all three remaining files were exactly the conflation described above — an authored literal annotated with the OUTPUT type — and the flip made the bare name mean the INPUT type, so they compile with no edit. An empty `entries` is the goal state, not a disabled gate: a file that gains an error is red on arrival.",
2+
"_comment": "Per-file tsc error debt of the @objectstack/client TEST layer (#5286). `tsconfig.test.json` compiles `src/**/*.test.ts` — which `tsconfig.json` excludes and therefore no gate ever read — and every file below still carries errors from before that gate existed. THIS FIELD IS GENERATED: every regeneration rewrites it from scripts/check-test-typecheck.mts, and the EXACT ratchet below requires a regeneration on every repair — so an edit made here is gone by the next one. Anything true of THIS package goes in the sibling `_note` field, which is authored, is preserved verbatim, and is never written by the generator (#12624). This comment states NO cause for the errors, deliberately: the classes differ per package and per file, they move as the debt is paid down, and a cause written here is rewritten verbatim into every ledger by every regeneration — so it outlives its own repair and cannot be corrected in the file where it is read. Measure instead, before repairing anything: `tsc --noEmit --pretty false -p tsconfig.test.json` in the package prints the real classes with their TS codes. EXACT ratchet, judged by re-running tsc: a file that gains errors is red, a file that loses them is red until its number is re-recorded, a file that reaches zero is red until its entry is deleted, and a file NOT listed here may have no errors at all. Regenerate with: pnpm --filter @objectstack/client gen:test-typecheck-debt",
3+
"_note": "ADR-0122 phase 2 (#6083) emptied this ledger: all three remaining files were an authored literal annotated with the schema's OUTPUT type (`z.infer`), and the flip made the bare name mean the INPUT type, so they compile with no edit. An empty `entries` is the goal state, not a disabled gate: a file that gains an error is red on arrival.",
34
"entries": {}
45
}

packages/rest/test-typecheck-debt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"_comment": "Per-file tsc error debt of the @objectstack/rest TEST layer (#5286). `tsconfig.test.json` compiles `src/**/*.test.ts` — which `tsconfig.json` excludes and therefore no gate ever read — and every file below still carries errors from before that gate existed, almost all of them fixture literals annotated with a schema OUTPUT type (`z.infer`) while holding an authored INPUT literal. EXACT ratchet, judged by re-running tsc: a file that gains errors is red, a file that loses them is red until its number is re-recorded, a file that reaches zero is red until its entry is deleted, and a file NOT listed here may have no errors at all. Regenerate with: pnpm --filter @objectstack/rest gen:test-typecheck-debt",
2+
"_comment": "Per-file tsc error debt of the @objectstack/rest TEST layer (#5286). `tsconfig.test.json` compiles `src/**/*.test.ts` — which `tsconfig.json` excludes and therefore no gate ever read — and every file below still carries errors from before that gate existed. THIS FIELD IS GENERATED: every regeneration rewrites it from scripts/check-test-typecheck.mts, and the EXACT ratchet below requires a regeneration on every repair — so an edit made here is gone by the next one. Anything true of THIS package goes in the sibling `_note` field, which is authored, is preserved verbatim, and is never written by the generator (#12624). This comment states NO cause for the errors, deliberately: the classes differ per package and per file, they move as the debt is paid down, and a cause written here is rewritten verbatim into every ledger by every regeneration — so it outlives its own repair and cannot be corrected in the file where it is read. Measure instead, before repairing anything: `tsc --noEmit --pretty false -p tsconfig.test.json` in the package prints the real classes with their TS codes. EXACT ratchet, judged by re-running tsc: a file that gains errors is red, a file that loses them is red until its number is re-recorded, a file that reaches zero is red until its entry is deleted, and a file NOT listed here may have no errors at all. Regenerate with: pnpm --filter @objectstack/rest gen:test-typecheck-debt",
33
"entries": {
44
"src/meta-public-book-grant.test.ts": 1,
55
"src/rest-batch-size-cap.test.ts": 1,

packages/spec/test-typecheck-debt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"_comment": "Per-file tsc error debt of the @objectstack/spec TEST layer (#5286). `tsconfig.test.json` compiles `src/**/*.test.ts` — which `tsconfig.json` excludes and therefore no gate ever read — and every file below still carries errors from before that gate existed, almost all of them fixture literals annotated with a schema OUTPUT type (`z.infer`) while holding an authored INPUT literal. EXACT ratchet, judged by re-running tsc: a file that gains errors is red, a file that loses them is red until its number is re-recorded, a file that reaches zero is red until its entry is deleted, and a file NOT listed here may have no errors at all. Regenerate with: pnpm --filter @objectstack/spec gen:test-typecheck-debt",
2+
"_comment": "Per-file tsc error debt of the @objectstack/spec TEST layer (#5286). `tsconfig.test.json` compiles `src/**/*.test.ts` — which `tsconfig.json` excludes and therefore no gate ever read — and every file below still carries errors from before that gate existed. THIS FIELD IS GENERATED: every regeneration rewrites it from scripts/check-test-typecheck.mts, and the EXACT ratchet below requires a regeneration on every repair — so an edit made here is gone by the next one. Anything true of THIS package goes in the sibling `_note` field, which is authored, is preserved verbatim, and is never written by the generator (#12624). This comment states NO cause for the errors, deliberately: the classes differ per package and per file, they move as the debt is paid down, and a cause written here is rewritten verbatim into every ledger by every regeneration — so it outlives its own repair and cannot be corrected in the file where it is read. Measure instead, before repairing anything: `tsc --noEmit --pretty false -p tsconfig.test.json` in the package prints the real classes with their TS codes. EXACT ratchet, judged by re-running tsc: a file that gains errors is red, a file that loses them is red until its number is re-recorded, a file that reaches zero is red until its entry is deleted, and a file NOT listed here may have no errors at all. Regenerate with: pnpm --filter @objectstack/spec gen:test-typecheck-debt",
33
"entries": {
44
"src/ai/conversation.test.ts": 5,
55
"src/api/documentation.test.ts": 1,

0 commit comments

Comments
 (0)