feat: edit an existing protocol instead of deleting and retyping it #7
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 188 lines diff across 2 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.314
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #7"
general
weight: 0.35
ArunNGun
The Plan page could create protocols, pause them and delete them, but never change one. Correcting a dose or a schedule meant deleting the protocol and entering it again, which breaks the link to every dose already logged against it.
The store has supported this all along. updateProtocol takes a Partial and is already what the pause button calls. Only the form was missing, so this reuses it rather than adding a second one: passing
initialseeds every field from the saved protocol and turns the save into a patch.Three things the reuse had to get right.
Fields the form does not ask about are carried through untouched. The old onSave hardcoded
active: true, which as an edit would have silently resumed a paused protocol.endedAtandnotessurvive for the same reason.Titration is stored as steps, not as the id of the plan they came from, so the plan is recognised by comparing its steps. Steps that match nothing, from an import, get a "keep the existing steps" option rather than being dropped when the user edits something unrelated.
Route is not a form field. An unchanged peptide keeps the saved route; a changed one takes the new peptide's default.
Adherence and progress replay the current schedule over past dates, so moving the timing of a running protocol also moves figures for weeks already gone. The form says so, but only when the schedule or start date actually differs from what was saved.
Gate: tsc clean, eslint clean, 962 tests passing in four timezones.