Filed unassigned by the os-dev seat working #9432 (session session_01XqDQYVU5smx29ts9pAErja). Out of that card's scope — recording rather than fixing. Same file as #9432 / #9331, different defect, and it survives both of them.
What
parseRegistrarSource in scripts/docs-audit/affected-docs.mjs finds registration sites with
constm=lines[i].match(/(?:^|[\s{,(])path\s*:\s*([`'"])(.*?)\1/);— a path: whose value is a string or template literal. A registration whose path is a
plain variable (path: publishedPath) matches nothing, so it is not a site. It therefore does
not end the previous site's window either, and the previous route's window runs its full
REGISTRAR_HANDLER_WINDOW (150 lines) straight through the invisible registration and into
another route's handler body. Every identifier in that foreign handler is then credited to the
previous route.
Measured — on origin/main at 017c27e73, and still true with #9432's fix applied
Counting only sites the scan can see, packages/** registrar files carry 86 literal path:
sites and 33 path: lines that are not literals. Several of the latter are genuine
registrations: rest-server.ts alone has path: basePath (3121), path: metaPath (3528) and
path: publishedPath (5747); package-routes.ts:473 has path: packagesPath;
metadata/src/routes/hmr-routes.ts:107 has path: evt.path.
The concrete swallow, read off the comment-masked source so it is not #9432's defect:
/:name/state/:field site at rest-server.ts:5661
window ends 5811 (150 lines; next LITERAL site is 5916)
path: publishedPath at 5747 is inside it and invisible
-> `publishedPath` and every other code identifier of that
handler counts as an implementation of /:name/state/:field
So a diff touching a symbol the published door implements can put the state-machine page on
the advisory, with a via that says the page names something the diff touched. It also works
the other way as a recall miss: the variable-path route has no window of its own at all, so
nothing ever bridges to it.
Why it is worth a card rather than a shrug
Same reasoning as #9294 and #9432: the per-row via promise is a claim about implementation,
and here it is false for a whole handler at a time rather than one prose line. Unlike those
two, this one has a recall half as well — the invisible routes are unreachable.
Direction, not a prescription
Cheapest correct-looking move is to treat anypath: line as a site boundary while only
literal ones produce a tail, which closes the swallow without pretending to resolve the
variable. Whether the variable-path routes should also be resolved (a one-hop const lookup in
the same file) is a separate, larger question and should be measured before it is attempted —
#9432 measured that this scan's precision work is only worth doing with before/after numbers on
real commits, and the same standard applies here.
Note the file is contended: #9331 is queued on it and #9432 just landed on it. Sequence
accordingly.
Refs: #9432 (the prose half of the input side, fixed in #9502), #9294 (the container half),
#9331 (output side, different hop), #9192 (the precision rework all of these regress against).
Generated by Claude Code
Filed unassigned by the
os-devseat working #9432 (sessionsession_01XqDQYVU5smx29ts9pAErja). Out of that card's scope — recording rather than fixing. Same file as #9432 / #9331, different defect, and it survives both of them.What
parseRegistrarSourceinscripts/docs-audit/affected-docs.mjsfinds registration sites with— a
path:whose value is a string or template literal. A registration whose path is aplain variable (
path: publishedPath) matches nothing, so it is not a site. It therefore doesnot end the previous site's window either, and the previous route's window runs its full
REGISTRAR_HANDLER_WINDOW(150 lines) straight through the invisible registration and intoanother route's handler body. Every identifier in that foreign handler is then credited to the
previous route.
Measured — on
origin/mainat017c27e73, and still true with #9432's fix appliedCounting only sites the scan can see,
packages/**registrar files carry 86 literalpath:sites and 33
path:lines that are not literals. Several of the latter are genuineregistrations:
rest-server.tsalone haspath: basePath(3121),path: metaPath(3528) andpath: publishedPath(5747);package-routes.ts:473haspath: packagesPath;metadata/src/routes/hmr-routes.ts:107haspath: evt.path.The concrete swallow, read off the comment-masked source so it is not #9432's defect:
So a diff touching a symbol the
publisheddoor implements can put the state-machine page onthe advisory, with a
viathat says the page names something the diff touched. It also worksthe other way as a recall miss: the variable-path route has no window of its own at all, so
nothing ever bridges to it.
Why it is worth a card rather than a shrug
Same reasoning as #9294 and #9432: the per-row
viapromise is a claim about implementation,and here it is false for a whole handler at a time rather than one prose line. Unlike those
two, this one has a recall half as well — the invisible routes are unreachable.
Direction, not a prescription
Cheapest correct-looking move is to treat any
path:line as a site boundary while onlyliteral ones produce a tail, which closes the swallow without pretending to resolve the
variable. Whether the variable-path routes should also be resolved (a one-hop const lookup in
the same file) is a separate, larger question and should be measured before it is attempted —
#9432 measured that this scan's precision work is only worth doing with before/after numbers on
real commits, and the same standard applies here.
Note the file is contended: #9331 is queued on it and #9432 just landed on it. Sequence
accordingly.
Refs: #9432 (the prose half of the input side, fixed in #9502), #9294 (the container half),
#9331 (output side, different hop), #9192 (the precision rework all of these regress against).
Generated by Claude Code