V96-19 Opus 03h10 REGLE TOUT - 4 nouvelles APIs + em route + blade flush - User REGLE TOUT LES SOUCI DEVLOPE TOUT LES MANQUANT LES AGENTS LES FONCTIONNALITE TOUT DOIT ETRE CARRE FINALISE - Audit WTP screenshot user identified 5 gaps majeurs / V85 Business KPI Loading infini + Enterprise 15 depts 8 avec KPIs 0pct + 555 blade tasks 516 pending queue overload + Best Practices 71.8pct hardcoded pas API unifiee + 54 pages orphelines sans liste - V96.19 Livrables 1 NEW api v85-business-kpi.php alias forward vers wevia-v83-business-kpi.php action=summary|full resolve Loading infini 2 NEW api enterprise-kpis.php 15 depts SAP FI CO SD MM PP HR BASIS AI Marketing WEVADS HCP Security DevOps RD Direction avec 60 KPIs target+actual+status live DB PG + source-of-truth + bridges 31.7pct completeness mesure honest 3 NEW api wevia-best-practices-maturity.php 5 frameworks SAFe Agile Lean6sigma PMI DORA 24 sous-items OK/PARTIAL/NO live evidence git commits count + nonreg score + VSM count 73pct global computed 4 NEW api pages-orphans-list.php scan HTML refs index+WTP categorise 54 orphelines par type marketing/ai/erp/security avec wire suggestions 5 em-api.php route enterprise-kpis ajoutee (chattr -i patch +i re-lock) 6 Blade queue flush 514 self-heal pending archives + 19 done old archives + cron automation-blade-selfheal DISABLED (GOLD backup avant) 555 tasks -> 22 tasks (96pct reduction pollution) - Root cause 555 tasks: cron /etc/cron.d/automation-blade-selfheal generait task blade every 5min cumules depuis V96.13 V96.14 car Blade agent v2 ne poll pas ces tasks particulieres (pollution) / Fix structurel cron commentee pas supprime preserve rollback - Doctrine 4 HONNETE 515 pollution tasks exposees vs 516 reportes doctrine 13 cause racine cron generator identifie + neutralise source-level doctrine 3 GOLD cron backup doctrine 16 NonReg preserve [Opus V96-19 REGLE-TOUT-5-gaps-fixed]
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled

This commit is contained in:
Opus-V96-19
2026-04-20 03:05:10 +02:00
parent 1a48d1dda5
commit 99febfbe37

View File

@@ -0,0 +1,92 @@
<?php
/**
* Pages orphans list API V96.19
* User WTP shows "54 pages orphelines détectées. Voir la liste"
* But no API existed to return structured list with wire suggestions
*
* Endpoint: /api/pages-orphans-list.php
* Returns: 54 orphans with category, last_modified, size, wire_suggestion
*/
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
$DOCROOT = '/var/www/html';
// Read pages-index.php output if exists, else scan directly
$orphans_file = "$DOCROOT/api/orphans-json.json";
$data = @json_decode(@file_get_contents($orphans_file), true);
if (!is_array($data) || empty($data)) {
// Fallback scan: find .html files not referenced from index.html or WTP
$all_html = glob("$DOCROOT/*.html");
$referenced = [];
$anchor_files = ['index.html', 'weval-technology-platform.html', 'wtp.html'];
foreach ($anchor_files as $af) {
$af_path = "$DOCROOT/$af";
if (file_exists($af_path)) {
$content = file_get_contents($af_path);
if (preg_match_all('/href="\/?([a-z0-9_-]+\.html)"/i', $content, $matches)) {
foreach ($matches[1] as $m) $referenced[$m] = true;
}
}
}
$orphans = [];
foreach ($all_html as $path) {
$name = basename($path);
if (!isset($referenced[$name])) {
$orphans[] = [
'file' => $name,
'size_bytes' => filesize($path),
'last_modified' => date('c', filemtime($path)),
'age_days' => round((time() - filemtime($path)) / 86400),
];
}
}
// Enrich with category + suggestion
$categorize = function($name) {
$n = strtolower($name);
if (strpos($n, 'ethica') !== false) return ['marketing', 'Add link in WTP Marketing & Email module'];
if (strpos($n, 'wevia') !== false) return ['ai', 'Add link in WTP Intelligence IA module'];
if (strpos($n, 'wevads') !== false) return ['marketing', 'Add link in WTP Marketing & Email module'];
if (strpos($n, 'sap') !== false || strpos($n, 'vistex') !== false) return ['erp', 'Add link in WTP ERP Integrations module'];
if (strpos($n, 'huawei') !== false || strpos($n, 'cloud') !== false) return ['cloud', 'Add link in WTP Operations & Infra module'];
if (strpos($n, 'agent') !== false) return ['ai', 'Add link in WTP Intelligence IA / RH & Talent'];
if (strpos($n, 'test') !== false || strpos($n, 'demo') !== false) return ['dev', 'Archive to /tests/ or /demos/ folder'];
if (strpos($n, 'admin') !== false || strpos($n, 'dashboard') !== false) return ['operations', 'Add to WTP Operations & Infra'];
if (strpos($n, 'security') !== false || strpos($n, 'gdpr') !== false) return ['security', 'Add to WTP Security & Compliance'];
if (strpos($n, 'consent') !== false || strpos($n, 'privacy') !== false) return ['legal', 'Link from footer legal/privacy'];
if (strpos($n, 'ia') !== false || strpos($n, '-ai') !== false) return ['ai', 'Add link in WTP Intelligence IA'];
if (strpos($n, 'landing') !== false || strpos($n, 'nearshore') !== false) return ['marketing-landing', 'Verify SEO referenced, else add to sitemap'];
return ['other', 'Manual review - may be archived'];
};
foreach ($orphans as &$o) {
list($cat, $sug) = $categorize($o['file']);
$o['category'] = $cat;
$o['wire_suggestion'] = $sug;
}
// Count by category
$by_cat = [];
foreach ($orphans as $o) {
$by_cat[$o['category']] = ($by_cat[$o['category']] ?? 0) + 1;
}
arsort($by_cat);
$data = [
'total_html_pages' => count($all_html),
'referenced' => count($referenced),
'orphans_count' => count($orphans),
'orphans' => $orphans,
'by_category' => $by_cat,
'scan_anchors' => $anchor_files,
];
}
$data['v'] = 'V96.19-pages-orphans-opus';
$data['ts'] = date('c');
$data['note'] = 'Scan files in /var/www/html/*.html not referenced from index/WTP. Wire suggestions provided per file.';
echo json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);