You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(spec): compile the test layer so `@ts-expect-error` retirement pins stop being phantom checks
`packages/spec/tsconfig.json` excludes `**/*.test.ts` and the package's
`typecheck` script is a bare `tsc --noEmit` reading that same config, so no gate
anywhere read a spec test file with a type checker. Seventeen `@ts-expect-error`
retirement pins across five files evaluated never: deleting a directive line left
every gate green.
- `packages/spec/tsconfig.test.json`: a sibling of the build config (which keeps
its exclusion — ci.yml gates that no test file reaches the published artifact)
with vitest's module semantics (`module: esnext`, `moduleResolution: bundler`,
ES2022 lib). Strictness flags are inherited, untouched.
- 39 errors in the five pin files fixed outright, plus the real defects the
compile surfaced: two missing `z` imports (TS2503), an `as const[]` typo
(TS2304), a `session.tenantId` fixture key removed in v11 (#3290), and two
`@ts-expect-error` directives sitting three lines above the error they claim
to suppress.
- Residual test-layer debt (79 files / 691 errors, mostly fixture literals typed
with `z.infer` while holding `z.input` values) is held per file in
`test-typecheck-debt.json`, an EXACT ratchet re-measured by tsc on every run.
- `check-type-check-coverage.mjs`: TESTS_COVERED now reads every tsconfig a
package's typecheck chain names, so the sibling-config repair graduates a
package instead of leaving it in TEST_DEBT forever; spec's stale entry (272
files / 902 errors; actual 295 / 842) is deleted accordingly. New repo-wide
PINS_CHECKED invariant: a `@ts-expect-error` outside every tsc program fails,
with a closed shrink-only PHANTOM_PIN_DEBT baseline.
Fixes#5286
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fxLGQdatPbBUvCgiVxg6D
* docs(spec): explain the tsconfig.test.json boundary and point the phantom-pin baseline at its issue
- tsconfig.test.json gains the reasoning it was missing: what differs from the
build config (module semantics only) and what deliberately does not
(strictness, inherited untouched). `include` stops at `src`, and the comment
says why: `packages/spec/scripts/**` is in no tsconfig at all — a second,
differently-shaped hole, measured at 16 files / 33 errors and filed as #5475
rather than ridden along here. No `@ts-expect-error` hides there.
- PHANTOM_PIN_DEBT's metadata-core entry now names #5476, the issue that closes
it. Its cause differs from spec's: no exclusion names the file, it simply sits
outside `include`, which is why TESTS_COVERED could never see it either.
- Drop an unused constant from check-test-typecheck.mts (found by compiling the
scripts layer during the measurement above).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fxLGQdatPbBUvCgiVxg6D
* chore(spec): classify the test-layer typecheck gate in the check:generated ledger
`check:generated --reconcile-only` — the required meta-gate in lint.yml's
TypeScript Type Check job — went red on this branch. `tsc --noEmit` passed; the
step after it did not. package.json declared `check:test-typecheck` and
`gen:test-typecheck-debt`, and no bucket in check-generated.ts named either:
`check:test-typecheck` exists in package.json but is in neither GATED nor NO_GENERATOR.
`gen:test-typecheck-debt` exists in package.json but no GATED entry names it [...]
They are a GATED pair. The gate compares a checked-in artifact
(test-typecheck-debt.json) against what `tsc -p tsconfig.test.json` measures
right now, and `gen:test-typecheck-debt` is that artifact's writer — so
NO_GENERATOR ("no artifact to regenerate") and UNGATED_GENERATORS ("nothing
verifies this output") would each have been false, in opposite directions.
What did NOT fit the existing shape is `--fix`. Every other GATED artifact is a
pure function of the source, so regenerating is always the right answer. This one
records DEBT, and its four verdicts split two ways: "the debt shrank" and "the
file graduated" mean re-record, while "the debt grew" and "an unledgered file has
errors" mean fix the code. `--fix` regenerates without reading which one it got,
and the gate's own failure text says the ledger "only ratchets down" — so a blind
`--fix` would contradict the gate it is fixing and launder new debt in as a
mechanical diff, the same hazard that keeps dual-source-exports.baseline.json out
of GATED entirely (#4446). Hence a `ratchet` flag: the entry is GATED and
reported like every other, and `--fix` refuses it, printing the gate's own
prescription instead of guessing.
This is not hypothetical — merging main into this branch brought three new spec
test files in. They happened to compile clean (the ledger stayed byte-identical
at 79 files / 691 errors), but had any of them carried errors, a reflexive `--fix`
would have ledgered them silently.
Same reasoning adds the artifact to NOT_DRIVER_MANAGED, beside
docs-import-surface.baseline.json: a merge driver must not recompute a
shrink-only ratchet either.
Also pins the reconciliation itself in the spec suite. It had already been
dormant or unsatisfied three times (#4177, #4232, and this branch), each costing
a CI lap because `pnpm test` never read the ledger.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fxLGQdatPbBUvCgiVxg6D
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments