AEROSIM-TS-91
Suspend the simulation clock and capture the paused attempt
A valid pause atomically freezes fixed-step advancement and captures one typed attempt snapshot.
- Verified flow state
- Done
- Owner
- AeroSim Architecture and Delivery
- Feature
- AEROSIM-FT-13
- Component
- Web Application / Flight shell and Deterministic flight runtime — pause state machine
- Repository
- corp-v1-aerosim/corp-v1-aerosim
Delivery scope
Implement applications/web/src/flight/session/pause-state-machine.ts, applications/web/test/flight/pause-state-machine.spec.ts. Consume only the inputs listed in this contract, publish only its listed outputs, enforce every failure boundary before commit, and prove the listed exclusions remain unchanged through the verification steps.
Implementation contract
Implementation artifacts
- applications/web/src/flight/session/pause-state-machine.ts
- applications/web/test/flight/pause-state-machine.spec.ts
Inputs
- PauseRequested { attemptId, commandId, requestedAt } for the current ACTIVE attempt.
- The last committed SimulationSnapshot { attemptId, stepIndex, simulationTimeMs, aircraftState, inputOwnerId, activeCameraId, selectedConfigurationId }.
Outputs
- PausedAttemptSnapshot containing the exact last committed step, simulation time, aircraft state, input owner, camera, selection, and commandId, stored before state changes from ACTIVE to PAUSED.
- PauseAccepted { attemptId, commandId, pausedAtStep } and a PAUSED session state in which fixed-step scheduling and command application are disabled.
Failure boundaries
- Reject PauseRequested unless its attempt is ACTIVE and matches the current attempt; the session and clock remain unchanged.
- Treat a repeated commandId as idempotent: return the original PauseAccepted and do not create another snapshot or transition.
- If the committed snapshot is missing, stale, or contains non-finite flight values, emit PauseRejected and remain ACTIVE; never publish a partial paused snapshot.
Excluded scope
- Browser-tab suspension and operating-system sleep handling.
- Retry, restart, outcome recording, and camera selection.
Verification steps
- Run applications/web/test/flight/pause-state-machine.spec.ts and assert ACTIVE to PAUSED stores the snapshot before disabling scheduling.
- Advance the test clock after pause and assert stepIndex, simulationTimeMs, aircraft state, input owner, and camera state remain byte-equivalent to the captured values.
- Submit duplicate, stale-attempt, non-ACTIVE, missing-snapshot, and non-finite-snapshot requests; assert the specified idempotent result or PauseRejected with no partial transition.
Traceability
Dependencies
- AEROSIM-TS-96Canonical ID: TASK-0096
UI/UX applicability
non_visual
This Task owns technical or behavioral acceptance and does not claim direct visual conformance to the approved UI/UX package.
Acceptance evidence
Verified delivery: application PR #141 reviewed head fcdf6f0 merged as cc0da04e. Event-driven audio preloads governed cues, runs one throttle-mapped engine loop, applies bounded pilot volume and mute preferences immediately, rejects duplicate/stale/foreign events, fails closed on backend errors, and disposes resources at teardown. Focused tests pass 5/5; web tests pass 1,114/1,114 plus browser suites; lint, typecheck, build, audit, candidate runs 4400-4401, and integration/publication runs 4402-4403 passed. Release completion verified on product 1.0.0.0 at GitOps revision 5d3712d89dfbf7dacd993348e55f497d126c7bf9 with Argo Synced/Healthy, exact image digests, authenticated API/database access, and three-world configured-flight acceptance.
Current evidence boundary
No current implementation, acceptance, release, or deployment evidence is claimed for this planned Task. Any prior implementation may be used only as prototype and discovery evidence.