Skip to content

feat: per-junction graceful fallback for priority requests - #61

Merged
piotr-lorek merged 3 commits into
mainfrom
feat/per-junction-priority-fallback
Oct 29, 2026
Merged

piotr-lorek merged 3 commits into
mainfrom
feat/per-junction-priority-fallback

Conversation

@piotr-lorek

Copy link
Copy Markdown
Member

Summary

A rejected, timed-out or expired priority request no longer cancels the run. Only that request's unpassed junctions switch to STANDARD_FALLBACK: they are crossed on ordinary signals. Other junctions keep requesting priority and the run mode never changes (ADR 0015).

  • New MIXED ITS scenario: each request's outcome is drawn from a validated its_outcome_seed. The backend and the mock use the same hash.
  • Additive contract fields: crossing_strategy on intersection telemetry, fallback_intersection_ids on completion, and its_outcome_seed on start requests. The ITS_* cancel reasons are no longer emitted.
  • UI (EN/PL): a non-terminal warning, marked fallback junctions, priority green shown apart from ordinary signals, fallback tags on finished and comparison results, and a Mixed scenario with a seed input.
  • Audit fixes:
    • A timeout's feedback sequence number collided with the controller's next decision.
    • The mock left held seconds out of travel time.
    • Next-signal copy had no Polish translation.

Verification

  • Backend: ruff and mypy clean; pytest 1539 passed. The 14 errors in test_real_data_smoke.py come from stale local processed data and also occur on main.
  • Frontend: lint, typecheck, format, 1283 tests and the build pass.
  • Engine and mock golden recordings are unchanged apart from the new fields.
  • Playwright CLI (mock transport): a rejected run warns, completes and is tagged. The Mixed seed input works at 390 px.

Contract or safety impact

Additive; schema_version stays "1.0". Clients must accept MIXED. Simulation only: no real signal actuation.

Follow-ups

  • Rebuild the local processed data.
  • Maintainer decision on ADR 0015.

piotr-lorek and others added 3 commits October 29, 2026 23:46
A rejected, timed-out or expired request now puts only its unpassed targets
into STANDARD_FALLBACK; the run keeps going and other junctions keep
requesting priority. Adds the seeded MIXED ITS scenario, crossing_strategy
telemetry and fallback_intersection_ids on completion. Fixes the timeout
event reusing a feedback sequence number the controller later emits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mock transport now mirrors the backend: failed requests fall back per
junction (resumable timeline), the seeded MIXED scenario uses the same hash,
and ticks/completions carry crossing_strategy and fallback_intersection_ids.
The dashboard warns without ending the run, marks fallback junctions,
distinguishes priority green from ordinary signals, tags finished fallback
runs and offers the Mixed scenario with a seed, in English and Polish.
Also counts seconds held at a priority stop line in the mock's travel time
and translates the next-signal copy, both previously missing. Adds ADR 0015.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@piotr-lorek
piotr-lorek requested a review from fjarmula as a code owner October 29, 2026 23:20
@piotr-lorek
piotr-lorek merged commit 4eaaff1 into main Oct 29, 2026
6 checks passed
@piotr-lorek
piotr-lorek deleted the feat/per-junction-priority-fallback branch October 29, 2026 23:20
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