fix(tooling): put three more package-root plugin manifests inside a tsc program - #14458
Merged
baozhoutao merged 2 commits intoSep 2, 2026
Merged
Conversation
…sc program check:type-check-coverage's isUncheckedSourceCandidate skipped depth === 0 (the package root) unconditionally, so a package-root .ts file was invisible to SOURCES_COVERED regardless of content. This is why #13284's driver-memory / plugin-hono-server manifests went unchecked for as long as they did. Per the triage on #14386 (comment 5504408509), this admits depth === 0 only for a declared, exact-name allowlist (ROOT_SOURCE_FILES, currently just objectstack.config.ts) rather than every package-root file -- the wider 104-file question stays explicitly unresolved. The uncheckedByDir aggregation now keys a root-level file at '.' (which posix.join collapses to the package's own directory) instead of the rel.slice(0, -1) garbage key the old indexOf('/') === -1 arithmetic produced. The three sites the widened predicate then surfaces (plugin-auth, plugin-security, service-i18n) are put into a program: widened include on the existing sibling noEmit programs for the first two, a new sibling tsconfig.typecheck.json (following the driver-memory shape from #13284) for service-i18n, which had none to widen. Putting service-i18n's manifest into a program onboards that package's first tsc program to reach the bare @objectstack/spec specifier (src/ only ever imports subpaths), which check:type-source-resolution correctly flagged. Repaired via that gate's own documented onboarding-limb registry re-baseline (the sanctioned tool for a dep reached only through a newly-onboarded program -- paths is measured wrong for this shape on PR #12570), with --list before/after numbers stated in place. Fixes #14386
Contributor
📓 Docs Drift Check
What this run could not see
Coarse fallback — 21 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
baozhoutao
marked this pull request as ready for review
September 2, 2026 09:00
baozhoutao
enabled auto-merge
September 2, 2026 09:00
baozhoutao
deleted the
claude/issue-14386-coverage-gate-package-root-source
branch
September 2, 2026 09:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14386
What
check:type-check-coverage'sisUncheckedSourceCandidateskippeddepth === 0(the package root) unconditionally, so any package-root
.tsfile was invisibleto SOURCES_COVERED regardless of content — not reported, not tracked. This is
exactly why #13284's
driver-memory/plugin-hono-servermanifests wentunchecked for as long as they did:
pnpm --filter <pkg> typecheckexited 0over a file no tsc program read, while
check:type-check-coveragecalled thepackage COVERED at the same time.
Per the triage (comment 5504408509 on #14386), this queues the narrow repair
only — admitting a declared set of root filenames that are authored source,
not every package-root
.tsfile:ROOT_SOURCE_FILES(currently{'objectstack.config.ts'}) — the depth-0exception to
isUncheckedSourceCandidate, with a docblock stating the104-file question (every un-programmed
vitest.config.ts/tsup.config.tsat a package root) is deliberately not answered here.
uncheckedByDiraggregation now keys a root-level unread file at'.'— which
posix.join(dir, top)collapses to the package's own directory —instead of the
rel.slice(0, -1)garbage key the oldindexOf('/') === -1arithmetic produced.
--self-testcase for a root-level source file (predicate rows forobjectstack.config.ts/tsup.config.ts/ a hypothetical root.d.ts,plus an evaluate()-level fixture pinning that the
.root key renders asthe package's own directory) — the existing source-layer cases were all
subdirectory cases (
packages/a/scripts), which is exactly why this holesurvived.
plugin-auth: widened the existing siblingtsconfig.examples.json(
rootDir: ".")includeto also nameobjectstack.config.ts— alreadyinvoked by
typecheck, so nopackage.jsonchange needed.plugin-security: widened the existing siblingtsconfig.scripts.jsonincludethe same way — itsrootDir: "../.."(inherited fromtsconfig.json, Walled postures must not elevate the first self-registrant: platform admin comes ONLY from an env-declared owner email; self-signups never join the Default Organization — ruled fix for cloud#1509 #11184) already covers the package root, so norootDirchange either.
service-i18n: had no siblingnoEmitprogram (typecheckwas a baretsc --noEmit), so this addstsconfig.typecheck.jsonfollowing thedriver-memoryshape The two in-repo manifest authoring sites (driver-memory / plugin-hono-server objectstack.config.ts) sit outside every tsc program and import ObjectStackManifest from an entry that does not export it #13284 established, and widenstypecheckto runit.
All three type-check clean at zero errors — no
UNCHECKED_SOURCE_DEBTentryis added.
Not this card
Per the triage, the 104-file question (whether every un-programmed
vitest.config.ts/tsup.config.tsat a package root owes a program or aledger entry) is explicitly not decided here.
ROOT_SOURCE_FILESis aclosed, exact-name allowlist rather than a pattern, precisely so growing it
stays a decision made on its own card.
#13284 is not addressed herebeyond what already landed — its fence (driver-memory,plugin-hono-server) holds; this touches neither.Verified: no other package-root
objectstack.config.tsoutside the three namedfind packages apps examples -name objectstack.config.ts(filtered todirectories that are themselves a
package.jsonroot) turns up 8 hits: the 3examples/app-*(already inside their own tsc programs, pre-existing),driver-memory+plugin-hono-server(#13284, already covered), the 3 namedhere, and
packages/create-objectstack/src/templates/blank/. That last oneis a scaffold template with its own nested
pnpm-workspace.yaml— not a memberof this repo's own workspace (
workspacePackageDirs()does not walk into it),so the widened predicate correctly does not surface it. Left untouched, per the
triage's instruction not to add programs or ledger entries beyond the three
named sites — noted here for the record, not acted on.
Before / after
Baseline (
origin/mainbd8795ea1, before any edit):Predicate-only (before the three tsconfig edits — proves the widened predicate
now sees the sites):
Final, after the three tsconfig edits:
Same shape as baseline — the pre-existing 1-entry source-layer ledger is
unchanged, and the three new sites are NOT in it (they are fully covered, zero
debt).
Each package's own
typecheck, run against a freshly built dependency closure(
pnpm --filter "<pkg>..." build), also passes clean:A second gate the new program onboarding tripped:
check:type-source-resolutionPutting
service-i18n's manifest intotsconfig.typecheck.jsononboards thatpackage's first tsc program to reach the bare
@objectstack/specspecifier —src/only ever imports subpaths (@objectstack/spec/contracts,@objectstack/spec/system), never the bare package.check:type-source-resolutioncorrectly flagged this (a dep resolving through
dist/with nopathsrulepointing at source). Repaired via that gate's own documented onboarding-limb
registry re-baseline — the sanctioned tool for exactly this shape (a dep
reached only through a newly-onboarded program;
pathsis measured wrong forthis shape on PR #12570, since it would pull
packages/spec/src— andeverything it imports — into a program whose
rootDiris.). One entry addedto
KNOWN_DIST_RESOLVED_TYPE_IMPORTS:--listbefore/after (measured atbd8795ea1, the entry excluded from "after"to isolate what onboarding the program added):
+1 program, +1 pair, +1 package — this entry and nothing else. Full reasoning
in the file's own comment beside the entry. This edit is outside the file
surface named in the dispatch, filed as a bounded in-place-fix exemption per
os-dev.mdrule 3 (surface amendment posted on #14386 before this PR opened).Tests
node scripts/check-type-check-coverage.mjs --self-test— 48 semantic +68 observation (+1 / +3 over baseline) + 43 re-measure + 28 built-closure +
19 auto-lowering + 18 exit-code cases hold.
node scripts/check-type-check-coverage.mjs— before/predicate-only/final shown above.node scripts/check-type-source-resolution.mjs --self-test— OK.node scripts/check-type-source-resolution.mjs— OK, 56 registered (was 55 pre-onboarding, +1 this PR's entry), 0 unregistered exposure.pnpm --filter "@objectstack/plugin-auth..." --filter "@objectstack/plugin-security..." --filter "@objectstack/service-i18n..." buildthen each package's ownpnpm --filter <pkg> typecheck— all pass, shown above (os-verify-lockVERDICT command-exit 0, held 368s).dispatch-gates.mjsderives for this diff run green directly; the remaining 3 are legitimate NOT MEASURED (check-test-completenessneeds a CI test log;check:type-check-debt --re-measureneeds the full unfiltered workspace build closure, explicitly "not a pass and not a finding" per the gate's own refusal;check-half-states.mjstimed out against the network proxy under container contention — retried, not yet resolved by report time).check:i18n/check:i18n-stale-fill(convention-triggered by theplugin-security/tsconfig.scripts.jsonedit) — both green, all 9 packages' bundles in sync.pnpm check:pm-dispatch-gates(~11.5 min gate) — run in background under the shared verify lock; see report comment for its result.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands— 48 commands (44 by path + 4 by change kind); see report comment for the full list and results.Generated by Claude Code
Generated by Claude Code