chore(specs): sync ai-agentic embedded spec_kit state #13

Merged
electron-rare merged 1 commits from codex/agentic-credit-local-optimization into main 2026-02-21 18:44:56 +00:00
2 changed files with 206 additions and 46 deletions
+148 -22
View File
@@ -1,28 +1,154 @@
# Axe damélioration : badge & conformité
# Tasks autonomie locale (execution)
- Automatiser la génération, vérification et publication des badges (sécurité, SBOM, doc, qualité, communauté, coverage)
- Centraliser guides badge dans docs/badges/
- Vérifier la fraîcheur des badges à chaque commit (timestamp ≥ commit)
- Inclure badges et rapports dans levidence pack
- Ajouter checklist badge en tête du README
- Documenter la politique badge & conformité (docs/COMPLIANCE.md)
- Planifier un audit badge à chaque release majeure
Last updated: 2026-02-21
## Planification audit badge
Format:
- À chaque release majeure, exécuter un audit badge:
- Vérifier la couleur et lactualisation de chaque badge
- Vérifier la présence des rapports JSON
- Vérifier linclusion dans levidence pack
- Documenter les résultats dans docs/badges/audit_<release>.md
# Easter Egg musique concrète
- `[ ]` non fait
- `[x]` fait
- `AC` = acceptance criteria
- `Evidence` = fichier/commande de preuve
_« Les tâches sont des sons trouvés: chaque action, chaque gate, est une pièce du puzzle acousmatique. »_ — Pierre Schaeffer
# Tasks (Backlog exécutable)
## Sprint actuel
Format conseillé (copiable en GitHub Issues) :
- [x] T-001 - Merger la PR autonomie ZeroClaw
- AC: PR mergee sur `main`.
- Evidence: `https://github.com/electron-rare/Kill_LIFE/pull/5`
- [ ] T1 — ...
- AC: ...
- Evidence: ...
- [ ] T2 — ...
- [x] T-002 - Fermer ou merger la PR miroir restante
- AC: plus de PR redondante ouverte pour le meme scope.
- Evidence: `gh pr list --state open`
- [x] T-003 - Configurer secret fallback OpenRouter local
- AC: `~/.zeroclaw/env` present avec `OPENROUTER_API_KEY` et mode `600`.
- Evidence: `ls -l ~/.zeroclaw/env`
- [x] T-004 - Installer backend Prometheus local
- AC: commande `prometheus --version` disponible.
- Evidence: sortie shell `prometheus, version ...`
- [x] T-005 - Stabiliser pairing bearer auto
- AC: `artifacts/zeroclaw/pair_token.txt` utilisable pour webhook sans override manuel.
- Evidence: `tools/ai/zeroclaw_webhook_send.sh --repo-hint rtc "pairing check"`
- Status: `2026-02-21` done (401 resolved + webhook HTTP 200 after provider/model auto-fix in stack bootstrap).
- [x] T-006 - Activer fallback IA locale (macOS)
- AC: `ollama` installe, service actif, modele local disponible, stack capable de le preferer.
- Evidence: `tools/ai/ollama_local_setup.sh --no-pull --no-warmup` + config `default_provider = "ollama"`.
- Status: `2026-02-21` done (`llama3.2:1b` local); mode local est optionnel via `ZEROCLAW_PREFER_LOCAL_AI=1` pour garder la fiabilite webhook par defaut.
- [x] T-007 - Renforcer mode local-only agentic (ZeroClaw + OpenClaw)
- AC: `tools/ai/zeroclaw_dual_chat.sh <repo> --local-only --provider-check` choisit un provider local (`ollama` ou `lmstudio`) sinon exit explicite.
- Evidence: sortie provider-check + `openclaw models status --plain`.
- Status: `2026-02-21` done (`openclaw` default model force sur `ollama/llama3.2:1b`, fallbacks `openai-codex` puis `openrouter`).
- [x] T-008 - Scanner les options provider/agentic disponibles
- AC: rapport local avec statut runtime `openclaw/ollama/lmstudio/litellm` et matrice providers ZeroClaw.
- Evidence: `tools/ai/zeroclaw_provider_scan.sh --no-refresh` -> `artifacts/zeroclaw/provider_options.md`.
- Status: `2026-02-21` done.
- [x] T-009 - Verrouiller le mapping matériel par cible
- AC: la détection automatique affecte `zacus` aux ports `usbmodem`/S3 et `rtc` à lAudio Kit (pas dinterversion habituelle).
- Evidence:
- `ZEROCLAW_ZACUS_UPLOAD_PORT_HINT="1a86,usbmodem,ch340,freenove" tools/ai/zeroclaw_hw_firmware_loop.sh zacus --port '' --monitor-secs 5`
- `ZEROCLAW_RTC_UPLOAD_PORT_HINT="cp2102,10c4,esp32audiokit,audio" tools/ai/zeroclaw_hw_firmware_loop.sh rtc --port '' --monitor-secs 5`
- Status: `2026-02-21` done (`usbmodem` prioritaire pour zacus, `usbmodem` pénalisé pour rtc).
## Boucle hardware RTC
- [x] T-101 - Discover hardware RTC
- AC: au moins un port detecte pour carte RTC.
- Evidence: `tools/ai/zeroclaw_dual_chat.sh rtc --hardware`
- [x] T-102 - Build firmware RTC
- AC: `pio run -e esp32dev` termine sans erreur bloquante.
- Evidence: logs build RTC.
- Status: `2026-02-21` done.
- [x] T-103 - Upload + monitor RTC (forced default)
- AC: `pio run -e esp32dev -t upload` puis monitor 60s executes.
chatgpt-codex-connector[bot] commented 2026-02-21 18:46:36 +00:00 (Migrated from github.com)
Review

P2 Badge Remove unsupported --local-only invocation from acceptance criteria

The AC here requires tools/ai/zeroclaw_dual_chat.sh <repo> --local-only --provider-check, but tools/ai/zeroclaw_dual_chat.sh does not implement a --local-only flag (usage only lists --hardware, --provider-check, --cheap, and the parser falls back to usage/error for unknown first options). As written, operators following this spec cannot reproduce the claimed check and will hit a failure path instead of enforcing local-provider-only behavior.

Useful? React with 👍 / 👎.

**<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Remove unsupported --local-only invocation from acceptance criteria** The AC here requires `tools/ai/zeroclaw_dual_chat.sh <repo> --local-only --provider-check`, but `tools/ai/zeroclaw_dual_chat.sh` does not implement a `--local-only` flag (usage only lists `--hardware`, `--provider-check`, `--cheap`, and the parser falls back to usage/error for unknown first options). As written, operators following this spec cannot reproduce the claimed check and will hit a failure path instead of enforcing local-provider-only behavior. Useful? React with 👍 / 👎.
- Evidence: logs upload/monitor RTC.
- Status: `2026-02-21` done (`ESP32-D0WD-V3` flash + serial monitor output captured).
- [x] T-104 - Trace webhook RTC
- AC: une ligne JSONL avec `repo_hint=rtc` apparait.
- Evidence: `artifacts/zeroclaw/conversations.jsonl`
- Status: `2026-02-21` done (`http_status=200`, `ok=true`).
## Boucle hardware Zacus
- [x] T-201 - Discover hardware Zacus
- AC: au moins un port detecte pour carte Zacus.
- Evidence: `tools/ai/zeroclaw_dual_chat.sh zacus --hardware`
chatgpt-codex-connector[bot] commented 2026-02-21 18:46:36 +00:00 (Migrated from github.com)
Review

P2 Badge Replace ineffective port-hint vars with supported upload settings

These evidence commands rely on ZEROCLAW_ZACUS_UPLOAD_PORT_HINT and ZEROCLAW_RTC_UPLOAD_PORT_HINT to lock board-to-port mapping, but tools/ai/zeroclaw_hw_firmware_loop.sh only reads ZEROCLAW_UPLOAD_PORT (or --port) and otherwise auto-detects from pio device list; it never consumes either hint variable. That means the documented procedure does not actually enforce the claimed mapping fix and can still select the wrong serial device during hardware loops.

Useful? React with 👍 / 👎.

**<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Replace ineffective port-hint vars with supported upload settings** These evidence commands rely on `ZEROCLAW_ZACUS_UPLOAD_PORT_HINT` and `ZEROCLAW_RTC_UPLOAD_PORT_HINT` to lock board-to-port mapping, but `tools/ai/zeroclaw_hw_firmware_loop.sh` only reads `ZEROCLAW_UPLOAD_PORT` (or `--port`) and otherwise auto-detects from `pio device list`; it never consumes either hint variable. That means the documented procedure does not actually enforce the claimed mapping fix and can still select the wrong serial device during hardware loops. Useful? React with 👍 / 👎.
- [x] T-202 - Build firmware Zacus
- AC: `pio run -e esp32dev` (dans `hardware/firmware`) termine sans erreur bloquante.
- Evidence: logs build Zacus.
- Status: `2026-02-21` done.
- [x] T-203 - Upload + monitor Zacus (forced default)
- AC: `pio run -e <env valide> -t upload` puis monitor executes.
- Evidence: logs upload/monitor Zacus.
- Status: `2026-02-21` done (`ESP32-S3` detecte, env fallback `freenove_esp32s3`, flash + monitor OK).
- [x] T-204 - Trace webhook Zacus
- AC: une ligne JSONL avec `repo_hint=zacus` apparait.
- Evidence: `artifacts/zeroclaw/conversations.jsonl`
- Status: `2026-02-21` done (`http_status=200`, `ok=true`).
## Observabilite et cout
- [x] T-301 - Stack endpoints smoke
- AC: `3000/health`, `8788`, `9090/-/ready` tous OK.
- Evidence: captures `curl`.
- [x] T-302 - Dry-run webhook budget
- AC: `--dry-run` passe sans ecriture execution JSONL.
- Evidence: sortie script + diff JSONL.
- Status: `2026-02-21` done.
- [x] T-303 - Quota call limiter
- AC: depassement quota bloque avec code non-zero.
- Evidence: message `[budget] hourly call limit reached`.
- Status: `2026-02-21` done (test sandbox local `max_calls=1`, second call blocked with exit 12).
- [x] T-304 - Quota chars limiter
- AC: message trop long bloque avec code non-zero.
- Evidence: message `[budget] message length ... exceeds ...`.
- Status: `2026-02-21` done (`ZEROCLAW_WEBHOOK_MAX_CHARS=5`, exit 11).
## Integrations Open WebUI + n8n
- [x] T-401 - Ajouter API alerts + autotriage backend
- AC: endpoints `/api/alerts`, `/api/alerts/ack`, `/api/pr/autotriage` disponibles.
- Evidence: `tools/ai/zeroclaw_orchestrator_server.py`.
- [x] T-402 - Etendre WebUI orchestrateur
- AC: panneau Alerts + Integrations status + action `PR autotriage now`.
- Evidence: `tools/ai/zeroclaw_stack_up.sh`.
- [x] T-403 - Refactor Pipe Open WebUI en mapping mixte
- AC: pipe expose `zc.router` + modeles dedies et parsing `/run`/`/pr`.
- Evidence: `tools/ai/integrations/openwebui/zeroclaw_orchestrator_pipe.py`.
- [x] T-404 - Ajouter workflow n8n PR autotriage
- AC: workflow avec Webhook + Cron fallback + alert/question outputs.
- Evidence: `tools/ai/integrations/n8n/zeroclaw_pr_autotriage_workflow.json`.
- [x] T-405 - Ajouter provisioning local Docker integrations
- AC: compose + scripts `up/down/status` + import n8n + assist Open WebUI.
- Evidence:
- `tools/ai/integrations/docker/docker-compose.openwebui-n8n.yml`
- `tools/ai/zeroclaw_integrations_up.sh`
- `tools/ai/zeroclaw_integrations_down.sh`
- `tools/ai/zeroclaw_integrations_status.sh`
- `tools/ai/zeroclaw_integrations_import_n8n.sh`
- `tools/ai/zeroclaw_integrations_openwebui_assist.sh`
## Definition of done
- [x] Au moins une boucle complete RTC + Zacus executee en local.
- [x] Dashboard live exploitable pour suivi continu.
- [x] Prometheus disponible avec target gateway scrapee.
- [x] Logs et preuves archives dans `artifacts/zeroclaw/`.
- [x] Aucune commande documentee n'utilise `-e native` ou `-e test`.
@@ -1,36 +1,70 @@
# TODO: Dual Hardware Autonomy (RTC + Zacus)
# TODO: Dual hardware autonomy runbook (RTC + Zacus)
Last updated: 2026-02-21
## Phase A: Local Baseline
## Immediate now
- [ ] Run `tools/ai/zeroclaw_dual_bootstrap.sh` and capture hardware snapshot.
- [ ] Validate `tools/ai/zeroclaw_dual_chat.sh rtc -m "<diagnostic prompt>"`.
- [ ] Validate `tools/ai/zeroclaw_dual_chat.sh zacus -m "<diagnostic prompt>"`.
- [ ] Record detected ports and map preferred role per board.
- [x] I-001 - Merge autonomie stack into `main` (`PR #5`).
- [x] I-002 - Configure local secret file `~/.zeroclaw/env` (`OPENROUTER_API_KEY` placeholder + mode `600`).
- [x] I-003 - Ensure local Prometheus backend exists (`prometheus` binary installed).
- [x] I-004 - Resolve open mirror PR redundancy (`PR #7` merge/close decision).
- [x] I-005 - Enable local AI fallback (`ollama` + local model) for credit savings.
- [x] I-006 - Enforce local-only chat mode option (`--local-only`) with `ollama/lmstudio` detection.
- [x] I-007 - Align OpenClaw default model to local `ollama/llama3.2:1b` + cloud fallbacks for continuity.
- [x] I-008 - Add provider/agentic scanner (`tools/ai/zeroclaw_provider_scan.sh`) for live capability matrix.
## Phase B: Repo Specs and PR Cadence
## Daily autonomous sequence
- [ ] Create/refresh one issue in `RTC_BL_PHONE` for ZeroClaw-assisted hardware loop.
- [ ] Create/refresh one issue in `le-mystere-professeur-zacus` for ZeroClaw-assisted hardware loop.
- [ ] Open one small PR per repo focused on one gate (build, tests, hardware smoke, docs).
- [ ] Require code review pass before merge (`gh pr review --approve` only after checks).
- [x] D-001 - `tools/ai/zeroclaw_stack_down.sh` then `ZEROCLAW_PROM_MODE=auto tools/ai/zeroclaw_stack_up.sh`.
- [x] D-002 - Smoke endpoints:
- `curl -fsS http://127.0.0.1:3000/health`
- `curl -fsS http://127.0.0.1:8788/`
- `curl -fsS http://127.0.0.1:9090/-/ready`
- [x] D-003 - RTC loop:
- `tools/ai/zeroclaw_dual_chat.sh rtc --provider-check`
- `tools/ai/zeroclaw_dual_chat.sh rtc --hardware`
- `tools/ai/zeroclaw_hw_firmware_loop.sh rtc` (build+upload+monitor forced default)
- webhook trace with `--repo-hint rtc`
- status: `2026-02-21` done (flash + monitor + webhook HTTP 200).
- [x] D-004 - Zacus loop:
- `tools/ai/zeroclaw_dual_chat.sh zacus --provider-check`
- `tools/ai/zeroclaw_dual_chat.sh zacus --hardware`
- `tools/ai/zeroclaw_hw_firmware_loop.sh zacus` (build+upload+monitor forced default)
- webhook trace with `--repo-hint zacus`
- status: `2026-02-21` done (ESP32-S3 mismatch auto-corrected to `freenove_esp32s3`).
- [x] D-005 - Review `artifacts/zeroclaw/gateway.log` + `conversations.jsonl`.
## Phase C: Autonomy + Cost Optimization
- [x] D-006 - Corriger l'association cible↔port
- `RTC_UPLOAD_PORT_HINT` cible Audio Kit (`cp2102`, `esp32audiokit`, `audio`).
- `ZACUS_UPLOAD_PORT_HINT` cible Freenove/S3 (`usbmodem`, `1a86`, `ch340`, `freenove`).
- status: `2026-02-21` done.
- [ ] Keep prompts short, target one repo at a time.
- [ ] Use provider auto-fallback (`copilot` -> `openai-codex` -> `openrouter`) to avoid dead sessions.
- [ ] Add repo-level path filters in workflows to avoid expensive irrelevant runs.
- [ ] Use `workflow_dispatch` for hardware-required jobs to avoid noisy CI failures.
## Hardware safety gates
## Phase D: Hardware Robustness
- [x] H-001 - Flash/upload/monitor are forced by default when a board is detected.
- [x] H-002 - Resolve stable serial target before upload.
- [x] H-003 - Keep per-run logs under `artifacts/zeroclaw/`.
- [ ] Add serial-port resolver step before every upload/flash action.
- [ ] Fail fast if no expected USB device is detected.
- [ ] Archive logs per run for replayability (`artifacts/<timestamp>/...`).
## Cost/control gates
## Exit Criteria
- [x] C-001 - Validate `tools/ai/zeroclaw_webhook_send.sh --dry-run`.
- [x] C-002 - Validate hourly quota guard (`ZEROCLAW_WEBHOOK_MAX_CALLS_PER_HOUR`).
- [x] C-003 - Validate message length guard (`ZEROCLAW_WEBHOOK_MAX_CHARS`).
- [ ] Both repos can be targeted with one command (`rtc` or `zacus`) without workspace leakage.
- [ ] Hardware discovery passes before action on connected boards.
- [ ] At least one successful PR cycle completed per repo with this orchestration path.
## Exit criteria
- [x] E-001 - One successful complete loop RTC in local hardware.
- [x] E-002 - One successful complete loop Zacus in local hardware.
- [x] E-003 - Dashboard live usable for continuous supervision.
- [x] E-004 - Prometheus target scrape confirmed on gateway metrics.
## Integrations (Open WebUI + n8n)
- [x] I-201 - Add mixed Open WebUI Pipe mapping (`zc.router` + dedicated models).
- [x] I-202 - Add n8n PR autotriage workflow (webhook + cron fallback).
- [x] I-203 - Add local docker compose stack for Open WebUI (`3001`) and n8n (`5678`).
- [x] I-204 - Add runtime scripts (`integrations_up/down/status`, `import_n8n`, `openwebui_assist`).
- [ ] I-205 - Validate end-to-end import + activation on local Docker runtime.
- command: `tools/ai/zeroclaw_integrations_up.sh`
- command: `tools/ai/zeroclaw_integrations_status.sh`
- command: `tools/ai/zeroclaw_integrations_import_n8n.sh`