Marius Mutu
3e7818286b
feat(ralph): rate limit budget tracking + whatsapp text-keywords
Task #1 — Rate limit budget tracking MVP:
- tools/ralph_usage.py: pure functions (extract_usage_entry, parse_usage_jsonl,
aggregate_by_day/_project, filter_by_days, summarize) + CLI append/summarize
subcommands. Atomic write via temp+rename.
- tools/ralph/ralph.sh: după fiecare claude -p, append usage entry
derivat din JSON envelope la <project>/scripts/ralph/usage.jsonl. Best-effort,
niciodată blochează rularea (|| true).
- dashboard/handlers/ralph.py: GET /api/ralph/usage[?days=N] aggregează cross-
project și returnează {today_cost, today_runs, by_project, by_day, ...}.
Task #2 — WhatsApp text-keyword commands:
- src/router.py: helper _translate_whatsapp_text mapează "aprob"/"stop <slug>"/
"stare [<slug>]" → /a, /k, /l. Apelat DOAR pe adapter whatsapp în
_try_ralph_dispatch (Discord/TG nu sunt afectate). NU acoperim propose
intentionat — descrierea liberă e prea fragilă pentru parsing text-only.
Tests: 49 noi (test_ralph_usage 28 + test_whatsapp_keywords 21) + 4 noi în
test_dashboard_ralph_endpoint pentru /api/ralph/usage. Toate trec; regression
suite (test_router, test_router_planning, test_dashboard_ralph_endpoint,
test_whatsapp) — 90/90 pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 19:05:50 +00:00
..
2026-04-21 07:01:30 +00:00
2026-04-26 19:05:50 +00:00
2026-04-21 07:01:30 +00:00
2026-04-26 19:05:50 +00:00
2026-04-21 07:01:30 +00:00
2026-04-21 07:01:30 +00:00
2026-04-21 07:11:41 +00:00
2026-04-21 07:19:23 +00:00
2026-04-21 07:01:30 +00:00
2026-04-25 21:44:58 +00:00
2026-04-21 13:56:53 +00:00
2026-04-21 07:01:30 +00:00
2026-04-21 13:56:53 +00:00
2026-04-21 13:56:53 +00:00
2026-04-26 15:56:52 +00:00
2026-04-21 07:01:30 +00:00
2026-04-25 21:42:42 +00:00
2026-04-21 10:23:21 +00:00
2026-04-21 13:56:53 +00:00
2026-04-26 18:36:35 +00:00
2026-04-25 21:42:42 +00:00
2026-04-25 22:19:07 +00:00
2026-04-21 07:01:30 +00:00
2026-04-26 08:06:52 +00:00
2026-04-21 13:56:53 +00:00
2026-04-21 10:23:21 +00:00