Skip to content

docs(tooling): rewrite metadata's DEBT note to its measured composition - #10775

Merged
os-zhuang merged 1 commit into
mainfrom
claude/issue-10723-metadata-debt-note
Aug 21, 2026
Merged

docs(tooling): rewrite metadata's DEBT note to its measured composition#10775
os-zhuang merged 1 commit into
mainfrom
claude/issue-10723-metadata-debt-note

Conversation

@claude

@claudeclaudeBot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Closes#10723

DEBT['@objectstack/metadata'] recorded errors: 89 while its own note itemised
34 + 24 + 34 = 92 and stated "Re-measured 92 at 5ab0842, up from 87". The entry was
evidently lowered 92 -> 89 without the note being rewritten alongside it — the same class
PR #10721 repaired for @objectstack/service-automation an hour earlier.

Prose only. errors: 89 is unchanged — no count moves.

Measured, not adopted

Re-derived with the gate's own invocation (tscErrorCount()'s), from the repo root
against a built dependency closure, at base 4b84834a32:

$ ./node_modules/.bin/tsc --noEmit --pretty false -p packages/metadata/tsconfig.json
CodeCountTier
TS700633noise
TS234530code
TS283525config
TS61331noise
Total89

89 exactly — matching the field.TS2322, which the old note itemised at x4, is
measurably absent (0 occurrences in the output).

The measurement is valid, not a silent zero: the output carries none of the codes in
the gate's own TSC_SETUP_ERROR set (TS5058/5083/6053/18003/5012/2688), and tsc's exit 2
came with 89 recognisable diagnostics, so the gate's "refusing to record 0" guard does not
fire.

What moved — and it is fully attributable

Against the composition the note itself recorded at 92:

TierNote said (92)Measured (89)Delta
code34 (TS2345 x30, TS2322 x4)30 (TS2345 x30)-4
config24 (TS2835)25 (TS2835)+1
noise34 (TS7006 x33, TS6133)34 (TS7006 x33, TS6133)0

-4 +1 +0 = -3, and 92 - 3 = 89. The delta closes exactly, so the new note states the
attribution rather than falling back on the file's own escape hatch at :167-173 ("when
the delta cannot be attributed, say so in the note rather than inventing composition").

Read across the entry's history, the code tier is the only churning one: TS2353 gave way
to TS2322, and TS2322 has now gone too. TS2345 x30 is its only lasting resident.

Two inherited claims re-derived — one of which never held

Per the dispatch, neither the tier split nor the per-file claim was carried forward
unchecked.

  • The per-file counts survive exactly.metadata.test.ts = 34 and
    register-notifies-watchers.test.ts = 16 today, the same two numbers the note carried at
    92. The whole -3 landed in the other ten files.
  • The fraction did not. 34 + 16 = 50 of 89 is 56% — over half, not the "two thirds"
    the note claimed. It was not true at 92 either (50/92 = 54%), so this was a wrong claim
    at both endpoints rather than a stale one. The rewrite says "over HALF" and names both
    numbers it was wrong at.

The residue restated as what it actually is

The 89 is three mechanical repairs, not 89 problems:

  • All 30 TS2345 are one defect thirty times over — metadata.test.ts between lines 608
    and 945, every one the same mock PluginContext object literal missing
    registerServiceFactory and getServiceScoped. Verified rather than assumed: 30/30 of
    those diagnostics carry the identical "is not assignable to parameter of type
    'PluginContext'" head and the identical "missing the following properties ...
    registerServiceFactory, getServiceScoped" continuation. One shared fixture closes the
    code tier outright.
  • The 25 TS2835 are the widest spread — 12 files — and are one codemod: a relative
    import wanting an explicit .js extension under node16 resolution.
  • The remaining 34 are noise: implicit-any parameters, plus one unused import.

Mutation verified, not assumed

This is a prose edit inside a multi-line string concatenation, exactly where a zero-match
edit reads as a clean no-op. Repo-wide phrase counts across scripts/, before -> after:

PhraseBeforeAfter
Re-measured 92 at 5ab0842810
code-tier 34 (TS2345 x30, TS2322 x4)10
Two thirds of the pile10
Re-measured 89 at 4b84834a3201
Re-measured (every ledger note)3030
ledger entries named @objectstack/metadata...1313

Re-measured holding at 30 is the neighbour check — one occurrence was swapped for one, so
no other entry's note moved. The replacement itself asserted a match count of exactly 1
before writing. git diff --stat is 1 file, +12/-4, and no errors: line appears in the
diff at all
.

Deliberately not in this PR

Gates

Derived with node scripts/pm/dispatch-gates.mjs (no paths — merge base 4b84834a3,
1 committed path, 0 working-tree, 0 untracked), then run at 464fe41468:

GateResult
check:type-check-coverageOK — 64/77 packages type-checked, 13 in DEBT; self-test 23+24+25+28+9 cases hold
check:type-check-debt (--re-measure)OK — 33 ledger entries re-measured in 277.1s, 1912 raw errors, none above its recorded number
check:cross-package-test-inputsOK — 13 packages read outside themselves, all declared; 90 self-test cases passed
check:nul-bytesOK — 6235 text files scanned, no raw ASCII control bytes

The re-measure half refused correctly on the first attempt — "43 workspace
dependenc(ies) of the ledgered packages have no built type entry point on disk ... measuring
now would not fail, it would silently measure a DIFFERENT WORLD"
— and was re-run after
pnpm exec turbo run build --filter='./packages/*' --filter='./packages/*/*' (70/70
successful). That refusal is the evidence the number came from a real closure.

Its one informational line is @objectstack/plugin-auth TEST_DEBT 109 recorded vs 97
measured — pre-existing, unrelated to this card, explicitly not an error, and already owned
by #6376 / #10615. @objectstack/metadata is not among the surplus entries, which is
the gate's own independent confirmation that it measures its recorded 89 exactly.

No changeset: gate-ledger prose publishes nothing, so this carries skip-changeset.


Generated by Claude Code

`DEBT['@objectstack/metadata']` recorded `errors: 89` while its own note
itemised 34 + 24 + 34 = 92 and stated "Re-measured 92 at 5ab0842". The
entry was evidently lowered 92 -> 89 without the note being rewritten
alongside it, the same class PR #10721 just repaired for
`@objectstack/service-automation`.
Prose only. `errors: 89` is unchanged -- re-measured at 4b84834 against
a built dependency closure, the package reports exactly 89.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DdCnBGcHeufjrq7drTD3wt
@claudeclaudeBot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Aug 21, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review August 21, 2026 11:13
@os-zhuang
os-zhuang enabled auto-merge August 21, 2026 11:14
@os-zhuang
os-zhuang added this pull request to the merge queueAug 21, 2026
Merged via the queue into main with commit 699132fAug 21, 2026
32 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-10723-metadata-debt-note branch August 21, 2026 11:35
os-zhuang pushed a commit that referenced this pull request Aug 21, 2026
…er minting the drift
`DEBT`/`TEST_DEBT` pair a measured `errors` with free prose, and nothing read
the prose: a note could narrate any count at all, including one its own field
contradicted, with every gate green. Four hand repairs of that shape are on
record (#7038, #8982, #10721, #10775), the last two on the same day. None of
them closed the class, because `--lower` MINTS it -- its regex capture ends at
the digits, so the sanctioned one-command way to close a surplus is also the way
to desynchronise a note.
Both halves land together, because neither is safe alone. A check without the
tool fix leaves the ledger RED after the next `--lower` run, in whoever's PR ran
it, breaking the "closing an entry is FREE" invariant #5278/#6376 paid for. The
tool fix without the check leaves today's instances undetected.
COMPOSITION reads exactly one thing -- the house-convention tier itemisation the
notes already open with -- and abstains, silently, everywhere else. A tier
counted twice or a further tier count later in the note means the note quotes
its own history and the entry is skipped rather than guessed at. Per-code
tallies (`TS2835 x67, ...`) are deliberately NOT summed: they are partial by
construction, and plugin-rest's sums to 147 while saying "composition as counted
at 153".
`--lower` now plans a `compositionAt` declaration alongside each lowering that
would strand an itemisation, and writes it as a sibling field beside the number
it already locates -- no prose surgery, no invented composition. The staleness
becomes a declared fact the check reads and the green summary reports, instead
of a silent one nothing reads at all. `compositionAt` may only ever declare a
pile LARGER than the field, so it cannot launder a raise.
Measured: over all 33 entries on main, 11 are checked and 0 fire. Over the tree
before #10721 landed, exactly the two known instances fire and nothing else.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DdCnBGcHeufjrq7drTD3wt
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DEBT['@objectstack/metadata'] says errors: 89 while its note itemises 92 and says "Re-measured 92" — a second live instance of the #10174 class

2 participants

@os-zhuang@claude