You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tooling): put three more package-root plugin manifests inside a tsc program (#14458)
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
Co-authored-by: Claude <noreply@anthropic.com>
label: 'an UNCHECKED_SOURCE_DEBT entry covers it, but only with a reason',
3738
3811
packages: [
@@ -4249,14 +4322,24 @@ function selfTest() {
4249
4322
}
4250
4323
4251
4324
// SOURCES_COVERED's file-level predicate (#10756). Each exclusion is a way
4252
-
// this invariant can be silently wrong: lose `depth > 0` and 42 packages'
4253
-
// tool configs flood the ledger, lose the test check and one hidden file is
4254
-
// billed to two ledgers, lose `.d.ts` and the gate reports a finding about a
4255
-
// file that states types rather than being checked for them.
4325
+
// this invariant can be silently wrong: lose `depth > 0` (unqualified) and
4326
+
// 42 packages' tool configs flood the ledger, lose the test check and one
4327
+
// hidden file is billed to two ledgers, lose `.d.ts` and the gate reports a
4328
+
// finding about a file that states types rather than being checked for
4329
+
// them.
4256
4330
constsourceCandidateCases=[
4257
4331
{label: 'a module in a subdirectory is the subject',name: 'dry-run-hash-compat.ts',depth: 1,expect: true},
4258
4332
{label: 'the same module at the package root is not',name: 'dry-run-hash-compat.ts',depth: 0,expect: false},
4259
4333
{label: 'a package-root tool config is out of scope by the depth rule',name: 'vitest.config.ts',depth: 0,expect: false},
4334
+
// #14386: `ROOT_SOURCE_FILES` is the depth-0 exception, and it is an
4335
+
// EXACT-name allowlist, not "anything that looks like config at the
4336
+
// root" -- the next two rows pin both sides of that line.
4337
+
{label: 'a declared root source file IS in scope despite depth 0 (#14386)',name: 'objectstack.config.ts',depth: 0,expect: true},
4338
+
{label: 'a root-level BUILD tool config stays out of scope -- the 104-file question is not this predicate\'s to answer',name: 'tsup.config.ts',depth: 0,expect: false},
4339
+
// Defense in depth: even a name that WERE declared in `ROOT_SOURCE_FILES`
4340
+
// must still lose to the `.d.ts` exclusion below -- a states-types file
4341
+
// is never "unread source" regardless of depth.
4342
+
{label: 'a declaration file at the root is still excluded, even hypothetically declared',name: 'globals.d.ts',depth: 0,expect: false},
4260
4343
{label: 'the SAME tool config inside a directory IS in scope',name: 'i18n-extract.config.ts',depth: 1,expect: true},
4261
4344
{label: 'a test file belongs to TESTS_COVERED, not here',name: 'engine.test.ts',depth: 1,expect: false},
4262
4345
{label: 'a spec file likewise',name: 'engine.spec.tsx',depth: 2,expect: false},
0 commit comments