Uh oh!
There was an error while loading. Please reload this page.
fix(devx): count a package's unread source directories, and stop billing the re-measure's own rootDir - #10876
Conversation
…ing the re-measure's own rootDir (#10756, #10779) Two defects in `scripts/check-type-check-coverage.mjs`, folded because they are the same instrument and #10779 lives in the function #10756's census had to reason about. #10756 — SOURCES_COVERED. The gate was package-granular on the source layer: it asked whether a package declares a `typecheck` script and could not see one that declares a script while its tsconfig `include` omits an entire source directory. `@objectstack/objectql` passed as COVERED with `packages/objectql/scripts/**` in no program its `typecheck` runs. The census, over the 64 covered packages, found 65 non-test `.ts` files outside every accounting program: 54 package-root tool configs (`vitest.config.ts` x32, `tsup.config.ts` x16, `objectstack.config.ts` x5, `vitest.integration.config.ts` x1) and 11 files in a real source directory. The count chose the remedy: 11 directories across 11 packages is too many for the sibling-config route to close on its own and would still leave the gate blind to the 12th, so this adds the ratchet limb — structural, sub-second, no `tsc --listFiles` needed, because the gate already walks every package's tree for TESTS_COVERED and PINS_CHECKED. `UNCHECKED_SOURCE_DEBT` is seeded at 10, shrink-only and closed to new entries; the 11th, the directory the card was filed about, is repaired instead. #10779 — the TEST_DEBT re-measure billed packages for TS6059 about its own generated config. ⛔ NOT repaired by setting `compilerOptions.rootDir = pkgAbs` unconditionally, which is the shape the finding reads as wanting: that was implemented and measured, and it RAISES a ledger count. `pkgAbs` is wider than the `src` most packages declare but narrower than one that widened its own — `packages/rest` sets `rootDir: ".."` for a `paths` rule that pulls a sibling package's source into the program (#9960), and pinning it back to the package directory took `@objectstack/rest` 155 -> 175 on a shrink-only ledger. The diagnostic is dropped where it is counted instead, for the generated project only, which holds for every rootDir shape a package can declare. Ledger movement, both attributable and both DOWN: @objectstack/objectql TEST_DEBT 355 -> 354 (the TS6059 its note already named) @objectstack/lint TEST_DEBT 19 -> 16 (the 3 TS6059 its note already named) Both notes re-tallied rather than declared stale, so neither carries a `compositionAt`. No entry rose: full `--re-measure` reports 33 entries, 1908 raw errors, none above its recorded number. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DdCnBGcHeufjrq7drTD3wt
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 14 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
✅ ACCEPT — reviewer of record: |
Uh oh!
There was an error while loading. Please reload this page.
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 32497883605 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Fixes#10756
Fixes#10779
Folded: both cards are
scripts/check-type-check-coverage.mjs, and #10779 lives inremeasureProject— the function #10756's census has to reason about. Everything belowis re-derived on
origin/main@5886ee6d22; every line number and count on both cardspredates PR #10820.
#10756 — the census chose the remedy
The gate was package-granular on the source layer: it asked whether a package
declares a
typecheckscript, and could not see a package that declares one while itstsconfig
includeomits an entire source directory.Carrying the card's corrected extent (its author's comment 1), not the body's first
claim:
packages/objectql/scripts/**is invisible to the package's owntsc -p—true — but not to every tsc program, because the TEST_DEBT re-measure builds a different
project and reaches the file transitively through a test import.
The count, over the 64 packages the headline calls covered
65 non-test
.tsfiles sit outside every program accounting for them, and they splitcleanly:
vitest.config.tsx32,tsup.config.tsx16,objectstack.config.tsx5,vitest.integration.config.tsx1)The card's own question — "how many covered packages have a real source directory
outside their own tsc program" — answers 11.
What that chose, and why
The ratchet limb, not the
tsconfig.scripts.jsonsibling route alone. 11 directoriesacross 11 packages is too many for the sibling route to close by itself, and repeating it
11 times would still leave the gate blind to the 12th — the card's actual subject is the
gate's blindness. The limb is cheap in a way the card could not assume: it needs no
tsc --listFiles, because the gate already walks every package's whole tree forTESTS_COVERED and PINS_CHECKED, so
SOURCES_COVEREDstays structural and sub-second.UNCHECKED_SOURCE_DEBTis seeded at 10, shrink-only and closed to new entries. The11th is repaired rather than recorded:
packages/objectql/scripts— the directory thecard was filed about — now has a sibling
tsconfig.scripts.jsonnamed in thetypecheckscript (thepackages/spec#5475 pattern), and type-checks clean at 0 errors.A detail worth the reviewer's eye:
packages/spec/tsconfig.scripts.json's own headeralready stated this defect class in the words the finding later used — "the directory was
never INCLUDED by anything …
check:type-check-coveragecould not even count it". Thisturns that observation into the count.
The scoping decision, stated out loud
SOURCES_COVEREDgoverns the 11, not the 54: the observation half takes files atdepth > 0. Argued both ways in the ledger's header, including the part that cutsagainst it — the
depth > 0line can be walked around by moving a file up into thepackage root, and that hole is left open knowingly. Filed as #10870 for a maintainer to
rule on rather than decided here.
#10779 — the shape the finding reads as wanting is refuted by measurement
⛔ NOT repaired by setting
compilerOptions.rootDir = pkgAbsunconditionally. Thatwas implemented and measured first, exactly as triage required ("verify no ledger count
rises under that change before choosing it"), and it raises one:
pkgAbsis wider than thesrcmost packages declare but narrower than one thatwidened its own.
packages/rest/tsconfig.jsonsetsrootDir: ".."because apathsrule redirects
@objectstack/metadata-protocolto the producer's source, putting asibling package's files in the program — #9960 paid to remove exactly those 20 TS6059,
and pinning
rootDirback to the package directory re-created them. A "neutralisation"that can narrow is not one.
Chosen instead: drop TS6059 where it is counted, for the generated re-measure
project only (
countTscErrors). That is complete where arootDirvalue cannot be — itholds for every shape a package's own config declares, including ones no rule could
predict — and it leaves each package's own
rootDir, the one governing real emit,untouched.
measureDebtstill counts TS6059, because there it is a statement about aconfig the package ships.
Ledger movement — both attributable, both DOWN
@objectstack/objectql@objectstack/lintBoth notes re-tallied rather than declared stale, so neither carries a
compositionAt— the delta was exactly attributable in both, which is what the gate'sown prose asks for.
lint's 3 were a discovery of this change, not of either card: itsnote already named them as imports of three
examples/app-showcasefiles.⛔ No entry was raised. The base tree measured 1912 raw errors with a surplus of 12 on
plugin-auth; the final tree measures 1908 with the same surplus of 12 on the sameentry, so this change opens no new permission allowance (#6376). The −4 is exactly
objectql −1 plus lint −3.
Verification — quoted verdict lines, all at
52d0c746d2Self-test grew 34→38 semantic, 24→38 observation, 25→29 re-measure.
Gate union, derived with
node scripts/pm/dispatch-gates.mjs(no hand-written pathlist) and run at
52d0c746d2— 14 matched families pluscheck:entry-guard,check:parse-guard(both invisible to the derivation) andcheck:nul-bytes: all 18exit 0.
pnpm --filter @objectstack/objectql typecheckexits 0 and the log echoestsc --noEmit && tsc --noEmit -p tsconfig.scripts.json, so the filter really matched(#10853).
Ablations — each mutation proven on disk by marker count, both legs
plugin-auth/examplesfrom the ledgertypechecktotsc --noEmit-p tsconfig.scripts.json1 → 0packages/objectql/scripts— so the sibling config is only coverage because the script NAMES it · restored → 1, greendropRootDirDiagnosticsNo
dist/is involved — this is a CI gate script, so there is no build leg to prove.Out of scope — filed, not repaired here
scripts/i18n-extract.config.tsfail to type-check: TS2883 on an inferreddefaultnaming @objectstack/spec's hashed dist chunks #10868 — 8 packages'scripts/i18n-extract.config.tsfail to type-check (1–3 xTS2883 each): the inferred
defaultnames hash-suffixed internal chunks of@objectstack/spec's dist. Two candidate repairs, one of which is inspec.plugin-auth/examples/basic-usage.tsimports@objectstack/plugin-hono-server, which the package declares in no dependency block #10869 —plugin-auth/examples/basic-usage.tsimports@objectstack/plugin-hono-server, declared in no dependency block (TS2307). Thecensus's only file in no tsc program at all.
vitest.config.ts,tsup.config.ts, …) are TypeScript no tsc program reads — SOURCES_COVERED deliberately does not govern them #10870 —[finding]the 54 package-root tool configs, and thedepth > 0scopingline, for a maintainer to rule on.
No changeset: nothing published changes —
@objectstack/objectql'sfilesis["dist","README.md","CHANGELOG.md"], so neither thescriptsfield nor the newtsconfig ships, and the gate script is CI-only.
skip-changesetapplied.Generated by Claude Code
Generated by Claude Code