Skip to content

refactor(v0.44): remove second request-time route winner semantics (#1215) - #1256

Merged
SisyphusZheng merged 2 commits into
devfrom
v044/a10.7-route-admission
Sep 2, 2026
Merged

refactor(v0.44): remove second request-time route winner semantics (#1215)#1256
SisyphusZheng merged 2 commits into
devfrom
v044/a10.7-route-admission

Conversation

@SisyphusZheng

Copy link
Copy Markdown
Member

Problem

Issue #1215 (umbrella #1155, Alpha.10). Generated request-time code owned a second matcher: renderRequestTimeRouteTable sorted by specificity rank and matchRequestTimeRoute ran first-match-wins with its own percent-decoding — precedence DIFFERENT from the canonical RouteTable's declaration order. Proven divergence at base SHA: corpus ['/:slug'(rt), '/about'(rt)], path /about → RouteTable winner /:slug, generated matcher winner /about.

Owner

Route winner semantics: App RouteTable (client) + Hono entry registered in the same declaration order (server runtime). Generated code now owns ONLY admission: isRequestTimePath(pathname): boolean, a derived conservative-superset predicate over the shared normalizeRoutePatternForURLPattern grammar. This PR REMOVES a semantic authority (winner selection/params/precedence in generated code).

Amendment authority

ADR-0151 (generated entry sections border the ADR-0122 §2/§3 frozen surface; Alpha.10 truth-closure scope).

Evidence

  • New request-time-admission-parity.test.ts: adversarial corpus across three surfaces (canonical RouteTable / admission predicate / Hono entry) — both declaration orders for /:slug vs /about, optional segments, catch-all, method-specific + HEAD/GET + 405, encoded/malformed/unsafe params (:__proto__), query collisions. Proves: one observable winner; admission === derived OR; no admission false-negative for request-time winners. Structural pins: no matchRequestTimeRoute/sort/params/decoding in generated code.
  • RED at base SHA (divergence script printed DIVERGENT: true; corpus test failed 2 tests / 9 steps); GREEN after.
  • Fixture rebuilt against new codegen; request-time parity (dev hono vs build Nitro, 23 steps) green; app+adapter suites 836 passed; full deno task test exit 0 (1663 + 150); all static gates green.
  • Fresh kimi-code/k3-256k HIGH implementer session; orchestrator independently re-ran the parity corpus and verified matchRequestTimeRoute is gone.

Risk

Sanctioned coarsening: a path admitted by a request-time pattern but canonically won by an earlier static route now reaches the server entry, which renders the same page (Hono order = declaration order, corpus-proven). Malformed encoded paths matching a request-time pattern reach the server as raw params (canonical no-crash semantics) instead of the old matcher's 400; non-admitted malformed paths still 400 in tryStatic (#823). Rollback: revert.

…1215)

Alpha.10 truth closure: generated request-time code owned a second
matcher with a DIFFERENT precedence rule (specificity rank vs the
canonical RouteTable declaration order) plus its own params decoding —
client and server could pick different winners for the same path
(divergence proven at base SHA: /:slug vs /about).

Amendment authority: ADR-0151 (generated entry sections border the
ADR-0122 §2/§3 frozen surface; Alpha.10 truth-closure scope, umbrella
#1155).

- generated code now exports isRequestTimePath(pathname): boolean — a
  derived, conservative-superset admission predicate over the shared
  URLPattern grammar; no winner selection, no params, no precedence
- canonical winner semantics stay with App RouteTable (client) and the
  Hono entry registered in the same declaration order (server); the
  matchRequestTimeRoute contract is deleted
- adversarial corpus proves one observable winner across RouteTable /
  admission predicate / Hono entry (declaration orders, optional,
  catch-all, method-specific, HEAD/GET, encoded/malformed/unsafe params,
  query collisions)

Implemented by fresh kimi-code/k3-256k HIGH session
(.agents/v044-kimi-implementer.md), packet A10.7. No publish, no tag.
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

APIError: Insufficient Balance

opencode session  |  github run

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploying openelement with  Cloudflare Pages  Cloudflare Pages

Latest commit: 944c36a
Status: ✅  Deploy successful!
Preview URL: https://81b85188.lessjs.pages.dev
Branch Preview URL: https://v044-a10-7-route-admission.lessjs.pages.dev

View logs

… boundary gate (#1215)

The gate parsed the deleted second-matcher route table
('{ path, paramNames, pattern }'); generated output now carries the
derived isRequestTimePath admission patterns (new URLPattern({ pathname
})). Update the parser + fixture test to the new shape. Verified against
the real starter dist: deno task fullstack:boundary-check passes.
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

APIError: Insufficient Balance

opencode session  |  github run

@SisyphusZheng
SisyphusZheng merged commit a472b68 into dev Sep 2, 2026
9 checks passed
@SisyphusZheng
SisyphusZheng deleted the v044/a10.7-route-admission branch September 3, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant