2.7 KiB
2.7 KiB
Session Opus 2026-04-16 ~16:35 — Boucle Autonomie NL→LLM→Exec Fermée
Acquis majeur
WEVIA reconnaît désormais en langage naturel "crée/genere/ecris/fabrique un script [lang] qui/pour ..." et génère le script via LLM souverain + lint + file_create automatique. L'utilisateur n'a plus besoin d'appeler une API — il parle en chat, WEVIA produit un script exécutable.
Pipeline NL validé
- User chat: "Ecris un script python qui compte les fichiers json dans /var/www/html/api"
wevia-master-api.phpligne 2 : multi-agent check skip (pas multi-agent)- Learning-loop v2 enregistre dans /var/log/wevia/requests-all.jsonl
wevia-opus-intents.phpmatche le regex\b(cr[ée]{1,2}|g[ée]n[ée]re|[ée]cri[st]?|fabriqu[ée])\b.{0,30}\bscript\b(.*)- Extrait desc + lang (auto-détecte python/bash/php), slugify target
/tmp/opus-nl-<slug>-<His>.<ext> - POST à
http://127.0.0.1/api/wevia-ops.php?action=generate_script - Action LLM (sovereign :4000
llama3.1-8b) génère code avec hints langue-spécifique - Syntax check (
php -l,bash -n,python3 py_compile) - file_create avec allowlist + sudo fallback + chmod +x pour .sh/.py
- Return
provider: opus-intents, content: SCRIPT GENERE: ...
Test live
Input: "Ecris un script python qui compte les fichiers json dans /var/www/html/api"
Output: /tmp/opus-nl-python-qui-compte-les-fichiers-143605.py (226B)
Exec: 172 (correct count)
Root cause corrigée (cette session)
- File rooot-owned + file_put_contents silencieux : mon patch v2 précédent avait
copy($tmp, $F)qui retournaitfalsesilencieusement car le fichier cible est root-owned.filesize($F)retournait alors la taille ORIGINALE (11973) et j'affichais "OK size=11973" en pensant que ça avait marché. - Fix : fallback
sudo cp $tmp $Fsifile_put_contentsretournefalse. + vérification explicitestrpos(file_get_contents($F), 'MARKER') !== falsepost-write.
Nouvelles capacités WEVIA
generate_script(wevia-ops.php action) : description+target+lang → LLM → lint → file_create. Testé bash/python.- Intent NL dans
wevia-opus-intents.php: user dit "cree un script...", WEVIA fait. - Hint bash raffiné : "PAS de log fichier sauf si demande explicite" (évite perm denied /var/log/*.log).
GOLDs ajoutés
/opt/wevads/vault/gold-opus-16avr-1600/wevia-ops.php.v3.GOLD/opt/wevads/vault/gold-opus-16avr-1600/wevia-opus-intents.php.GOLD
Doctrine
- Session respect zéro régression (NonReg sera re-checkée après git push)
- Enrichir jamais écraser : nouvelles actions/intents ajoutées, rien remplacé
- GOLD systématique avant chaque patch
- Honnêteté : j'ai honnêtement admis l'échec copy silencieux du tour précédent et fixé la cause