Skip to content

Report what Guard + Runway did in AlgorithmOutput - #12

Merged
ps2 merged 1 commit into
mainfrom
feature/guard-and-runway-output
Oct 25, 2026
Merged

ps2 merged 1 commit into
mainfrom
feature/guard-and-runway-output

Conversation

@ps2

@ps2 ps2 commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Adds AlgorithmOutput.guardAndRunway so Loop can show what Guard + Runway did on the Predicted Glucose screen.

It's set when the guardAndRunway experiment ran and dosing was recommended:

  • volatility: σ5 for this run, mg/dL
  • bandApplied: false when active carbs kept the volatility band off
  • bandDepth: how far the band lowers the forecast at 60 min, mg/dL (0 when off)
  • bandGain: the band's depth multiplier from the volatility baseline
  • runwayShift: how far the automatic-dosing target was lowered, mg/dL
  • postLowRiseCutActive: whether the post-low cut is scaling down rising RC
  • guarded(_:): applies the same band to another forecast, so a display can draw the comparison curve with or without it

Nothing about dosing changes. The output is nil without the experiment, and the fixture encoding is unchanged. Tests extend the existing experiment tests; swift test passes (179).

AlgorithmOutput.guardAndRunway carries the run's volatility (σ5), whether the
volatility band was applied or kept off by active carbs, its depth at the
60 min horizon, the runway's aim shift and whether the post-low rise cut is
active. guarded(_:) applies the same band to another forecast, so a display
can compare forecasts with and without it.
@ps2
ps2 merged commit fec96bc into main Oct 25, 2026
Trpl7ca pushed a commit to Trpl7ca/LoopWorkspace that referenced this pull request Oct 25, 2026
- LoopKit/LoopAlgorithm#12: AlgorithmOutput.guardAndRunway
- LoopKit/LoopAlgorithm#13: Report the guard band's actual depth
- LoopKit/Loop#2611: Show and record what Guard + Runway did
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant