AEROSIM-TS-83
Implement warning, grace-zone, and hard-limit transitions
Configured horizontal and altitude limits produce a visible warning zone, a return grace zone, and an unambiguous hard-limit event.
- Verified flow state
- Done
- Owner
- AeroSim Architecture and Delivery
- Feature
- AEROSIM-FT-2
- Component
- Web flight runtime — world boundary state machine and warning presenter
- Repository
- corp-v1-aerosim/corp-v1-aerosim
Delivery scope
Implement updateWorldBoundaryState(previous, sample, policy): BoundaryTransition for horizontal radial distance and altitude. States are INSIDE, WARNING, GRACE, RETURNED, and HARD_LIMIT; policy defines warningDistanceM, hardDistanceM, minAltitudeM, maxAltitudeM, graceTicks, and returnHysteresisM. Emit one warning transition and one hard-limit event per excursionId.
Implementation contract
Implementation artifacts
- applications/web/src/flight/boundary/world-boundary-state-machine.ts
- applications/web/src/flight/presentation/boundary-warning-model.ts
- applications/web/test/flight/world-boundary-state-machine.spec.ts
Inputs
- BoundarySample {simulationTick,positionWorldM,radialDistanceM,altitudeM}, BoundaryPolicyV1, and BoundaryState {state,excursionId,enteredWarningTick,enteredGraceTick,hardLimitEmitted}.
Outputs
- BoundaryTransition {previousState,nextState,excursionId,event:'NONE'|'WARNING_ENTERED'|'GRACE_STARTED'|'RETURNED'|'HARD_LIMIT_REACHED',remainingGraceTicks,limitType:'HORIZONTAL'|'LOW_ALTITUDE'|'HIGH_ALTITUDE'|null} plus BoundaryWarningModel.
Failure boundaries
- Return BOUNDARY_SAMPLE_INVALID for non-finite position/distance/altitude or a regressing/fractional tick; do not advance state.
- Return BOUNDARY_POLICY_INVALID when warning/hard thresholds overlap incorrectly, altitude minimum is not below maximum, graceTicks is not positive, or hysteresis is negative.
- Crossing the hard threshold or exhausting grace emits HARD_LIMIT_REACHED exactly once; later samples in the same excursion emit NONE.
- A return is accepted only after crossing warning threshold minus returnHysteresisM; boundary jitter before that point remains in GRACE.
Excluded scope
- Collision detection, safe-state capture/restore, invalid-state action selection, map rendering, arbitrary polygon/geofence boundaries, and multiplayer boundaries are excluded.
Verification steps
- Run applications/web/test/flight/world-boundary-state-machine.spec.ts.
- Exercise horizontal, low-altitude, and high-altitude entry; grace countdown; hysteretic return; immediate hard crossing; grace expiry; jitter; and a second excursion.
- Test exact warning/hard/altitude thresholds and grace expiry tick, asserting state, event, excursionId, remaining ticks, and exactly-once hard event.
- Inject invalid samples and every invalid policy relation; assert exact failure and unchanged previous state.
Traceability
Requirements
Dependencies
- AEROSIM-TS-2Canonical ID: TASK-0002
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: final application PR #96 reviewed head c99b9e1699570ef637ac49cbbdeaf9ff6677ba67 passed exact-head application validation run 3957, merged as 97ab0ab9014703e0a5fdf3dc659562dd270b16e5, and integration runs 3958 and 3959 succeeded. 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.