Status: backlog
Priority: P0
Created: 2026-02-18
Owner: conductor
Current denied-route handling for browser back/forward uses deferred timing checks in CLJS (setTimeout + post-hoc URL/state comparison). This is pragmatic, but it is heuristic and time-based.
We need a deterministic design for route acceptance/denial under async routing, invoked child charts, and rapid history navigation.
This spec is intentionally design-first: produce and agree on a robust mechanism before coding.
- Produce a concrete design proposal that removes fixed-time denial heuristics from core correctness logic.
- Proposal must define acceptance/denial based on deterministic signals, not elapsed delay.
- Proposal must handle:
- async route transitions
- invoked child chart save ordering
- rapid back/forward bursts
- forced override (
force-continue-routing!)
- Proposal must include migration strategy from current behavior and rollback plan.
- Proposal must include test strategy with failure injection and race-oriented scenarios.
- Correlated navigation intents (
nav-id) with explicit completion/denial events. - Root-session commit acknowledgement hook (only root commit resolves navigation intent).
- Deterministic queue semantics for popstate intents (latest-wins with intent supersession).
- Explicit routing sync state machine in local data (
idle, pending, accepted, denied, restoring).
src/main/com/fulcrologic/statecharts/integration/fulcro/ui_routes.cljcsrc/main/com/fulcrologic/statecharts/integration/fulcro/route_url.cljcsrc/main/com/fulcrologic/statecharts/integration/fulcro.cljc (if completion hooks are needed)src/test/com/fulcrologic/statecharts/integration/fulcro/url_sync_headless_spec.cljcdocs/ai/specs/browser-navigation-async.md (closeout/update after redesign)
- Design doc in this spec (or linked plan) with sequence diagrams for:
- accepted popstate
- denied popstate
- superseded popstate
- Decision record: selected design + rejected alternatives with rationale.
- Test matrix mapped to race classes and invariants.
- Agent 1: Model invariants and state machine proposal
- Agent 2: Prototype API/hooks needed for deterministic completion signals
- Agent 3: Enumerate race scenarios and derive test matrix
- Agent 4: Consolidate final design ADR and migration plan
- [ ] Proposal defines strict invariants for URL/state consistency
- [ ] Proposal removes fixed timer dependency from correctness path
- [ ] Proposal covers async child invocation ordering explicitly
- [ ] Proposal includes incremental migration steps and compatibility notes
- [ ] Proposal includes concrete tests that can fail under intentionally injected races