Build Log
The Behavior Loop
July 2, 2026
Known's second pillar ships — capture what worked when he asks again, retrieve it before you have to remember it from scratch.
Timeline
What shipped
New entryType 'behavior_loop' + behaviorLoopDetails side table (repeated_question category only, v1 scope)
POST /api/portraits/[id]/behavior-loop — capture route, two sequential inserts with manual rollback on failure
PATCH /api/portraits/[id]/behavior-loop/[entryId]/confirm — 'still working?' tap, records result + timestamp
BehaviorLoopQuickAdd — capture form, 'What happened' + 'What helped' required, two optional corpus prompts below
BehaviorLoopList — retrieval view, sorted by last-confirmed-working, visible '✓ Worked' / '✗ Didn't work' label per entry
Portrait page wiring — excluded behavior_loop entries from the printed Portrait book (memories filter), added explanatory note for that exclusion
guide-04-pattern-recognition.md status updated design → built
“I think we could just use the what happened field and then infer if it worked or not? no”