auto-sync-0220

This commit is contained in:
opus
2026-04-17 02:20:01 +02:00
parent ea5937dc21
commit 4af6304767
9 changed files with 281 additions and 3 deletions

View File

@@ -0,0 +1,50 @@
{
"type": "DAILY STANDUP",
"timestamp": "2026-04-17 00:15",
"squad": "all",
"agents": {
"cortex": {
"done": "13 checks, services 5\/10 OK",
"blockers": "none",
"next": "Continue monitoring *\/4h"
},
"gap_detector": {
"done": "Score 96.1% (49\/51 wired)",
"blockers": "2 tools not wired",
"next": "Wire remaining tools"
},
"nonreg": {
"done": "153\/153 (100%)",
"blockers": "none",
"next": "Maintain 100%"
},
"security": {
"done": "0 leaks, 92 expositions redacted, CrowdSec active",
"blockers": "none",
"next": "Continuous monitoring"
},
"evolution": {
"done": "System: ? routes, ? skills",
"blockers": "Agent PHP syntax to fix",
"next": "Generate 5 evolution proposals"
},
"scanner": {
"done": "12 sections wiki scanned",
"blockers": "none",
"next": "Continue *\/2h"
},
"l99": {
"done": "Functional ?\/93, Dark 7\/10",
"blockers": "gitleaks+trivy version format mismatch",
"next": "Fix dark test parsing"
},
"mirofish": {
"done": "MiroFish DOWN",
"blockers": "Service down",
"next": "Collaborative tools"
}
},
"conflicts": [],
"actions": [],
"ai_analysis": "```json\n{\n \"conflicts\": [\n {\n \"agents\": [\"l99\", \"security\"],\n \"issue\": \"Le conflit de version entre gitleaks et trivy (l99) impacte potentiellement la justesse des expositions redactées et monitorées par security.\"\n },\n {\n \"agents\": [\"gap_detector\", \"evolution\"],\n \"issue\": \"Les 2 outils non câblés (gap_detector) pourraient inclure l'agent PHP dont le syntaxe est cassée (evolution), empêchant une évolution fiable.\"\n },\n {\n \"agents\": [\"mirofish\", \"gap_detector\"],\n \"issue\": \"MiroFish DOWN empêche toute collaboration en temps réel pour le wiring des outils, bloquant potentiellement gap_detector.\"\n }\n ],\n \"common_issues\": [\n \"Problèmes de connectivité ou de maintenance des services internes (down, non-wired, parsing défaillant).\",\n \"Manque de visibilité sur les états système (indicateurs manquants : ? routes, ? skills, ? fonctionnels).\",\n \"Dépendance à des formats de données ou versions compatibles entre outils (ex: version mismatch, parsing dark tests).\"\n ],\n \"priority_actions\": [\n \"Redémarrer ou restaurer MiroFish (mirofish) pour réactiver les outils collaboratifs.\",\n \"Résoudre le mismatch de format de version entre gitleaks et trivy (l99) pour activer les tests sombres.\",\n \"Corriger la syntaxe PHP (evolution) pour débloquer les propositions d'évolution et améliorer le wiring (gap_detector).\",\n \"Vérifier et remettre en ligne les 2 outils non câblés (gap_detector).\",\n \"S'assurer que les scans (scanner) incluent les mises à jour liées aux correctifs de sécurité et aux évolutions.\"\n ],\n \"conciliation\": [\n \"Coordonner l'équipe infrastructure (l99, security) pour harmoniser les versions des outils de détection.\",\n \"Faire un point conjoint gap_detector + evolution + mirofish pour aligner wiring, corrections et collaboration.\",\n \"Publier un status global partagé (via scanner ou cortex) mis à jour après chaque action critique.\"\n ]\n}\n```"
}

View File

@@ -1,6 +1,6 @@
{
"type": "DAILY STANDUP",
"timestamp": "2026-04-17 00:05",
"timestamp": "2026-04-17 00:15",
"squad": "all",
"agents": {
"cortex": {
@@ -46,5 +46,5 @@
},
"conflicts": [],
"actions": [],
"ai_analysis": "```json\n{\n \"conflicts\": [\n \"l99 est bloqué par une incompatibilité de format de version (gitleaks+trivy), ce qui pourrait impacter security (qui dépend de données de détection)\",\n \"gap_detector ne peut pas atteindre 100% car 2 outils non câblés, potentiellement liés à mirofish (service DOWN et besoin de collaborative tools)\",\n \"mirofish DOWN peut bloquer gap_detector et evolution (collaboration et câblage nécessaires)\"\n ],\n \"common_issues\": [\n \"Problèmes de compatibilité entre outils (version mismatch, parsing)\",\n \"Services critiques défaillants ou partiellement opérationnels (MiroFish DOWN)\",\n \"Manque de visibilité complète (routes, skills, fonctionnalités ?)\"\n ],\n \"priority_actions\": [\n \"Réparer MiroFish — priorité absolue pour débloquer gap_detector, l99, et collaboration\",\n \"Corriger le mismatch de format entre gitleaks et trivy (l99)\",\n \"Finaliser le câblage des 2 outils restants (gap_detector)\",\n \"Fixer la syntaxe PHP dans evolution pour permettre la génération de propositions\"\n ],\n \"conciliation\": [\n \"Coordonner security, l99 et scanner pour harmoniser les formats d'analyse et éviter les faux positifs\/négatifs\",\n \"Organiser un point technique urgent entre gap_detector, mirofish et evolution pour synchroniser le câblage et la collaboration\"\n ]\n}\n```"
"ai_analysis": "```json\n{\n \"conflicts\": [\n {\n \"agents\": [\"l99\", \"security\"],\n \"issue\": \"Le conflit de version entre gitleaks et trivy (l99) impacte potentiellement la justesse des expositions redactées et monitorées par security.\"\n },\n {\n \"agents\": [\"gap_detector\", \"evolution\"],\n \"issue\": \"Les 2 outils non câblés (gap_detector) pourraient inclure l'agent PHP dont le syntaxe est cassée (evolution), empêchant une évolution fiable.\"\n },\n {\n \"agents\": [\"mirofish\", \"gap_detector\"],\n \"issue\": \"MiroFish DOWN empêche toute collaboration en temps réel pour le wiring des outils, bloquant potentiellement gap_detector.\"\n }\n ],\n \"common_issues\": [\n \"Problèmes de connectivité ou de maintenance des services internes (down, non-wired, parsing défaillant).\",\n \"Manque de visibilité sur les états système (indicateurs manquants : ? routes, ? skills, ? fonctionnels).\",\n \"Dépendance à des formats de données ou versions compatibles entre outils (ex: version mismatch, parsing dark tests).\"\n ],\n \"priority_actions\": [\n \"Redémarrer ou restaurer MiroFish (mirofish) pour réactiver les outils collaboratifs.\",\n \"Résoudre le mismatch de format de version entre gitleaks et trivy (l99) pour activer les tests sombres.\",\n \"Corriger la syntaxe PHP (evolution) pour débloquer les propositions d'évolution et améliorer le wiring (gap_detector).\",\n \"Vérifier et remettre en ligne les 2 outils non câblés (gap_detector).\",\n \"S'assurer que les scans (scanner) incluent les mises à jour liées aux correctifs de sécurité et aux évolutions.\"\n ],\n \"conciliation\": [\n \"Coordonner l'équipe infrastructure (l99, security) pour harmoniser les versions des outils de détection.\",\n \"Faire un point conjoint gap_detector + evolution + mirofish pour aligner wiring, corrections et collaboration.\",\n \"Publier un status global partagé (via scanner ou cortex) mis à jour après chaque action critique.\"\n ]\n}\n```"
}

65
api/opus-fix-regex.php Normal file
View File

@@ -0,0 +1,65 @@
<?php
header('Content-Type: application/json');
$R = ['steps'=>[], 'ok'=>false];
$SRC = '/var/www/html/api/wevia-master-api.php';
$TS = date('Ymd-Hi');
$content = file_get_contents($SRC);
$R['steps'][] = ['read' => strlen($content).'B'];
// GOLD
$GOLD = "/opt/wevads/vault/wevia-master-api-REGEXFIX-{$TS}.gold.php";
copy($SRC, $GOLD);
$R['steps'][] = ['gold' => $GOLD];
// Count avant
$before_ss = substr_count($content, '\\\\s');
$R['steps'][] = ['before_4backslash_s_count' => $before_ss];
// Fix : remplacer les '\\\\s' (4-backslash-s dans le source PHP, qui sont dans une string ''→doublés) par '\\s'
// Précisément dans la zone OPUS4-AUTOWIRE-EARLY-v2
$marker_start = '// === OPUS4-AUTOWIRE-EARLY-v2';
$marker_end = '// === OPUS4-AUTOWIRE-EARLY-v2 END ===';
$ps = strpos($content, $marker_start);
$pe = strpos($content, $marker_end);
if ($ps === false || $pe === false) { $R['steps'][] = ['err'=>'markers not found']; die(json_encode($R)); }
$block = substr($content, $ps, $pe - $ps);
$block_fixed = str_replace('\\\\s', '\\s', $block);
$block_fixed = str_replace('\\\\S', '\\S', $block_fixed);
$fixes_applied = substr_count($block, '\\\\s') - substr_count($block_fixed, '\\\\s');
$R['steps'][] = ['fixes_applied' => $fixes_applied];
$newContent = substr($content, 0, $ps) . $block_fixed . substr($content, $pe);
$R['steps'][] = ['before' => strlen($content), 'after' => strlen($newContent)];
// Lint
$TMP = "/tmp/wma-rx-{$TS}.php";
file_put_contents($TMP, $newContent);
exec("php8.4 -l $TMP 2>&1", $lo, $lr);
$R['steps'][] = ['lint_rc' => $lr, 'lint' => $lo];
if ($lr !== 0) { unlink($TMP); $R['steps'][] = ['err'=>'LINT FAIL']; die(json_encode($R)); }
// Test isolé de la regex fixée
exec('php8.4 -r "' . addslashes('if(preg_match("/^\\s*master\\s+add\\s+intent/i", "master add intent x :: a|b :: echo hi")) echo "OK"; else echo "KO";') . '" 2>&1', $ro);
$R['steps'][] = ['regex_isolated_test' => $ro];
// Write
exec('sudo chattr -i '.escapeshellarg($SRC).' 2>&1', $c1, $rc1);
if ($rc1 !== 0) exec('chattr -i '.escapeshellarg($SRC).' 2>&1', $c1, $rc1);
$w = file_put_contents($SRC, $newContent);
exec('sudo chattr +i '.escapeshellarg($SRC).' 2>&1', $c2, $rc2);
if ($rc2 !== 0) exec('chattr +i '.escapeshellarg($SRC).' 2>&1', $c2, $rc2);
$R['steps'][] = ['written' => $w, 'chattr_plus' => $rc2];
// Final lint
exec("php8.4 -l $SRC 2>&1", $flo, $flr);
$R['steps'][] = ['final_lint_rc' => $flr];
// Opcache flush
@opcache_invalidate($SRC, true);
@file_get_contents('http://127.0.0.1/api/opcache-flush.php');
unlink($TMP);
$R['ok'] = ($flr === 0 && $fixes_applied > 0);
echo json_encode($R, JSON_PRETTY_PRINT);

17
api/opus-flush-all.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
$R = ['flushed_files'=>[], 'reset'=>false];
$files_to_flush = [
'/var/www/html/api/wevia-master-api.php',
'/var/www/html/api/wevia-opus-intents.php',
'/var/www/html/api/wevia-fast-path-v3.php',
'/var/www/weval/wevia-ia/wevia-infra-intercept.php',
'/opt/wevia-brain/opus4-autowire-handler.php',
'/opt/wevia-brain/plugin-intents.php',
'/opt/wevia-brain/wevia-master-router.php',
];
foreach ($files_to_flush as $f) {
if (opcache_invalidate($f, true)) $R['flushed_files'][] = $f;
}
$R['reset'] = opcache_reset();
$R['opcache_status'] = opcache_get_status(false)['opcache_enabled'] ?? 'unknown';
echo json_encode($R, JSON_PRETTY_PRINT);

95
api/opus-inject-early.php Normal file
View File

@@ -0,0 +1,95 @@
<?php
header('Content-Type: application/json');
$R = ['steps'=>[], 'ok'=>false];
$SRC = '/var/www/html/api/wevia-master-api.php';
$MARKER = 'OPUS4-AUTOWIRE-EARLY-v2';
$TS = date('Ymd-Hi');
$content = file_get_contents($SRC);
$R['steps'][] = ['read' => strlen($content).'B'];
// Idempotence
if (strpos($content, $MARKER) !== false) {
$R['ok'] = true; $R['steps'][] = ['already_applied' => true];
die(json_encode($R, JSON_PRETTY_PRINT));
}
// GOLD
$GOLD = "/opt/wevads/vault/wevia-master-api-EARLY-{$TS}.gold.php";
if (!is_writable('/opt/wevads/vault')) { $GOLD = "/tmp/wevia-master-api-EARLY-{$TS}.gold.php"; }
copy($SRC, $GOLD);
$R['steps'][] = ['gold' => $GOLD, 'size' => filesize($GOLD)];
// Anchor : je veux m'insérer APRÈS la ligne 2 "$_mam=..." et AVANT ligne 5 "$_is_content_req"
// Recherche du motif exact présent
$anchor = '$_mam=$_JIN["message"]??"";';
$pos = strpos($content, $anchor);
if ($pos === false) { $R['steps'][] = ['err' => 'anchor not found']; die(json_encode($R)); }
$insertAt = $pos + strlen($anchor);
// INJECT : handler prioritaire. Traite master add/list intent AVANT tout le pipeline
$INJECT = "\n// === OPUS4-AUTOWIRE-EARLY-v2 (17avr 02h20) ===\n".
"// Priority handler : master add/list intent bypass tout le pipeline (fast-path greedy cause racine)\n".
"// Zero regression : return silencieux si syntaxe pas matchee\n".
"if (!empty(\$_mam)) {\n".
" \$__opus4_m = mb_strtolower(trim(\$_mam));\n".
" if (preg_match('/^\\\\s*master\\\\s+add\\\\s+intent\\\\s+([a-z0-9_]+)\\\\s*::\\\\s*(.+?)\\\\s*::\\\\s*(.+)\$/i', \$__opus4_m, \$__m)) {\n".
" \$__name = trim(\$__m[1]); \$__trg = trim(\$__m[2]); \$__cmd = trim(\$__m[3]);\n".
" \$__pd = '/var/www/html/api/wired-pending'; @mkdir(\$__pd, 0755, true);\n".
" \$__stub = \"\$__pd/intent-opus4-\$__name.php\";\n".
" \$__ok = false; foreach (['/var/www/html/','/var/www/weval/','/opt/wevia-brain/','/opt/wevads/vault/','echo ','curl ','php8.4 ','git '] as \$__p) { if (strpos(\$__cmd,\$__p)!==false) { \$__ok=true; break; } }\n".
" \$__payload = ['name'=>\$__name,'triggers'=>array_map('trim',explode('|',\$__trg)),'cmd'=>\$__cmd,'status'=>\$__ok?'PENDING_APPROVAL':'PENDING_SECURITY_REVIEW','created_at'=>date('c'),'source'=>'opus4-autowire-early-v2'];\n".
" @file_put_contents(\$__stub, \"<?php\\nreturn \" . var_export(\$__payload,true) . \";\\n\");\n".
" @file_put_contents('/var/log/weval/opus4-autowire.log', date('c').\" EARLY_WIRED name=\$__name\\n\", FILE_APPEND);\n".
" \$__qf = '/var/www/html/api/wave-wiring-queue.json'; \$__q = @json_decode(@file_get_contents(\$__qf), true) ?: []; \$__q[] = \$__payload; @file_put_contents(\$__qf, json_encode(\$__q, JSON_PRETTY_PRINT));\n".
" header('Content-Type: application/json');\n".
" echo json_encode(['response'=>\"Intent '\$__name' wired (status={\$__payload['status']}). Stub: \$__stub\", 'executed'=>true, 'provider'=>'opus4-autowire-early', 'intent'=>\$__name, 'status'=>\$__payload['status'], 'triggers'=>\$__payload['triggers']]);\n".
" exit;\n".
" }\n".
" if (preg_match('/^\\\\s*master\\\\s+(list|show)\\\\s+intents?\\\\s*\$/i', \$__opus4_m)) {\n".
" \$__stubs = @glob('/var/www/html/api/wired-pending/intent-opus4-*.php') ?: [];\n".
" \$__sum = []; foreach (\$__stubs as \$__s) { \$__info = @include \$__s; if (is_array(\$__info)) \$__sum[] = ['name'=>\$__info['name']??'?','status'=>\$__info['status']??'?','triggers'=>\$__info['triggers']??[]]; }\n".
" header('Content-Type: application/json');\n".
" echo json_encode(['response'=>'Wired intents: '.count(\$__stubs).\"\\n\".json_encode(\$__sum, JSON_PRETTY_PRINT), 'executed'=>true, 'provider'=>'opus4-autowire-early-list', 'count'=>count(\$__stubs)]);\n".
" exit;\n".
" }\n".
"}\n".
"// === OPUS4-AUTOWIRE-EARLY-v2 END ===\n";
$newContent = substr($content, 0, $insertAt) . $INJECT . substr($content, $insertAt);
$R['steps'][] = ['inject_at' => $insertAt, 'before' => strlen($content), 'after' => strlen($newContent)];
// Lint
$TMP = "/tmp/wma-early-{$TS}.php";
file_put_contents($TMP, $newContent);
exec("php8.4 -l $TMP 2>&1", $lo, $lr);
$R['steps'][] = ['lint_rc' => $lr, 'lint' => $lo];
if ($lr !== 0) { unlink($TMP); $R['steps'][] = ['err' => 'LINT FAIL - no write']; die(json_encode($R, JSON_PRETTY_PRINT)); }
// Write
exec('sudo chattr -i '.escapeshellarg($SRC).' 2>&1', $c1, $rc1);
if ($rc1 !== 0) exec('chattr -i '.escapeshellarg($SRC).' 2>&1', $c1, $rc1);
$R['steps'][] = ['chattr_minus' => $rc1];
$w = file_put_contents($SRC, $newContent);
$R['steps'][] = ['written' => $w];
exec('sudo chattr +i '.escapeshellarg($SRC).' 2>&1', $c2, $rc2);
if ($rc2 !== 0) exec('chattr +i '.escapeshellarg($SRC).' 2>&1', $c2, $rc2);
$R['steps'][] = ['chattr_plus' => $rc2];
// Final lint
exec("php8.4 -l $SRC 2>&1", $flo, $flr);
$R['steps'][] = ['final_lint_rc' => $flr, 'final_lint' => $flo];
$final = file_get_contents($SRC);
$R['steps'][] = ['marker_present' => (strpos($final, $MARKER) !== false)];
// Opcache flush
@opcache_invalidate($SRC, true);
@file_get_contents('http://127.0.0.1/api/opcache-flush.php', false, stream_context_create(['http'=>['timeout'=>3]]));
unlink($TMP);
$R['ok'] = ($flr === 0 && strpos($final, $MARKER) !== false && $w > 20000);
echo json_encode($R, JSON_PRETTY_PRINT);

File diff suppressed because one or more lines are too long

View File

@@ -73,5 +73,15 @@
"requested_via": "chat_master"
}
],
"last_update": "2026-04-11 14:27:56"
"last_update": "2026-04-11 14:27:56",
"0": {
"name": "opus4_direct",
"triggers": [
"pattern"
],
"cmd": "echo hello",
"status": "PENDING_APPROVAL",
"created_at": "2026-04-17T00:19:26+00:00",
"source": "opus4-autowire-early-v2"
}
}

View File

@@ -1,5 +1,33 @@
<?php
$_RAW=file_get_contents("php://input");$_JIN=json_decode($_RAW,true);$_mam=$_JIN["message"]??"";
// === OPUS4-AUTOWIRE-EARLY-v2 (17avr 02h20) ===
// Priority handler : master add/list intent bypass tout le pipeline (fast-path greedy cause racine)
// Zero regression : return silencieux si syntaxe pas matchee
if (!empty($_mam)) {
$__opus4_m = mb_strtolower(trim($_mam));
if (preg_match('/^\s*master\s+add\s+intent\s+([a-z0-9_]+)\s*::\s*(.+?)\s*::\s*(.+)$/i', $__opus4_m, $__m)) {
$__name = trim($__m[1]); $__trg = trim($__m[2]); $__cmd = trim($__m[3]);
$__pd = '/var/www/html/api/wired-pending'; @mkdir($__pd, 0755, true);
$__stub = "$__pd/intent-opus4-$__name.php";
$__ok = false; foreach (['/var/www/html/','/var/www/weval/','/opt/wevia-brain/','/opt/wevads/vault/','echo ','curl ','php8.4 ','git '] as $__p) { if (strpos($__cmd,$__p)!==false) { $__ok=true; break; } }
$__payload = ['name'=>$__name,'triggers'=>array_map('trim',explode('|',$__trg)),'cmd'=>$__cmd,'status'=>$__ok?'PENDING_APPROVAL':'PENDING_SECURITY_REVIEW','created_at'=>date('c'),'source'=>'opus4-autowire-early-v2'];
@file_put_contents($__stub, "<?php\nreturn " . var_export($__payload,true) . ";\n");
@file_put_contents('/var/log/weval/opus4-autowire.log', date('c')." EARLY_WIRED name=$__name\n", FILE_APPEND);
$__qf = '/var/www/html/api/wave-wiring-queue.json'; $__q = @json_decode(@file_get_contents($__qf), true) ?: []; $__q[] = $__payload; @file_put_contents($__qf, json_encode($__q, JSON_PRETTY_PRINT));
header('Content-Type: application/json');
echo json_encode(['response'=>"Intent '$__name' wired (status={$__payload['status']}). Stub: $__stub", 'executed'=>true, 'provider'=>'opus4-autowire-early', 'intent'=>$__name, 'status'=>$__payload['status'], 'triggers'=>$__payload['triggers']]);
exit;
}
if (preg_match('/^\s*master\s+(list|show)\s+intents?\s*$/i', $__opus4_m)) {
$__stubs = @glob('/var/www/html/api/wired-pending/intent-opus4-*.php') ?: [];
$__sum = []; foreach ($__stubs as $__s) { $__info = @include $__s; if (is_array($__info)) $__sum[] = ['name'=>$__info['name']??'?','status'=>$__info['status']??'?','triggers'=>$__info['triggers']??[]]; }
header('Content-Type: application/json');
echo json_encode(['response'=>'Wired intents: '.count($__stubs)."\n".json_encode($__sum, JSON_PRETTY_PRINT), 'executed'=>true, 'provider'=>'opus4-autowire-early-list', 'count'=>count($__stubs)]);
exit;
}
}
// === OPUS4-AUTOWIRE-EARLY-v2 END ===
// OPUS WIRE: Content-generation guard — bypass multiagent for content requests
$_is_content_req = preg_match('/(?:r[eé]dige|[eé]cris|pr[eé]pare|g[eé]n[eè]re|compose|cr[eé]e|fais)[\s\-].*(?:post|linkedin|article|contenu|texte|email|marketing|communic|blog|newsletter|carousel|pitch)/iu', $_mam)

View File

@@ -0,0 +1,12 @@
<?php
return array (
'name' => 'opus4_direct',
'triggers' =>
array (
0 => 'pattern',
),
'cmd' => 'echo hello',
'status' => 'PENDING_APPROVAL',
'created_at' => '2026-04-17T00:19:26+00:00',
'source' => 'opus4-autowire-early-v2',
);