Skip to content

Latest commit

 

History

History
323 lines (298 loc) · 121 KB

File metadata and controls

323 lines (298 loc) · 121 KB

Project State

Active Project

  • name: MoneyMirror — AI-Powered Personal Finance Coach
  • repo_path: apps/money-mirror
  • owner: Vijay Sehgal
  • started_on: 2026-04-01
  • goal (1 sentence): Build a mobile-first PWA AI financial coach that reads Indian bank statements, reveals the "perception gap" (perceived vs actual spend) via a Mirror moment, and delivers consequence-first nudges to help Gen Z Indians (₹20K–₹80K/month) reduce wasteful spend by ≥30% and initiate their first SIP within 60 days.
  • active_cycle: issue-012 — Gen Z clarity loop (emotional UX, frequency-first insights, perf SLAs) — experiments/ideas/issue-012.md; Linear VIJ-52
  • phase_4_closed_in_repo: Merchant/UPI-native visibility, bad patterns, compare, chat, proactive, hardening — see experiments/plans/plan-011.md; Linear VIJ-43 + VIJ-44–VIJ-51 (complete /learning + /linear-close for VIJ-43 when ready)

Current Stage

  • stage: learning
  • last_command_run: /debug-hotfix — money-mirror dashboard 500 post-gmail-sync (2026-04-10)
  • status: completed
  • active_issue: issue-012 — Gen Z clarity loop (Enhancement); Linear root VIJ-52; prior umbrella issue-011 / VIJ-43 still in learning until /learning + /linear-close

Active Work

  • active_branch: main (push feature branches for new work)
  • last_commit: adca1a1 (fix(money-mirror): hotfix dashboard 500 — ZodError on gmail_sync statement type)
  • open_pr_link: open a new PR when pushing MoneyMirror hardening / perf follow-ups
  • environments: local, production (https://money-mirror-rho.vercel.app)
  • implementation_focus: issue-012 — Learning completed: knowledge files, prompt library, agent prompts, deploy-check command, and apps/money-mirror/CODEBASE-CONTEXT.md updated from postmortem-012.md. Post-closeout deploy hardening completed on 2026-04-09: MoneyMirror Vercel Git reconnect, main-only production deploy guard, proof deployment from main, and landing deploy isolation via path-scoped ignore rule. Post-cycle Gmail sync ship (2026-04-09/10): Phase 1 /gmail-sync slash command + Phase 2 full Gmail OAuth/sync/cron shipped to production outside the issue-012 pipeline. Gmail is now the primary ingestion path; PDF upload retained as fallback. New routes: /api/oauth/google/*, /api/gmail/sync, /api/gmail/sync/status, /api/gmail/trigger-sync, /api/cron/gmail-sync/*. New schema tables: user_oauth_tokens, gmail_sync_runs; new column transactions.dedup_hash. Dashboard Sync tab (SyncPanel.tsx) replaces Upload tab. Commit 5690212 deployed to production. Post-cycle hotfix (2026-04-10): 5-fix patch for dashboard HTTP 500 triggered by Gmail sync — root cause: layerAFactsSchema Zod enum missing 'gmail_sync'; secondary: legacy dashboard query selected Gmail synthetic statements as most-recent. Files changed: coaching-facts.ts, statements.ts, dashboard-legacy.ts, schema-upgrades.ts, gmail/run-sync.ts.
  • linear_ops_note: VIJ-42 (Done) — production-readiness mirror issue; comment 2026-04-06 on VIJ-37 links VIJ-42 + post-close summary (docs/PERFORMANCE-REVIEW.md, production-launch-checklist-010.md, SCHEMA-DRIFT.md).
  • linear_last_sync: 2026-04-07T15:43:41Z
  • linear_sync_status: success — /linear-close for issue-012 finalized Linear closure. Project issue-012 remains Completed; root VIJ-52 remains Done with labels Improvement + Completed; closeout snapshot document issue-012 Closeout Snapshot and final closeout comment 55b267c0 created.

Quality Gates

  • create_issue: done — issue-012 created 2026-04-07. Enhancement: Gen Z clarity loop — emotional UX, frequency-first insights, performance-to-insight SLAs, guided review, high-signal proactive copy. Source: .cursor/plans/money_mirror_10x_issue_34a61725.plan.md. experiments/ideas/issue-012.md. Linear: project issue-012 — Gen Z clarity loop (emotional UX, frequency, perf SLAs) + root VIJ-52 (labels Discovery + Improvement). experiments/linear-sync/issue-012.json (last_sync_mode: bind). Next: /explore issue-012.
  • explore (issue-012): done — Build recommendation. Real wedge is not another tracker; it is statement-truth plus fast frequency/cluster storytelling for UPI-heavy Gen Z users. Market proof exists across UPI scale, quick-commerce frequency, and SMS/card-led competitors, but none combine cross-bank statement truth with shame-safe review loops. Priority order: T0 perf + emotional UX -> T1 frequency/cluster insights -> T2 guided review/proactive copy. Saved to experiments/exploration/exploration-012.md. Checkpoint: /linear-sync issue recorded before /create-plan.
  • create_plan (issue-012): done — experiments/plans/plan-012.md + experiments/plans/manifest-012.json (AC + phased tasks T0–T2, PostHog list, guided_review_outcomes schema). Next: /execute-plan from phase-t0; /linear-sync plan ✅ 2026-04-07 (VIJ-53–VIJ-64, Plan Snapshot document).
  • execute_plan (issue-012): done — T0 (VIJ-53–VIJ-56): perf marks (dashboard_ready_ms, time_to_first_advisory_ms), skeleton-first dashboard, progressive disclosure, shame-safe copy, COACHING-TONE Gen Z subsection. T1 (VIJ-57–VIJ-60): merchant-clusters.ts (5 clusters: quick_commerce, food_delivery, entertainment, transport, shopping), GET /api/insights/frequency-clusters, FrequencyClusterSection + cluster drill-through, frequency_insight_opened / merchant_cluster_clicked. T2 (VIJ-61–VIJ-64): guided_review_outcomes schema + schema-upgrades, POST /api/guided-review/outcome, GuidedReviewSheet (3-step), guided_review_started / guided_review_completed / commitment_saved, fact-specific recap email. Validation: npm test 144/144, npm run lint 0 errors, npm run build clean. No new env vars.
  • deslop (issue-012): done — Type consolidation for frequency UI (FrequencyClusterSection + InsightsPanel import shared FrequencyMerchantRow / ClusterRollup); removed dead sheetRef on guided review sheet container. Tests 144/144. Ready for Review: Yes. Next: /review.
  • review (issue-012): done — experiments/results/review-012.md (Passes: 3). Pass 3 confirms all earlier findings are fixed, including guided-review non-2xx handling + retryable inline error path. Focused suite: 19/19 passing. Quality gate: PASS.
  • peer_review (issue-012): done — experiments/results/peer-review-012.md. Adversarial rerun after blocker fixes. Verdict: APPROVED. Prior blockers resolved: server-enforced guided-review privacy (dismissed=true persists commitment_text=NULL) and full-scope frequency-cluster aggregates (no top-N-derived totals). Scope-aware SLA timer reset is also in place. Quality gate: PASS. Next: /linear-sync status then /qa-test.
  • qa_test (issue-012): done — PASS. Artifact: experiments/results/qa-test-012.md. Automated suite: 159/159 (32 files). Focused issue-012 suites: 19/19 (frequency clusters, guided-review outcome API, Insights panel, GuidedReviewSheet). Env var audit against .env.local.example matched all current source/script keys. No blocking reliability, failure-path, performance, or UX defects found. Quality gate: PASS.
  • metric*plan (issue-012): done — experiments/results/metric-plan-012.md. Defined repeat statement upload (North Star proxy) and supporting funnel metrics. Validated tracking for dashboard_ready, frequency_insight_opened, merchant_cluster_clicked, and guided_review*\*. Set performance SLA targets and event single-source contracts. Next: /deploy-check.
  • deploy_check (issue-012): done — experiments/results/deploy-check-012.md APPROVE. Build/README/Sentry/env/schema checks pass; Gate 0 manual smoke confirmed by PM in-session. Quality gate: PASS. Next: /postmortem.
  • postmortem (issue-012): done — experiments/results/postmortem-012.md. Cycle closed with deploy approval; systemic improvements focus on shifting semantic correctness checks left (ownership checks on optional IDs, aggregate drill-through fidelity, non-2xx completion behavior, canonical event naming alignment, deploy env optionality semantics). Quality gate: PASS. Next: /learning.
  • learning (issue-012): done — Applied prompt-autopsy fixes to backend-engineer-agent, frontend-engineer-agent, code-review-agent, deploy-agent, analytics-agent, and commands/deploy-check.md; appended new entries to knowledge/engineering-lessons.md, knowledge/product-lessons.md, and knowledge/prompt-library.md; refreshed apps/money-mirror/CODEBASE-CONTEXT.md for issue-012 endpoints/tables. Pipeline cycle for issue-012 complete.
  • create_issue: done — issue-011 created 2026-04-05. Enhancement: MoneyMirror Phase 4 — merchant-native visibility, proactive coaching, growth readiness. Source: .cursor/plans/moneymirror_phase_4_issue_93cc59db.plan.md. Umbrella + epic map P4-A–P4-H in experiments/ideas/issue-011.md. Linear: project issue-011 — MoneyMirror Phase 4 — merchant visibility & growth + root VIJ-43 (labels Discovery + Improvement). experiments/linear-sync/issue-011.json.
  • create_issue: done — issue-010 created. Enhancement: MoneyMirror Phase 3 — unified multi-source dashboard, transaction-native insights, expert AI coaching. Source: .cursor/plans/moneymirror_pm_ux_plan_08398100.plan.md. Umbrella problem/acceptance themes + T1–T6 map; Linear Option A: parent VIJ-37, children VIJ-38 (T1) … VIJ-41 (T4); T5–T6 deferred. No code. Saved to experiments/ideas/issue-010.md. Linear project issue-010 — MoneyMirror Phase 3 — Unified dashboard, txns, expert AI.
  • create_issue (issue-009): done — issue-009 created. MoneyMirror — AI-Powered Personal Finance Coach for Gen Z India. Source: 13 @warikoo YouTube transcripts (238,000+ chars). Gap confirmed: zero budgeting/behavioral coaching tool recommended across 100+ Money Matters episodes. Hypothesis: PWA-first AI coach that parses Indian bank statements + delivers consequence-first nudges reduces avoidable spend ≥30% and drives first SIP initiation for ≥20% of users within 60 days. Money Health Score (0–100) is the North Star proxy metric. Saved to experiments/ideas/issue-009.md.
  • explore (issue-011): done — Build recommendation. Merchant/UPI visibility (P4-A) and bad-pattern detection (P4-E) are the highest-pain epics. No India competitor at statement-native + merchant-truth positioning. Market: 15M+ target cohort, Product Hunt + Warikoo distribution. Risks plannable: Gemini re-label latency (batch offline), WhatsApp vendor lead time (start now), chat token cost (rate-limit + Layer A grounding). Epic priority: P4-A → P4-E → P4-G → P4-F → P4-D → P4-B → P4-C → P4-H. Saved to experiments/exploration/exploration-011.md. Checkpoint: /linear-sync issue before /create-plan.
  • create_plan (issue-011): done — experiments/plans/plan-011.md + experiments/plans/manifest-011.json (AC + tasks per epic P4-A–P4-H). Linear: project Planned; issue-011 Plan Snapshot; child epics VIJ-44 (P4-A), VIJ-45 (P4-E), VIJ-46 (P4-G), VIJ-47 (P4-F), VIJ-48 (P4-D), VIJ-49 (P4-B), VIJ-51 (P4-C), VIJ-50 (P4-H). Root VIJ-43 updated. /linear-sync plan completed 2026-04-06. Next: /execute-plan from VIJ-44.
  • deslop (issue-011): done — S1 whatsapp-opt-in silent provider failure fixed (logs + 502 on non-ok), S2 MerchantRollups 360→286L (renamed dialog extracted to MerchantRenameDialog.tsx, RenameTarget exported), S3 chat/route.ts prompt extracted to buildChatPrompt() helper, S4 merchant-rollups sumDebit branches merged into sumDebitPaisaInternal(keyedOnly). 105 tests / lint / build pass. Ready for Review: Yes.
  • execute_plan (issue-011): done — P4-A / VIJ-44, P4-E / VIJ-45, P4-G / VIJ-46, P4-F / VIJ-47, P4-D / VIJ-48, P4-B / VIJ-49, P4-C / VIJ-51, P4-H / VIJ-50 implemented. Additions in final slice: POST /api/proactive/whatsapp-opt-in, POST /api/proactive/push-subscription, upload retry CTA, POST /api/chat (facts-only + citations + chat daily rate limit), shared rate-limit.ts on heavy GET routes (/api/dashboard, /api/transactions, /api/insights/merchants) with rate_limit_hit. Validation: npm --prefix apps/money-mirror test (105/105), npm --prefix apps/money-mirror run lint, npm --prefix apps/money-mirror run build (Sentry sourcemap upload warning under sandbox only). Next: /deslop.
  • review (issue-011): done — APPROVED (2 passes). Pass 1 (Codex/GPT-5, 2026-04-07): 0 CRITICAL, 2 HIGH fixed (compare logic, month-over-month copy), 2 MEDIUM fixed (MerchantRollups AbortController, rate-limit bucket pruning), 109/109 tests. Pass 2 (Claude Sonnet 4.6, 2026-04-07): 0 CRITICAL, 0 HIGH, 3 MEDIUM fixed (persist-statement await PostHog + console.error, useDashboardState console.error), 1 LOW fixed (schema.sql upi_handle base table). Artifact: experiments/results/review-011.md (passes_logged: 2). Quality gate: PASS. Next: /peer-review.
  • peer_review (issue-011): done — APPROVED. Three-lens adversarial review (architecture/scalability, reliability/security, PM alignment). No blocking issues; non-blocking: in-memory limiter cross-instance semantics, chat Promise.race without Gemini abort (cost), chat_query_submitted before GEMINI availability check (analytics skew), refresh CODEBASE-CONTEXT rate-limit note. Artifact: experiments/results/peer-review-011.md. Quality gate: PASS. Next: /qa-test.
  • qa_test (issue-011): done — PASS (Run 1 · Claude Sonnet 4.6; Run 2 · Codex / GPT-5). Run 1: 109/109 automated tests across 23 files. All P4-A–P4-H epics functionally verified. Env var audit: 0 missing keys (16/16 covered). PostHog fire-and-forget: 100% compliant. Rate limits with Retry-After on all 4 heavy-read routes. P4-E advisory triggers (MICRO_UPI_DRAIN, REPEAT_MERCHANT_NOISE, CC_MIN_DUE_INCOME_STRESS) unit-tested. Run 2: npm test rerun stayed green at 109/109, .env.local.example was rechecked against current source/runtime keys, WhatsApp opt-in failure behavior was confirmed explicit (400 invalid input, 502 provider failure, 200 stub when unconfigured), and the prior non-blocking caveat was retained: chat_query_submitted fires before the GEMINI_API_KEY availability guard, so metric-plan must treat it as attempted demand rather than guaranteed availability. Artifact: experiments/results/qa-test-011.md (Run Log tracks per-model verdicts). Quality gate: PASS. Next: /metric-plan.
  • metric_plan (issue-011): done — experiments/results/metric-plan-011.md. North Star: repeat statement upload within 60d (cohort; continuity with issue-009/010). Supporting: merchant clarity engagement, bad-pattern click-through, chat attempts vs. chat_response_rendered, paywall funnel (flag-gated), proactive opt-ins, heavy-read rate_limit_hit + parse health. Events mapped to captureServerEvent, posthog-browser, manifest-011.json. Quality gate: PASS. Next: /deploy-check.
  • deploy_check (issue-011): done — experiments/results/deploy-check-011.md APPROVE (production readiness). Build PASS; env/README/Sentry gates PASS; Neon schema verified after npm run db:upgrade. PR automation: not completed — git commit blocked by husky file-size check (four files over 300-line limit); see artifact PR creation section. Quality gate: PASS for deploy approval; follow-up: split oversized files or policy-approved --no-verify, then open PR. Next: /postmortem.
  • postmortem (issue-011): done — experiments/results/postmortem-011.md. Systemic themes: funnel telemetry must declare availability semantics (chat_query_submitted overstates usable chat demand when env-gated off), repo file-size policy surfaced too late and blocked PR automation, and architecture still allowed authenticated heavy-read throttle posture and soft-vs-true Gemini abort semantics to remain advisory instead of explicit. Prompt Autopsy targets: analytics-agent, backend-architect-agent, deslop-agent, code-review-agent, deploy-agent / commands/deploy-check.md. Quality gate: PASS. Next: /learning.
  • explore: done — Phase 3: Build recommendation. Multi-statement users need txn-level truth + unified scope before insights/AI feel credible; risks (PDF variance, merchant normalization, coaching copy, performance, perceived-vs-actual rollup) are plannable. MVP experiment slice: T1 (transaction surface + API). Saved to experiments/exploration/exploration-010.md.
  • create_plan (issue-010): done — experiments/plans/plan-010.md + experiments/plans/manifest-010.json (AC per T1–T4; T5–T6 deferred). Checkpoint: /linear-sync plan completed 2026-04-05.
  • execute_plan (issue-010): done — T1–T4 / VIJ-38–VIJ-41 (transactions + unified scope + merchant rollups + facts-grounded Gemini coaching + Sources drawer; tests 76 passing). T5–T6 remain deferred (not in execute-plan scope).
  • deslop (issue-010): done — 7 fixes applied to T4 Phase 3 files: S1 wrong error message in advisories route, S2 silent catch blocks → console.error, S3 TIMEOUT_MS 14 000→9 000 (Eng Lesson #15) + NOTE comment re AbortController SDK gap, N1 nnarrative, N2 ffact + typed filter, C1 AdvisoryCard extracted from 76-line map callback, CM1 redundant JSDoc removed. Build/lint/76 tests pass. Ready for Review: Yes.
  • review (issue-010): done — Two review passes completed; all findings fixed. Codex pass: H1 dashboard math truncation, H2 backfill infinite loop, M1 scope URL drift. Claude Code second pass: H2 missing AbortController in loadDashboard (stale scope race), H1 wrong per-year food delivery annualization, M1 Sentry missing in 4 catch blocks, M2 advisory copy bugs (subscription /mo + NO_INVESTMENT this month), M3 N+1 backfill UPDATE queries → batched unnest, M4 DashboardClient 457→159L (extracted useDashboardState hook), M5 TransactionsPanel 342→166L (extracted TxnFilterBar + TxnRow), L1 inline @keyframes → globals.css. Validation: npm test 76/76 ✓, npm run lint 0 errors ✓, npm run build clean ✓. Full findings in experiments/results/review-010.md. Quality gate: PASS.
  • peer_review (issue-010): done — APPROVED. Three-lens adversarial review (architecture, reliability/security, PM alignment). No blocking issues; non-blocking: heavy read APIs without per-user rate limits (hardening), Gemini timeout without true HTTP abort (documented), merchant heuristic limits (known / T5–T6). Artifact: experiments/results/peer-review-010.md. Quality gate: PASS. Next: /qa-test.
  • qa_test (issue-010): done — PASS. No blocking findings. Validation: npm test 76/76 ✓, npm run lint ✓, npm run build ✓, env var key audit ✓, cron worker failure-path and telemetry contract inspection ✓. Residual non-blocking note: heavy authenticated read APIs still have no explicit per-user throttle. Artifact: experiments/results/qa-test-010.md. Quality gate: PASS. Next: /metric-plan.
  • metric_plan (issue-010): done — experiments/results/metric-plan-010.md. North Star: repeat statement upload within 60 days of first success (cohort; aligns with issue-009 proxy ≥60%). Supporting: Phase 3 trust proxy, scope adoption, coaching engagement, parse reliability, read-path health. Events mapped to existing captureServerEvent + manifest-010 list. Quality gate: PASS. Next: /deploy-check.
  • deploy_check (issue-010): done — experiments/results/deploy-check-010.md APPROVE. PM exception: Sentry DSN / org / project not required for env gate. Neon: profiles, statements, transactions, advisory_feed confirmed on connected DB. Automated smoke PASS; manual OTP/PDF path still recommended. Quality gate: PASS. Next: /postmortem.
  • postmortem (issue-010): done — experiments/results/postmortem-010.md. Systemic themes: financial aggregates must be full-scope SQL (not row-capped); scope-aware copy; backfill loop termination; URL-synced scope UI; AbortController on competing dashboard loads; deploy-check env exceptions; heavy-read API strategy backlog. Quality gate: PASS. Next: /learning.
  • learning (issue-010): done — Engineering lessons, product lesson, and prompt-library postmortem section appended; agent files updated per Prompt Autopsy (backend-architect-agent, backend-engineer-agent, code-review-agent, frontend-engineer-agent, product-agent, design-agent, peer-review-agent, deploy-agent, commands/deploy-check.md); apps/money-mirror/CODEBASE-CONTEXT.md refreshed. Pipeline cycle for issue-010 complete.
  • linear_close (issue-010): done — Linear project Completed; root VIJ-37 + children VIJ-38–VIJ-41 Done; document issue-010 Closeout Snapshot; final comment on VIJ-37. experiments/linear-sync/issue-010.json updated (last_sync_mode: close). linear_last_sync: 2026-04-05T15:40:12Z. linear_sync_status: success.
  • explore (issue-009): done — Recommendation: Build. Problem is critical (Hair on fire for 22–30 segment), gap is confirmed from 13 Warikoo transcripts (238K chars, zero coaching tool recommended across 100+ Money Matters episodes). Competitive scan: no Indian product at this positioning (Walnut abandoned, ET Money investment-first, CRED rewards bad behavior, Jupiter/Fi bank-first). MVP: HDFC bank statement parse + onboarding Money Health Score + Day 7 Mirror Report + 5 advisory triggers + weekly email. WhatsApp, credit card parsing, gamification, paywall all excluded from Phase 1. North Star: second-month statement upload rate (≥60%). Primary risk: PDF parsing reliability. Saved to experiments/exploration/exploration-009.md.
  • create_plan: done — plan-009.md + manifest-009.json created. Historical issue-009 plan snapshot specified a Supabase-auth/RLS-oriented shape. Current MoneyMirror implementation has since drifted and is now Neon Auth + Neon Postgres with server-enforced ownership. The repo codebase is the source of truth for local testing.
  • execute_plan: done — Full apps/money-mirror implementation. Current canonical stack: Next.js 16, Neon Auth email OTP, Neon Postgres, Gemini 2.5 Flash, Resend, PostHog, Sentry. Built statement parse, dashboard rehydration, onboarding completion, weekly recap fan-out, and HDFC-only advisory flow. Historical issue-009 notes that mention Supabase JWT wiring or RLS should be read as cycle-era findings, not the current app architecture. Current automated validation target after repair: 39 tests.
  • execute_plan (issue-009 phase-1 expansion): done — Phase 1 scope expansion shipped in apps/money-mirror (statement_type, parser helpers, card metadata, monthly_income_paisa, credit-card-safe advisory math). Neon schema migrated; local + production smoke complete. Linear VIJ-13/VIJ-20/VIJ-22 closed 2026-04-04. Production: https://money-mirror-rho.vercel.app (root directory apps/money-mirror, ssoProtection preview-only). CLI: run vercel deploy --prod from monorepo root (gitignored .vercel/project.json links project) so rootDirectory does not double-resolve.
  • execute_plan: done — Phase 1 (Core Engine): apps/nykaa-personalisation built, Neon DB ready, 5 API routes, affinity scoring live. Phase 2 (P2P & Conversions): PDP UI implemented with dynamic routing ([id]), ingest-event API enhanced for add_to_cart tracking. Update: Fixed missing backend agent logic by adding GET /api/catalog/product/[id] route and refactoring PDP to use server-side fetch for foolproof integration.
    • deslop (issue-008): done — extracted duplicated scoreProduct into shared score-product.ts module.
    • review (issue-008): done — Fixed missing SHELF_CLICK tracking and reduced latency in rerank route.
    • qa_test (issue-008): done — PASS. 2 medium UX issues fixed. Results saved to experiments/results/qa-test-008.md.
    • metric_plan (issue-008): done — metric-plan-008.md created. North Star: Add-to-Cart Rate Lift (+10% target).
    • deploy_check (issue-008): done — APPROVED. Sentry configured, PR #7 created.
    • postmortem (issue-008): done — 5 systemic issues identified. Root cause: architecture under-specification. Result saved to experiments/results/postmortem-008.md.
    • learning (issue-008): done — 4 engineering rules extracted. knowledge/engineering-lessons.md updated. CODEBASE-CONTEXT.md written. Full pipeline cycle for issue-008 complete.
  • deslop: done — 9 restatement comments removed, 1 dead prop removed, PostHog events parallelised
  • review (issue-009): done — Historical cycle review caught and fixed parser API drift, auth/ownership gaps, missing perceived spend persistence, dead PostHog singleton reuse, cron failure accounting, and score page cleanup issues. These findings remain historically valid, but current auth/storage terminology in the repo should be read through the current Neon-based implementation.
  • peer-review (issue-009): done — Historical cycle peer review verified dashboard rehydration, fail-closed statement persistence, worker failure propagation, and recap pagination. Current app still preserves those repaired behaviors, now on the Neon stack.
  • qa_test (issue-009): done — PASS. Historical cycle QA fixed env var naming and Web Share rendering issues. Current MoneyMirror repair pass extends automated validation to 39 tests and keeps .env.local.example aligned with actual process.env.* usage.
  • deploy_check (issue-009): done — APPROVED. Historical deploy-check notes that mention Supabase SQL Editor are outdated relative to the current Neon Postgres app. Current local setup should apply schema.sql to Neon and use app-local vercel.json for recap scheduling.
  • postmortem (issue-009): done — 7 systemic issues identified across 5 agents. Root cause pattern: 6/7 issues trace to execute-plan output gaps (under-specified architecture, incomplete cross-verification, no file-size budget during generation). Recurring failure: parent/child write atomicity (2nd consecutive cycle). Agents requiring prompt updates: backend-architect-agent (3 checklist items), backend-engineer-agent (2 hard rules), code-review-agent (1 caller-verification check), execute-plan command (3 additions), qa-agent (1 env var dimension). Result saved to experiments/results/postmortem-009.md.
  • learning (issue-009): done — 7 engineering rules extracted and written to knowledge/engineering-lessons.md. Prompt library updated (knowledge/prompt-library.md). Agent files updated: backend-architect-agent.md (items 10–12: rehydration path, write atomicity, fan-out HTTP contract), backend-engineer-agent.md (auth caller verification + file size budget), code-review-agent.md (authenticated route caller check + parent/child write sequence check), qa-agent.md (env var key name cross-check dimension), commands/execute-plan.md (env var grep step, read/write path checkpoint, third-party library API verification, file size budget section). CODEBASE-CONTEXT.md written to apps/money-mirror/. Full pipeline cycle for issue-009 complete.
  • linear_close (issue-009): done — Linear project set to Completed. VIJ-11 set to Done. Closeout snapshot document created (https://linear.app/vijaypmworkspace/document/issue-009-closeout-snapshot-aee923543aa2). Final closeout comment posted on VIJ-11. linear_last_sync: 2026-04-03T08:29:07Z. linear_sync_status: success.
  • peer_review: done — all items fixed; EC1 localStorage guard on ControlGroupSimulator, PA1 split test/control orders in North Star section, RR1 DEMO_SECRET header on reorder-events, AC1 reminder_sent=false filter on dashboard query, AC2 DO NOTHING write-once cohort. Build clean.
  • qa_test: done — PASS. 2 medium findings (QA1: reminders/opened unguarded DB call, QA2: PostHog failure causes worker 500 + undercount). No high-risk blockers. Fix QA1+QA2 before demo run. Results saved to experiments/results/qa-test-006.md.
  • metric_plan: done — metric-plan-006.md created. North Star: 21-day repeat purchase rate lift (test vs. control, +10pp target). 7 events verified wired. 3 missing error-path events flagged for production. Ground-truth queries defined against reorder_events + experiment_cohorts tables.
  • deploy_check: done — APPROVED. README created, .env.local.example completed (added DEMO_SECRET, NEXT_PUBLIC_DEMO_SECRET, EXPERIMENT_END_DATE). QA1+QA2 verified fixed. Build clean (TypeScript, 9 routes, 1.35s). Manual step: apply schema.sql in Neon SQL Editor before first deploy. Result saved to experiments/results/deploy-check-006.md.
  • postmortem: done — 7 systemic issues identified across 4 agents. Key rules: worker endpoint auth required at architecture stage, single emission source for North Star events, orderId-as-DB-key fidelity, localStorage+DB deduplication for simulation tools, PostHog Promise.allSettled with per-call catch in workers, README+.env.local.example as execute-plan deliverables (not deploy-check fixes), error-path telemetry required during execute-plan. Prompt autopsy targets: execute-plan (single emission, telemetry resilience, error-path events), backend-architect-agent (worker auth, URL ID fidelity, simulation idempotency), peer-review-agent (demo simulation tool reload guard), qa-agent (telemetry unavailability failure simulation). Result saved to experiments/results/postmortem-006.md.
  • learning: done — 7 engineering rules extracted. knowledge/engineering-lessons.md and knowledge/prompt-library.md updated. Agent files updated: backend-architect-agent.md (items 4–7 in Mandatory Pre-Approval Checklist), peer-review-agent.md (Step 5 simulation idempotency + URL ID fidelity checks), qa-agent.md (Telemetry Unavailability Test + Failure Telemetry Verification), code-review-agent.md (PostHog dual-emission critical check), commands/execute-plan.md (Sections 6–8). CODEBASE-CONTEXT.md written to apps/ozi-reorder/. Full pipeline cycle for issue-006 complete.

MoneyMirror PM roadmap — Linear map (parent VIJ-11)

All items sit in Linear project issue-009 — MoneyMirror. Feature work for Sprints 1–3 and Epics A–H is Done in repo; issues record scope and traceability.

Sprints (suggested ordering from plan)

Sprint Linear Status Scope (plan)
Sprint 1 VIJ-26 Done Epic A + B
Sprint 2 VIJ-27 Done Epic C + D
Sprint 3 VIJ-28 Done Epic E + F (F1–F2)
Sprint 4 / Backlog VIJ-25 Duplicate → VIJ-37 (Phase 3) F3, G2–G3, H3 merged into issue-010 T1–T4 (2026-04-05)

Epics A–H

Epic Linear Status Notes
A — Date polish VIJ-29 Done
B — Dashboard shell VIJ-30 Done
C — Statement library VIJ-31 Done
D — Filters / month VIJ-32 Done D3 compare months → backlog
E — Insights surface VIJ-33 Done
F — Wasteful spend VIJ-34 Done F3 → Phase 3 VIJ-40/VIJ-41 (was VIJ-25)
G — Multi-account VIJ-35 Done G1 shipped; G2–G3 → Phase 3 VIJ-39 (was VIJ-25)
H — Coaching tone VIJ-36 Done H1 doc; H2–H3 → Phase 3 VIJ-41 / T5 (was VIJ-25)

Roll-up + ops

Item Linear Status
Phase 2 delivery summary VIJ-23 Done
Neon ALTER for label columns VIJ-24 Done (2026-04-05)

Pending Queue

  • VIJ-25: Duplicate of VIJ-37 (2026-04-05) — Sprint 4 F3/G2–G3/H3 merged into Phase 3; see VIJ-25 description for mapping to VIJ-38–VIJ-41. Active backlog: project issue-010 + children.
  • Credit card PDF smoke follow-up: categorisation can still skew high "Other" — rolls into VIJ-40 / VIJ-41 (merchant + AI tracks), not a separate VIJ-25 card.
  • Optional: confirm Neon Auth redirect / allowed origins for production OTP if sign-in fails (dashboard)

Blockers

  • (none)

Decisions Log (append-only)

  • 2026-04-10: [hotfix] Dashboard 500 post-Gmail-sync — Root cause confirmed via systematic RCA: ZodError in layerAFactsSchema (coaching-facts.ts:31) — 'gmail_sync' not in enum. PM decisions: (1) fix the Zod enum to accept gmail_sync; (2) exclude gmail_sync statements from legacy dashboard auto-select so Gmail synthetic statements never displace PDF uploads as the primary dashboard view; (3) update schema-upgrades.ts constraint for new deployments; (4) fix run-sync.ts copy-paste observability bug. ?state= URL param confirmed red herring. All 5 fixes applied as post-cycle hotfix outside the pipeline. Commit adca1a1.
  • 2026-04-07: /linear-close issue-012 — Finalized Linear closure for VIJ-52: project issue-012 confirmed Completed, root issue confirmed Done with labels Improvement + Completed, closeout document issue-012 Closeout Snapshot created, and final closeout comment 55b267c0-2010-489e-b6b3-fbc317159d16 posted. Updated experiments/linear-sync/issue-012.json (last_sync_mode: close) and repo Linear sync metadata.
  • 2026-04-07: /linear-sync status issue-012 (learning complete) — Synced final repo stage to Linear: project issue-012 set to Completed (summary/description refreshed with postmortem + learning artifacts), root VIJ-52 set to Done with labels Improvement + Completed (replacing Review/Release-Ready stage labels due Linear label-group exclusivity). Posted status comment e3058150-8cd0-46ee-8b06-bed15234a44f. Sync map experiments/linear-sync/issue-012.json updated (last_sync_mode: status, repo_stage: learning, repo_status: completed). Repo pipeline stage unchanged.
  • 2026-04-07: /learning issue-012 — Converted postmortem-012.md into durable system updates. Appended engineering lessons (aggregate drill-through fidelity; non-2xx completion-state correctness), product lesson (canonical event dictionary requirement), and prompt-library process patterns (acceptance sweep + canonical event mapping). Prompt Autopsy applied directly to agents/backend-engineer-agent.md, agents/frontend-engineer-agent.md, agents/code-review-agent.md, agents/deploy-agent.md, agents/analytics-agent.md, plus commands/deploy-check.md fallback/optionality rules. apps/money-mirror/CODEBASE-CONTEXT.md refreshed with issue-012 schema/API/key-file context. Stage remains learning, status set to completed. Cycle complete.
  • 2026-04-07: /postmortem issue-012 — Created experiments/results/postmortem-012.md. Findings: no release-blocking failures remained after deploy-check approval, but review required three passes due late semantic fixes (ownership checks, aggregate drill-through fidelity, non-2xx completion behavior). Added prompt-autopsy actions for backend-engineer-agent, frontend-engineer-agent, code-review-agent, deploy-agent/commands/deploy-check.md, and analytics-agent. Pipeline advanced to learning / ready. Next command: /learning.
  • 2026-04-07: /deploy-check issue-012 finalization — PM confirmed Gate 0 manual smoke in-session (dev server/login OTP/onboarding/upload flow/no 500 regressions). Updated experiments/results/deploy-check-012.md verdict to APPROVE deployment readiness. Pipeline advanced to postmortem / ready. Next command: /postmortem.
  • 2026-04-07: /deploy-check issue-012 follow-up (technical unblock pass) — Cleared prior deploy blockers by (1) adding explicit optional marker for WHATSAPP_API_URL/WHATSAPP_API_TOKEN in apps/money-mirror/.env.local.example, (2) running npm --prefix apps/money-mirror run db:upgrade, and (3) verifying target Neon tables via information_schema.tables now include guided_review_outcomes plus all prior tables. Updated experiments/results/deploy-check-012.md. Remaining blocker is only Gate 0 PM manual smoke confirmation.
  • 2026-04-07: /deploy-check issue-012 — Gate result BLOCK. Added artifact experiments/results/deploy-check-012.md. Build passed (npm --prefix apps/money-mirror run build), README quality gate passed, and Sentry wiring checks passed. Blockers recorded: (1) Gate 0 manual smoke not confirmed in this run, (2) target DB schema verification unresolved for guided_review_outcomes because Neon MCP auth was skipped and no explicit confirmation was provided, (3) .env.local missing WHATSAPP_API_URL / WHATSAPP_API_TOKEN while present in .env.local.example without explicit optional marker. Stage set to deploy_check / blocked; next action is unblock and rerun /deploy-check.
  • 2026-04-07: /qa-test issue-012 — QA gate PASS; created experiments/results/qa-test-012.md. Validation: npm --prefix apps/money-mirror test32/32 files, 159/159 tests; focused issue-012 run __tests__/api/frequency-clusters.test.ts, __tests__/api/guided-review-outcome.test.ts, src/app/dashboard/__tests__/InsightsPanel.test.tsx, src/components/__tests__/GuidedReviewSheet.test.tsx19/19. Revalidated guided-review retry behavior on non-2xx, frequency-cluster aggregate coverage, and .env.local.example parity with active process.env.* usage. Pipeline stage set to qa_test / completed. Next: /linear-sync status then /metric-plan.
  • 2026-04-07: /linear-sync status issue-012 — Mirrored peer-review rerun PASS to Linear: project issue-012 summary/description updated to peer-review complete and next /qa-test; root VIJ-52 kept In Review with labels Improvement + Review and refreshed artifact/gate section; status comment 5dc3a28b-9723-4371-9dca-40cd8bcfe3f5 posted. Sync map experiments/linear-sync/issue-012.json updated (last_sync_mode: status, gate_result: pass). Repo stage unchanged (peer_review / completed). Next: /qa-test.
  • 2026-04-07: /peer-review issue-012 rerun — Updated experiments/results/peer-review-012.md to APPROVED after verifying prior blockers are fixed in code: (1) POST /api/guided-review/outcome now nullifies commitment_text on dismissed=true server-side, (2) frequency clusters now use full-scope SQL aggregates (fetchClusterMerchantAggregates) rather than top-N sampling. Also confirmed scope-change reset for dashboard SLA timers. Pipeline gate peer_review marked PASS; next /linear-sync status then /qa-test.
  • 2026-04-07: /review issue-012 — Pass 3 (Codex / GPT-5) — Updated experiments/results/review-012.md to PASS (passes_logged: 3). Verified HIGH blocker fix: GuidedReviewSheet now requires response.ok before completion; non-2xx/network failures keep Step 3 visible with retryable inline alert. Regression test added at src/components/__tests__/GuidedReviewSheet.test.tsx. Focused verification: npm --prefix apps/money-mirror run test -- src/components/__tests__/GuidedReviewSheet.test.tsx __tests__/api/guided-review-outcome.test.ts __tests__/api/frequency-clusters.test.ts src/app/dashboard/__tests__/InsightsPanel.test.tsx19/19 passing. Pipeline stage remains review with status ready; next command /peer-review.
  • 2026-04-07: /review issue-012 — Pass 2 (Codex / GPT-5) — Updated artifact experiments/results/review-012.md (passes_logged: 2). Verified pass-1 fixes: statement ownership check in POST /api/guided-review/outcome, cluster drill-through via merchant_keys in transactions URL/API, debit-only frequency aggregation, and advisory render-boundary timing emission. Focused tests: npm --prefix apps/money-mirror test -- __tests__/api/guided-review-outcome.test.ts __tests__/api/frequency-clusters.test.ts src/app/dashboard/__tests__/InsightsPanel.test.tsx 18/18. Remaining finding: 1 HIGH (GuidedReviewSheet marks non-2xx outcome responses as success). Pipeline remains review / blocked until fixed.
  • 2026-04-07: /linear-sync status issue-012 — Mirrored post–deslop state: Linear project issue-012 summary/description (next /review); root VIJ-52 In Review with AI Product OS/Review (replaces Execution). Comment d42d2f76-055a-412c-84fc-fa4979f34036. experiments/linear-sync/issue-012.json updated. Repo stage unchanged (review / ready). release not applicable (no new deploy-check).
  • 2026-04-07: /deslop issue-012 — Pre-review cleanup on execute-plan output: shared types for FrequencyClusterSection / InsightsPanel (FrequencyMerchantRow from dashboard-helpers, ClusterRollup from merchant-clusters); removed unused sheetRef from GuidedReviewSheet. Validation: npm test in apps/money-mirror 144/144. Pipeline stage → review / ready. /linear-sync status optional before /review per CLAUDE checkpoints.
  • 2026-04-07: /linear-sync plan issue-012 — Linear: project issue-012 state Planned; document issue-012 Plan Snapshot; root VIJ-52 Todo, labels Planning + Feature + Improvement, link to plan doc; 12 child issues VIJ-53VIJ-64 ([issue-012][T0.1][T2.4]), labels Feature + Execution. Sync map experiments/linear-sync/issue-012.json + manifest-012.json linear.tasks updated. project-state.md Links linear_last_sync / linear_sync_status updated. Next: /execute-plan T0.1.
  • 2026-04-07: /create-plan issue-012 — Delivered experiments/plans/plan-012.md (Product / Design / Backend / DB: T0 emotional UX + perf SLAs, T1 frequency + deterministic merchant clusters, T2 guided review + recap copy; metric→flow table; acceptance criteria) and experiments/plans/manifest-012.json (phases phase-t0phase-t1phase-t2, tasks, posthog_events, new table guided_review_outcomes). Pipeline stage → execute-plan / ready. Next: /execute-plan starting T0; /linear-sync plan for VIJ-52 per CLAUDE Linear checkpoints.
  • 2026-04-07: /create-issue issue-012 — Structured Enhancement from .cursor/plans/money_mirror_10x_issue_34a61725.plan.md. Artifact experiments/ideas/issue-012.md. /linear-bind: project issue-012 — Gen Z clarity loop (emotional UX, frequency, perf SLAs); root VIJ-52 Backlog (Discovery + Improvement). Sync map experiments/linear-sync/issue-012.json. project-state.md active issue → issue-012; stage explore / in-progress. CHANGELOG entry 2026-04-07. Next: /explore issue-012. Note: issue-011 /learning remains the closeout step for VIJ-43 when the PM runs it.
  • 2026-04-07: /linear-sync status issue-011 — Mirrored postmortem completion to Linear: project summary/description and VIJ-43 description updated with postmortem findings and next steps; status comment 9df64615-be78-47ef-b650-36e6bb921c6e posted on VIJ-43. Root issue intentionally remains In Review with Release Ready applied because repo stage is learning / ready, not closed. experiments/linear-sync/issue-011.json updated (last_sync_mode: status). Next: /learning.
  • 2026-04-07: /postmortem issue-011 — Artifact experiments/results/postmortem-011.md. Phase 4 closed successfully, but the postmortem recorded three systemic gaps: (1) chat funnel telemetry needs availability semantics because chat_query_submitted fires before chat availability is confirmed; (2) husky file-size enforcement surfaced only at PR automation time, blocking repo handoff after deploy approval; (3) architecture still allowed authenticated heavy-read throttle posture and soft-vs-true Gemini timeout abort semantics to remain advisory instead of explicitly declared. Prompt Autopsy targets: analytics-agent, backend-architect-agent, deslop-agent, code-review-agent, deploy-agent, and commands/deploy-check.md. Pipeline stage → learning / ready.
  • 2026-04-07: /linear-sync release issue-011VIJ-43: attached production (https://money-mirror-rho.vercel.app) and Vercel project (https://vercel.com/vijay-sehgals-projects/money-mirror) as issue links; release summary comment 6452a8fc-cbd6-4e3f-a9bd-c875b298e409 (PR URL still none per deploy-check-011). Release Ready label unchanged; issue In Review until /linear-close. experiments/linear-sync/issue-011.json updated (last_sync_mode: release). Next: /postmortem.
  • 2026-04-07: /linear-sync status issue-011 — Mirrored post–deploy-check state to Linear: VIJ-43 description updated (deploy-check APPROVE + artifact path + postmortem next steps); stage label Release Ready (exclusive group — replaces Review); project issue-011 summary + description updated. Status comment d626753a-3d98-4bce-b3b9-e7b98b130b9f on VIJ-43. experiments/linear-sync/issue-011.json updated (last_sync_mode: status, deploy_check_gate, last_sync_comment_id). Next: /postmortem.
  • 2026-04-07: /deploy-check issue-011 — Readiness APPROVE; artifact experiments/results/deploy-check-011.md. Build PASS; env audit PASS (required vars FILLED; PM Sentry DSN/org/project exempt); Neon information_schema verified all six tables from schema.sql after idempotent npm run db:upgrade (DB was initially missing user_merchant_aliases / merchant_label_suggestions until upgrade). README + Sentry gates PASS. Pipeline stage → postmortem / ready. /linear-sync release when PR is opened or promoted.
  • 2026-04-07: /linear-sync status issue-011 — Mirrored deploy-check readiness after /metric-plan: Linear project summary + description and VIJ-43 description updated (QA PASS both runs, metric-plan experiments/results/metric-plan-011.md); status comment af87af97-eadc-4cd1-abe9-aaaefa2ac70a on VIJ-43. experiments/linear-sync/issue-011.json updated. Next: /deploy-check.
  • 2026-04-07: /metric-plan issue-011 — Post-launch measurement plan recorded: experiments/results/metric-plan-011.md. North Star unchanged from issue-010 (repeat statement upload ≤60d). Phase 4 adds supporting metrics and funnels for merchant/UPI depth (merchant_rollup_clicked, alias/suggestion), bad-pattern advisories (client bad_pattern_advisory_*), chat (chat_query_submitted = attempted demand per QA; chat_response_rendered for successful turns), paywall (paywall_prompt_seen / upgrade_intent_tapped when enabled), proactive (whatsapp_opt_in_completed, push_subscription_granted), and heavy-read rate_limit_hit. Pipeline stage → deploy-check / ready. /linear-sync status recommended to mirror gate before /deploy-check.
  • 2026-04-07: /qa-test issue-011 — Run 2 (Codex / GPT-5) — QA PASS. Re-ran npm test in apps/money-mirror: 109/109 tests passing across 23 files in 7.02 s. Re-audited .env.local.example against current source/runtime keys and rechecked high-risk routes (/api/chat, /api/proactive/whatsapp-opt-in, /api/dashboard/compare-months, weekly recap cron paths). No new blocking defects. Non-blocking metric caveat retained: chat_query_submitted is emitted before the GEMINI_API_KEY availability check, so it should be interpreted in metric-plan as attempted chat demand, not guaranteed available chat volume. Artifact updated: experiments/results/qa-test-011.md. Pipeline stage → metric-plan / ready.
  • 2026-04-07: /qa-test issue-011 — Run 1 (Claude Sonnet 4.6) — QA PASS. 109/109 automated tests (23 files). All P4-A–P4-H epics verified. Env var audit: 0 missing (16/16). PostHog fire-and-forget: 100% compliant. Rate limits with Retry-After on all 4 heavy-read routes. P4-E advisory triggers confirmed. Peer-review non-blocking items resolved: CODEBASE-CONTEXT.md line 104 updated; chat_query_submitted skew noted for metric-plan. Artifact: experiments/results/qa-test-011.md (Run Log tracks per-model verdicts). Pipeline stage → qa-test / completed. Additional QA runs (different models) can append to Run Log in artifact before proceeding to /metric-plan.
  • 2026-04-07: /linear-sync status issue-011 — Mirrored review + peer-review gates to Linear: VIJ-43 status In Review, stage label Review (replaces Execution), description + quality-gate section; project issue-011 — MoneyMirror Phase 4 — merchant visibility & growth summary + description updated; comment b2f3efee-051f-4aa1-b213-db40f287a3f8 on VIJ-43. experiments/linear-sync/issue-011.json + linear_last_sync updated. Next: /qa-test.
  • 2026-04-07: /peer-review issue-011 — Adversarial peer review APPROVED; artifact experiments/results/peer-review-011.md. Pipeline stage → peer-review / completed; next /qa-test. Non-blocking follow-ups: document in-memory rate-limit semantics at scale; true Gemini abort for chat timeout path; align chat_query_submitted with chat availability for funnels; update CODEBASE-CONTEXT.md heavy-read limitation wording.
  • 2026-04-06: /linear-sync status issue-011 — Linear mirrored execute-plan completion. Project summary updated to “P4-A→P4-H complete in repo; next /deslop”. Root VIJ-43 description refreshed; child epics VIJ-48, VIJ-49, VIJ-51, VIJ-50 set Done (joining prior done VIJ-44–VIJ-47). Status comment posted (62427804-1317-450b-b329-4207652b0091). Sync map experiments/linear-sync/issue-011.json updated (last_sync_mode: status, timestamp 2026-04-06T09:00:59.137Z). Repo stage unchanged (execute-plan / completed).
  • 2026-04-06: /execute-plan issue-011 — P4-D/B/C/H closeout — Added proactive opt-in endpoints POST /api/proactive/whatsapp-opt-in (env-gated provider relay + telemetry-only stub fallback) and POST /api/proactive/push-subscription; Upload panel now has explicit retry CTA for failed parses; added facts-only POST /api/chat (scope-aware Layer A facts + bounded txn context + citation validation + daily rate limit events chat_*); introduced shared src/lib/rate-limit.ts and applied per-user heavy-read throttles to GET /api/dashboard, GET /api/transactions, and GET /api/insights/merchants with rate_limit_hit. README + .env.local.example updated (WhatsApp vars, chat/proactive APIs, golden PDF regression section). Validation: npm --prefix apps/money-mirror test (105/105), npm --prefix apps/money-mirror run lint, npm --prefix apps/money-mirror run build (Sentry sourcemap upload warning under sandbox only). Next: /deslop then /linear-sync status for VIJ-48/49/51/50.
  • 2026-04-06: /linear-sync status issue-011 — Mirrored latest execute-plan progress to Linear: project summary now includes P4-F shipped and next P4-D; root VIJ-43 description refreshed; child epic VIJ-47 set Done; status comment posted (c84133bd-b39a-49a2-be22-946fefa67223). Sync map experiments/linear-sync/issue-011.json updated (last_sync_mode: status, timestamp 2026-04-06T08:47:11.335Z, child_epics_marked_done now includes VIJ-47). Repo stage unchanged (execute-plan / in-progress).
  • 2026-04-06: /execute-plan issue-011 — P4-F (VIJ-47) — URL-synced dashboard tabs now persist ?tab= across nav/scope/statement changes; added GET /api/dashboard/compare-months (auth + scope parser + previous-window derivation) with shared src/lib/dashboard-compare.ts; dashboard payload includes month_compare and Overview renders MoM debit/credit deltas. Added tests: __tests__/api/compare-months.test.ts and src/app/dashboard/__tests__/dashboard-tab-params.test.ts. Validation: npm --prefix apps/money-mirror test (101/101), npm --prefix apps/money-mirror run lint, npm --prefix apps/money-mirror run build (Sentry sourcemap upload warning only under sandbox). Next: P4-D / VIJ-48 or /linear-sync status for VIJ-47.
  • 2026-04-06: /linear-sync status issue-011 — Project In Progress; summary updated (P4-A/E/G shipped, next P4-F). VIJ-44, VIJ-45, VIJ-46 set Done. VIJ-43 description refreshed; status comment posted. experiments/linear-sync/issue-011.json + linear_last_sync updated. Repo stage unchanged (execute-plan / in-progress). Next: /execute-plan P4-F / VIJ-47.
  • 2026-04-06: /execute-plan issue-011 — P4-G (VIJ-46)profiles.plan (free | pro, default free); GET /api/dashboard + POST /api/statement/parse return plan; PaywallPrompt on Overview after Money Mirror visible when NEXT_PUBLIC_PAYWALL_PROMPT_ENABLED=1; client PostHog paywall_prompt_seen / upgrade_intent_tapped; README Product Hunt section; user-plan.test.ts + parse tests updated. Next: P4-F / VIJ-47 or /linear-sync status for VIJ-46.
  • 2026-04-06: /linear-sync status issue-011 — Linear project In Progress; root VIJ-43 In Progress with Execution (+ Feature, Improvement); description + summary updated; status comment posted. experiments/linear-sync/issue-011.json + linear_last_sync updated. Repo stage unchanged (execute-plan / in-progress). Next: /execute-plan P4-G / VIJ-46 or continue implementation.
  • 2026-04-06: /execute-plan issue-011 — P4-E (VIJ-45) — Bad-pattern detection: bad-pattern-signals.ts thresholds; dashboard SQL aggregates (micro-UPI, repeat merchant, CC min-due); advisory-engine.ts triggers + cta metadata; GET /api/transactions?upi_micro=1; AdvisoryFeed + posthog-browser.ts (bad_pattern_advisory_*); coaching-facts Layer A rows; README + CHANGELOG. Tests 92/92. Pipeline execute-plan / in-progress. Next: P4-G / VIJ-46 or /linear-sync status for VIJ-45.
  • 2026-04-06: /execute-plan issue-011 — P4-A (VIJ-44) — Implemented Phase 4 merchant/UPI visibility v2: schema + schema-upgrades, UPI extraction on parse, GET|POST|DELETE /api/merchants/alias, POST /api/merchants/suggest-accept, weekly GET /api/cron/merchant-enrich + src/lib/merchant-label-enrich.ts (Gemini off upload path), transaction + rollup SQL joins for aliases/suggestions, UI (TxnRow, MerchantRollups). README + CHANGELOG updated. Tests 87/87. Pipeline stage execute-plan / in-progress (remaining epics P4-E–P4-H per manifest). Next: continue /execute-plan for P4-E or run /linear-sync status when ready to mirror gate progress on Linear VIJ-44.
  • 2026-04-06: /create-plan issue-011 — Delivered experiments/plans/plan-011.md + experiments/plans/manifest-011.json (PRD, UX, architecture, schema, per-epic AC, PostHog list). /linear-sync plan: Linear project Planned; document issue-011 Plan Snapshot; child epics VIJ-44 (P4-A), VIJ-45 (P4-E), VIJ-46 (P4-G), VIJ-47 (P4-F), VIJ-48 (P4-D), VIJ-49 (P4-B), VIJ-51 (P4-C), VIJ-50 (P4-H); root VIJ-43 description links plan + children. experiments/linear-sync/issue-011.json updated (last_sync_mode: plan). Quality gate create_plan: done. Pipeline stage execute-plan / in-progress; next /execute-plan from VIJ-44.
  • 2026-04-06: Linear production-readiness sync (post–VIJ-37) — Workspace has a single Linear team (Vijaypmworkspace); no separate “Market” team. Created VIJ-42 (Done) documenting post-close ops: gated launch checklist (production-launch-checklist-010.md), schema drift / db:upgrade / boot DDL, perf + Web Vitals + Playwright E2E, docs. Classified as ops + checklist + small bugfixes (e.g. db:upgrade main()), not a reopened Phase 3 feature cycle. Comment on VIJ-37 links VIJ-42. experiments/linear-sync/issue-010.json + this file updated; pipeline stage remains learning / completed.
  • 2026-04-06: E2E documentation + verification closeoutCODEBASE-CONTEXT.md refreshed for schema upgrades, pg-errors / SCHEMA_DRIFT, WebVitalsReporter, Playwright; README Docs links PERFORMANCE-REVIEW.md + SCHEMA-DRIFT.md; CHANGELOG.md entry with Learnings / corrections (db:upgrade main() vs top-level await; treating 42703 as schema drift with operator hint). Ran checklist commands: lint, vitest (81/81), Playwright install + test:e2e (2/2), repo check:all, npm run db:upgrade (success against Neon from .env.local). Issue-010 pipeline remains completed; no /linear-sync (no new issue).
  • 2026-04-06: MoneyMirror post-close ops + launch checklist — Repo updates: next/font, lazy Gemini/Insights path, scope-keyed dashboard loads, WebVitalsReporter + optional NEXT_PUBLIC_POSTHOG_KEY, Playwright smoke E2E, viewport zoom, dev-only transaction error detail, dev:loopback script + README note for uv_interface_addresses noise. Linear: comment on VIJ-37 with summary and links to apps/money-mirror/docs/PERFORMANCE-REVIEW.md + experiments/results/production-launch-checklist-010.md. Pipeline stage for issue-010 remains completed; this is operations / hardening, not a new pipeline cycle.
  • 2026-04-05: /create-issue issue-011 — MoneyMirror Phase 4 umbrella (Enhancement). Artifact experiments/ideas/issue-011.md. Linear: project issue-011 — MoneyMirror Phase 4 — merchant visibility & growth (69fcb02f-fd81-47a1-9997-16939b49c590); root VIJ-43 Backlog, labels Discovery + Improvement. Sync map experiments/linear-sync/issue-011.json (last_sync_mode: bind). project-state.md active issue → issue-011; stage create_issue / in-progress. CHANGELOG entry 2026-04-05. Next: /explore issue-011.
  • 2026-04-05: /linear-close issue-010 — Linear project Completed (418bfd75-bf67-47e1-8cb3-dd48c6bd9cb3); VIJ-37 + VIJ-38–VIJ-41 set Done; issue-010 Closeout Snapshot; final closeout comment on VIJ-37. experiments/linear-sync/issue-010.json: last_sync_mode close, closeout_snapshot id recorded. /create-issue when starting the next cycle.
  • 2026-04-05: /learning issue-010 — Converted postmortem-010.md into durable rules: knowledge/engineering-lessons.md (6 entries), knowledge/product-lessons.md (1 entry), knowledge/prompt-library.md (issue-010 section). Prompt Autopsy applied to agent/command files (dated # Added: 2026-04-05 — MoneyMirror Phase 3 (issue-010)). CODEBASE-CONTEXT.md updated. Stage learning / status completed. Next: /linear-close (completed same day).
  • 2026-04-05: /postmortem issue-010 — Artifact experiments/results/postmortem-010.md. Root pattern: correctness and scope-semantics gaps caught late in /review (two passes); architecture should state financial aggregate invariants and scope-neutral copy defaults. Prompt Autopsy targets: backend-architect, backend-engineer, code-review, frontend-engineer, product/design, deploy-check. Next: /learning per system-orchestrator.md.
  • 2026-04-05 (revised): /deploy-check issue-010 — Verdict APPROVE readiness. experiments/results/deploy-check-010.md updated: PM excludes NEXT_PUBLIC_SENTRY_DSN, SENTRY_ORG, SENTRY_PROJECT from blocking env check; .env.local.example + README aligned. Neon schema verified live (four public tables). Automated smoke: next dev -H 127.0.0.1, / /login /dashboard → 200, /api/cron/weekly-recap → 401. Next: /postmortem then /learning per system-orchestrator.md.
  • 2026-04-05: /deploy-check issue-010 — Verdict BLOCK. Artifact experiments/results/deploy-check-010.md. Build OK; README updated with /api/auth/[...path] and GET /api/sentry-example-api. Blockers: empty Sentry-related values in local .env.local; dirty git tree (no gh pr create). Stage set to deploy_check / blocked. /postmortem deferred until deploy-check passes per system-orchestrator.md.
  • 2026-04-05: /linear-sync status issue-010 — VIJ-37 description refreshed (pipeline through /metric-plan ✅, link to metric-plan-010.md); project summary set to metric_plan → /deploy-check; status comment posted. Sync map + linear_last_sync updated.
  • 2026-04-05: /metric-plan issue-010 — North Star locked to repeat statement upload within 60 days (cohort), with Phase 3 trust proxy and PostHog event map in experiments/results/metric-plan-010.md. Next pipeline step: /deploy-check.
  • 2026-03-05: Chose PostgreSQL via Supabase because relational model fits users → digests → processed_emails structure
  • 2026-03-05: Chose monolith + cron worker over microservices because MVP speed is the priority
  • 2026-03-05: Excluded reply-from-WhatsApp from MVP because it adds OAuth write scope complexity and is not needed to validate core hypothesis
  • 2026-03-05: [project closed] AI PM Portfolio Generator — stage was create-issue, archived to run Gmail WhatsApp Notifier as active project
  • 2026-03-05: Built as single Next.js app (API routes + frontend + cron endpoint) instead of splitting across Vercel + Railway for MVP simplicity
  • 2026-03-05: Used lazy Supabase client via Proxy to allow builds without env vars present
  • 2026-03-06: Fixed review items — encrypted OAuth tokens (AES-256-GCM), mandatory cron auth, batched Gmail API, parallel cron processing, bounded processed_emails query, Google token revocation on disconnect
  • 2026-03-06: Fixed round-2 review items — OAuth CSRF state param, cron error propagation (throw + 500), frequency validation on cron endpoint, JWT fallback removal + lazy init
  • 2026-03-06: Peer review must-fix items — E1 (conditional refresh token upsert), A1 (RLS policies on all tables), S1 (processed_emails TTL cleanup via pg_cron + app-level)
  • 2026-03-07: Performed second round of adversarial /peer-review yielding new issues S1 (Serverless timeout), E1 (Failed summaries loop), R1 (Twilio failed send user pausing), R2 (SPOF API), and A1 (Synchronous batch cron execution). Result saved to experiments/results/peer-review-2.md
  • 2026-03-07: Fixed PR 2 blockers — implemented decoupled worker API for parallel individual user crons, added permanent error detection for Twilio to prevent false-pausing, and added fallback mock digests for when Gemini AI fails completely.
  • 2026-03-07: Performed manual /qa-test yielding two high risks: Infinite Pagination Loop leading to Vercel timeouts and Shallow Email Context (snippet only). Result saved to experiments/results/qa-test.md.
  • 2026-03-07: Fixed QA blockers — capped Gmail pagination to 5 pages with newer_than:30d, and extracted full text/plain body payloads to improve AI context.
  • 2026-03-07: Re-ran /qa-test validation. High-risk blockers verified fixed. Proceeding to /metric-plan.
  • 2026-03-07: Executed /metric-plan. Defined 'Daily Summary Read Rate' as the North Star. Outlined PostHog integration and Twilio Webhooks to track the Core Onboarding and Daily Engagement funnels. Result saved to experiments/results/metric-plan.md.
  • 2026-03-07: Executed /deploy-check validation. High-risk failures detected: Supabase DB schema is not initialized and PostHog/Twilio webhooks are missing. Result saved to experiments/results/deploy-check.md.
  • 2026-03-07: Fixed deployment blockers. Applied schema.sql logic manually via Supabase editor, mitigating the schema deficit. Added posthog-js locally for web events (landing_page_view) and posthog-node for server-side metrics (digest_sent, setup_completed). Ready to re-run /deploy-check.
  • 2026-03-07: Re-ran /deploy-check validation. Production NextJS compilation successful with Database and Telemetries properly bundled. Finalized deployments and advanced to /postmortem.
  • 2026-03-07: Executed /postmortem. Analyzed infinite loops, telemetry failures, and single-point-of-failure deployment architecture. Outlined overarching system rules on Async Fan-outs and upfront PostHog integrations. MVP marked completed. Result saved to experiments/results/postmortem.md.
  • 2026-03-07: Executed /learning. Extracted 6 engineering rules and 3 product rules from postmortem and result files. Written to knowledge/engineering-lessons.md, knowledge/product-lessons.md, and knowledge/prompt-library.md. Full pipeline cycle for issue-002 complete.
  • 2026-03-08: AI Personal Finance Advisor (issue-003) — Completed postmortem and learning execution. Extracted rules on serverless promise suspension, cron query batching, and UX fallbacks for media/0-spend. Full pipeline cycle for issue-003 complete.
  • 2026-03-11: Project Clarity (PM To-Do List MVP, issue-004) set as active project.
  • 2026-03-11: Completed /review for Clarity MVP. Applied critical limits (taskText max 500 chars, GET limit 100) and graceful UI error fallbacks to prevent abuse and handle Gemini potential failures.
  • 2026-03-11: Completed /peer-review for Clarity MVP. Implemented MUST-FIX items: added PUT endpoint for persistent state, and added fallback AI parsing to prevent data loss if Gemini returns invalid JSON.
  • 2026-03-11: Completed /qa-test for Clarity MVP. Validated system reliability against missing payloads, network drops, empty strings, and long initial load times. Results logged to experiments/results/qa-test-004.md.
  • 2026-03-11: Completed /metric-plan for Clarity MVP. Defined "Tasks Categorized per User" as North Star. Outlined PostHog integration linking frontend submission funnels with backend ai_latency_ms and fallback alerts. Results logged to experiments/results/metric-plan-004.md.
  • 2026-03-11: Completed /deploy-check. Verified Next.js production builds via npm run build and integrated PostHog telemetry across frontend (posthog-js) and backend (posthog-node). Approved for deployment.
  • 2026-03-11: Completed /learning. Extracted 4 engineering rules and 1 product rule. Full pipeline cycle for Project Clarity (issue-004) complete.
  • 2026-03-19: SMB Feature Bundling Engine (issue-005) created. Target user: B2B SaaS PM selling into Indian SMB market. Core hypothesis: custom feature bundle + value-based pricing proposal reduces deal cycle and inconsistent pricing.
  • 2026-03-19: Executed /explore for issue-005. Recommendation: Build. Problem is real and gap is unoccupied at the right weight class. Central risk: PM trust in AI-generated INR pricing proposals. MVP = feature selection board + Gemini structured output for price + pitch. Saved to experiments/exploration/exploration-005.md.
  • 2026-03-19: Executed /create-plan for issue-005. Architecture: single Next.js monolith, Neon DB (serverless PostgreSQL via @neondatabase/serverless), no auth. Gemini 2.5 Flash with structured output JSON schema for INR pricing + email pitch. 10-feature whitelist to prevent prompt injection. bundle_sessions table tracks selected_features + pitch_copied. PostHog for bundle_generated and pitch_copied events. 20-task implementation plan. Saved to experiments/plans/plan-005.md.
  • 2026-03-19: Chose Neon DB over Supabase because no auth is needed — Neon is lighter (connection string only, no client SDK, no RLS setup) and @neondatabase/serverless works natively in Vercel serverless functions via HTTP without a connection pool.
  • 2026-03-19: Executed /execute-plan for issue-005. Implemented full apps/smb-bundler Next.js app: FeatureBoard with 10-item catalogue, POST /api/generate-proposal (whitelist validation + Gemini 2.5 Flash structured output + Neon insert), PATCH /api/bundle-sessions/[id]/copied, PostHog server (bundle_generated) and client (pitch_copied) telemetry. DB failure non-blocking. All 20 tasks complete.
  • 2026-03-19: Executed /deslop for issue-005. No naming, complexity, hallucination, or standards violations found. Removed 11 restatement comments across gemini.ts, route.ts, EmailPitchCard.tsx, FeatureCard.tsx, page.tsx. Removed 1 dead guard (!disabled &&) from FeatureCard.tsx onClick. Ready for /review.
  • 2026-03-19: Executed /review for issue-005. Approved. No critical issues or architecture violations. 1 required fix before deploy: S1 rate limiting on /api/generate-proposal (Gemini cost abuse). Low items: Q1 roi_points length not validated, Q2 "unknown" sessionId contaminates PostHog, Q3 posthog.__loaded is internal API, P1 sequential DB+PostHog awaits (parallelisable). Proceeding to /peer-review.
  • 2026-03-19: Executed /peer-review for issue-005. BLOCKED. 3 must-fix items: RR1 (sessionId="unknown" fallback corrupts PostHog analytics and causes 400 on PATCH — fix: pre-generate crypto.randomUUID()), RR2 (no Gemini timeout — add AbortController 9s + JSON 504), PA3 ([First Name] literal placeholder in copied pitch with no UI affordance). Additional: S1 rate limiting still required. Result saved to experiments/results/peer-review-005.md.
  • 2026-03-19: Fixed all 4 peer-review blockers. RR1: pre-generate crypto.randomUUID() before DB insert in route.ts + db.ts accepts caller-supplied id. RR2: Promise.race with 9s timeout in gemini.ts, returns JSON 504 on timeout. PA3: amber warning note added to EmailPitchCard above pitch text. S1: in-memory rate limiter (5 req/60s per IP) added to route.ts. TypeScript clean. peer_review gate: approved.
  • 2026-03-19: Executed /qa-test for issue-005. BLOCKED. QA1 (required): silent clipboard failure in EmailPitchCard.tsx — empty catch block gives PM zero feedback if copy fails during live sales call. Additional findings: QA2 stale proposal visible after feature toggle (medium), QA3 sequential DB+PostHog awaits (medium), QA4-6 low severity items. Results saved to experiments/results/qa-test-005.md.
  • 2026-03-19: Fixed QA1 — clipboard copy now tries navigator.clipboard first, falls back to document.execCommand, and shows "Copy failed — please select manually" inline error with red button state if both fail. qa_test gate: approved.
  • 2026-03-19: Executed /metric-plan for issue-005. North Star: Pitch Copy Rate (>50% of sessions). Supporting: latency p95, Gemini failure rate, feature distribution in copied sessions, daily volume. 3 missing events before deploy: proposal_generation_failed, proposal_generation_timeout, proposal_generation_rate_limited. Ground-truth analytics via bundle_sessions.pitch_copied in Neon DB. Result saved to experiments/results/metric-plan-005.md.
  • 2026-03-19: Executed /postmortem for issue-005. 5 systemic issues identified. Root cause: architecture under-specification (backend-architect-agent missing Mandatory Pre-Approval Checklist). Key rules: rate limit unauthenticated paid-API endpoints at architecture stage, pre-generate sessionId before DB ops, AbortController ≤9s on all Gemini calls, clipboard fallback required, error-path telemetry required during /execute-plan. Prompt autopsy targets: backend-architect-agent (mandatory checklist), peer-review-agent (Step 4 exactness), execute-plan command (error-path telemetry requirement). Result saved to experiments/results/postmortem-005.md.
  • 2026-03-19: Executed /learning for issue-005. Extracted 4 engineering rules (rate limiting, sessionId ordering, Gemini timeout, clipboard fallback) and 1 process lesson. Written to knowledge/engineering-lessons.md, knowledge/prompt-library.md, knowledge/coding-standards.md. Agent files updated: backend-architect-agent.md (Mandatory Pre-Approval Checklist), peer-review-agent.md (Step 4 exactness), commands/execute-plan.md (Telemetry Completeness Requirement). CODEBASE-CONTEXT.md written to apps/smb-bundler/. Full pipeline cycle for issue-005 complete.
  • 2026-03-19: Executed /deploy-check for issue-005. Initially BLOCKED — 4 missing telemetry events (proposal_generation_failed, proposal_generation_timeout, proposal_generation_rate_limited, landing_page_viewed). Added all 4 events: 3 server-side in posthog.ts + wired into route.ts catch/timeout/rate-limit branches; landing_page_viewed via useEffect in page.tsx. Build passes clean (3.2s, TypeScript clean). Manual step: apply schema.sql in Neon SQL Editor before first deploy. APPROVED. Result saved to experiments/results/deploy-check-005.md.
  • 2026-03-20: Ozi Reorder Experiment (issue-006) created. Target user: parents of 0–3 year olds in Delhi-NCR; sub-segments: emergency, routine replenishment, first-time. Core hypothesis: timely reorder reminder (Day 18–20 post-delivery) + one-tap pre-filled cart repeat order will improve repeat purchase rate within 21 days by removing memory friction. Demo script created at experiments/demos/ozi-reorder-demo.md — 6-screen founder walkthrough with opening/closing narration.
  • 2026-03-20: Executed /explore for issue-006. Recommendation: Build. Problem confirmed — dark-store churn driven by absence of re-engagement, not delivery failure. Competitive gap: no quick-commerce player uses consumption-cycle-aware push timing. MVP: push trigger (Day 18–20 post order_delivered) + pre-filled cart deep link + 7 events + 50/50 control group. Saved to experiments/exploration/exploration-006.md.
  • 2026-03-21: Peer review pass 2 complete. APPROVED for QA. All 3 prior MUST FIX items verified fixed. New medium items: EC1 (ControlGroupSimulator non-idempotent across page refreshes — control conversions inflate), PA1 (getOrdersPlacedCount excludes control group — one-sided dashboard), RR1 (reorder-events unauthenticated — metric fabrication risk during demo). Two low items: AC1 (eligible orders dashboard shows processed orders), AC2 (write-once cohort footgun). Fix medium items before founder demo, not required for QA. Result saved to experiments/results/peer-review-006.md.
  • 2026-03-21: Fixed all peer-review blockers. RR1: created /api/orders/[orderId] route using getOrderByOrderId — reorder page now fetches by the specific triggering orderId. EC1: flipped markReminderSent before insertReminder to eliminate duplicate-reminder risk on partial DB failure. PA1: added ControlGroupSimulator component to dashboard — control-group users can simulate organic orders, firing control_order_placed to PostHog + DB. Also fixed medium items: S1 (DISTINCT ON user_id in getEligibleOrders), EC2 (localStorage deduplication for reminder_opened), RR2 (EXPERIMENT_END_DATE guard in reorder-trigger). Build clean. peer_review gate: approved.
  • 2026-03-21: Executed /qa-test for issue-006. PASS. No high-risk blockers. Core demo flow verified end-to-end. 2 medium findings: QA1 (reminders/opened route — no try/catch on markReminderOpened, unhandled 500 on invalid UUID), QA2 (worker PostHog failure throws from Promise.all — returns 500, trigger undercounts remindersSent even though DB state is correct). 3 low findings (fire-and-forget reminder_opened fetch, sequential insertMockOrders loop, funnel conversion denominator unlabeled). Fix QA1+QA2 before demo run. Results saved to experiments/results/qa-test-006.md.
  • 2026-03-21: Executed /metric-plan for issue-006. North Star: 21-day repeat purchase rate lift (test vs. control, +10pp target). Supporting: notification open rate (>25%), post-open conversion (>40%), cart→checkout (>60%), cron reliability (>98%), opt-out guardrail (<5%). All 7 events verified wired with correct properties and locations. Funnel: reminder_triggered → reminder_delivered → reminder_opened → cart_prefilled → checkout_started → order_placed. 3 missing error-path events identified for production (reminder_trigger_failed, cron_run_completed, experiment_ended). Ground-truth SQL queries defined. Result saved to experiments/results/metric-plan-006.md.
  • 2026-03-21: Executed /deploy-check for issue-006. Initially BLOCKED — README missing, .env.local.example missing DEMO_SECRET/NEXT_PUBLIC_DEMO_SECRET/EXPERIMENT_END_DATE. Fixed: created apps/ozi-reorder/README.md (all 9 required sections), updated .env.local.example with 3 missing vars. QA1+QA2 verified fixed in code. Build clean (TypeScript, 9 routes, 1.35s). Vercel cron configured (09:00 UTC daily). Schema.sql idempotent (5 tables). APPROVED. Manual step: apply schema.sql in Neon SQL Editor before first deploy. Result saved to experiments/results/deploy-check-006.md.
  • 2026-03-21: Executed /learning for issue-006. Extracted 7 engineering rules (worker auth, single emission source, URL ID fidelity, simulation idempotency, PostHog worker resilience, README deliverable, error-path telemetry). Written to knowledge/engineering-lessons.md, knowledge/prompt-library.md. Agent files updated: backend-architect-agent.md (items 4–7 added to Mandatory Pre-Approval Checklist), peer-review-agent.md (simulation tool idempotency + URL ID fidelity added to Step 5), qa-agent.md (Telemetry Unavailability Test + Failure Telemetry Verification added to Step 3), code-review-agent.md (PostHog dual-emission check added to Step 4), commands/execute-plan.md (Single Emission Source Rule + expanded Telemetry Completeness + Execute-Plan Completion Checklist added as Steps 7–8). CODEBASE-CONTEXT.md written to apps/ozi-reorder/. Full pipeline cycle for issue-006 complete.
  • 2026-03-21: Executed /postmortem for issue-006. 7 systemic issues identified. Root causes: missing worker auth at architecture spec level, no single-emission-source rule for North Star events, URL ID lookup fidelity not enforced in architecture, component-state-only idempotency on simulation tools, PostHog calls in Promise.all without per-call catch, README/env as deploy-check retrofits instead of execute-plan deliverables (3rd consecutive cycle), error-path telemetry consistently absent. Prompt autopsy targets: execute-plan command (3 fixes), backend-architect-agent (3 fixes), peer-review-agent (1 fix), qa-agent (1 fix). Result saved to experiments/results/postmortem-006.md.
  • 2026-03-21: Executed /peer-review for issue-006. BLOCKED. 3 must-fix items: RR1 (orderId in deep link is decorative — page fetches last-essential by userId instead of the specific order, wrong product shown if user has newer essential order), EC1 (insertReminder + markReminderSent sequential without transaction — partial failure causes duplicate reminder on next cron run), PA1 (control group has no conversion measurement path — control_order_placed event exists in schema/API but nothing emits it, North Star unmeasurable). Medium: S1 (multi-SKU users get duplicate reminders — no per-user deduplication), EC2 (reminder_opened inflates on page refresh), RR2 (no experiment end date guard). Result saved to experiments/results/peer-review-006.md.
  • 2026-03-21: Executed /review for issue-006. BLOCKED. 2 critical issues: C1 (worker endpoint unprotected — anyone can corrupt cohort/reminder data), C2 (order_placed fires twice — server via /api/reorder-events + client useEffect — corrupts North Star metric). Medium: Q1 (reminder_opened fires for null reminderId). Low: Q2 (insertCronRun outside try/catch), Q3 (hardcoded demo orderId). Pre-production: S1 (userId from URL, no ownership check). Must fix C1 and C2 before proceeding.
  • 2026-03-21: Executed /deslop for issue-006. No naming, complexity, or hallucination violations. Removed 9 restatement comments across reorder-trigger, reorder-worker, reorder/[orderId]/page.tsx, ReorderProductCard.tsx, and page.tsx. Removed unused skuCategory prop from ReorderProductCard (dead code). Parallelised independent PostHog event calls in reorder-worker (Promise.all). Build clean. Ready for /review.
  • 2026-03-20: Executed /execute-plan for issue-006. Built apps/ozi-reorder Next.js app: experiment dashboard (cohort split, funnel stats, eligible orders table, cron run log, "Run Trigger Now" button), POST /api/reorder-trigger (cron master, LIMIT 500, Promise.allSettled fan-out), POST /api/reorder-worker (deterministic cohort assign, reminders_sent insert, reminder_triggered + reminder_delivered PostHog events), GET /api/order-history/[userId]/last-essential, POST /api/reorder-events, /reorder/[orderId] page (reminder_opened, cart_prefilled, checkout_started, order_placed events), POST /api/seed with 15 mock baby essential orders (Pampers, MamyPoko, Huggies, Himalaya, Johnson's). All 7 PostHog events wired. Neon DB with 5 tables. TypeScript clean, build passes (8 dynamic routes). Decision: Option B for both trigger (cron fan-out) and repeat order path (lightweight reorder screen).
  • 2026-03-20: Executed /create-plan for issue-006. Architecture: experiment instrumentation layer (not standalone app). Two Option A/B decision gates: (1) trigger — event-based workflow tooling vs. cron fan-out; (2) repeat order path — pre-filled cart deep link vs. lightweight /reorder/:orderId screen. 4 new DB tables (experiment_cohorts, reminders_sent, reorder_events, cron_runs). 7 required PostHog events. 25 implementation tasks. North Star: 21-day repeat purchase rate test vs. control (+10pp target). Decision gate with Ozi engineering required before sprint start. Saved to experiments/plans/plan-006.md. Demo Screen 4 updated with Option A/B framing. Recommendation: Build. Problem is real and confirmed — dark-store churn is driven by absence of re-engagement, not delivery failure. Competitive gap: no quick-commerce player uses consumption-cycle-aware push timing. Primary risks: push infra event-trigger capability and pre-filled cart deep link feasibility must be confirmed with Ozi engineering before sprint scope is committed. MVP: push trigger (Day 18–20 post order_delivered) + pre-filled cart deep link + 7 events + 50/50 control group. Saved to experiments/exploration/exploration-006.md. Target user: parents of 0–3 year olds in Delhi-NCR; sub-segments: emergency, routine replenishment, first-time. Core hypothesis: timely reorder reminder (Day 18–20 post-delivery) + one-tap pre-filled cart repeat order will improve repeat purchase rate within 21 days by removing memory friction. Demo script created at experiments/demos/ozi-reorder-demo.md — 6-screen founder walkthrough with opening/closing narration.
  • 2026-03-27: Executed /create-plan for issue-008. Architecture: Next.js 16 (App Router), Neon DB (serverless PostgreSQL), rule-based scoring engine (0.6 affinity + 0.4 intent). 3 tables (experiment_cohorts, user_affinity_profiles, session_events). 4 API routes. Deterministic SHA-256 A/B cohort split. 10 PostHog events. 12 implementation tasks. Saved to experiments/plans/plan-008.md + experiments/plans/manifest-008.json.
  • 2026-03-27: Executed /execute-plan for issue-008. Built apps/nykaa-personalisation: Neon DB project created (fancy-morning-92870210), 3 tables + 5 indexes applied. 5 API routes (GET shelf, POST ingest-event, GET rerank, POST rebuild-affinity, POST seed). 4 services (CohortService with SHA-256 cohort, PersonalisationService, RerankEngine, AffinityBuilder). Frontend: ForYouShelf with 500ms timeout fallback, ShelfSkeleton, ProductCard, useIntentTracker (sessionStorage FIFO + async ingest), demo user switcher (5 users with different affinities), search page with re-ranking + personalised badge. PostHog: 10 events wired (5 server-side, 5 client-side), all with single emission source. Rate limiting on shelf + rerank routes. Auth: base64 JWT for user routes, CRON_SECRET for admin routes. TypeScript clean, npm run build passes. README.md + .env.local.example created. Database choice: Neon DB over Supabase (no auth SDK needed, lighter setup).
  • 2026-03-28: Executed /review for issue-008. Approved with 2 fixes committed: 1 critical bug fixed (missing shelf_click event added to ingest-event server route per single source rule) and 1 performance improvement (parallelized catalog search and cohort lookup in rerank route). Dual-emission check passed. SQL injection safe via parameterized queries. Proceeding to peer-review.
  • 2026-03-21: [ARCHIVED] issue-007 (Order Reliability & Support Escape Hatch) — explored for demonstration purposes only. No sprint committed, no app built. Artifacts preserved: experiments/ideas/issue-007.md, experiments/exploration/exploration-007.md. Pipeline reset to idle.
  • 2026-03-28: Executed /peer-review round 2 for issue-008. APPROVED. All 6 prior findings verified fixed: RR1 (AffinityBuilder batched Promise.allSettled), EC1 (AB_EXPERIMENT_SALT server-only), AC1 (fire-and-forget PostHog in user-facing routes), EC2 (search reads ?user= param), EC3 (control returns 'default'), RR2 (ingest-event rate limited). Challenge mode: no new blocking assumptions. 2 low items noted: L1 (rerank still returns real cohort label vs shelf's 'default'), L2 (EDITORIAL_PRODUCTS positional slice undocumented). Ready for /qa-test. Result saved to experiments/results/peer-review-008-r2.md.
  • 2026-03-28: Executed /peer-review for issue-008. BLOCKED. 3 must-fix items: RR1 (AffinityBuilder sequential processing — will timeout at scale, needs batched SQL or Promise.allSettled), EC1 (NEXT_PUBLIC_AB_EXPERIMENT_SALT exposes A/B salt to client — rename to server-only), AC1 (PostHog await flush() in user-facing routes adds 200-500ms latency, causes false client-side timeouts corrupting experiment measurement — make fire-and-forget). Medium: EC2 (search page ignores homepage user selection), EC3 (control cohort label exposed in API response), RR2 (ingest-event has no rate limiting). Result saved to experiments/results/peer-review-008.md.
  • 2026-03-21: Executed /explore for issue-007. Recommendation: Build. Problem confirmed — compound trust failure (ghost-support 86% abandonment + no cancel button) is entirely product-fixable. Competitive scan: delay alerts and in-window cancel are now category standard (Blinkit, Swiggy Instamart) but no competitor solves post-dispatch escape. Unserved gap: honest delay alert + cancel request after dispatch. MVP: in-app delay alert (>15 min past ETA) + cancel-as-ops-queue-request + WhatsApp deep link escalation. Pre-sprint dependencies: ops cancel policy + order status API access. Do not wait — build demo with simulated delay state in parallel. Saved to experiments/exploration/exploration-007.md.
  • 2026-03-21: Executed /create-issue for issue-007. Source: Play Store scrape (85 reviews, 18×1★) + 30 synthetic Freshdesk tickets (apps/ozi-insights/data/freshdesk-synthetic.json). Analysis: support-ghost priority score 26.9 (#1), delivery-delay 23.2 (#2), compound failure identified (86% ghost rate, 14% resolution rate on support tickets). Issue: Order Reliability & Support Escape Hatch. Hypothesis: proactive delay alert + self-serve cancel/reschedule + non-chat escalation breaks the UX trap that converts every late delivery into a 1-star churn event.
  • 2026-03-21: Executed /learning for issue-006. 7 engineering rules extracted and written to knowledge/engineering-lessons.md + knowledge/prompt-library.md. Agent files updated: backend-architect-agent.md (Mandatory Pre-Approval Checklist items 4–7: worker auth, URL ID fidelity, simulation idempotency, North Star comparison display), peer-review-agent.md (Step 5: simulation tool idempotency check + URL ID fidelity check), qa-agent.md (Error Scenario Testing: Telemetry Unavailability Test + Failure Telemetry Verification), code-review-agent.md (Security Review: PostHog dual-emission critical check), commands/execute-plan.md (Section 6 telemetry resilience + error-path events, Section 7 single emission source rule, Section 8 completion checklist). CODEBASE-CONTEXT.md written to apps/ozi-reorder/. Full pipeline cycle for issue-006 complete.
  • 2026-03-28: Executed /qa-test for issue-008. PASS. Validated robustness of PostHog drop logic and DB connection failovers. 2 medium UX issues identified: unprotected JSON parse and missing AbortController. Proceeding to /metric-plan. Result saved to experiments/results/qa-test-008.md.
  • 2026-03-28: Executed /metric-plan for issue-008. North Star: Add-to-Cart Rate Lift defined.
  • 2026-03-28: Executed /deploy-check for issue-008. Resolved README missing details and configured Sentry for error tracking. Automated PR #7 created successfully.
  • 2026-03-28: [ARCHIVED] Nykaa Hyper-Personalized Style Concierge (issue-008) — Full pipeline cycle complete. Final fix: added backend PDP API route and server-side fetch logic. All quality gates passed. Pipeline reset to idle.
  • 2026-04-02: Executed /deslop for issue-009 (MoneyMirror). Removed template copy headers from posthog.ts, db.ts, error-handler.ts (dead boilerplate from libs/shared). Removed {/_ Bar _/} restatement comment from MirrorCard.tsx. Fixed critical hallucination in pdf-parser.ts — replaced non-existent default export with correct named { PDFParse } class from pdf-parse v2 (constructor takes LoadParameters, getText() returns TextResult with .text/.pages). Moved inline foodRegex/subRegex to module-level FOOD_REGEX/SUBSCRIPTION_REGEX in advisories/route.ts. Fixed unsafe CategorySummary cast with exclusion guards. Added .limit(1000) to transactions query. Ready for /review.
  • 2026-04-02: Executed /review for issue-009 (MoneyMirror). 2 CRITICAL + 2 HIGH + 2 MEDIUM issues found and fixed. CRITICAL-1: pdf-parser.ts used result.pages?.length instead of result.total on TextResult from pdf-parse v2 PDFParse class. CRITICAL-2: /api/dashboard/advisories missing Supabase JWT auth + ownership filter — any UUID could access another user's financial data. HIGH-1: perceived_spend_paisa never written to statements INSERT — PERCEPTION_GAP advisory was permanently broken (always 0). Fixed by fetching from profiles table before INSERT. HIGH-2: PostHog singleton _posthogServer not reset to null after shutdown() — dead client reused on subsequent calls, silently dropping events. MEDIUM-1: cron master succeeded/failed counts wrong — .catch() swallowed errors making all results appear fulfilled. Fixed by throwing on non-2xx responses. MEDIUM-2: score/page.tsx setTimeout in useEffect missing cleanup — setState on unmounted component risk. PostHog dual-emission check: PASS. Review result saved to experiments/results/review-009.md.
  • 2026-04-02: Executed /peer-review for issue-009 (MoneyMirror). BLOCKED. 4 MUST-FIX items: A1 /dashboard has no persisted rehydration path and does not implement the planned GET /api/dashboard, so refreshes and weekly email deep links lose the mirror state; R1 /api/statement/parse returns success and emits statement_parse_success even when transactions insert fails, creating partial-write corruption; R2 /api/cron/weekly-recap/worker returns HTTP 200 on Resend failure, so master success counts and weekly_recap_completed telemetry remain wrong; P1 dashboard/page.tsx calls /api/dashboard/advisories without Authorization header, so the core coaching feed never renders. MEDIUM: A2 weekly recap fan-out is capped by .limit(1000) on statement rows. Result saved to experiments/results/peer-review-009.md.
  • 2026-04-02: Executed /peer-review round 2 for issue-009 (MoneyMirror). APPROVED. Verified all prior findings fixed: A1 authenticated persisted dashboard rehydration path added via /api/dashboard and dashboard page now hydrates on first load; R1 statement parse persistence is now fail-closed with processingprocessed transition only after transactions save; R2 weekly recap worker now returns 502 on email failure and master rejects unsuccessful worker responses; P1 dashboard no longer loses advisories due to missing auth because post-upload flow hydrates from authenticated dashboard data; A2 recap fan-out paginates through processed statements in 1000-row batches. Additional build-safety fixes: lazy Supabase client init in src/lib/db.ts, Resend client moved inside request handler. Validation: npm test PASS, npm run build PASS. Result saved to experiments/results/peer-review-009-r2.md.
  • 2026-04-02: Executed /qa-test for issue-009 (MoneyMirror). PASS. 34 automated tests passing. QA1 (BLOCKING) fixed: .env.local.example declared NEXT_PUBLIC_POSTHOG_KEY/NEXT_PUBLIC_POSTHOG_HOST but src/lib/posthog.ts reads POSTHOG_KEY/POSTHOG_HOST — would have caused all server-side telemetry to be silently dead in production; corrected to server-only names (no NEXTPUBLIC prefix). QA2 (MEDIUM) fixed: "Share My Mirror" button conditionally rendered only when navigator.share is available — no longer a silent no-op on desktop. Telemetry resilience verified: all PostHog calls fire-and-forget. No duplicate event emissions. Result saved to experiments/results/qa-test-009.md.
  • 2026-04-03: Executed /learning for issue-009 (MoneyMirror). 7 engineering lessons written to knowledge/engineering-lessons.md (dashboard rehydration path, parent/child write atomicity, fan-out HTTP contract, auth caller cross-verification, env var grep verification, file size budget at generation time, third-party library API verification). Prompt library updated (knowledge/prompt-library.md). Agent files updated per Prompt Autopsy: backend-architect-agent.md (items 10–12 in Mandatory Pre-Approval Checklist: rehydration path, write atomicity, fan-out HTTP contract), backend-engineer-agent.md (2 hard rules: auth caller verification + file size budget), code-review-agent.md (2 new checks: authenticated route caller cross-verification + parent/child write sequence), qa-agent.md (env var key name cross-check as standalone QA dimension), commands/execute-plan.md (env var grep step in completion checklist, read/write path checkpoint + third-party library API verification in Step 5, file size budget as Step 5b). CODEBASE-CONTEXT.md written to apps/money-mirror/. Full pipeline cycle for issue-009 complete.
  • 2026-04-03: Drift correction for issue-009 (MoneyMirror). Canonical app state rebaselined to the current Neon Auth + Neon Postgres + email OTP implementation in apps/money-mirror/. Fixed onboarding completion to fail closed on persistence errors, added app-local Vercel cron scheduling via apps/money-mirror/vercel.json, aligned recap auth to Vercel Bearer cron + local x-cron-secret, normalized Monday recap cadence, refreshed app docs, and prepared Linear resync so PM state matches the codebase that is locally testable.
  • 2026-04-03: MoneyMirror Phase 1 scope expanded in-code beyond the earlier HDFC-only MVP contract. apps/money-mirror/ now supports explicit upload modes for bank_account and credit_card, persists monthly_income_paisa from onboarding, stores institution_name + statement_type + optional card-due metadata on statements, and uses credit-card-safe summary/advisory logic so card payments and refunds do not inflate income. Validation in workspace: npm test PASS (45 tests), npx tsc --noEmit PASS, npx next build --webpack PASS. Remaining pre-deploy work: apply schema changes to Neon and complete live local smoke against OTP/Gemini/Resend.
  • 2026-04-03: MoneyMirror Phase 1 rollout validation started against live local/runtime infrastructure. Verified npm run dev boots outside the sandbox, verified cron auth contract locally (401 without auth, 200 {"ok":true,"total":0,"succeeded":0,"failed":0} with x-cron-secret), created dedicated Linear follow-up issue VIJ-13, and confirmed the target Neon DB is still on the old schema. Blocking drift: profiles lacks monthly_income_paisa; statements still uses bank_name and lacks institution_name, statement_type, and credit-card due metadata fields. Next required action: apply apps/money-mirror/schema.sql to Neon, then resume OTP/onboarding/upload/dashboard smoke on VIJ-13.
  • 2026-04-04: MoneyMirror Phase 1 live smoke complete. Applied 7 ALTER TABLE migrations to Neon DB steep-meadow-97750093 (profiles + statements schema drift resolved). Linear cleanup: cancelled VIJ-12/VIJ-14/VIJ-15 (duplicates), restructured VIJ-13 as canonical Phase 1 Rollout Validation issue (In Progress), created 6 child sub-issues (VIJ-16 schema Done, VIJ-17 OTP Done, VIJ-18 bank upload Done, VIJ-19 CC upload Done, VIJ-20 Vercel deploy pending, VIJ-21 cron gate Done). Smoke results: OTP login ✅, bank account PDF parse (Kotak, 24 txns, ₹31,926) ✅ DB confirmed, credit card PDF parse (HDFC, 18 txns, ₹16,245) ✅ DB confirmed. Fixed gemini-2.5-flash timeout by disabling thinking (thinkingBudget: 0) in parse route — reduces response time from >25s to ~8s. Only remaining gate: Vercel deploy (VIJ-20).
  • 2026-04-04: MoneyMirror production deploy attempt executed for VIJ-20. Created and linked Vercel project money-mirror in scope vijay-sehgals-projects, synced production env vars from app-local .env.local except blank Sentry values (NEXT_PUBLIC_SENTRY_DSN, SENTRY_ORG, SENTRY_PROJECT), and corrected NEXT_PUBLIC_APP_URL to https://money-mirror-rho.vercel.app. First deploy failed because middleware.ts imported @neondatabase/auth/next/server, which Vercel rejected in the Edge runtime. Fixed by replacing middleware.ts with proxy.ts so auth gating runs in Next 16's Node proxy runtime. Local validation after the fix: npm test PASS (45 tests), npx next build --webpack PASS, npx tsc --noEmit PASS after regenerating .next/types. Subsequent production builds succeeded and Vercel aliased the app to https://money-mirror-rho.vercel.app, but the release is still blocked: unauthenticated requests return Vercel Authentication 401, and authenticated vercel curl requests still return NOT_FOUND for /, /login, /dashboard, and /api/cron/weekly-recap. Next required action: fix Vercel project/public routing configuration before VIJ-20 can be closed.
  • 2026-04-04: MoneyMirror Vercel production unblocked and Linear VIJ-22/VIJ-20/VIJ-13 closed. Vercel API PATCH /v9/projects/money-mirror: rootDirectory: apps/money-mirror, framework: nextjs, sourceFilesOutsideRootDirectory: true; ssoProtection.deploymentType changed from all_except_custom_domains to preview (production .vercel.app URLs public). Production redeploy dpl_UrdwuBkS4qvSwgqY2PjTJvyKS8cW READY. Verified: GET / and /login → 200 (Next.js HTML); GET /api/cron/weekly-recap → 401 without secret, 200 with x-cron-secret; NEXT_PUBLIC_APP_URL matches alias. Gitignored repo-root .vercel/project.json added so vercel deploy --prod runs from monorepo root (avoids doubled apps/money-mirror path when project rootDirectory is set).
  • 2026-04-04: Repo / dev-environment hygiene — removed committed Neon MCP secret (gitignore .mcp.json, .mcp.json.example), added Codex .codex/config.toml with NEON_API_KEY bearer env var, documented in CHANGELOG. Opened GitHub PR #15 for review. Linear: VIJ-11 remains Done (verified); linear_last_sync unchanged — these changes are not a MoneyMirror product milestone, so /linear-sync was not re-run for them.
  • 2026-04-05: MoneyMirror Phase 2 (PM roadmap in .cursor/plans/moneymirror_pm_roadmap_*.plan.md) implemented in repo — not the same as automatic Linear sprint import; roadmap sprints were engineering guidance. Linear: created VIJ-23 (Done) = Phase 2 delivery record under VIJ-11; VIJ-24 (Todo, High) = Neon ALTER for label columns; VIJ-25 (Backlog) = F3/G2–G3/H3 follow-ups. Next Codex/Claude sessions: pick VIJ-24 first if uploads fail on missing columns; use VIJ-25 when planning the next sprint.
  • 2026-04-05 (later): Full Linear mirror of sprint + epic breakdown — Sprints 1–3 VIJ-26–28 (Done), Sprint 4 / Backlog VIJ-25 (title updated), Epics A–H VIJ-29–36 (Done, with F3/G2–G3/H2–H3 called out in epic bodies → VIJ-25). See MoneyMirror PM roadmap — Linear map section in this file.
  • 2026-04-05: /deslop issue-010 T4 — 7 issues fixed (S1: wrong error message, S2: silent catches, S3: Gemini timeout 14s→9s per Eng Lesson #15 + AbortController gap documented, N1: nnarrative, N2: ffact + typed filter, C1: AdvisoryCard component extracted, CM1: redundant JSDoc removed). Coaching-enrich.ts timeout_ms telemetry value also corrected to 9 000. Build/lint/76 tests clean. Stage advanced to review.
  • 2026-04-05: /review issue-010 (Codex pass) — Recorded results in experiments/results/review-010.md. Fixed H1 dashboard truth truncation by replacing row-limited overview/coaching math with full-scope SQL aggregates in src/lib/dashboard.ts; fixed H2 merchant backfill infinite loop in src/app/api/transactions/backfill-merchant-keys/route.ts; also fixed M1 scope editor state drift in src/components/ScopeBar.tsx. Validation: npm test pass (76/76). npm run build starts cleanly but was not observed to completion in-session. Review stage remains in-progress pending any additional model review passes before /peer-review.
  • 2026-04-05: /qa-test issue-010 — PASS. No blocking findings. Verified npm test (76/76), npm run lint, escalated npm run build, env var key audit, and cron failure-path / telemetry contract behavior. Residual non-blocking hardening note carried forward: authenticated heavy read APIs still have no explicit per-user throttle. Artifact: experiments/results/qa-test-010.md. Next: /metric-plan.
  • 2026-04-05: Post-merge engineering sync — GitHub PR #16 squash-merged to main (3cdd83a): Phase 2 dashboard/statements work, parse-route splits for file-size limits, schema.sql label columns. Production: vercel deploy --prod from monorepo root → https://money-mirror-rho.vercel.app (project rootDirectory = apps/money-mirror). Neon: ALTER TABLE ... ADD COLUMN IF NOT EXISTS for statements.nickname, account_purpose, card_network applied and verified via information_schema. Local main fast-forwarded; backup dirs (apps/money-mirror.pre-pull-backup, .cursor.userbak) and redundant git stash removed. Linear VIJ-24 marked Done (repo + Linear aligned).
  • 2026-04-04: Phase 2 learning pass — 2 new engineering rules extracted from Phase 2 (Sprints 1–3) work. E1: schema-coupling — user input fields require pre-enumerated DB columns in architecture spec before execute-plan (mid-cycle ALTER TABLE = schema migration risk). E2: validation bidirectionality — enum inputs require client picker + server 4xx + schema CHECK constraint; silent server-side sanitization to null is never acceptable. Agent files updated: agents/backend-architect-agent.md (items 13–14 in Mandatory Pre-Approval Checklist), commands/execute-plan.md (item 4 in Execute-Plan Completion Checklist). Prompt library updated with Phase 2 meta-rule: every knowledge-file lesson must have a corresponding agent prompt change in the same session. CODEBASE-CONTEXT.md refreshed: DashboardClient component architecture noted, docs/COACHING-TONE.md added to Key Files, metadata validation trap documented. Pipeline cycle for issue-009 Phase 2 complete.
  • 2026-04-05: /create-issue issue-010 — MoneyMirror Phase 3 umbrella Enhancement from PM UX plan (.cursor/plans/moneymirror_pm_ux_plan_08398100.plan.md). No code. Linear Option A: new project + parent VIJ-37, children VIJ-38 (T1) … VIJ-41 (T4); T5–T6 deferred. Prior cycle artifacts remain in experiments/linear-sync/issue-009.json (VIJ-11). Overlap with VIJ-25 (Sprint 4 backlog): merge/supersede F3/G2–G3/H3 into Phase 3 to avoid duplicate scope. Next pipeline step: /explore for issue-010.
  • 2026-04-05: /explore issue-010 — Recommendation Build. Phase 3 deepens trust for multi-upload / multi-source users; smallest validation slice T1 (transaction API + UI). Risks catalogued with mitigations (parser variance, merchant normalization strategy, COACHING-TONE extension, query performance, explicit PRD decision on perceived vs actual under global rollup). Artifact: experiments/exploration/exploration-010.md. Next pipeline step: /create-planexperiments/plans/plan-010.md.
  • 2026-04-05: VIJ-25 supersededVIJ-25 marked Duplicate of VIJ-37; description updated with F3/G2–G3/H3 → VIJ-38–VIJ-41 mapping. Comment on VIJ-37. Sync maps issue-009.json / issue-010.json updated.
  • 2026-04-05: /create-plan issue-010 — Delivered experiments/plans/plan-010.md (PRD, UX, architecture aligned to Neon Auth + Neon Postgres + apps/money-mirror codebase) and experiments/plans/manifest-010.json (phases T1–T4 → VIJ-38–VIJ-41). PRD decisions: blended “actual” under global scope + single profile perceived baseline (or explicit schema change if per-account perceived later); merchant v1 = heuristic merchant_key; facts-grounded AI (Layer A JSON) in T4. Next: /linear-sync plan then /execute-plan from VIJ-38 (T1).
  • 2026-04-05: /linear-sync plan issue-010 — Linear project Planned; created issue-010 Plan Snapshot; updated VIJ-37 (plan links, Execution label, In Progress, attachment to doc); VIJ-38–VIJ-41 descriptions from manifest-010.json task breakdown; experiments/linear-sync/issue-010.json + project-state.md sync metadata updated.
  • 2026-04-05: /execute-plan issue-010 (T1 / VIJ-38) — Transaction surface shipped: schema.sql + ALTER for transactions.merchant_key, indexes, src/lib/merchant-normalize.ts + tests, persist-statement insert path, GET /api/transactions (ownership, caps, filters), POST /api/transactions/view-opened + backfill-merchant-keys, dashboard Transactions tab with ?tab= + TransactionsPanel (AbortController search debounce). Added apps/money-mirror/.env.local.example; README + CODEBASE-CONTEXT.md updated. Tests 59 passing. T2–T4 remain for follow-up execute-plan slices.
  • 2026-04-05: /execute-plan issue-010 (T2 / VIJ-39) — Unified scope: src/lib/scope.ts (shared parse + URL helpers), fetchDashboardData legacy vs unified (date_from/date_to + optional statement_ids), profile perceived_spend_paisa for Mirror baseline, GET /api/transactions supports statement_ids, ScopeBar + POST /api/dashboard/scope-changed for scope_changed, TransactionsPanel aligned to dashboard scope. README updated. Tests 67 passing.
  • 2026-04-05: /execute-plan issue-010 (T4 / VIJ-41) — Facts-grounded coaching: zod + src/lib/coaching-facts.ts (Layer A JSON), src/lib/gemini-coaching-narrative.ts (structured { narrative, cited_fact_ids } per advisory, validate ⊆ facts), src/lib/coaching-enrich.ts + PostHog coaching_narrative_*, DashboardData.signals, GET /api/dashboard returns coaching_facts, POST /api/dashboard/coaching-facts-expandedcoaching_facts_expanded, FactsDrawer / AdvisoryFeed Sources. Tests 76 passing. Next: /deslop/review.
  • 2026-04-05: /execute-plan issue-010 (T3 / VIJ-40) — Merchant rollups: src/lib/merchant-rollups.ts, GET /api/insights/merchants (scope-aligned GROUP BY merchant_key debits), POST /api/insights/merchant-click for merchant_rollup_clicked (bucketed key), MerchantRollups + Insights ScopeBar; Transactions panel reads merchant_key URL param and clears via router. README + merchant-rollups reconciliation tests. Tests 71 passing.
  • 2026-04-07: /explore issue-012 — Recommendation Build. Current gap is habit formation, not truth acquisition: statement-native accuracy is already shipped, but Gen Z users still need fast frequency-first story resolution, shame-safe copy, and explicit performance-to-insight budgets. External scan confirms strong adjacent demand signals (UPI at national scale, quick commerce as frequent behavior, SMS/card-led competitors proving spend visibility demand) but no strong competitor combining cross-bank statement truth with guided review loops. Artifact: experiments/exploration/exploration-012.md. Next pipeline step: /create-plan. Mandatory /linear-sync issue checkpoint recorded in experiments/linear-sync/issue-012.json.
  • 2026-04-05: /peer-review issue-010 — Verdict APPROVED (architecture, reliability, PM alignment). Artifact experiments/results/peer-review-010.md. Pipeline stage advanced to qa_test; next command /qa-test. /linear-sync status recommended to mirror gate on Linear VIJ-37.
  • 2026-04-07: /linear-sync status issue-011 — review Pass 2 sync — Status comment posted on VIJ-43 summarising both review passes (Pass 1: Codex/GPT-5 / Pass 2: Claude Sonnet 4.6) and APPROVED gate outcome. experiments/results/review-011.md Gate Status updated (passes_logged: 2, ready_for_peer_review: Yes). experiments/linear-sync/issue-011.json updated (last_sync_mode: status, timestamp 2026-04-07T...). project-state.md stage corrected to review / completed (prematurely set to peer-review in prior edit; reverted). Next: /peer-review.
  • 2026-04-07: /review issue-011 — Pass 2 (Claude Sonnet 4.6) — Full hardening pass: 20 files reviewed. Findings: M1 persist-statement.ts — removed await from PostHog catch-block call (anti-pattern #4), added Sentry.captureException, removed console.error; M2 useDashboardState.ts — removed console.error from loadCoachingNarratives catch; LOW schema.sql — added upi_handle TEXT to base CREATE TABLE block. 0 CRITICAL, 0 HIGH. Review gate: PASS. Stage: review / completed. Next: /peer-review.
  • 2026-04-07: /review issue-011 — pass 1 (Codex / GPT-5) — Artifact experiments/results/review-011.md created as an append-only multi-pass review log. Findings fixed in pass: legacy compare now resolves a real previous statement, compare copy changed from “Month-over-month” to explicit previous-period ranges, MerchantRollups fetches abort stale requests, shared rate-limit buckets prune expired entries. Validation: npm --prefix apps/money-mirror test (109/109). npm --prefix apps/money-mirror run build blocked by an existing next build process/lock in the workspace, so build was not claimed as verified in this pass. Stage advanced to review / in_progress to allow additional review passes before /peer-review.
  • 2026-04-07: /metric-plan issue-012 — Delivered experiments/results/metric-plan-012.md. Configured North Star proxy metric (repeat statement upload within 60 days) and explicit SLA budgets (p75 dashboard_ready < 800ms, time_to_first_advisory < 1500ms). Tracked adoption of new frequency and cluster insights, and defined the 3-step guided review funnel with single-source (client) emission to prevent skew. Next: /deploy-check.
  • 2026-04-10: Post-cycle Gmail sync Phase 1 + Phase 2 shipped to production — Phase 1: /gmail-sync slash command (commands/gmail-sync.md) uses Claude Code's Gmail MCP tools → Gemini Flash parse → POST to /api/gmail/sync → prints scanned/inserted/skipped summary; registered in CLAUDE.md Utility Commands. Phase 2: full Google OAuth 2.0 (gmail.readonly) flow, token storage in user_oauth_tokens (Neon), sync engine at /api/gmail/sync (Gemini Flash email parse → dedup via transactions.dedup_hash → insert → advisory retrigger), cron fan-out at 01:30 UTC, dashboard Sync tab (SyncPanel.tsx) replaces Upload tab. Key decisions: (1) OAuth tokens in Neon user_oauth_tokens table — not Neon Auth session, not Supabase; (2) OAuth DB ops extracted to db-oauth.ts to keep db.ts < 300 lines; (3) dedup_hash GENERATED ALWAYS column for idempotent re-syncs; (4) cron scheduled 01:30 UTC (07:00 IST); (5) file-size splits: db-oauth.ts, log-sync-run.ts, SyncPanelParts.tsx. Deploy: commit 5690212https://money-mirror-rho.vercel.app ✅. Linear: post-cycle comment added to closed VIJ-52.
  • 2026-04-09: MoneyMirror deploy contract hardened after closeout — Synced branches to main, confirmed Vercel project money-mirror root directory apps/money-mirror, found root cause for missing auto-deploy (link: null with createDeployments = "enabled"), reconnected the existing project to shadowdevcode/ai-product-os, and confirmed production branch main. Added main-only Git deployment guard in apps/money-mirror/vercel.json. Proof deployment: pushing commit 133e62d939445cd95113c8acf7e0d592ee75fab9 on main automatically created production deployment money-mirror-3so34gj1d-vijay-sehgals-projects.vercel.app, now aliased by https://money-mirror-rho.vercel.app (HTTP 200 verified). Separate repo impact also confirmed: root landing project ai-product-os-493e is Git-linked to the same repo/root apps/landing, so unrelated main pushes were redeploying it. To isolate that project, apps/landing/vercel.json now uses a path-scoped ignoreCommand scoped to the landing root directory. Runtime verification completed: config-fix commit f7c18ff produced a normal landing production build, while subsequent non-landing pushes were canceled quickly instead of running a normal production build.

Links