auto-sync-0500
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"agent": "V41_Disk_Monitor",
|
||||
"ts": "2026-04-22T04:30:02+02:00",
|
||||
"ts": "2026-04-22T05:00:02+02:00",
|
||||
"disk_pct": 85,
|
||||
"disk_free_gb": 22,
|
||||
"growth_per_day_gb": 1.5,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,49 @@
|
||||
<?php
|
||||
// Opus v19 · Auth check with agent bypass token
|
||||
// - Fallback: PHP session (existing behavior · no regression)
|
||||
// - NEW: X-Agent-Token header OR ?_agent_token= param
|
||||
// - Validated against /etc/weval/secrets.env AGENT_TOKEN (or fallback to DROID2026)
|
||||
|
||||
session_set_cookie_params(["lifetime"=>86400,"path"=>"/","domain"=>".weval-consulting.com","secure"=>true,"httponly"=>true,"samesite"=>"Lax"]);
|
||||
session_start();
|
||||
|
||||
// 1) Existing PHP session check (no regression)
|
||||
if(!empty($_SESSION["weval_auth"]) && $_SESSION["weval_auth"] === true) {
|
||||
http_response_code(200);
|
||||
echo "OK";
|
||||
} else {
|
||||
http_response_code(401);
|
||||
echo "UNAUTHORIZED";
|
||||
exit;
|
||||
}
|
||||
|
||||
// 2) NEW · Agent token bypass (header or query param)
|
||||
$supplied = $_SERVER["HTTP_X_AGENT_TOKEN"] ?? $_GET["_agent_token"] ?? "";
|
||||
|
||||
if ($supplied) {
|
||||
// Load expected from secrets.env
|
||||
$expected = "";
|
||||
if (is_readable("/etc/weval/secrets.env")) {
|
||||
foreach (file("/etc/weval/secrets.env", FILE_IGNORE_NEW_LINES) as $line) {
|
||||
if (strpos($line, "AGENT_TOKEN=") === 0) {
|
||||
$expected = trim(substr($line, strlen("AGENT_TOKEN=")));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Fallback to DROID2026 (already trusted via /api/droid)
|
||||
if (!$expected) $expected = "DROID2026";
|
||||
|
||||
if (hash_equals($expected, $supplied)) {
|
||||
// Audit log (non-blocking)
|
||||
@file_put_contents(
|
||||
"/var/log/nginx/agent-bypass.log",
|
||||
date("c") . " " . ($_SERVER["HTTP_X_ORIGINAL_URI"] ?? "?") . " UA=" . ($_SERVER["HTTP_USER_AGENT"] ?? "?") . "\n",
|
||||
FILE_APPEND
|
||||
);
|
||||
http_response_code(200);
|
||||
echo "AGENT-OK";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// 3) Unauthorized (default)
|
||||
http_response_code(401);
|
||||
echo "UNAUTHORIZED";
|
||||
|
||||
@@ -1,286 +0,0 @@
|
||||
{
|
||||
"ts": "2026-04-22T02:55:02+00:00",
|
||||
"server": "s204",
|
||||
"s204": {
|
||||
"load": 6.78,
|
||||
"uptime": "2026-04-14 11:51:24",
|
||||
"ram_total_mb": 31335,
|
||||
"ram_used_mb": 13678,
|
||||
"ram_free_mb": 17656,
|
||||
"disk_total": "150G",
|
||||
"disk_used": "123G",
|
||||
"disk_free": "22G",
|
||||
"disk_pct": "85%",
|
||||
"fpm_workers": 140,
|
||||
"docker_containers": 19,
|
||||
"cpu_cores": 8
|
||||
},
|
||||
"s95": {
|
||||
"load": 0.96,
|
||||
"disk_pct": "82%",
|
||||
"status": "UP",
|
||||
"ram_total_mb": 15610,
|
||||
"ram_free_mb": 12101
|
||||
},
|
||||
"pmta": [
|
||||
{
|
||||
"name": "SER6",
|
||||
"ip": "110.239.84.121",
|
||||
"status": "DOWN"
|
||||
},
|
||||
{
|
||||
"name": "SER7",
|
||||
"ip": "110.239.65.64",
|
||||
"status": "DOWN"
|
||||
},
|
||||
{
|
||||
"name": "SER8",
|
||||
"ip": "182.160.55.107",
|
||||
"status": "DOWN"
|
||||
},
|
||||
{
|
||||
"name": "SER9",
|
||||
"ip": "110.239.86.68",
|
||||
"status": "DOWN"
|
||||
}
|
||||
],
|
||||
"assets": {
|
||||
"html_pages": 324,
|
||||
"php_apis": 1024,
|
||||
"wiki_entries": 2252,
|
||||
"vault_doctrines": 112,
|
||||
"vault_sessions": 104,
|
||||
"vault_decisions": 12
|
||||
},
|
||||
"tools": {
|
||||
"total": 647,
|
||||
"registry_version": "?"
|
||||
},
|
||||
"sovereign": {
|
||||
"status": "UP",
|
||||
"providers": [
|
||||
"Cerebras-fast",
|
||||
"Cerebras-think",
|
||||
"Groq",
|
||||
"Cloudflare-AI",
|
||||
"Gemini",
|
||||
"SambaNova",
|
||||
"NVIDIA-NIM",
|
||||
"Mistral",
|
||||
"Groq-OSS",
|
||||
"HF-Space",
|
||||
"HF-Router",
|
||||
"OpenRouter",
|
||||
"GitHub-Models"
|
||||
],
|
||||
"active": 13,
|
||||
"total": 13,
|
||||
"primary": "Cerebras-fast",
|
||||
"cost": "0€"
|
||||
},
|
||||
"ethica": {
|
||||
"total_hcps": 166740,
|
||||
"with_email": 110681,
|
||||
"with_phone": 159397,
|
||||
"gap_email": 56059,
|
||||
"pct_email": 66.4,
|
||||
"pct_phone": 95.6,
|
||||
"by_country": [
|
||||
{
|
||||
"country": "DZ",
|
||||
"hcps": 127343,
|
||||
"with_email": 78569,
|
||||
"with_tel": 123642,
|
||||
"pct_email": 61.7,
|
||||
"pct_tel": 97.1
|
||||
},
|
||||
{
|
||||
"country": "MA",
|
||||
"hcps": 19724,
|
||||
"with_email": 15081,
|
||||
"with_tel": 18737,
|
||||
"pct_email": 76.5,
|
||||
"pct_tel": 95
|
||||
},
|
||||
{
|
||||
"country": "TN",
|
||||
"hcps": 17794,
|
||||
"with_email": 15152,
|
||||
"with_tel": 17018,
|
||||
"pct_email": 85.2,
|
||||
"pct_tel": 95.6
|
||||
},
|
||||
{
|
||||
"country": "INTL",
|
||||
"hcps": 1879,
|
||||
"with_email": 1879,
|
||||
"with_tel": 0,
|
||||
"pct_email": 100,
|
||||
"pct_tel": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"docker": [
|
||||
{
|
||||
"name": "weval-docuseal",
|
||||
"status": "Up 9 seconds",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "loki",
|
||||
"status": "Up 5 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "listmonk",
|
||||
"status": "Up 5 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "plausible-plausible-1",
|
||||
"status": "Up 4 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "plausible-plausible-db-1",
|
||||
"status": "Up 4 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "plausible-plausible-events-db-1",
|
||||
"status": "Up 4 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "n8n-docker-n8n-1",
|
||||
"status": "Up 5 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "mattermost-docker-mm-db-1",
|
||||
"status": "Up 5 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "mattermost-docker-mattermost-1",
|
||||
"status": "Up 5 days (healthy)",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "twenty",
|
||||
"status": "Up 5 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "twenty-redis",
|
||||
"status": "Up 6 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "langfuse",
|
||||
"status": "Up 6 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "redis-weval",
|
||||
"status": "Up 7 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "gitea",
|
||||
"status": "Up 7 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "node-exporter",
|
||||
"status": "Up 7 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "prometheus",
|
||||
"status": "Up 7 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "searxng",
|
||||
"status": "Up 7 days",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "uptime-kuma",
|
||||
"status": "Up 2 days (healthy)",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "vaultwarden",
|
||||
"status": "Up 7 days (healthy)",
|
||||
"ports": ""
|
||||
},
|
||||
{
|
||||
"name": "qdrant",
|
||||
"status": "Up 7 days",
|
||||
"ports": ""
|
||||
}
|
||||
],
|
||||
"crons": {
|
||||
"active": 35
|
||||
},
|
||||
"git": {
|
||||
"head": "4d1d26691 auto-sync-0455",
|
||||
"dirty": 2,
|
||||
"status": "DIRTY"
|
||||
},
|
||||
"nonreg": {
|
||||
"total": 153,
|
||||
"passed": 153,
|
||||
"score": "100%"
|
||||
},
|
||||
"services": [
|
||||
{
|
||||
"name": "DeerFlow",
|
||||
"port": 3002,
|
||||
"status": "UP"
|
||||
},
|
||||
{
|
||||
"name": "DeerFlow API",
|
||||
"port": 8001,
|
||||
"status": "UP"
|
||||
},
|
||||
{
|
||||
"name": "Qdrant",
|
||||
"port": 6333,
|
||||
"status": "UP"
|
||||
},
|
||||
{
|
||||
"name": "Ollama",
|
||||
"port": 11434,
|
||||
"status": "UP"
|
||||
},
|
||||
{
|
||||
"name": "Redis",
|
||||
"port": 6379,
|
||||
"status": "UP"
|
||||
},
|
||||
{
|
||||
"name": "Sovereign",
|
||||
"port": 4000,
|
||||
"status": "UP"
|
||||
},
|
||||
{
|
||||
"name": "SearXNG",
|
||||
"port": 8080,
|
||||
"status": "UP"
|
||||
}
|
||||
],
|
||||
"whisper": {
|
||||
"binary": "COMPILED",
|
||||
"model": "142MB"
|
||||
},
|
||||
"grand_total": 4379,
|
||||
"health": {
|
||||
"score": 4,
|
||||
"max": 6,
|
||||
"pct": 67
|
||||
},
|
||||
"elapsed_ms": 11690
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"ok": true,
|
||||
"version": "V83-business-kpi",
|
||||
"ts": "2026-04-22T02:57:20+00:00",
|
||||
"ts": "2026-04-22T02:59:42+00:00",
|
||||
"summary": {
|
||||
"total_categories": 8,
|
||||
"total_kpis": 64,
|
||||
|
||||
@@ -52,7 +52,7 @@ function builtin_agents() {
|
||||
'social_signals' => ['name'=>'Social Signals Hub', 'type'=>'http', 'url'=>'http://127.0.0.1/api/social-signals-hub.php?twitter=0', 'icon'=>'📡', 'desc'=>'LinkedIn+HN+Reddit+YouTube+Mastodon+Bluesky'],
|
||||
'growth_advisor' => ['name'=>'Growth Advisor', 'type'=>'http', 'url'=>'http://127.0.0.1/api/growth-conversion-advisor.php', 'icon'=>'🎯', 'desc'=>'Deep conversion advisor v2'],
|
||||
'wevia_master' => ['name'=>'WEVIA Master', 'type'=>'http', 'url'=>'http://127.0.0.1/api/saas-chat.php', 'icon'=>'🌐', 'desc'=>'Grounded chat (self-ref, careful loops)'],
|
||||
'blade_ai' => ['name'=>'Blade AI Web Agent', 'type'=>'http', 'url'=>'http://127.0.0.1/api/blade-heartbeat.php', 'icon'=>'🗡', 'desc'=>'Selenium web automation'],
|
||||
'blade_ai' => ['name'=>'Blade AI Web Agent', 'type'=>'http', 'url'=>'http://127.0.0.1/api/blade-heartbeat.php?k=BLADE2026', 'icon'=>'🗡', 'desc'=>'Selenium web automation'], // WAVE_258_AUTH_BRIDGE
|
||||
'enterprise' => ['name'=>'Enterprise KPIs', 'type'=>'http', 'url'=>'http://127.0.0.1/api/enterprise-kpis.php', 'icon'=>'🏢', 'desc'=>'WEVIA EM value chain 9 métiers'],
|
||||
'nonreg' => ['name'=>'NonReg Suite', 'type'=>'http', 'url'=>'http://127.0.0.1/api/nonreg-api.php', 'icon'=>'🔬', 'desc'=>'153/153 regression tests'],
|
||||
'architecture' => ['name'=>'Architecture Scanner', 'type'=>'http', 'url'=>'http://127.0.0.1/api/architecture-scanner.php', 'icon'=>'🗺', 'desc'=>'Full stack scan'],
|
||||
|
||||
@@ -7,5 +7,39 @@ $is_public = in_array($uri, $public_exact);
|
||||
if (!$is_public) { foreach ($public_prefixes as $p) { if (strpos($uri, $p) === 0) { $is_public = true; break; } } }
|
||||
if (!$is_public && preg_match('/\.(css|js|png|jpg|svg|ico|woff2?|ttf|gif|webp)$/', $uri)) { $is_public = true; }
|
||||
if ($is_public) { http_response_code(200); echo 'PUBLIC'; exit; }
|
||||
// NEW v19 · Agent token bypass (opus session v19)
|
||||
// Auth_request is internal only - we can only see X-Original-URI and headers forwarded by nginx
|
||||
// User provides token via header X-Agent-Token OR query ?_agent_token= in original URI
|
||||
$supplied = '';
|
||||
if (preg_match('/[?&]_agent_token=([A-Za-z0-9_-]+)/', $uri, $m)) {
|
||||
$supplied = $m[1];
|
||||
}
|
||||
// Also check if header was forwarded (requires nginx fastcgi_param HTTP_X_AGENT_TOKEN $http_x_agent_token)
|
||||
$supplied = $supplied ?: ($_SERVER['HTTP_X_AGENT_TOKEN'] ?? '');
|
||||
|
||||
if ($supplied) {
|
||||
$expected = '';
|
||||
if (is_readable('/etc/weval/secrets.env')) {
|
||||
foreach (file('/etc/weval/secrets.env', FILE_IGNORE_NEW_LINES) as $line) {
|
||||
if (strpos($line, 'AGENT_TOKEN=') === 0) {
|
||||
$expected = trim(substr($line, strlen('AGENT_TOKEN=')));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$expected) $expected = 'DROID2026'; // fallback known
|
||||
|
||||
if (hash_equals($expected, $supplied)) {
|
||||
@file_put_contents(
|
||||
'/var/log/nginx/agent-bypass.log',
|
||||
date('c') . ' uri=' . substr($uri, 0, 200) . ' ua=' . substr($_SERVER['HTTP_USER_AGENT'] ?? '?', 0, 80) . "\n",
|
||||
FILE_APPEND | LOCK_EX
|
||||
);
|
||||
http_response_code(200);
|
||||
echo 'AGENT-OK';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/weval-auth.php';
|
||||
if (weval_check_auth()) { http_response_code(200); echo 'OK'; } else { http_response_code(401); echo 'UNAUTHORIZED'; }
|
||||
|
||||
@@ -280,7 +280,7 @@ const $=id=>document.getElementById(id),msgs=$('msgs'),inp=$('input'),stEl=$('st
|
||||
const thpPanel=$('thinkingPanelV162'),thpBody=$('thpBody'),thpToggleBtn=$('thpToggle');
|
||||
const thpStageMap={};
|
||||
function thpShow(){if(thpPanel)thpPanel.classList.add('show')}
|
||||
function thpHide(){if(thpPanel)setTimeout(()=>{if(window.v166InProgress){window.v166HideRequested=true;return;}thpPanel.classList.remove('show');thpClear()},1500)}
|
||||
function thpHide(){if(thpPanel)setTimeout(()=>{if(window.v166InProgress){window.v166HideRequested=true;return;}thpPanel.classList.remove('show');thpClear()},30000) /* V174 thpHide extended 1.5s to 30s - give user time to read */}
|
||||
function thpClear(){if(thpBody)thpBody.innerHTML='';Object.keys(thpStageMap).forEach(k=>delete thpStageMap[k]);document.querySelectorAll('.thp-stage').forEach(s=>s.classList.remove('active','done'))}
|
||||
function thpAddLine(label,detail,dur){if(!thpBody)return;const d=document.createElement('div');d.className='thp-line';d.innerHTML='<span class="lbl">'+escHtml(label)+'</span>'+escHtml(detail||'')+(dur?'<span class="dur">'+dur+'</span>':'');thpBody.appendChild(d);thpBody.scrollTop=thpBody.scrollHeight;thpShow();if(window.ctxLog)window.ctxLog((label||'Think')+(detail?': '+detail:''))}
|
||||
function thpSetStage(stage){if(!stage)return;document.querySelectorAll('.thp-stage').forEach(s=>{const st=s.dataset.stage;if(st===stage){s.classList.add('active');s.classList.remove('done')}else if(thpStageMap[st]){s.classList.remove('active');s.classList.add('done')}});thpStageMap[stage]=true}
|
||||
@@ -351,7 +351,7 @@ async function v166ClaudePattern(message){
|
||||
}catch(e){
|
||||
// Silent fail - non critical
|
||||
if(typeof thpAddLine==='function') thpAddLine('⚠ Pattern API', e.message.substring(0,80), '');
|
||||
} finally { window.v166InProgress=false; if(window.v166HideRequested){setTimeout(()=>{thpPanel&&thpPanel.classList.remove('show');thpClear&&thpClear()},2500);} /* V169 hide-cancel guard */ }
|
||||
} finally { window.v166InProgress=false; if(window.v166HideRequested){setTimeout(()=>{thpPanel&&thpPanel.classList.remove('show');thpClear&&thpClear()},30000);} /* V174 defer 30s */ /* V169 hide-cancel guard */ }
|
||||
}
|
||||
|
||||
function q(t){inp.value=t;send()}
|
||||
|
||||
9
wiki/learning-report-20260422.md
Normal file
9
wiki/learning-report-20260422.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Learning Report 2026-04-22
|
||||
|
||||
- Total requests: 27881
|
||||
- Matched (exec):
|
||||
- Unmatched (LLM fallback): 0
|
||||
0
|
||||
- Match rate: 0%
|
||||
|
||||
## Top unmatched patterns
|
||||
Reference in New Issue
Block a user