Build Log

What we've shipped

A chronological record of every build session. Updated as we go.

p0stman for ThynkNu / Last updated: 15 May 2026

Pre-handover polish: Vault, reports, docs, invite codes, outcome wording

15 May 2026

Done
  • Renamed /dashboard to /vault per Sarah's preference (route, middleware, i18n, header menu)
  • Created /reports page: unit tests (250), agent test suite (17), tree audit, security audit
  • Created /docs handover page: architecture, credentials, env vars, key files, maintenance guide
  • 20 beta invite codes created in Supabase (KINDANT-BETA-001 to 020)
  • Decline/postpone outcome wording softened: 'likely outcome' framing + 'confirm directly with insurer' (Sarah's Slack request)
  • Updated /build page with project status section and links to /reports and /docs
  • Cleaned up TASKS.md: removed client-blocked items, closed deferred items

Critical tree fix: fabricated data replaced, full audit, sign-off agreed

8 May 2026

Done
  • Replaced fabricated disease lists in chest pain, arrhythmias with source Excel data
  • Built complete diabetes mellitus Type 2 downstream branch (comorbidity, inpatient, HbA1c 3-band)
  • Fixed 5 remaining empty-options stubs across Q2, Q7, Q8, Q11
  • Full tree audit: 15 categories, 234 conditions, 1,373 nodes, zero issues
  • 250 tests passing (up from 248)
  • Sign-off date agreed with Sarah: 22 May 2026. 30-day bug support from that date.

Hypertension rebuild, Guided Choice phase split, tree fidelity

7 May 2026

Done
  • Hypertension tree rebuilt against source Excel: cardiac investigation, doctor/nurse BP validation, three-band systolic/diastolic
  • Guided Choice journey split into Phase 1 (needs discovery) and Phase 2 (UW qualification)
  • Tree fidelity prompt hardening: model can only ask tree node questions, no invented clinical follow-ups
  • Made Michael admin in Supabase for /admin/trees access
  • 2 new agent test scenarios (hypertension self-measured, find-the-right-cover) passing against live API

Security audit, admin tree viewer, 5 bug fixes, agent test suite

5 May 2026

Done
  • Security audit: 6 findings, all fixed (prompt injection framing, npm audit, DB migrations, env validation, lint, analytics format)
  • Admin tree viewer at /admin/trees: visual representation of all 15 categories and 234 conditions
  • 5 bugs from Sarah/Michael fixed: hypertension premature conclusion, retinal detachment stalls, policy reading freezes, claims receipt not readable, fresh conversations per journey
  • Agent test suite: 17 multi-turn scenarios, tone/sentiment analysis, 13/17 passing (4 expected: Vera correctly asks age/sex first)
  • Prompt injection fix: uploaded content moved to user-role messages with UNTRUSTED framing
  • DB migrations committed to source control (11 tables, 33 RLS policies)

Sarah's bug doc resolved, upload UX, clinical neutrality

4 May 2026

Done
  • All 6 items from Sarah's bug doc resolved end-to-end
  • Policy upload root cause: missing RLS UPDATE policy. Silent failure. Migration applied.
  • PDF extraction rewritten: unpdf replaces Anthropic vision (10s vs 5+ min timeout)
  • lookupCondition tool returns {value, label} objects (was labels only, breaking evaluateCondition)
  • Extended thinking enabled on Guided Choice journey (4k budget)
  • Clinical neutrality prompt section: bans interpretation of clinical values, safe phrasing examples
  • Upload status card: inline progress indicator, chronological position, auto-fires summary nudge
  • smoothStream chunking: line mode (word mode produced 'it.Your' with no space)

Beta bug fixes, analytics integrity, latency optimisation, production hardening

1 May 2026

Done
  • PDF upload limit raised 10MB to 25MB. HEIF (image/heif) MIME type added for iOS Safari.
  • Sarah removed from INTERNAL_EMAILS (was invisible in analytics). Refusal heuristic tightened.
  • readPolicy output trimmed (12k to 3-4k). Policy summary injected into system prompt.
  • Per-journey step limits: guided_choice=8, living_protection=5, transparent_resolution=5, trusted_guide=4
  • Security headers, error boundaries, context window trim (40 messages), OG/Twitter meta tags
  • 6 new GitHub issues created (#37-#42)

Voice, image upload, Google SSO, analytics, zh-HK, 247 tests

30 April 2026

Done
  • Voice I/O: browser speech recognition for input, ElevenLabs TTS (Alice, British) for output. Mic button with voice mode toggle.
  • All 4 journeys unlocked for beta (Trusted Guide, Transparent Resolution were locked as Coming Soon)
  • Image upload: JPEG/PNG/WebP/HEIC via Claude vision analysis. readDocument tool for Vera.
  • Admin analytics dashboard at /admin/analytics: cost, latency, P95, tool usage, refusal rate, daily volume, traffic by country/device
  • User vault at /vault: uploaded policies, documents, conversation history with journey badges
  • Google SSO: GCloud project, OAuth consent screen, credentials, Supabase provider, login + signup buttons, in-app browser warning
  • Resend SMTP configured in Supabase. 4 branded email templates pasted (confirm, magic link, reset, change email).
  • Agentic web stack: llms.txt, context.md, agent.json, robots.ts (16 AI crawlers), sitemap.xml, /api/ai/context
  • 247 auto-generated underwriting evaluator tests from real tree data (up from 16 hand-written)
  • Zero-retention mode for Anthropic API
  • zh-HK Traditional Chinese: i18n locale system, translation strings, language toggle in chat header
  • 3 new knowledge files: care-navigation.md, claims-process.md, uk-market.md (22 files total)
  • Accessibility: aria-labels, aria-live on messages, muted text contrast improved to WCAG AA
  • Supabase URL config updated: Site URL, redirect URLs whitelisted for production + localhost
  • 10 GitHub issues closed (7 remaining, all Phase 3 or client-decision)

Journey system, underwriting evaluator, PDF ingestion, escalation

28 April 2026

Done
  • Journey-anchored conversations: 4 journey tiles on /chat, per-journey threads, journey-specific system prompts
  • Underwriting evaluator tool: deterministic engine runs from chat via evaluateCondition, auto-persists audit log to Supabase
  • PDF ingestion pipeline: upload policy documents, Claude extraction, readPolicy tool surfaces content in conversation
  • In-chat escalation: escalateToHuman tool, /api/escalate endpoint, inline EscalationCard rendered in message stream
  • Q13 Others tree complete: all 15 categories now covered (234 conditions across 14 trees)
  • 3 new agent tools: evaluateCondition, readPolicy, escalateToHuman

Closed beta launch, observability foundation

25 April 2026

Done
  • Closed beta live: invite codes for Sarah, Michael, Suki + 5 spare beta codes
  • Supabase email rate limit hit by Suki on signup. Fixed: turned off email confirmation, invite codes gate access
  • Observability: message_metrics table (model, tokens, latency, tool calls, refused, internal flag)
  • First-party analytics: /api/track page-view path live with internal-email filter and bot-UA skip
  • Vercel Speed Insights installed alongside existing Analytics

Phase 1 foundation: Supabase, auth, chat persistence, admin dashboard

24 April 2026

Done
  • Supabase project live in eu-west-2 (London): 8 tables, RLS, 3 helper RPCs, auth trigger
  • Auth: email/password + magic link, invite-code-gated signup, /auth/callback (PKCE + email token)
  • Chat persistence migrated to Supabase (conversations + messages tables)
  • Deterministic tree evaluator with 16 vitest unit tests passing
  • Admin escalation dashboard: list + detail + claim + resolve server actions
  • Waitlist signup on landing hero + /api/waitlist
  • Kickoff call with Sarah + Michael: scope, positioning, and decisions captured
  • 3 kickoff bug fixes: prompt verbosity, tool-call dedupe, scroll lock
  • 9 new GitHub issues opened (#28-#36)

Design system, agent, and knowledge architecture

23 April 2026

Done
  • Warm Guide direction confirmed and locked in
  • Product name: Kindant. Agent name: Vera.
  • Full colour token system (light + dark mode)
  • DM Sans typography scale defined
  • 19 UI components built (6 shared, 13 chat-specific)
  • DESIGN.md created as machine-readable design spec
  • Vera is live at /chat with Claude Sonnet 4.6
  • 4 agent tools connected: knowledge base lookup, condition search, category listing, underwriting criteria
  • Tool call action cards show transparency (loading, success states)
  • Knowledge base seeded: glossary, HK market, 14 condition categories
  • 14 of 15 underwriting trees converted (233 conditions, 1,330 nodes)
  • Conversation persistence with localStorage
  • Markdown rendering in agent messages
  • Dark mode support

Knowledge architecture and underwriting engine

21 April 2026

Done
  • 3-layer architecture designed: rules engine + knowledge base + conversational agent
  • Full TypeScript type system for underwriting decision trees
  • Zod validation schemas for runtime safety
  • Excel-to-JSON conversion pipeline built
  • Proof of concept: Q4 Gastro category converted (33 conditions, 143 nodes)
  • Journeys 1-4 narratives received and processed from Michael

Design and vision deck

19 April 2026

Done
  • 12-section vision deck built and deployed
  • 3 design directions with AI-generated moodboards and mood films
  • Market landscape research (8 key players, gap analysis)
  • Agent UX patterns and design principles defined
  • Delivery roadmap visualised
  • Staging site live at healthx.p0stman.com

Project foundation

14 April 2026

Done
  • Project scaffolded (Next.js 16, TypeScript, Tailwind v4)
  • GitHub repo, Vercel deployment, Slack channel
  • Wiki initialised with 16 pages
  • 3 architecture decisions documented (tech stack, insurer-agnostic, deterministic underwriting)
  • Naming shortlist created (8 options across 3 themes)