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] driver-mongodb type-checks none of its 30 test files — tsconfig excludes **/*.test.ts, so a compile-time pin there is a phantom (measured: 0 test files in the program, vs 43 in driver-turso) #14917
Recording + measurement only — no severity asserted, no fix chosen. Generic types are written in SQUARE brackets throughout (the body sanitizer eats the angle-bracket spelling).
Found while implementing #14428 (PR #14914), which needed a declared-return-type pin on MongoDBDriver.update(). I hit this, measured it, and moved the pin out rather than land a check that cannot fail.
So the package's only tsc --noEmit compiles no test file at all. Measured with --listFiles, both packages, same tree, same commit:
Package
tsconfig exclude
Files ending .test.ts in the tsc program
driver-mongodb
node_modules, dist, **\/*.test.ts
0
driver-turso
node_modules, dist
43
driver-mongodb has 30 test files (25 passing + 5 opt-in skipped, per its own suite summary). None is type-checked.
Why that makes a pin a phantom rather than merely uncovered
Nothing else picks these files up:
vitest does not typecheck — it transpiles through oxc/esbuild, so a type error is not an error, it is erased.
the root tsconfig.json excludes packages entirely ("exclude": ["node_modules", "packages", "apps", "examples"]), so no repo-wide program covers them either.
the root typecheck script is turbo run typecheck, i.e. the per-package tsc --noEmit above.
So a type-level assertion in a driver-mongodb test file — the Equals / IsAny const idiom that #13878's packages/drivers/driver-memory/src/memory-update-declared-null.test.ts established and that sibling driver suites copy — is green forever and unable to fail. It appears in the file list, it reads as coverage in review, and it is checked by nothing. That is worse than absent coverage, because absent coverage does not claim to be there.
The concrete near-miss: #14428 called for "a per-driver pin of the same shape as driver-memory's". Copying that shape into driver-mongodb produces a file whose type half is inert. PR #14914 therefore carries the type pin only in driver-turso's twin file and states the measurement in the mongo file instead, pinning the mongo declaration through mongodb-driver.ts itself (which IS in the program — narrowing the declaration there is a real tsc error, verified by ablation).
Scope of the claim
⛔ No fix chosen. Removing the exclude line would put 30 test files into the program for the first time and is very likely to surface pre-existing errors — that is a measurement nobody has taken, and the cost is unknown until someone does.
⛔ No claim that any existingdriver-mongodb test contains a phantom pin. The claim is about the instrument: the package cannot hold one that works.
⛔ Nothing about the behavioural coverage — the 552 runtime assertions run and pass normally. Only the compile-time layer is affected.
Dedup
MCP search_issues, one targeted query → 30 results. This genre is well known and has been filed repeatedly, but no open or closed card names driver-mongodb:
Recording + measurement only — no severity asserted, no fix chosen. Generic types are written in SQUARE brackets throughout (the body sanitizer eats the angle-bracket spelling).
Found while implementing #14428 (PR #14914), which needed a declared-return-type pin on
MongoDBDriver.update(). I hit this, measured it, and moved the pin out rather than land a check that cannot fail.The measurement
packages/drivers/driver-mongodb/tsconfig.json:(the
**\/is escaped for this comment only.)So the package's only
tsc --noEmitcompiles no test file at all. Measured with--listFiles, both packages, same tree, same commit:exclude.test.tsin the tsc programdriver-mongodbnode_modules,dist,**\/*.test.tsdriver-tursonode_modules,distdriver-mongodbhas 30 test files (25 passing + 5 opt-in skipped, per its own suite summary). None is type-checked.Why that makes a pin a phantom rather than merely uncovered
Nothing else picks these files up:
tsconfig.jsonexcludespackagesentirely ("exclude": ["node_modules", "packages", "apps", "examples"]), so no repo-wide program covers them either.typecheckscript isturbo run typecheck, i.e. the per-packagetsc --noEmitabove.So a type-level assertion in a
driver-mongodbtest file — theEquals/IsAnyconst idiom that #13878'spackages/drivers/driver-memory/src/memory-update-declared-null.test.tsestablished and that sibling driver suites copy — is green forever and unable to fail. It appears in the file list, it reads as coverage in review, and it is checked by nothing. That is worse than absent coverage, because absent coverage does not claim to be there.The concrete near-miss: #14428 called for "a per-driver pin of the same shape as driver-memory's". Copying that shape into
driver-mongodbproduces a file whose type half is inert. PR #14914 therefore carries the type pin only indriver-turso's twin file and states the measurement in the mongo file instead, pinning the mongo declaration throughmongodb-driver.tsitself (which IS in the program — narrowing the declaration there is a realtscerror, verified by ablation).Scope of the claim
excludeline would put 30 test files into the program for the first time and is very likely to surface pre-existing errors — that is a measurement nobody has taken, and the cost is unknown until someone does.driver-mongodbtest contains a phantom pin. The claim is about the instrument: the package cannot hold one that works.Dedup
MCP
search_issues, one targeted query → 30 results. This genre is well known and has been filed repeatedly, but no open or closed card namesdriver-mongodb:typecheckcompiles none of the 112 test files undertest/—include: ["src"]makes the green verdict empty for half the suite #14710 (open) —packages/clicompiles none of its 112test/files@objectstack/metadatahas no typecheck script at all@ts-expect-error, so other compile-time pin idioms in a hidden test layer are invisible to it — measured on a live example #8113 (open) —PINS_CHECKEDdetects only@ts-expect-error, missing other pin idiomspackages/runtime, 208 test files, same**\/*.test.tsexcludetest/**, so their test files are never type-checked — app-crm's existing smoke test does not compile when it is included #7312, packages/spec 的「编译期 pin」是失效的:tsconfig 排除了 *.test.ts,vitest 也不做类型检查 #4642,@ts-expect-error退役 pin 在packages/spec里是幽灵检查:tsconfig 把**/*.test.ts排除出唯一的tsc --noEmit#5286,packages/spec/scripts/**在任何 tsconfig 的 include 之外:9 个 vitest 测试文件 + 全部构建/gate 脚本无类型检查覆盖 #5475,packages/metadata-core/test/types.test.ts的@ts-expect-error是幽灵检查:文件在include: ["src/**/*"]之外,没有任何 exclude 指向它 #5476 (closed) — the same shape inexamples/app-crm,packages/spec,packages/metadata-coreThe channel answered on-topic and non-empty, so the absence of a
driver-mongodbcard is a reading rather than a silent zero.Related
#14428 / PR #14914 (where this was hit) · #13878 + PR #14434 (the pin idiom being copied) · #14504 (nearest prior instance, closed) · #14438 (a different
driver-mongodb-adjacent published-type finding, open)