Skip to content

Commit bdda691

Browse files
authored
Merge branch 'main' into claude/plan-desktop-app-aaSsY
2 parents c8a2b94 + dc482f7 commit bdda691

251 files changed

Lines changed: 54831 additions & 688 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Python Verify
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
verify:
11+
runs-on: windows-latest
12+
steps:
13+
- name: Check out repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.12"
20+
21+
- name: Install package and test dependencies
22+
run: python -m pip install --upgrade pip && python -m pip install .[dev]
23+
24+
- name: Verify Python source and built wheel
25+
run: python scripts/verify_python_build.py

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,50 @@ CATO_SESSION_*.md
4040
*_SESSION_*.md
4141
*_EXECUTION.md
4242
*_IMPLEMENTATION_REPORT.md
43+
44+
# Dev session docs and checklists (personal working files)
45+
CATO_BUILD_IMPROVEMENTS_CHECKLIST.md
46+
CATO_BUILD_POTENTIAL_ISSUES.md
47+
CATO_BUILD_RISKS.md
48+
CATO_CLI_INTEGRATION_CHECKLIST.md
49+
CATO_FINAL_TEST_REPORT.md
50+
CATO_GENESIS_BRAINSTORM.md
51+
CATO_HUDSON_REVIEW_M3.md
52+
CATO_HUDSON_REVIEW_M4.md
53+
DAEMON_RESTART_COMPLETE.md
54+
SKILLS_RECOGNITION_FIX_VERIFIED.md
55+
TELEGRAM_DESKTOP_INTEGRATION_FIX.md
56+
TELEGRAM_INTEGRATION_COMPLETE.md
57+
desktop/WINDOWS_BUILD.md
58+
59+
# Kraken/test run artifacts
60+
kraken_e2e_report.json
61+
kraken_e2e_test.py
62+
kraken_test_output.txt
63+
kraken_test_run.txt
64+
test_skills.py
65+
66+
# Local bridge/startup scripts (machine-specific)
67+
launch_bridge.py
68+
register_telegram_bridge_task.ps1
69+
start_telegram_bridge.ps1
70+
scripts/install_watchdog.ps1
71+
72+
# Utility scripts (local dev only)
73+
scripts/sync_version.py
74+
scripts/verify_python_build.py
75+
76+
# Claude Code session data
77+
.claude/
78+
79+
# Log directories
80+
logs/
4381
# Desktop app build artifacts
4482
desktop/src-tauri/target/
4583
desktop/dist/
4684
desktop/node_modules/
4785
desktop/src-tauri/binaries/
86+
87+
# Ralph Loop state directories
88+
Ralph Loop Desktop APP/
89+
Ralph Loop Web UI/

.ralph/guardrails.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# RALPH LOOP GUARDRAILS
2+
# Cato Integration Project
3+
4+
## HARD RULES
5+
1. Tests MUST stay 100% passing after every iteration — check with: python -m pytest tests/ -x -q --tb=short
6+
2. Never rename existing Python modules (breaks imports + tests)
7+
3. Never modify existing working API routes — only ADD new ones
8+
4. Never break existing desktop views — only ADD/MODIFY what's needed
9+
5. Max 5 iterations per chunk before Hudson escalation
10+
6. All file writes use dedicated Write/Edit tools — never bash echo/heredoc
11+
7. All new TSX files follow React functional component pattern with named + default export
12+
8. Never introduce hardcoded IP/port — use httpPort prop
13+
9. All new server.py route handlers have try/except with logger.error + graceful fallback
14+
10. Input validation on all new routes that take path params (regex allowlist on names)
15+
16+
## ITERATION PROTOCOL
17+
- Each iteration: implement → run tests → check output → fix if needed
18+
- If tests fail after 5 iterations: call Hudson agent, pass full error context
19+
- Hudson fixes, returns control, continue to next chunk
20+
21+
## NAMING CONVENTIONS
22+
- Views: PascalCase + "View" suffix (MemoryView, SystemView, etc.)
23+
- Routes: lowercase hyphenated (/api/memory/stats, /api/cli/status)
24+
- State variables: camelCase
25+
- CSS classes: kebab-case matching existing patterns
26+
27+
## DO NOT TOUCH
28+
- cato/orchestrator/clawflows.py (working, tests cover it)
29+
- cato/audit/* (working, tested)
30+
- cato/core/memory.py (working, tested)
31+
- Any file in tests/ (unless adding new tests)
32+
- pyproject.toml / Cargo.toml
33+
- conftest.py

.ralph/implementation_plan.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
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

Comments
 (0)