feat: plan a protocol by weeks, with a dose and a frequency per band #16
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 429 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.363
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16"
general
weight: 0.35
ArunNGun
What
A titration varies the dose and holds the frequency. That is the right shape for a published escalation and the wrong shape for a plan someone writes themselves, so this could not be said at all:
This adds a third option to the protocol form, beside Fixed and Titration: By weeks. Bands of weeks, each with a dose and optionally a frequency of its own. The last band runs on indefinitely, which is what "week 8 onwards" means.
Model
ProtocolPhaseis the general form of a titration: weeks, a dose, and an optionalSchedule. It is optional onProtocol.Phases live on the protocol and never in the compound library. A
TitrationPlancarries asourceand anevidencelevel because it is a claim about what was studied. A personal ladder is a claim about nothing except what its author intends to do, so it has no business sitting next to trial data.One code path, not two
protocolPhases()reads an auto-advancing titration as a phase list, because that is what it already is. Everything downstream works on phases, so there is no second mechanism to keep in step with the first.The schedule primitives are untouched. New protocol-level wrappers resolve phases onto the calendar and then defer to them:
protocolDoseTimesBetweenprotocolNextDoseTimeprotocolPreviousDoseTimeprotocolDosesPerWeekA protocol with no phases yields a single span covering all of time and takes exactly the path it always did. That is asserted rather than assumed:
phases.test.tscompares the old and new calls across six schedule shapes, including cycling and anendedAt, and requires identical output.Two decisions worth naming
Each phase anchors its own interval. "From week four, every three days" counts from the start of week four, not from a rhythm inherited from a start date months earlier. The alternative is defensible but surprising.
protocolDosesPerWeekreports the current phase's rate, not an average. It feeds burn rate and days of supply, and the question those answer is how fast the vial is emptying now.Data
phasesis optional, so nothing needed migrating.migrateAppDataspreads protocols rather than rebuilding them field by field, and the backup is whole object JSON, so a plan built on the web imports into the Android build and back out again.Gate
tsc --noEmitcleaneslintcleannext buildsucceedsBUILD_TARGET=static next buildsucceeds and emits/plan/index.html, so the Capacitor webview build is unaffectedThe two builds were run with the
next/fontGoogle Fonts calls stubbed in a throwaway copy of the tree, because the environment this was prepared in cannot reach fonts.googleapis.com. Worth one confirming run somewhere with network before merge.Out of scope, deliberately
No new network calls, no notifications, no changes to the compound library. Per-phase injection sites were not added; sites remain a protocol-level choice.
Noticed in passing
CLAUDE.mdandCONTRIBUTING.mdboth say 774 tests. The suite is at 962 before this change and 990 after. Left alone here to keep the diff to one subject.