Uh oh!
There was an error while loading. Please reload this page.
fix(docs-audit): a registration bounds the previous handler window even when its path is a variable - #9571
Merged
Conversation
…en when its path is a variable Refs #9503
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. |
This was referenced Aug 18, 2026
os-steve
marked this pull request as ready for review
August 18, 2026 11:39
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#9503
Third and last layer of the same defect family in
scripts/docs-audit/affected-docs.mjs:#9294/#9431 kept container symbols out of the route bridge, #9432/#9502 made the
identifier scan read comment-masked source, and this one is the window boundary.
Neither of those two behaviours is touched.
The defect, re-measured on today's
main(e7daea169)parseRegistrarSourceconflated two different questions on one line. "Does a registration'sproperty list start here?" decides the window boundary; "which route is it?" decides the
tail. Only the second needs a literal, but both were answered by the same
literal-only regex — so a registration written
path: publishedPathwas neither a site nor aboundary, and the previous route's window ran its full 150 lines straight through it.
The card's numbers hold exactly.
packages/**registrar files carry 86 literalpath:lines and 33 that are not literals, and there is exactly one place where a
non-literal one falls inside a live window:
The measurement the card did not have: today that costs ZERO rows
This is the finding worth reading before the diff. Of those 64 over-run lines, 55 are the
ADR-0033/#8278 commentary that #9432 masks to blank, and the remaining 9 are
for/register/method/handler/try/constboilerplate whose every token alreadyoccurs earlier in the same window. So the over-run reaches no identifier the route did not
already have:
/:name/state/:fieldwindow ids60-commit recall sweep (the #9432 bar), every commit touching
packages/back tofab693bee, each run twice from the same parent with only this hop swapped: 60 runs, 0substantive differences, 380 advisory rows identical. The only textual delta in 6 of the 60
JSON outputs is
computedOn.dirty, which flips because the harness itself overwrites thescript in the checked-out tree — not a row.
So: the mechanism is real and verified, the harm is latent.#9432's comment mask is what
is holding it down, and it holds it down by accident of comment length.
What is underneath it
Measure the same span against the foreign handler's own 150 lines and it carries 18
identifiers the
stateroute does not otherwise see:That is the
publishedroute's implementation — including the exact namerest-route-ledger.tsbinds/:type/:name/publishedto (meta.getPublished). Shorten thatcomment block by a screenful and a
published-handler diff starts putting the state-machinepage on the advisory with a
vianaming a symbol it really does implement, for a route itdoes not. The window's invariant is "this span is ONE route's handler"; the invariant is
false today and free today. Both halves are true, and the fix costs nothing to take now.
The change
Three lines. A
path:line is always a site; only a literal one carries a tail. Theloop already tolerated tail-less sites — 38 of the 86 literal lines yield no tail (a bare
/api/v1, a mount prefix) and are skipped for window production while still bounding theprevious site. A non-literal line now behaves identically.
Tests — 233 to 242 self-test cases, pinned in three directions
trade this precision bug for the recall hole the bridge exists to fill);
path:written in a comment must still bound nothing — new risk this changeintroduces and docs-drift's route bridge counts identifiers found inside COMMENT text — an English sentence in a handler can mint a route anchor #9432 could not have pinned, because before it a commented
path:couldonly mint a phantom tail, and now it could also truncate a real window;
parseRegistrarSourceverbatim as it stood before this hop, assertingthe fixture really does carry the defect and that the boundary, not the 150-line cap, is
what closes it.
Reverse-verified from the committed state — reverting only the code hop and keeping the
tests turns exactly the two precision assertions red:
Deliberately NOT in scope
The recall half. A variable-path route still gets no window of its own, so nothing
bridges to
/:type/:name/published. ResolvingpublishedPathneeds a one-hop bindinglookup, and the hole it would dent is a small slice of a much larger one: 176 of the 221
client-bound ledger rows have no registrar tail at all today, most of them
plugin-authroutes that never take a
path:property. That is a different card with a differentmeasurement; filed separately. The self-test states the omission as an assertion on the
emitted tails rather than leaving it to be discovered.
Also corrected from the card:
metadata/src/routes/hmr-routes.ts:107is not aregistration — it is a
path:key in abroadcast({ ... })payload. It is a boundary nowregardless, and falls inside no window either way.
Gates run locally, on
486b43dff(the final commit)Derived at runtime from the changed path with
node scripts/pm/dispatch-gates.mjs scripts/docs-audit/affected-docs.mjs, after the finalcommit. Scripts-only, publishes nothing:
skip-changeset.Generated by Claude Code