|
| 1 | +# CATO INTEGRATION IMPLEMENTATION PLAN |
| 2 | +# Generated: 2026-03-08 |
| 3 | +# Owner: Ralph Wiggum Loop |
| 4 | + |
| 5 | +## OBJECTIVE |
| 6 | +Integrate all backend modules from cato/ into the Cato Desktop App and Web UI. |
| 7 | +Fix broken save buttons. Add missing views for every exposed API route. |
| 8 | +Max 5 iterations per chunk. Escalate to Hudson if chunk fails after 5 iterations. |
| 9 | +Backend-architect handles migration/wiring after each chunk. Alex assembles. Kraken audits live. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## CHUNKS |
| 14 | + |
| 15 | +### CHUNK 1 — Fix Broken Save Buttons (CRITICAL) |
| 16 | +**Files:** SkillsView.tsx, IdentityView.tsx (investigate why save fails) |
| 17 | +**Tasks:** |
| 18 | +- [ ] Add Save button + save() fn to SkillsView.tsx (PATCH /api/skills/{name}/content) |
| 19 | +- [ ] Add "saved" toast/banner to SkillsView.tsx |
| 20 | +- [ ] Debug IdentityView.tsx save (button disabled when isDirty=false — investigate why) |
| 21 | +- [ ] Verify workspace_put route in server.py returns correct JSON |
| 22 | +- [ ] Test both saves end-to-end against live daemon |
| 23 | +**Escalation:** Hudson if >5 iterations |
| 24 | + |
| 25 | +### CHUNK 2 — Memory View |
| 26 | +**Files:** NEW desktop/src/views/MemoryView.tsx, server.py (routes already exist) |
| 27 | +**Tasks:** |
| 28 | +- [ ] Create MemoryView.tsx with tabs: Facts | Chunks | Stats | Graph |
| 29 | +- [ ] Facts tab: list stored facts, search, delete individual facts |
| 30 | +- [ ] Stats tab: total facts, kg_nodes, kg_edges, embedding model, DB size |
| 31 | +- [ ] Chunks tab: recent context chunks with token counts |
| 32 | +- [ ] Wire /api/memory/files, /api/memory/content, /api/memory/stats |
| 33 | +- [ ] Add "Memory" to Sidebar nav (Monitoring group) |
| 34 | +- [ ] Update App.tsx with MemoryView import + case |
| 35 | +**Escalation:** Hudson if >5 iterations |
| 36 | + |
| 37 | +### CHUNK 3 — CLI Process Pool Monitor + Action Guard Dashboard |
| 38 | +**Files:** NEW desktop/src/views/SystemView.tsx |
| 39 | +**Tasks:** |
| 40 | +- [ ] Create SystemView.tsx with two panels: |
| 41 | + - Panel A: CLI Process Pool (GET /api/cli/status) — warm/cold status, model PIDs |
| 42 | + - Panel B: Action Guard (GET /api/action-guard/status) — 3-rule gate status, autonomy level |
| 43 | + - Panel C: Daemon restart button (POST /api/daemon/restart) |
| 44 | +- [ ] Add "System" to Sidebar nav (Settings group) |
| 45 | +- [ ] Update App.tsx |
| 46 | +**Escalation:** Hudson if >5 iterations |
| 47 | + |
| 48 | +### CHUNK 4 — Replay Visualization |
| 49 | +**Files:** NEW desktop/src/views/ReplayView.tsx, update SessionsView.tsx |
| 50 | +**Tasks:** |
| 51 | +- [ ] Create ReplayView.tsx — shows step-by-step replay with match/mismatch |
| 52 | +- [ ] Add "Replay" button to SessionsView.tsx that triggers POST /api/sessions/{id}/replay |
| 53 | +- [ ] Navigate to ReplayView with results after replay completes |
| 54 | +- [ ] Show: total steps, matched %, mismatched list, timing per step |
| 55 | +- [ ] Update App.tsx + Sidebar |
| 56 | +**Escalation:** Hudson if >5 iterations |
| 57 | + |
| 58 | +### CHUNK 5 — Skill Improvement + Diagnostics Panel |
| 59 | +**Files:** server.py (new routes), NEW desktop/src/views/DiagnosticsView.tsx |
| 60 | +**Tasks:** |
| 61 | +- [ ] Add GET /api/diagnostics/query-classifier — expose QueryClassifier tier decisions |
| 62 | +- [ ] Add GET /api/diagnostics/skill-corrections — list stored corrections |
| 63 | +- [ ] Add GET /api/diagnostics/contradiction-health — ContradictionDetector health summary |
| 64 | +- [ ] Add GET /api/diagnostics/decision-memory — DecisionMemory open decisions + overconfidence |
| 65 | +- [ ] Add GET /api/diagnostics/anomaly-domains — AnomalyDetector domain summaries |
| 66 | +- [ ] Create DiagnosticsView.tsx with tabs for each diagnostic |
| 67 | +- [ ] Add "Diagnostics" to Sidebar nav (Monitoring group) |
| 68 | +- [ ] Update App.tsx |
| 69 | +**Escalation:** Hudson if >5 iterations |
| 70 | + |
| 71 | +### CHUNK 6 — Adapter Status + Heartbeat View |
| 72 | +**Files:** server.py (new routes), update DashboardView.tsx |
| 73 | +**Tasks:** |
| 74 | +- [ ] Add GET /api/adapters — list active adapters (Telegram, WhatsApp) and their status |
| 75 | +- [ ] Add GET /api/heartbeat — last heartbeat timestamp + agent name + uptime |
| 76 | +- [ ] Add adapter status pills to DashboardView.tsx |
| 77 | +- [ ] Add heartbeat info to DashboardView.tsx |
| 78 | +- [ ] Wire Telegram adapter status to ConfigView.tsx (already has Telegram section) |
| 79 | +**Escalation:** Hudson if >5 iterations |
| 80 | + |
| 81 | +### CHUNK 7 — Session Checkpoints + Receipts |
| 82 | +**Files:** server.py (new routes), update SessionsView.tsx, AuditLogView.tsx |
| 83 | +**Tasks:** |
| 84 | +- [ ] Add GET /api/sessions/{id}/checkpoints — list checkpoints for session |
| 85 | +- [ ] Add GET /api/sessions/{id}/checkpoints/{checkpoint_id} — get checkpoint summary |
| 86 | +- [ ] Add GET /api/sessions/{id}/receipt — generate signed receipt (receipt.py) |
| 87 | +- [ ] Add "Checkpoints" tab to SessionsView.tsx |
| 88 | +- [ ] Add "Download Receipt" button to AuditLogView.tsx |
| 89 | +- [ ] Update SessionsView.tsx to show checkpoint count per session |
| 90 | +**Escalation:** Hudson if >5 iterations |
| 91 | + |
| 92 | +### CHUNK 8 — Web UI (dashboard.html + coding_agent.html) Sync |
| 93 | +**Files:** cato/ui/dashboard.html, cato/ui/coding_agent.html |
| 94 | +**Tasks:** |
| 95 | +- [ ] Audit dashboard.html for all nav items — add Memory, System, Diagnostics, Replay pages |
| 96 | +- [ ] Add JS handlers for Memory page (facts table, stats, search) |
| 97 | +- [ ] Add JS handlers for System page (CLI pool status, action guard, daemon restart) |
| 98 | +- [ ] Add JS handlers for Diagnostics page |
| 99 | +- [ ] Fix MODEL_ICONS in coding_agent.html (C/X/G/⊕) — keep as text abbreviations (these are intentional) |
| 100 | +- [ ] Verify coding_agent.html has logo in header (currently favicon only) |
| 101 | +**Escalation:** Hudson if >5 iterations |
| 102 | + |
| 103 | +--- |
| 104 | + |
| 105 | +## INTEGRATION RULES |
| 106 | + |
| 107 | +1. All new views follow existing patterns (fetch on mount, auto-refresh where needed) |
| 108 | +2. All new API routes follow existing handler pattern in server.py |
| 109 | +3. All new views exported as named + default export |
| 110 | +4. All new routes registered in router section of server.py |
| 111 | +5. Tests must stay 100% passing after every chunk |
| 112 | +6. No hardcoded ports — use httpPort prop |
| 113 | +7. Error states shown with existing .error-banner / .page-error classes |
| 114 | +8. Loading states shown with .app-loading-spinner |
| 115 | + |
| 116 | +--- |
| 117 | + |
| 118 | +## AGENT HANDOFF PROTOCOL |
| 119 | + |
| 120 | +``` |
| 121 | +Ralph Loop → chunk complete |
| 122 | + ↓ |
| 123 | +backend-architect → migration/wiring verification |
| 124 | + ↓ |
| 125 | +Next chunk (Ralph Loop) |
| 126 | + ↓ |
| 127 | +[After all chunks] |
| 128 | + ↓ |
| 129 | +Alex → assemble + integration check |
| 130 | + ↓ |
| 131 | +Kraken → live audit + fix |
| 132 | + ↓ |
| 133 | +DONE |
| 134 | +``` |
0 commit comments