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
[finding] affected-docs.mjs passes isTestFile a BASENAME, so its three directory arms (__tests__/__mocks__/__fixtures__) are dead — latent today, 0 live #11866
Observed while implementing #11178 (PR #11865). Latent, not live — filed so it is recorded rather than re-discovered. Filed unassigned and unlabelled for queueing. ⛔ Not a claim on anyone's time.
The reading
scripts/docs-audit/affected-docs.mjs defines the exclusion over a path:
The first arm requires a /, so against a basename it can never match. Only the *.test.ts / *.spec.ts arm does any work. The function's directory-based exclusion is not happening at this call site.
Measured impact today: zero
Three non-.test/.spec.ts files live in such directories under packages/** and are therefore walked:
0 of the three match REGISTRAR_FILE_RE, so none becomes a registrar and no route tail today comes from a test directory. (server-body.ts does not match the -server.ts alternative — that requires -server immediately before the extension.) Confirmed on 589758d22: none of the 14 discovery-gap witnesses PR #11865 reports comes from any of these paths; all 14 are packages/spec/src/api/*.zod.ts.
So this is a dormant hole, not a current wrong number. It becomes live the moment a file named *route*.ts or *-server.ts is added under a __tests__/, __mocks__/ or __fixtures__/ directory — at which point a test double starts contributing production route tails silently.
Not claimed
No opinion on the remedy. Passing rel instead of e.name is the obvious shape, but rel is computed after the test in the current code, and whether the walk should exclude these directories at all is a real question — the ceiling in PR fix(devx): split the sdk bridge's unreachable rows by cause (#11178) #11865 arguably wants the widest possible population.
Whether other callers of isTestFile pass a path or a basename was not swept.
Related but different
#11857 records a separate gap in the same function — that it excludes neither test/fixtures/*.ts (no underscores) nor *.bench.ts. That one is about the patterns; this one is about the argument the patterns are tested against. Both would need to hold for a test double to be reliably kept out.
Refs
#11178 · PR #11865 (where this was observed) · #11857 (the sibling isTestFile gap)
Observed while implementing #11178 (PR #11865). Latent, not live — filed so it is recorded rather than re-discovered. Filed unassigned and unlabelled for queueing. ⛔ Not a claim on anyone's time.
The reading
scripts/docs-audit/affected-docs.mjsdefines the exclusion over a path:Both
scanRouteSurface's walk and the--bridge-coverageceiling added by PR #11865 call it withe.name— the basename:The first arm requires a
/, so against a basename it can never match. Only the*.test.ts/*.spec.tsarm does any work. The function's directory-based exclusion is not happening at this call site.Measured impact today: zero
Three non-
.test/.spec.tsfiles live in such directories underpackages/**and are therefore walked:packages/services/service-datasource/src/__tests__/entitled-caller.fixture.tspackages/cli/src/utils/__tests__/server-body.tspackages/adapters/hono/src/__mocks__/runtime.ts0 of the three match
REGISTRAR_FILE_RE, so none becomes a registrar and no route tail today comes from a test directory. (server-body.tsdoes not match the-server.tsalternative — that requires-serverimmediately before the extension.) Confirmed on589758d22: none of the 14discovery-gapwitnesses PR #11865 reports comes from any of these paths; all 14 arepackages/spec/src/api/*.zod.ts.So this is a dormant hole, not a current wrong number. It becomes live the moment a file named
*route*.tsor*-server.tsis added under a__tests__/,__mocks__/or__fixtures__/directory — at which point a test double starts contributing production route tails silently.Not claimed
relinstead ofe.nameis the obvious shape, butrelis computed after the test in the current code, and whether the walk should exclude these directories at all is a real question — the ceiling in PR fix(devx): split the sdk bridge's unreachable rows by cause (#11178) #11865 arguably wants the widest possible population.isTestFilepass a path or a basename was not swept.Related but different
#11857 records a separate gap in the same function — that it excludes neither
test/fixtures/*.ts(no underscores) nor*.bench.ts. That one is about the patterns; this one is about the argument the patterns are tested against. Both would need to hold for a test double to be reliably kept out.Refs
#11178 · PR #11865 (where this was observed) · #11857 (the sibling
isTestFilegap)