| @@ -0,0 +1,42 @@ |
| 1 | +# ADR 0035: Retained vehicle sessions on one modeled clock |
| 2 | + |
| 3 | +Status: accepted for software simulation. |
| 4 | + |
| 5 | +## Context |
| 6 | + |
| 7 | +Cargo issue #25 needs distinct vehicles with current authority and source evidence at |
| 8 | +the handover epoch. Running one complete fixture and relabeling its result as a fresh |
| 9 | +peer would discard timing, independent watchdog and sensor identity requirements. |
| 10 | +The shared vehicle loop previously ran to completion with fixed boot 55/session 123. |
| 11 | + |
| 12 | +## Decision |
| 13 | + |
| 14 | +Expose `createVehicleSimulationSession` over that same loop. Its caller advances exact |
| 15 | +4 ms epochs from zero; the loop retains raw sensing, estimator updates, 20 ms policy, |
| 16 | +mission, controls, authority, payload ownership and independent board state. The ordinary |
| 17 | +`runVehicleSimulation` drains this interface to the same terminal report. |
| 18 | + |
| 19 | +Capture an optional nonzero uint64 boot/session scope before allocating a profile session. |
| 20 | +The actual synthetic raw packets, pipeline clock anchor, estimator reference, supervisor |
| 21 | +and board use that scope. Defaults retain the original identities and report projection. |
| 22 | +Identity labels do not authenticate a peer, prevent duplicate scope selection or establish |
| 23 | +distributed time synchronization. |
| 24 | + |
| 25 | +Ticks expose detached mission/authority/board snapshots, reference, phase and last completed |
| 26 | +host policy epoch. Host loss freezes host work while the finite independent settling tail |
| 27 | +can still advance the board and plant. The caller can advance another live vehicle at the |
| 28 | +same epochs. Payload teardown occurs once. Explicit close or a step exception revokes the |
| 29 | +board and closes ownership; simultaneous failures remain observable. |
| 30 | + |
| 31 | +## Consequences |
| 32 | + |
| 33 | +This is a necessary runtime prerequisite for a captured, two-vehicle custody protocol. |
| 34 | +It does not implement that protocol or claim fleet handover is complete. The cargo |
| 35 | +coordinator must still bind distinct peers, physically modeled parcel transfer, current |
| 36 | +qualified captures, cancellation and conservative uncertain outcomes. |
| 37 | + |
| 38 | +The caller owns stepping and cleanup and must stop stepping a terminal session. Invalid |
| 39 | +epochs do not mutate execution. `result` is unavailable until terminal and detached |
| 40 | +thereafter. Explicit close stops simulation without running recovery or a physical |
| 41 | +settling interval. All physical outputs remain inhibited. This clock is deterministic |
| 42 | +simulation time, not a wall-clock deadline guarantee or real-time hardware scheduler. |