ForgeKitFORGEKIT

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.

KnownFeatureSchemaEthics
2
new API routes
1
new table (behaviorLoopDetails)
1
AI-inference shortcut rejected mid-session

Timeline

Start
Read guide-04-pattern-recognition.md
Corpus-backed v2 design, already resolved its own open questions
Shape
Shaping Pass + placement decision
Confirmed exclude behavior_loop entries from printed Portrait book
Build
Schema + capture + retrieval
behaviorLoopDetails table, quick-add form, grouped list, wired into portrait page
Feedback
Copy, grouping, required fields
Zeb caught confusing copy, ungrouped section, missing 'what I did about it' capture
Feedback
'still working?' confirm tap
Added doc's step 5 — thumbs up/down, visible result label, re-sorts by recency
Stop
AI-inference shortcut rejected
Zeb proposed inferring outcome from free text; correctly rejected as an ethics-boundary violation
Close
Crucible post-build audit + deploy prep
1 actionable finding (Portrait-book exclusion unexplained), fixed before close

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

Zeb, proposing and then immediately rejecting the AI-inference shortcut mid-session