AEROSIM-TS-80
Classify governed invalid states into explicit outcomes
Crash, out-of-bounds, and unrecoverable runtime events transition to one typed recoverable, retryable, or terminal outcome.
- Verified flow state
- Done
- Owner
- AeroSim Architecture and Delivery
- Feature
- AEROSIM-FT-11
- Component
- Web flight session — invalid-state classifier
- Repository
- corp-v1-aerosim/corp-v1-aerosim
Delivery scope
Implement classifyInvalidFlightEvent(event, session): InvalidFlightOutcome. Map unsafe terrain/obstacle contact, horizontal/altitude hard limit, recovery exhaustion/failure, non-finite physics state, and runtime invariant failure to CRASHED, OUT_OF_BOUNDS, or UNRECOVERABLE. Bind one outcomeId to sessionId+triggerEventId and calculate allowedActions from InvalidFlightPolicyV1.
Implementation contract
Implementation artifacts
- applications/web/src/flight/outcome/classify-invalid-flight-event.ts
- applications/web/src/flight/outcome/invalid-flight-contracts.ts
- applications/web/test/flight/invalid-flight-classifier.spec.ts
Inputs
- InvalidFlightEvent {sessionId,triggerEventId,simulationTick,reasonCode,stateDigest,lastSafeStateDigest|null,recoveryCount} and InvalidFlightPolicyV1 action matrix.
Outputs
- InvalidFlightOutcome {outcomeId,sessionId,simulationTick,kind:'CRASHED'|'OUT_OF_BOUNDS'|'UNRECOVERABLE',reasonCode,stateDigest,allowedActions:('RECOVER'|'RETRY'|'EXIT')[],terminal:true}.
Failure boundaries
- Return INVALID_EVENT_UNSUPPORTED when reasonCode has no explicit policy mapping; classify as UNRECOVERABLE with allowedActions=['EXIT'] rather than guessing recovery.
- Return INVALID_EVENT_CORRUPT when IDs are empty, tick/count is invalid, or a required state digest is absent; stop the session and permit EXIT only.
- Reject INVALID_ACTION_POLICY when an outcome has an empty action set, RECOVER without lastSafeStateDigest, or any action outside RECOVER/RETRY/EXIT.
- A duplicate triggerEventId returns the same outcomeId; conflicting bytes for that trigger emit INVALID_EVENT_CONFLICT and retain the first outcome.
Excluded scope
- Collision/boundary detection, recovery execution, session creation, score calculation, telemetry upload, and presentation styling are excluded.
Verification steps
- Run applications/web/test/flight/invalid-flight-classifier.spec.ts.
- Assert exact kind, reasonCode, terminal flag, and allowed action set for every supported contact, boundary, recovery, physics, and invariant reason.
- Exercise unknown/corrupt/conflicting/duplicate events and invalid policy matrices; assert fail-safe EXIT-only behavior and stable outcomeId.
- Assert no mapped outcome produces RECOVER without a valid lastSafeStateDigest.
Traceability
Requirements
Dependencies
- AEROSIM-TS-75Canonical ID: TASK-0075
- AEROSIM-TS-85Canonical ID: TASK-0085
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 #123 merged reviewed head e357d01e06c49ed4198966984f0cc6dfe64338c7 as 610672f4fb85466c79aa782e194aa662a04fab71; 30 focused tests prove exact crash/out-of-bounds/unrecoverable mappings for all shipped contact, boundary, recovery, physics, and invariant reasons, immutable policy-selected actions, deterministic duplicate IDs, retained-first conflict behavior, corrupt/unsupported fail-safe outcomes, and RECOVER safe-state requirements; full local validation, 120 world-interaction runs, production audit, exact-head CI run 4209, integration/publication run 4210, and integration validation run 4211 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.