Skip to content

Commit 96dc446

Browse files
claude[bot]claude
andauthored
fix(devx): sweep the type-check debt ledger onto its measurements (#12798)
`--re-measure` is green by design while an entry sits ABOVE its measured count -- the contract is "none above its recorded number" -- so the slack lives in the ledger data, not in the gate's logic. Nothing schedules the `--lower` the tool advertises on every run, which is disclosure rather than a mechanism. All 31 entries were re-measured at ead7317 on a closure the gate built itself. 4 carried slack, worth 118 raw errors: objectql 354 -> 251, runtime 227 -> 217, plugin-auth 97 -> 94, plugin-approvals 347 -> 345. Numbers written by `--re-measure --lower`, never typed by hand. All four are TEST_DEBT; none of the 13 DEBT entries had moved. A DEBT number is what a package's own `typecheck` would report, so repair work there is visible to whoever does it; a TEST_DEBT number exists only inside the temp project this gate generates, so fixing a test-layer type error moves a number nobody sees until the next sweep. The header now records that. The four notes are corrected rather than left stranded: each records the lowering, and says its tally was taken at the OLD number and is NOT re-tallied, since the sweep measured totals only. `--lower` wrote no `compositionAt` for any of them (per-code tallies are not tier itemisations, and two of the notes were already ambiguous), so nothing mechanical would have said the notes had gone stale. Three of them also asserted a present-tense equality with a field that had moved -- the failure the header names as the surest way to make the next reader mis-derive this policy. Claude-Session: https://claude.ai/code/session_01PfaSTikked61BkcsB5Rn69 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 391f9f4 commit 96dc446

1 file changed

Lines changed: 61 additions & 14 deletions

File tree

scripts/check-type-check-coverage.mjs

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,37 @@
240240
// to an issue that is now closed with nothing left to read there
241241
// (#11497).
242242
//
243+
// SWEPT LEDGER-WIDE at ead731756 (#12723), which is the first time
244+
// all 31 entries were re-measured to answer the surplus question
245+
// rather than one entry noticed in passing. 4 carried slack, worth
246+
// 118 raw errors: objectql 354 -> 251, runtime 227 -> 217,
247+
// plugin-auth 97 -> 94, plugin-approvals 347 -> 345. The shape of
248+
// that result is the part worth keeping, and it is not the one the
249+
// card predicted. ALL FOUR ARE TEST_DEBT; not one of the 13 DEBT
250+
// entries had moved, each measuring its recorded number to the
251+
// unit. That asymmetry has a mechanical cause rather than a moral
252+
// one: a DEBT entry's number is what the package's OWN `typecheck`
253+
// would report if it had one, so ordinary repair work in those
254+
// packages is visible to whoever does it, while a TEST_DEBT number
255+
// is only ever produced by the temp project this file generates --
256+
// nothing a contributor runs reports it, so fixing a test-layer
257+
// type error here moves a number NOBODY SEES until the next
258+
// re-measure. The surplus is therefore not evenly distributed
259+
// noise; it accumulates in exactly the layer whose measurement is
260+
// invisible outside this gate.
261+
//
262+
// ⛔ Read that 118 as a measurement of ONE MOMENT, not as a
263+
// standing property. It is what four months of ordinary repair
264+
// work banked between sweeps, and the entries above sit at their
265+
// measurement again as of that sha -- so the next reader must
266+
// re-measure rather than quote this paragraph, exactly as the
267+
// bootstrap-margin roster above must not be read as a current
268+
// inventory. What the number IS good for is sizing the open
269+
// design question: whether a surplus should additionally make this
270+
// gate RED (a self-tightening ratchet). #6376 decided not to when
271+
// the mechanism was built, and this sweep is the first evidence
272+
// about what that costs in practice.
273+
//
243274
// What drifts is not only the NUMBER but the note's COMPOSITION:
244275
// service-automation's note named `engine.test.ts:2547/2577` as
245276
// the whole debt while three TS2341 in a different file, from an
@@ -778,9 +809,13 @@ const EXEMPT = {
778809
// import a test file gains.
779810
const TEST_DEBT = {
780811
'@objectstack/plugin-approvals': {
781-
errors: 347,
812+
errors: 345,
782813
note: 'TS2339 x296, TS2550 x20, TS2345 x16, TS18048 x10, plus 5 singletons (TS2554 x2, TS1470, '
783-
+ 'TS2352, TS6133). Lowered 348 -> 347 at 0e0bf8049 (#11497): tsc against that tree reports the '
814+
+ 'TS2352, TS6133). LOWERED 347 -> 345 at ead731756 (#12723), in a sweep that re-measured all 31 '
815+
+ 'ledger entries at once and found 4 of them carrying slack. The tally above was taken at 347 and '
816+
+ 'is NOT re-tallied here: that sweep measured per-entry TOTALS only, so the -2 is unattributed, '
817+
+ 'and an admitted gap beats an invented composition. '
818+
+ 'Lowered 348 -> 347 at 0e0bf8049 (#11497): tsc against that tree reports the '
784819
+ 'same seven codes at the same counts as the prior 348 composition, TO THE UNIT, minus the sole '
785820
+ 'TS2353 -- a fully attributable single-error retirement, not a rescale. '
786821
+ 'Was 547 (re-measured at 5ab08428, up from 467; TS2345 x213 then). '
@@ -800,11 +835,16 @@ const TEST_DEBT = {
800835
+ 'away. Still entirely test-only (src is clean), so nothing but this ledger has ever seen it.',
801836
},
802837
'@objectstack/objectql': {
803-
errors: 354,
838+
errors: 251,
804839
note: 'code-tier 300 (TS2339 x115, TS2554 x113 wrong arity, TS2345 x24, TS2749 x14, TS2322 x14, '
805840
+ 'TS18048 x8, TS2353 x4, plus 8 singletons); config-tier 8 (TS2550 x8, `Array.prototype.at` '
806841
+ 'against a `lib` older than es2022); noise 46 (TS7006 x36, TS6133 x9, '
807-
+ 'TS6196 x1). LOWERED 355 -> 354 in #10779, and the note RE-TALLIED rather than declared stale '
842+
+ 'TS6196 x1). LOWERED 354 -> 251 at ead731756 (#12723) -- the largest single surplus the 31-entry '
843+
+ 'sweep found, and 103 of the 118 raw errors of slack it found in total. The itemisation above was '
844+
+ 'tallied at 354 and is NOT re-tallied here: that sweep measured per-entry TOTALS only, so the '
845+
+ '-103 is unattributed, and inventing a composition for errors that are gone is the one thing this '
846+
+ 'ledger is written against. '
847+
+ 'LOWERED 355 -> 354 in #10779, and the note RE-TALLIED rather than declared stale '
808848
+ 'because the delta is exactly attributable: the retired error is the TS6059 this itemisation '
809849
+ 'used to name (src/dry-run-hash-compat.test.ts importing scripts/dry-run-hash-compat.ts from '
810850
+ 'outside rootDir), which was never this package\'s debt -- it was the generated re-measure '
@@ -841,17 +881,21 @@ const TEST_DEBT = {
841881
+ 'description of this entry today. This is the one of the five that was never lowered, and it did '
842882
+ 'not need to be: the margin was not handed back, it was SPENT. Real growth carried the '
843883
+ 'measurement 345 -> 355 while the slack absorbed it, so the recorded number stood still and the '
844-
+ 'measurement rose to meet it, and this entry now measures its recorded 355 EXACTLY (62b2655d8). '
884+
+ 'measurement rose to meet it, and this entry measured its then-recorded 355 EXACTLY at 62b2655d8. '
845885
+ 'Read the distinction, because both routes end in the same place and only one of them shows up '
846886
+ 'as a lowering in the history: the other four were TIGHTENED onto their measurement, this one '
847-
+ 'was OVERTAKEN by its own. There is no slack here today, and the next new error in this package '
848-
+ 'goes red on arrival exactly as it would on an entry that had been tightened '
849-
+ '(#5278 option A).',
887+
+ 'was OVERTAKEN by its own. There was no slack at that measurement, and the next new error in this '
888+
+ 'package went red on arrival exactly as it would on an entry that had been tightened '
889+
+ '(#5278 option A). That sentence is history too: the entry had drifted 103 below its ceiling by '
890+
+ 'ead731756, which is what the lowering at the top of this note closed.',
850891
},
851892
'@objectstack/runtime': {
852-
errors: 227,
893+
errors: 217,
853894
note: 'TS18048 x98 (possibly-undefined), TS2345 x26, TS18046 x20, TS2339 x16, TS2493 x15, TS2835 x11, '
854-
+ 'TS2554 x11. Src '
895+
+ 'TS2554 x11. LOWERED 227 -> 217 at ead731756 (#12723) -- the entry that card was filed on, where '
896+
+ 'the slack turned out to be 10 rather than the 1 it reported: the 226 it quoted was itself a '
897+
+ 'reading taken days earlier, which is the card\'s own point about a number that drifts. The tally '
898+
+ 'above was taken at 227 and is NOT re-tallied here; that sweep measured per-entry TOTALS only. Src '
855899
+ 'graduated in #4311 (declares `typecheck`); this is purely the hidden test layer. Measured 220 -> '
856900
+ '218 (5ab08428, one of only two entries that ever shrank; TS6133 x25 collapsed to x7 while '
857901
+ 'possibly-undefined grew, so that net -2 hid a much larger churn in both directions) -> 227 '
@@ -893,13 +937,16 @@ const TEST_DEBT = {
893937
+ 'it should go red rather than be absorbed.',
894938
},
895939
'@objectstack/plugin-auth': {
896-
errors: 97,
897-
note: 'RE-TALLIED from tsc at the 97 below (#10615), measured at cea8c7d867 with the workspace closure '
940+
errors: 94,
941+
note: 'LOWERED 97 -> 94 at ead731756 (#12723), in a sweep that re-measured all 31 ledger entries at '
942+
+ 'once. Everything below -- the tally, the per-file split, the 97 they sum to -- was taken at 97 '
943+
+ 'and is NOT re-tallied here: that sweep measured per-entry TOTALS only, so the -3 is unattributed. '
944+
+ 'RE-TALLIED from tsc at the 97 below (#10615), measured at cea8c7d867 with the workspace closure '
898945
+ 'built by the same command lint.yml runs before this gate, so the composition, the per-file split '
899946
+ 'and the total are ONE measurement rather than a rescale: TS2493 x36 (tuple index out of range), '
900947
+ 'TS18048 x24, TS2322 x11, TS2532 x9, TS2345 x4, TS2339 x3, TS2554 x3, TS2741 x3, TS7006 x2, '
901-
+ 'TS2769 x1, TS6133 x1 = 97, the recorded number EXACTLY -- no margin, so the next new error here '
902-
+ 'goes red immediately. The per-file split is COMPLETE at this measurement rather than a top-four: '
948+
+ 'TS2769 x1, TS6133 x1 = 97, the number recorded at THAT time EXACTLY. The per-file split is '
949+
+ 'COMPLETE at this measurement rather than a top-four: '
903950
+ '43 in src/auth-manager.test.ts, 18 in src/admin-user-endpoints.test.ts, 12 in '
904951
+ 'src/auth-plugin.test.ts, 11 in src/admin-import-users.test.ts, 3 each in '
905952
+ 'src/objectql-adapter.test.ts and src/sso-client-secret-at-rest.test.ts, 2 each in '

0 commit comments

Comments
 (0)