Skip to content

Commit f847b64

Browse files
shadowdevcodeclaude
andcommitted
docs: MoneyMirror README Phase 2, root README, agent/knowledge updates
- 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>
1 parent 8c6e4be commit f847b64

9 files changed

Lines changed: 149 additions & 28 deletions

File tree

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## 2026-04-05 — Docs: MoneyMirror added to root README + app README updated for Phase 2
4+
5+
**What:** Closed remaining documentation gaps after Phase 2 ship and VIJ-24 closure.
6+
7+
**Root [README.md](README.md):**
8+
9+
- Added MoneyMirror (issue-009) to the Projects Built table — was missing entirely despite being live at `https://money-mirror-rho.vercel.app`.
10+
- Added v3 row to System Evolution table covering the MoneyMirror pipeline cycle.
11+
12+
**[apps/money-mirror/README.md](apps/money-mirror/README.md):**
13+
14+
- Rewrote "What it does" to reflect Phase 2: 3-tab dashboard (Overview/Insights/Upload), statement library, month picker, mirror card (perceived vs actual), upload labels, multi-account.
15+
- Added `GET /api/statements` to the API section.
16+
- Added Docs section linking to `docs/COACHING-TONE.md`.
17+
- Updated "Current scope" into explicit Shipped / Not shipped (Sprint 4 backlog) sections.
18+
19+
**Linear:** VIJ-24 confirmed Done (Neon label columns verified applied). VIJ-25 remains Backlog (Sprint 4 — F3, G2–G3, H3).
20+
21+
---
22+
323
## 2026-04-05 — Repo sync: PR #16, VIJ-24 Done, project-state + Linear map
424

525
**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.

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ A simulated, end-to-end product development organization where specialized AI ag
2929

3030
## Projects Built
3131

32-
| Issue | App | What It Does | Stack | Status |
33-
| ----- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | --------------------------------- | -------- |
34-
| 002 || Gmail → WhatsApp daily digest summarizer | Next.js, Supabase, Gemini, Twilio | Archived |
35-
| 003 | [finance-advisor](apps/finance-advisor/) | AI personal finance advisor | Next.js, Supabase, Gemini | Complete |
36-
| 004 | [clarity](apps/clarity/) | PM to-do list with AI task categorization | Next.js, Neon, Gemini | Complete |
37-
| 005 | [smb-bundler](apps/smb-bundler/) | Feature bundle + value-based pricing engine for B2B SaaS PMs | Next.js, Neon, Gemini | Complete |
38-
| 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 |
40-
| 008 | [nykaa-personalisation](apps/nykaa-personalisation/) | Hyper-personalized discovery feed (affinity + intent scoring, 10 PostHog events, 5 API routes) | Next.js, Neon, PostHog | Archived |
41-
|| [landing](apps/landing/) | Framework landing page showcasing pipeline, agents, and shipped products | Next.js, Tailwind CSS | Live |
32+
| Issue | App | What It Does | Stack | Status |
33+
| ----- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | -------- |
34+
| 002 || Gmail → WhatsApp daily digest summarizer | Next.js, Supabase, Gemini, Twilio | Archived |
35+
| 003 | [finance-advisor](apps/finance-advisor/) | AI personal finance advisor | Next.js, Supabase, Gemini | Complete |
36+
| 004 | [clarity](apps/clarity/) | PM to-do list with AI task categorization | Next.js, Neon, Gemini | Complete |
37+
| 005 | [smb-bundler](apps/smb-bundler/) | Feature bundle + value-based pricing engine for B2B SaaS PMs | Next.js, Neon, Gemini | Complete |
38+
| 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 |
40+
| 008 | [nykaa-personalisation](apps/nykaa-personalisation/) | Hyper-personalized discovery feed (affinity + intent scoring, 10 PostHog events, 5 API routes) | Next.js, Neon, PostHog | Archived |
41+
| 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 |
4243

4344
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`.
4445

@@ -195,11 +196,12 @@ command-protocol.md # How commands load context and update state
195196

196197
This OS isn't static — it improves with every cycle. Full history in [`CHANGELOG.md`](CHANGELOG.md).
197198

198-
| Phase | What Changed | PM Decision |
199-
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
200-
| **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. |
199+
| Phase | What Changed | PM Decision |
200+
| ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
201+
| **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. |
203205

204206
---
205207

agents/backend-architect-agent.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,21 @@ Before finalizing the architecture, answer all of the following. Any gap must be
235235
→ Master uses HTTP status only for success/failure accounting — never inspects JSON body.
236236
→ JSON error payloads with HTTP 200 are insufficient as a failure signal to the master.
237237

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.
251+
# Added: 2026-04-04 — MoneyMirror Phase 2
252+
238253
# Added: 2026-03-19 — SMB Feature Bundling Engine
239254

240255
# Updated: 2026-03-21 — Ozi Reorder Experiment (items 4–7)
@@ -243,6 +258,8 @@ Before finalizing the architecture, answer all of the following. Any gap must be
243258

244259
# Updated: 2026-04-03 — MoneyMirror (items 10–12)
245260

261+
# Updated: 2026-04-04 — MoneyMirror Phase 2 (items 13–14)
262+
246263
---
247264

248265
## Anti-Sycophancy Mandate

apps/money-mirror/CODEBASE-CONTEXT.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ MoneyMirror is a mobile-first PWA AI financial coach for Gen Z Indians (₹20K
88

99
## Architecture Overview
1010

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`.
1212
- **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.
1313
- **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.
1414
- **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
3232
| `src/lib/statements.ts` | Defines statement types, parser prompts, metadata validation, and shared display labels for bank-account and credit-card uploads. |
3333
| `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. |
3434
| `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. |
3536

3637
## Data Model
3738

@@ -62,6 +63,7 @@ MoneyMirror is a mobile-first PWA AI financial coach for Gen Z Indians (₹20K
6263
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 }`.
6364
6. **All monetary values are stored in paisa (BIGINT)** — divide by 100 to display as rupees. Never store or compute in rupees directly.
6465
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.
6567

6668
## Known Limitations
6769

0 commit comments

Comments
 (0)