diff --git a/CLAUDE.md b/CLAUDE.md index 15de3e4..4ca02c1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -179,7 +179,7 @@ Live dashboard → /echo/ralph.html (polling 5s) — cards per proiect Pe **Discord**: slash commands native cu autocomplete dinamic: `/p ` listează workspace, `/a ` pending, `/k ` running. Modal cu `TextInput` pentru descriere. Critical pattern: `await interaction.response.defer(ephemeral=True)` în orice button callback cu I/O (Discord 3s timeout). Pe **Telegram**: `callback_ralph` cu pattern `^ralph:` rutează acțiuni; `ForceReply` pentru input text descriere. -Pe **WhatsApp**: text-only — meniu redirect la Discord/Telegram. +Pe **WhatsApp**: text-only — meniu redirect la Discord/Telegram. **Text-keyword shortcuts**: `aprob ` → `/a `, `stop ` → `/k `, `stare`/`stare ` → `/l`/`/l ` (case-insensitive, doar pe WhatsApp; Discord/Telegram nu sunt afectate). `propose` intentionally NOT covered — descrierea fragilă. **Aliasuri legacy** (funcționează încă pentru backwards compat): `!propose`, `!approve`, `!status`, `!stop`. @@ -197,11 +197,13 @@ Pe **WhatsApp**: text-only — meniu redirect la Discord/Telegram. | `tools/ralph/prd-template.json` | Template prd.json: stories cu `acceptanceCriteria[]`, `tags[]`, `dependsOn[]`, `passes`, `retries` | | `tools/ralph_prd_generator.py` | Generează prd.json. Cu `final_plan_path` (de la PlanningOrchestrator) → Opus extrage stories cu acceptance criteria. Fără → backwards-compat description-only | | `tools/ralph_dag.py` | Pure functions Python (testabile): `infer_tags_from_paths`, `force_include_tags`, `topological_eligible`, `mark_failed`, blocked propagation iterativă. CLI subcommands chemate din ralph.sh (`infer-tags`, `next-story`, `mark-failed`, `incr-retry`) | +| `tools/ralph_usage.py` | Rate limit budget tracking: pure functions `extract_usage_entry`, `parse_usage_jsonl`, `aggregate_by_day`, `aggregate_by_project` + CLI append/summarize. Atomic write JSONL | +| `~/workspace//scripts/ralph/usage.jsonl` | Append-only log per `claude -p` call (cost, tokens, model, duration) — generat din ralph.sh, agregat de `/api/ralph/usage` | | `~/workspace//scripts/ralph/final-plan.md` | Output planning agent — citit de PRD generator | | `~/workspace//scripts/ralph/prd.json` | PRD per proiect cu schema extinsă | | `~/workspace//scripts/ralph/logs/` | Loguri ralph.sh per rulare | -| `dashboard/handlers/ralph.py` | Endpoints `/api/ralph/status`, `//log`, `//prd`, `//stop` | -| `dashboard/ralph.html` | UI live cards, polling 5s, status badges, ETA, butoane log/prd/stop | +| `dashboard/handlers/ralph.py` | Endpoints `/api/ralph/status`, `//log`, `//prd`, `//stop`, `//rollback`, `/usage[?days=N]`, `/stream` (SSE) | +| `dashboard/ralph.html` | UI live cards, status badges, ETA, butoane log/prd/stop/rollback. Realtime via EventSource cu fallback la polling 5s; badge 🟢 Live / ⏱ Polling | | `dashboard/.env` | `GITEA_TOKEN` pentru clone HTTPS la `gitea.romfast.ro` | **Status flow:** `pending` → (`planning` →) `approved` → `running` → `complete` / `failed` / `stopped` / `blocked` (DAG)