Latest Results
Address review findings on the router var split
Whole-router dependency (greptile P1, cubic P2): deps=[State.router]
registered only router_url, because VarData.merge surfaces the first
non-empty field name, so a cached var declaring the whole router went
stale when any other router field changed. Vars now name the state fields
a dependency must track via _dependency_field_names(); RouterDataVar
names all five. Non-composite vars keep their existing behaviour.
Cached headers aliasing (greptile P2, cubic P2): the cached headers dict
was shared with every event and, through it, with the mutable
state.router_data, so a handler mutating self.router_data["headers"]
corrupted the connection cache. Copy it per event -- measured at 0.081us
against the 1.347us decode it replaced, so the cache still pays for
itself 17x over. My note on the PR claiming the copy was the cost being
removed was simply wrong.
Omitted static keys (cubic P2): a router_data carrying only the
navigation keys says nothing about the session or headers, but
_update_router_vars read the omission as a change and reset them to
their defaults. A key absent from the new payload is now left alone.
Non-origin headers (cubic P2): only the origin header feeds the page and
URL, so a cookie change no longer rebuilds the navigation vars.
Hardcoded identifiers (greptile P2): the router field names are now
named constants, used at the lookup sites and in the dynamic route
dependency.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mwk1pagH3KZ884Xw55BNMhclaude/router-vars-refactor-7j1305 Latest Branches
+3%
claude/happy-brown-ajf67r +3%
claude/router-vars-refactor-7j1305 0%
© 2026 CodSpeed Technology