Repository navigation
Extension mounts own their namespace (overlaps name both routes); 405 before extension gates (#912, #915) - #919
Merged
Merged
Conversation
…tension gates (#912, #915) #912: extension mount overlap is now one pure check over route keys (assertExtensionMountsDisjoint) run by compileRoutes, by createRuntime before extension preparation (so a stale pin cannot hide it) and by `urlcode validate` without a host file. The error names the extension mount and the other route (code extension-mount-overlap). A non-extension mount strictly enclosing an extension mount (a root `/*` static site, a `/**` redirect) is now allowed: mounts already select the longest prefix, so the extension keeps its whole namespace. Routes inside the mount and extension mounts enclosing it stay refused. ROUTING documents mount ownership and the supported site-root frontend beside `/api/*` mounts. #915: on a route an extension protects (mount or policies.extensions, auth: true included) an undeclared method is 405 with Allow in the route's error format before any extension authorize()/middleware(), after the agents/throttle host policies, matching the OpenAPI export's methodNotAllowed, whose description is updated. The 405 reveals only the declared methods, which unprotected routes and the OpenAPI export already publish. Core package budget raised with measured sizes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-measure core budget Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 29, 2026 13:59
…budget Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 free
to 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 #912 and #915, both found by the #841 agent trial.
#912: overlap with extension mounts
compileRoutes, and its error named no route. Staticvalidatenever called it, and a stale pin hid it at activation.assertExtensionMountsDisjoint(routes), runs incompileRoutes, increateRuntimebefore extension preparation, and inurlcode validatewithout--host-file. The error (extension-mount-overlap) names both routes and says which to move./*static site or/**redirect beside extension mounts is allowed. Mounts already pick the longest matching prefix, so the extension keeps its whole namespace, including its bare path./api/*extension mounts" section (root/*static withindex, orspa-shellwith/apiexcluded). ASSETS, SPECIFICATION, EXTENSIONS, llms and the proof README link to it.#915: 405 before extension gates
Core routes had the same problem: on any route an extension protects, including
auth: trueon a plainrespondroute, an undeclared method got 401/403 fromauthorize().New order on protected routes:
Allow, in the route's error format, through the response policies)authorize()middleware()Unprotected routes are unchanged.
Behavior change: on protected routes, plugins and extension
middleware()no longer see undeclared methods.OpenAPI: the
x-urlcode.methodNotAlloweddescription and TOOLING now state this order.Security note (EXTENSIONS, auth README): a 405 before auth reveals only the declared methods. Unprotected routes and the OpenAPI export already publish those.
RUNTIME-IMPLEMENTATION: new
RIM-ROUTE-MOUNT-001, andRIM-DISPATCH-001now states the protected-route order.Evidence (macOS, Node 26)
test/extensions.test.ts:/**cases, plus every allowed shape;validate --localrefuses an overlap and accepts a root static site;Allowand zeroauthorize()calls on a protected mount, on a core auth route and in JSON format. The 405 test fails if the runtime change is reverted.npm run verifypasses after merging main (with Named project schemas shared by HTTP bodies and MCP tools, loadable from files offline (#845) #907);test:proofandtest:addonsare included.npm run test:packagepassed before the merge.🤖 Generated with Claude Code