|
| 1 | +# ChittyCommand Adversarial Review (Restated) |
| 2 | + |
| 3 | +**Date:** 2026-03-05 |
| 4 | +**Status:** Canonical correction to prior analysis |
| 5 | + |
| 6 | +## Corrections to Prior Claims |
| 7 | + |
| 8 | +1. Queue approval does execute a DB payment state change today. |
| 9 | +- `src/routes/swipe-queue.ts` sets linked obligation `status='paid'` on approved payment-type actions. |
| 10 | +- It bypasses the explicit `/obligations/:id/pay` path, but it is still a real mutation. |
| 11 | + |
| 12 | +2. Dispute "Take Action" is not a same-page no-op from Dashboard context. |
| 13 | +- In Focus Mode it navigates from `/` to `/disputes`. |
| 14 | +- Real issue: it does not deep-link to a specific dispute/action target. |
| 15 | + |
| 16 | +## Verified Findings |
| 17 | + |
| 18 | +1. Dispute progress dots are currently synthetic and not backed by lifecycle-stage storage. |
| 19 | +2. Recommendations page duplicates Action Queue capabilities. |
| 20 | +3. Payment plan activation updates DB status only; no downstream execution artifacts are created. |
| 21 | +4. Cash Flow tabs are disconnected data views without synthesis. |
| 22 | +5. Upload flows cannot explicitly set `linked_dispute_id` from UI. |
| 23 | +6. Legal and Disputes are not cross-linked via `case_ref`. |
| 24 | +7. Chat sidebar content is in-memory and lost on refresh. |
| 25 | +8. Queue does not auto-run triage on empty first-load. |
| 26 | +9. Dashboard pay action had no confirmation. |
| 27 | +10. No frontend dispute creation form despite backend POST support. |
| 28 | + |
| 29 | +## Plan Flaws Identified |
| 30 | + |
| 31 | +1. Double-write risk in queue approval flow (`decideQueue` plus `markPaid`). |
| 32 | +2. `case_ref` top-level proposal conflicts with existing `metadata.ledger_case_id`. |
| 33 | +3. Stage/status semantics were undefined. |
| 34 | +4. Chat context expansion added heavy per-message query cost with no cache strategy. |
| 35 | +5. Replacing Cash Flow tabs entirely was high-risk relative to value. |
| 36 | +6. Chat message action buttons did not account for SSE stream completion boundaries. |
| 37 | +7. No automated test coverage was defined for large-scope financial-flow changes. |
| 38 | + |
| 39 | +## Required Fixes |
| 40 | + |
| 41 | +1. Remove payment side-effect from queue decide endpoint; keep payment execution explicit and single-path. |
| 42 | +2. Promote `metadata.ledger_case_id` into a first-class column (or migration path), not parallel sources of truth. |
| 43 | +3. Define lifecycle contract: stage = position, status = resolution outcome with terminal transitions only. |
| 44 | +4. Lazy-load heavy dispute verification context only for targeted prompts/actions. |
| 45 | +5. Keep Cash Flow tabs and add synthesis strip first. |
| 46 | +6. Render chat action buttons only after SSE stream completion (`[DONE]`). |
| 47 | +7. Gate each phase with integration tests before merge. |
| 48 | + |
| 49 | +## Priority Order |
| 50 | + |
| 51 | +### P0 (ship first) |
| 52 | +- Toast system + ConfirmDialog |
| 53 | +- Dashboard pay confirmation |
| 54 | +- Auto-triage on empty queue |
| 55 | + |
| 56 | +### P1 |
| 57 | +- Remove queue payment double-write path and add explicit execution path |
| 58 | +- Swipe decision feedback toasts |
| 59 | + |
| 60 | +### P2 |
| 61 | +- Real dispute lifecycle model (stage column + stage/status rules) |
| 62 | +- Dispute creation form |
| 63 | +- Progress dots from DB state |
| 64 | +- Upload documents from dispute context |
| 65 | + |
| 66 | +### P3 |
| 67 | +- Legal ↔ Disputes cross-linking |
| 68 | +- Payment plan outputs into queue items |
| 69 | +- Cash Flow synthesis strip while preserving tabs |
| 70 | + |
| 71 | +### P4 |
| 72 | +- Chat persistence and streaming-aware insight actions |
| 73 | +- Chat-to-correspondence bridge |
| 74 | +- Sidebar information architecture cleanup |
| 75 | +- Remove redundant Recommendations page |
| 76 | + |
| 77 | +## Current Execution Snapshot (this pass) |
| 78 | + |
| 79 | +- Implemented P0 foundations in UI: |
| 80 | + - Added global toast system and provider. |
| 81 | + - Added reusable confirmation dialog. |
| 82 | + - Added Dashboard pay confirmation and feedback toasts. |
| 83 | + - Added Action Queue auto-triage on first empty load and decision feedback toasts. |
0 commit comments