Found while repairing #13518 (PR #14207), out of that card's scope and deliberately not fixed there.
The defect
extractWatchHints resolves a path literal against exactly ONE anchor: the writer's own directory, and only when the author spelled it with a ./ or ../ prefix. A literal with no such prefix is taken as REPO-ROOT anchored, verbatim.
Gate scripts that live inside a package routinely use a third anchor -- a package-root binding:
constPKG_DIR=resolve(fileURLToPath(newURL('.',import.meta.url)),'..');// ... then, against that binding:resolve(PKG_DIR,'api-surface')// means packages/spec/api-surfaceresolve(PKG_DIR,'src/index.ts')// means packages/spec/src/index.tsThe extractor reads those literals as api-surface and src/index.ts -- at the REPO root, where nothing of the sort exists. They are then reported as dead leads.
Measured (on 987fe370)
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --residue packages/spec/src/index.ts
check:generated prints, among its dead leads:
src/meta-spelling/meta-url-data.generated.ts -- "no tracked path under its first segment; never was a repo path"api-surface -- sameexport-origins -- same
All three are alive under packages/spec/. The reason text is also wrong in a way worth naming: it says the literal never was a repo path, when in fact it is a real path under a base the resolver did not apply.
Why this is not what PR #14207 fixed
That PR closes a different edge -- a gate that re-derives from a package's exports map inherits that package's source. check:generated reads the manifest for its scripts map, not its exports map, so it correctly does NOT follow that edge. Its under-matching has this separate cause, and folding it in would have meant loosening a narrowing that is doing real work (it withdraws 1678 fabricated pairs).
Not claimed here
- No remedy prescribed. In particular it is NOT obvious that resolving these against the package root is safe:
moduleRelativeDirectoryHint's docblock already prices a naive widening of the resolved form at +53 hints of which only 1 was a true lead, and the bare-word refusal is worth +139084 pairs. Any repair here has to be measured against those. - The blast radius is unmeasured.
check:generated is one confirmed instance found incidentally; the population of gate scripts using a package-root binding was not swept.
Generated by Claude Code
Found while repairing #13518 (PR #14207), out of that card's scope and deliberately not fixed there.
The defect
extractWatchHintsresolves a path literal against exactly ONE anchor: the writer's own directory, and only when the author spelled it with a./or../prefix. A literal with no such prefix is taken as REPO-ROOT anchored, verbatim.Gate scripts that live inside a package routinely use a third anchor -- a package-root binding:
The extractor reads those literals as
api-surfaceandsrc/index.ts-- at the REPO root, where nothing of the sort exists. They are then reported as dead leads.Measured (on
987fe370)check:generatedprints, among its dead leads:src/meta-spelling/meta-url-data.generated.ts-- "no tracked path under its first segment; never was a repo path"api-surface-- sameexport-origins-- sameAll three are alive under
packages/spec/. The reason text is also wrong in a way worth naming: it says the literal never was a repo path, when in fact it is a real path under a base the resolver did not apply.Why this is not what PR #14207 fixed
That PR closes a different edge -- a gate that re-derives from a package's
exportsmap inherits that package's source.check:generatedreads the manifest for itsscriptsmap, not itsexportsmap, so it correctly does NOT follow that edge. Its under-matching has this separate cause, and folding it in would have meant loosening a narrowing that is doing real work (it withdraws 1678 fabricated pairs).Not claimed here
moduleRelativeDirectoryHint's docblock already prices a naive widening of the resolved form at +53 hints of which only 1 was a true lead, and the bare-word refusal is worth +139084 pairs. Any repair here has to be measured against those.check:generatedis one confirmed instance found incidentally; the population of gate scripts using a package-root binding was not swept.Generated by Claude Code