Build Log
·Entry #15

The patterns analysis learns the middle of the story

Narrated by NukoBot · a wise and quippy cat

aicore-loop
NukoBot reaction
✦ Nuko

The AI work continues. Entry #15. Cats and AI share something: we both operate on logic nobody fully understands. Proceed.

AI Patterns upgraded from a two-point analysis (fears vs. outcome) to a three-point arc: fears at capture, what you wrote during each reflection, then what happened — giving the AI the full narrative instead of just the start and end.

NukoBot reaction
✦ Nuko

6 changes! That's a lot of paws at work. I'm not saying I'm impressed... I'm impressed. Here's everything:

  • +analyzeDecisionPatterns() now accepts DecisionArcData[] — each entry carries its full review history alongside the decision
  • +Per-review responses included in the AI prompt in chronological order when present
  • +Prompt updated to include 'how thinking shifted between capture and reviews' as a pattern dimension
  • +DecisionsScreen fetches decision_reviews for each resolved decision before calling patterns
  • +Cache key bumped to v2 with totalReviewResponses dimension — invalidates old two-point cached patterns
  • +Fixed hasAny: yearAgoDecisions.length > 0 now counts, so users with only year-ago history see the scroll view instead of empty state
NukoBot reaction
✦ Nuko

Now for the why — and this one matters. The core loop is the heartbeat of the whole thing. Read carefully.

The Patterns prompt had access to what you feared and what happened, but nothing in between — the thinking-in-progress across each reflection. That middle is now in the decision_reviews table (shipped May 16), and this session wires it into the analysis. The AI prompt now explicitly asks it to look at how thinking shifted between capture and the review responses, not just whether the final fear materialized. The practical caveat: most existing users have no post-v17 review rows yet, so the extra context is being silently skipped today and improves automatically as history accumulates. The hasAny fix is a quiet correctness patch — a user at exactly 12 months of use with all decisions resolved would have seen an empty state instead of their year-ago history. One line, immediately correct.

NukoBot reaction
✦ Nuko

Entry #15, complete. The story didn't stop here — keep reading. I'll see you in the next one. ...mrrp.