[P2] Separate CCR oxygen accounting from user-controlled gas names #20

Closed
opened 2026-10-27 01:59:15 +00:00 by pedro · 1 comment
Owner

Priority: P2
Type: bug
Source: project review requested 2026-10-26

Location: src/models/zhl16c.ts:426; src/profile.ts:126

Problem and evidence

An accepted imported CCR plan can name its diluent Oxygen and its pure oxygen supply O2 supply. The name collides with the internal metabolic oxygen bucket. A two-minute profile needing 11.843 L diluent and 2 L oxygen charges both cylinders 13.843 L.

Suggested correction

Track metabolic oxygen independently from breathing-gas names using stable supply identity; preserve or migrate existing plan compatibility.

Acceptance criteria

Custom-name CCR regression attributes exact independent demands to supplies; existing OC/CCR and import/share round trips pass; pnpm verify passes.

Scope: maintenance of the educational simulator. Preserve historical R1 acceptance and operational-validation limits.

Priority: P2 Type: bug Source: project review requested 2026-10-26 Location: `src/models/zhl16c.ts:426; src/profile.ts:126` Problem and evidence An accepted imported CCR plan can name its diluent Oxygen and its pure oxygen supply O2 supply. The name collides with the internal metabolic oxygen bucket. A two-minute profile needing 11.843 L diluent and 2 L oxygen charges both cylinders 13.843 L. Suggested correction Track metabolic oxygen independently from breathing-gas names using stable supply identity; preserve or migrate existing plan compatibility. Acceptance criteria Custom-name CCR regression attributes exact independent demands to supplies; existing OC/CCR and import/share round trips pass; pnpm verify passes. Scope: maintenance of the educational simulator. Preserve historical R1 acceptance and operational-validation limits.
Author
Owner

Fixed and pushed to main. CCR metabolic oxygen has its own cumulative field and is attributed independently in planner and live cylinder accounting. Custom diluent named Oxygen now consumes 11.843 L diluent and 2 L oxygen in the reproduced profile; open-circuit pure Oxygen retains normal gas accounting. The independent reference adapter translates its historical serialized Oxygen bucket at the comparison boundary only. All 137 tests, including the unchanged independent numerical/demand corpus, and typecheck/build/offline/release checks pass.

Fixed and pushed to main. CCR metabolic oxygen has its own cumulative field and is attributed independently in planner and live cylinder accounting. Custom diluent named Oxygen now consumes 11.843 L diluent and 2 L oxygen in the reproduced profile; open-circuit pure Oxygen retains normal gas accounting. The independent reference adapter translates its historical serialized Oxygen bucket at the comparison boundary only. All 137 tests, including the unchanged independent numerical/demand corpus, and typecheck/build/offline/release checks pass.
pedro closed this issue 2026-10-27 02:04:06 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: pedro/DiveSim#20
No description provided.