[P1] Preserve replay oxygen peaks at gas-switch boundaries #19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Priority: P1
Type: bug
Source: project review requested 2026-10-26
Location:
src/diveReplay.ts:262Problem and evidence
Replay uses the departure gas for each leg endpoint and misses the new gas at the switch depth. Air to EAN50 at 21 m followed by ascent reports peak ppO2 0.654 bar instead of 1.557 bar and suppresses the elevated oxygen warning.
Suggested correction
Evaluate both sides of gas-switch boundaries for peak exposure and represent instantaneous gas changes in timeline presentation.
Acceptance criteria
Regression covers richer-gas ascent switch, correct peak/warning and exact-boundary scrubber behavior; gas demand and tissues remain correct; pnpm verify passes.
Scope: maintenance of the educational simulator. Preserve historical R1 acceptance and operational-validation limits.
Fixed and pushed to main. Replay retains both sides of instantaneous gas switches, so EAN50 selected at 21 m contributes its full 1.557 bar ppO2 peak and exact-boundary readout. Regression confirms no invented gas demand or tissue evolution at the instant of switching. All 136 tests, typecheck/build/offline/release checks pass. Commit and test evidence are in the repository maintenance log.