You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Added MoneyMirror to root README Projects Built + System Evolution tables
- Rewrote apps/money-mirror/README.md for Phase 2 (3-tab dashboard, statement library)
- Updated backend-architect-agent.md and execute-plan.md with new constraints
- Extracted engineering lessons and prompt library entries from VIJ-24 cycle
- Synced project-state.md to VIJ-24 Done
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
**What:** Aligned [project-state.md](project-state.md), [experiments/linear-sync/issue-009.json](experiments/linear-sync/issue-009.json), and Linear with post-merge engineering work.
| 006 |[ozi-reorder](apps/ozi-reorder/)| Reorder reminder experiment for dark-store baby essentials (50/50 test vs. control, 7 PostHog events) | Next.js, Neon, PostHog | Complete |
39
-
| 007 |[ozi-insights](apps/ozi-insights/)| Synthetic Freshdesk support data for order reliability research (30 tickets, grounded in Play Store) | Data workspace | Explored |
| 006 |[ozi-reorder](apps/ozi-reorder/)| Reorder reminder experiment for dark-store baby essentials (50/50 test vs. control, 7 PostHog events) | Next.js, Neon, PostHog | Complete |
39
+
| 007 |[ozi-insights](apps/ozi-insights/)| Synthetic Freshdesk support data for order reliability research (30 tickets, grounded in Play Store) | Data workspace | Explored |
| 009 |[money-mirror](apps/money-mirror/)| AI personal finance coach — parses Indian bank + credit card PDFs, reveals perception gap, delivers consequence-first nudges. Weekly recap email. | Next.js 16, Neon Auth, Neon DB, Gemini 2.5 Flash, Resend | Live |
42
+
| — |[landing](apps/landing/)| Framework landing page showcasing pipeline, agents, and shipped products | Next.js, Tailwind CSS | Live |
42
43
43
44
Each issue number maps directly across all folders: `experiments/ideas/issue-NNN.md`, `experiments/exploration/exploration-NNN.md`, `experiments/plans/plan-NNN.md`, and `experiments/results/*-NNN.md`.
44
45
@@ -195,11 +196,12 @@ command-protocol.md # How commands load context and update state
195
196
196
197
This OS isn't static — it improves with every cycle. Full history in [`CHANGELOG.md`](CHANGELOG.md).
|**v0**| Manual pipeline, no enforcement | Proved the 12-step concept works end-to-end |
201
-
|**v1**| Quality gates, knowledge base, 5 shipped products | Each postmortem generated rules that prevented the same class of failure in the next cycle |
202
-
|**v2**| Developer tooling (husky, prettier, enforcement scripts), test infrastructure (Vitest + shared mocks), progressive disclosure (.claude/rules/), landing page | Finalized with Nykaa Hyper-Personalization (issue-008). AI Product OS v2 is now feature-complete. |
|**v0**| Manual pipeline, no enforcement | Proved the 12-step concept works end-to-end |
202
+
|**v1**| Quality gates, knowledge base, 5 shipped products | Each postmortem generated rules that prevented the same class of failure in the next cycle |
203
+
|**v2**| Developer tooling (husky, prettier, enforcement scripts), test infrastructure (Vitest + shared mocks), progressive disclosure (.claude/rules/), landing page | Finalized with Nykaa Hyper-Personalization (issue-008). AI Product OS v2 is now feature-complete. |
204
+
|**v3**| MoneyMirror (issue-009): most complex pipeline cycle — Neon Auth, multi-bank PDF parsing, credit card flows, perception gap dashboard, weekly recap email. Phase 2 adds 3-tab dashboard, statement library, month picker, upload labels, multi-account. Linear PM layer + real-time feedback capture added. | First cycle requiring live DB migration, production smoke, and Vercel runtime fix before passing deploy-check. 7 new engineering rules extracted. |
Copy file name to clipboardExpand all lines: agents/backend-architect-agent.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -235,6 +235,21 @@ Before finalizing the architecture, answer all of the following. Any gap must be
235
235
→ Master uses HTTP status only for success/failure accounting — never inspects JSON body.
236
236
→ JSON error payloads with HTTP 200 are insufficient as a failure signal to the master.
237
237
238
+
13.**User Input → DB Column Enumeration**: For every new user-facing input field in the spec:
239
+
→ Enumerate the exact DB column it persists to: table name, column name, type, nullability, and CHECK constraint (if enum).
240
+
→ A feature that specifies UI controls (form fields, pickers, inputs) without corresponding schema columns is a blocking gap — execute-plan cannot begin.
241
+
→ Nullable column additions added after deploy are schema migrations; they must appear in schema.sql before the first deploy of the feature.
242
+
→ For enum fields: classify the input as enum vs free-text. Specify the full set of valid values and require a CHECK constraint in schema.sql.
243
+
244
+
# Added: 2026-04-04 — MoneyMirror Phase 2
245
+
246
+
14.**Enum Input Validation Contract**: For every input field that stores an enum value (status, type, network, purpose, category, etc.):
247
+
→ Client must use a picker or select element constrained to valid values — free-text inputs for enum columns are not acceptable.
248
+
→ Server must return HTTP 4xx on invalid enum input — not silently sanitize to null or a default. Silent sanitization gives users false confidence their input was saved.
249
+
→ Schema must include a CHECK constraint for the column.
250
+
→ Specify all three in the architecture spec: (1) client control type, (2) server validation response code, (3) schema CHECK constraint.
Copy file name to clipboardExpand all lines: apps/money-mirror/CODEBASE-CONTEXT.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ MoneyMirror is a mobile-first PWA AI financial coach for Gen Z Indians (₹20K
8
8
9
9
## Architecture Overview
10
10
11
-
-**Frontend**: Next.js 16 App Router (RSC by default, `"use client"` for interactive panels). Key pages: `/` (landing), `/onboarding` (5-question flow), `/score` (Money Health Score reveal), `/dashboard` (Overview with perceived vs actual + categories, **Insights** tab for AI nudges, **Upload** tab, statement picker + month filter, URL `?statement_id=`).
11
+
-**Frontend**: Next.js 16 App Router (RSC by default, `"use client"` for interactive panels). Key pages: `/` (landing), `/onboarding` (5-question flow), `/score` (Money Health Score reveal), `/dashboard` (Overview with perceived vs actual + categories, **Insights** tab for AI nudges, **Upload** tab, statement picker + month filter, URL `?statement_id=`). Dashboard shell is `DashboardClient.tsx` (client orchestrator) composed of `ResultsPanel`, `InsightsPanel`, `UploadPanel`, `ParsingPanel`, `DashboardNav`, `StatementFilters`, `DashboardBrandBar`.
12
12
-**Backend**: Next.js API routes under `src/app/api/`. Neon Auth for session auth, Neon Postgres for persistence, Gemini 2.5 Flash for PDF parse + categorization, Resend for weekly recap emails, PostHog for server-side telemetry.
13
13
-**Database**: Neon Postgres. 4 tables: `profiles`, `statements`, `transactions`, `advisory_feed`. `profiles` persists monthly income and perceived spend; `statements` tracks `institution_name`, `statement_type`, optional credit-card due metadata, optional `nickname`, `account_purpose`, `card_network` for multi-account labelling. All monetary values are stored as `BIGINT` in paisa (₹ × 100) to avoid float precision errors.
14
14
-**AI Integration**: Gemini 2.5 Flash via `@google/genai`. Used for: (1) PDF text → structured bank-account or credit-card statement JSON, (2) transaction category normalization. The statement-parse route currently enforces a 25s timeout and returns JSON 504 on timeout.
@@ -32,6 +32,7 @@ MoneyMirror is a mobile-first PWA AI financial coach for Gen Z Indians (₹20K
32
32
|`src/lib/statements.ts`| Defines statement types, parser prompts, metadata validation, and shared display labels for bank-account and credit-card uploads. |
33
33
|`src/lib/pdf-parser.ts`| Extracts raw text from PDF buffer using `pdf-parse`. Uses `result.total` (not `result.pages?.length`) for page count — v2 API. |
34
34
|`src/lib/posthog.ts`| Server-side PostHog singleton. Reads `POSTHOG_KEY` and `POSTHOG_HOST` (server-only, no `NEXT_PUBLIC_` prefix). |
35
+
|`docs/COACHING-TONE.md`| AI narrative guardrails for advisory copy — defines consequence-first framing, banned phrases, and tone rules for all Gemini-generated coaching language. |
35
36
36
37
## Data Model
37
38
@@ -62,6 +63,7 @@ MoneyMirror is a mobile-first PWA AI financial coach for Gen Z Indians (₹20K
62
63
5.**Weekly recap worker returns HTTP 502 on email failure** — master uses HTTP status, not JSON body, to count failures. Do not change the worker to return 200 with `{ ok: false }`.
63
64
6.**All monetary values are stored in paisa (BIGINT)** — divide by 100 to display as rupees. Never store or compute in rupees directly.
64
65
7.**Ownership is enforced in route handlers** — this app no longer uses Supabase RLS or service-role patterns.
66
+
8.**UploadPanel metadata fields use server-side sanitization helpers** (`sanitizeNickname`, `sanitizeCardNetwork`, `parseAccountPurpose`) — if adding validation, add a CHECK constraint in `schema.sql` AND return HTTP 4xx on invalid input. Do NOT silently sanitize to null; silent sanitization gives users false confidence their label was saved.
0 commit comments