Skip to main content

AEROSIM-TS-97

Project task

Reinitialize retry and restart to documented starting state

Retry and restart each dispose transient flight state and establish their documented known starting state reproducibly.

AEROSIM-TS-97Canonical ID TASK-0097
Verified flow state
Done
Owner
AeroSim Architecture and Delivery
Component
Web Application / Deterministic flight runtime — Shared flight-core and Web Application — session reset coordinator and state rehydration
Repository
corp-v1-aerosim/corp-v1-aerosim

Delivery scope

Implement packages/flight-core/src/session/flight-reset-contract.ts, applications/web/src/flight/session/flight-reset-coordinator.ts, applications/web/test/flight/flight-reset.browser.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

  • packages/flight-core/src/session/flight-reset-contract.ts
  • applications/web/src/flight/session/flight-reset-coordinator.ts
  • applications/web/test/flight/flight-reset.browser.spec.ts

Inputs

  • ResetFlightRequested { sourceAttemptId, commandId, mode: RETRY | RESTART } after a committed FlightOutcome.
  • Authoritative FlightStartConfiguration { aircraftId, sceneId, spawnId, environmentSeed, controlProfileId } used by the completed attempt.
  • Mode policy: RETRY preserves the authoritative start configuration; RESTART returns to pre-flight selection and carries no transient attempt state.

Outputs

  • For RETRY, a new attemptId with stepIndex 0, simulationTimeMs 0, spawn aircraft state, neutral controls, declared input owner, primary chase camera, empty warnings, and no prior outcome attached.
  • For RESTART, session state PREFLIGHT_SELECTION with no active attempt/runtime, while catalogue selection services remain available.
  • ResetAccepted { sourceAttemptId, newAttemptId|null, commandId, mode } only after old transient resources are disposed and the target state is fully constructed.

Failure boundaries

  • Reject reset before an outcome is committed, for stale sourceAttemptId, unsupported mode, or missing/invalid start configuration; retain the outcome screen and create no attempt.
  • Treat duplicate commandId as idempotent and return the original ResetAccepted without another disposal or attempt.
  • If disposal or reconstruction fails, dispose any partial replacement, retain the committed outcome and authoritative start configuration, emit ResetFailed with retryable stage, and permit a clean retry.

Excluded scope

  • Changing aircraft, scene, spawn, environment seed, or control profile during RETRY.
  • Implementing catalogue selection, aircraft definitions, or scene definitions.

Verification steps

  • Run applications/web/test/flight/flight-reset.browser.spec.ts for RETRY and RESTART and assert their exact target states, preserved/cleared fields, new-attempt identity rule, and step/time zero invariants.
  • Execute repeated reset cycles from one fixed configuration; compare every RETRY initial snapshot, count old/new runtime resources, and enforce configured reset latency and browser resource limits.
  • Inject invalid mode, stale source, missing configuration, disposal failure, and reconstruction failure plus duplicate commands; assert no partial attempt, no resource leak, retained recoverable outcome/configuration, and exactly one accepted reset.

Traceability

Acceptance evidence

Verified delivery: application PR #147 reviewed head 502e1a167f7ea2bed591cc11219f0f66ec5546ff merged as d95c528419fc2d8f8ed6529693dff55018ac9c28. RETRY preserves the authoritative five-field configuration and creates a fresh deterministic attempt at step/time zero with spawn state, neutral controls, declared input owner, primary chase camera, empty warnings, and no outcome; RESTART clears attempt/runtime/configuration to PREFLIGHT_SELECTION while catalogue selection remains available. Focused reset tests pass 16/16; flight-core 286/286 and web 1,200/1,200 pass. Candidate runs 4459-4460 and integration/publication runs 4463-4464 passed, including immutable image publication for the exact merge revision. 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.