Uh oh!
There was an error while loading. Please reload this page.
chore(devx): lower nine type-check DEBT ledger entries to their measurement (#7888) - #8225
Conversation
…rement (#7888) `pnpm check:type-check-debt --lower` on the DEBT / TEST_DEBT ledger in `scripts/check-type-check-coverage.mjs`. Nine entries recorded more raw tsc errors than the tree has; each is rewritten to what the compiler reports. 271 raw errors of regression headroom closed. No package source changes — this records where the numbers already are, it does not move them. Measured on b5e09b2 with the full build closure built first (70/70 turbo tasks successful), and `--re-measure` run twice in separate invocations with identical results entry for entry. DEBT metadata 92 -> 89 DEBT service-automation 5 -> 3 DEBT service-storage 52 -> 51 TEST_DEBT plugin-approvals 547 -> 348 TEST_DEBT plugin-auth 131 -> 108 TEST_DEBT lint 42 -> 20 TEST_DEBT mcp 63 -> 53 TEST_DEBT plugin-security 21 -> 11 TEST_DEBT http-conformance 4 -> 3 Nothing raised: the run reports `none above its recorded number` before it writes, and `plannedLowerings` skips any entry whose measurement is at or above its ceiling. plugin-approvals' -199 is a genuine floor, not a shrunken surface. Its composition moved in exactly one class (TS2345 213 -> 16) while TS2339 x296, TS2550 x20 and TS18048 x10 held to the unit; all 21 test files remain in the program; and src/approval-service.test.ts is byte-identical (blob 3fc272f) between the commit 547 was measured at and this base, with 170 fewer errors. Its note is rewritten to that attributed composition, as `--lower` asks; the other eight notes are left alone rather than inventing a composition. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N9ARHddV6frm9fXNHxA7Ee
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Uh oh!
There was an error while loading. Please reload this page.
The merge queue built this PR onto b16dcb4 and `check:type-check-debt` went red on one entry: @objectstack/plugin-auth: TEST_DEBT records 108 raw tsc error(s), `tsc --noEmit` now reports 111 (+3). That is the ledger working, not breaking. The 108 was measured at b5e09b2 and the package took +3 inside the hour, so an exactly-recorded ceiling with no margin went red the moment the queue rebuilt it — the same moving-base race that kicked #5278 three times, and the reason this PR's body says the repair is a re-measure on the new head rather than a raise. This is still a lowering, not a raise: `main` records 131, and this PR now records 111. The 108 is an intermediate that never existed on main. 111 is the merge-queue run's own re-measure, taken with the full build closure by the same command on the exact ref this PR lands on — a stricter provenance than a second reading from a container whose base has already moved again. The other eight entries need no change: that same run printed no `can be lowered` note for any of them, so all eight measured exactly at their new ceilings on the queue base. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N9ARHddV6frm9fXNHxA7Ee
hotlong
commented
Aug 12, 2026
Queue kick diagnosed and fixed in The merge queue built this onto That is the ratchet working. The 108 was measured at This is still a lowering. Why 111 is not hand-typed. It is the merge-queue run's own The other eight need no change, and that is a measured claim rather than an assumption. The same queue run printed no Ran locally on the fix: One judgement call worth a second pair of eyes, flagged rather than buried. Generated by Claude Code Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
…tuple (#8144) `vi.fn(async () => undefined)` types `mock.calls` as `[][]` — a zero-length tuple — so every `calls[0][0]` in this file reached past the end of a tuple the type system believed was empty (TS2493 x3), and the dereference that followed was `possibly undefined` (TS18048 x3). Reading the argument back is the entire point of these cases, so the fix is to declare what the spy receives rather than to soften the read: the spy's implementation now names its parameter, and the call log is pulled through `recordedEvents` / `firstEvent`, which name the "never called" case instead of letting it surface as a TypeError. Pinning the element type to `AuthSessionAuditEventInput` also makes these assertions type-check against the real event surface instead of `any`: a renamed field now fails at compile time rather than quietly comparing `undefined` to `undefined`. One `(c: any[])` map goes away with it. Behaviour unchanged — 1113/1113 plugin-auth tests pass, same 20 cases. Why now: #8225 lowered this package's TEST_DEBT ceiling 131 -> 111 after this branch was cut, so these six errors stopped being slack and became a violation in the merge queue. Measured at 117 against the merged tree, 111 after this commit — exactly the ceiling, ledger untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PEVB6w7D7uCszR9Mw1BL73
Fixes#7888
pnpm check:type-check-debt --loweron the DEBT / TEST_DEBT ledger inscripts/check-type-check-coverage.mjs. Nine entries recorded more raw tsc errors thanthe tree has; each is rewritten to what the compiler reports. 271 raw errors of
regression headroom closed. No package source changes — this PR records where the
numbers already are, it does not move them.
What moved
Measured on
b5e09b21(this PR's base) with the full closure built first:pnpm exec turbo run build --filter='./packages/*' --filter='./packages/*/*'— 70/70tasks successful, exit 0.
@objectstack/plugin-approvals@objectstack/plugin-auth@objectstack/lint@objectstack/mcp@objectstack/plugin-security@objectstack/metadata@objectstack/service-automation@objectstack/service-storage@objectstack/http-conformanceLedger totals: DEBT 442 → 436, TEST_DEBT 1795 → 1530.
Nothing was raised. Three independent guarantees, not one: the run prints
none above its recorded numberbefore it writes;plannedLoweringsskips every entrywhose measurement is at or above its ceiling (
if (m.actual >= m.recorded) continue, witha self-test case named a grown entry is never lowered); and
lowerLedgerEntriesrefusesany entry whose on-disk number is not the one the measurement was taken against.
Where this differs from the issue's table
The card measured at
b313fde(2026-08-12 02:17Z) and reported 273 across the samenine entries. Two entries have each gained one error since, so the surplus is smaller:
@objectstack/plugin-auth@objectstack/lintThe other seven are identical to the card. 273 → 271. (The card's
plugin-authmeasuredcell reads 106; the reopen comment already corrected it to 107, and 107 is whatthe −24 assumed. That correction stands.)
The card's set of nine entries is otherwise exactly reproduced — six PRs landing in the
lane since, including the one that changed a package's tsc program membership, moved two
counts by one each and nothing else.
plugin-approvals−199: a genuine floor, not a shrunken surfaceThe card asks for this one before its ceiling is written in, and the question is the right
one: a gap that size is either a wholesale fix (the new number is a real floor) or files
leaving the measured set (writing it in ratchets the gate against a smaller surface than it
thinks it is guarding). It is the first. Three readings, any one of which would have
falsified the other answer:
1. The composition moved in exactly one class.
Three of the four recorded classes are unchanged to the unit; only TS2345 (argument not
assignable) collapsed. This is also what rules out the dangerous reading — a program that
had degraded, with an unresolved import turning a type into
any, would have wiped the296 property errors first, because property access on
anyis legal. 296 surviving is proofthe program still resolves the same real types.
2. Nothing left the measured set; the set grew. All 21
*.test.tsfiles in the packageare on disk and all 21 are in the program (counted from
tsc --listFiles). No test file hasbeen deleted. Over the window the package's other test files gained 406 lines and lost 204.
3. The file carrying the debt is byte-identical.
src/approval-service.test.tsholds273 of the measured 348, as it held 443 of the recorded 547 — and its blob hash is the same
3fc272fat5ab08428, where the 547 was measured, and at this PR's base. Same 3335 lines,same bytes, 170 fewer errors. The repair landed in a producer's types; no assertion was
deleted to get it.
The 16 TS2345 that survive in that file are still reported against a fully-resolved
approver-config union, so the parameter type is still strict — the 197 that went away were
repaired, not loosened away.
That attribution is written into the entry's
note, which is what--lowerasks for on theentries you can attribute. The other eight notes are left exactly as they were — they
describe a larger pile than exists, which misleads in the safe direction, and inventing a
composition for errors that are gone is the one thing this ledger's own rules forbid.
Verification
script's
unbuiltClosureguard is the structural half: it refuses to measure at all if anyworkspace dependency of a ledgered package has no built type entry on disk, so a partial or
skipped closure cannot quietly yield low numbers — it yields a thrown error naming the
packages. (Its own docstring measures the stakes:
packages/lintreports 19 built and 147unbuilt, same tree, same commit.)
--re-measurerun twice in two separate clean invocationson the same tree: identical entry for entry, 1966 raw errors total, surplus 271 both times.
A third run, on the previous base
fa48973, gave the same nine entries and the same 271 —so the reading is a property of the tree, not of the run.
pnpm check:type-check-debtgreen, and--re-measurereports nosurplus line at all. Both readings, not one.
pnpm check:type-check-coveragegreen (47 structural + 15 re-measure + 12 built-closure +9 auto-lowering self-test cases hold).
check:nul-bytesgreen.Notes for the reviewer
errors:numbers plus one rewrittennote. Everything else in the fileis untouched.
scripts/only), so the PR carriesskip-changeset.b5e09b21; the base wasrefreshed to the tip once, mid-task, precisely to shrink that window, and the numbers were
identical at both bases. If the merge queue kicks this on a package that took a new error
in between, the repair is a re-measure on the new head — not a raise.
check-type-check-coverage.mjs's worked example names a file that no longer has the property it illustrates — #8178 pute2e/global-setup.tsin the program with zero errors #8189 (the stale worked example in this file's prose). As a by-product ofreading the file: that card's
~1410line number is accurate — the passage sits at lines1409-1412 on this base, inside
measureTestDebt's docblock. There is a second copy ofthe same
e2e/global-setup.tsclaim at line 500, in the TEST_DEBT preamble, which thecard does not name; whoever takes it should fix both or neither.
Generated by Claude Code