Build Log · July 2, 2026

The Behavior Loop

Known's second pillar ships — capture what worked when he asks again, retrieve it before you have to remember it from scratch.

  • Known
  • Feature
  • Schema
  • Ethics
new API routes
2

new API routes

new table (behaviorLoopDetails)
1

new table (behaviorLoopDetails)

AI-inference shortcut rejected mid-session
1

AI-inference shortcut rejected mid-session

Timeline

  1. Start

    Read guide-04-pattern-recognition.md

    Corpus-backed v2 design, already resolved its own open questions

  2. Shape

    Shaping Pass + placement decision

    Confirmed exclude behavior_loop entries from printed Portrait book

  3. Build

    Schema + capture + retrieval

    behaviorLoopDetails table, quick-add form, grouped list, wired into portrait page

  4. Feedback

    Copy, grouping, required fields

    Zeb caught confusing copy, ungrouped section, missing 'what I did about it' capture

  5. Feedback

    'still working?' confirm tap

    Added doc's step 5 — thumbs up/down, visible result label, re-sorts by recency

  6. Stop

    AI-inference shortcut rejected

    Zeb proposed inferring outcome from free text; correctly rejected as an ethics-boundary violation

  7. 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