mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
remember_fact and propose_plan wrote their rows during the tool round. An answer that was then blocked, failed or abandoned left the fact in memory without its note and Undo, and left the plan listed, activatable and fed into later turns and the briefing. Both are now staged under an id minted up front and written in the transaction that stores the assistant message, only when its provenance carries them. A background proposal counts as offered only once an answer carrying it is stored. Plan text is model text: ifCue, thenAction and target pass the outbound dose and risk screen in the person's locale, with their scheduled doses and medication names, and the injection screen; a trip declines as "unsafe". The trail route serves recalled facts and the proposal's fact to the owner whatever the AI capability (only the model-written entries are gated), and withholds medication facts while the medications module is off. Accepting a fact proposal is decided under a per-message advisory lock, so concurrent taps write one fact. Editing a fact re-reads its wording: text naming a medication moves to "medication", other health wording moves a non-health fact to "condition", and a health fact the person edited counts as confirmed.
2.8 MiB
2.8 MiB