Build Log
The bug wasn't where the fix started
July 2, 2026
Fixed four real bugs in Known's note-suggestion-to-Known-Card review pipeline, seeded realistic demo data into dev and production, and burned most of the session chasing a UTF-16-encoded env file before finding the actual root cause.
Timeline
What shipped
Known: fixed accept/route.ts hardcoding category: 'what_hurts' on every accepted note suggestion — now defaults to a neutral placeholder and requires an explicit section choice in the enrich review screen
Known: fixed approving an enrichment never setting portraitEntries.onKnownCard — approved guidance now actually appears on the Known Card; rejecting sets it back false
Known: fixed KnownCard.tsx's persistCard permanently freezing empty sections as blank overrides — now only persists sections with real text, and buildSections falls through to computed defaults when an override is empty
Known: added per-entry 'Edit guidance' links directly on the Known Card so existing entries can be enriched without navigating through the Book/Portrait page
Known: accepting a note suggestion now marks the keyword as dismissed too, preventing the same suggestion from resurfacing after it becomes a real entry
Known: enrich review screen renders concatenated source notes as a list instead of one run-on paragraph
Known: fixed env file precedence in drizzle.config.ts and the seed script — .env.development.local now correctly wins over .env.local, matching Next.js's own resolution order
Known: built realistic demo seed data (Rick, a father with dementia and Type 2 diabetes) — 20 memory entries across all 10 categories, 7 handoff notes (3 mention 'appetite' to trigger the note-suggestion nudge live), all 4 enrichment review states represented
Known: added a separate, explicit-args production seed script (lib/db/seed-prod.ts) that requires --env-file and --org with no silent fallback, prints a dry-run target summary before writing, and reads DATABASE_URL directly off disk (bypassing dotenv) with UTF-16 file detection
Known: home page 'Other portraits' row now links to Portrait and Known Card, not just 'Share something'
Known: deployed products/known to production — known.forgekits.build
“none of that makes sense. try again. what is the root cause for why we cant insert rows into production database?”