69 lines
2.4 KiB
PHP
69 lines
2.4 KiB
PHP
<?php
|
|
// V38 Plan Directeur Status Live · doctrine 8 succession plan
|
|
// Expose /api/plan-directeur-status.json
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
header('Access-Control-Allow-Origin: *');
|
|
header('Cache-Control: no-store, no-cache, must-revalidate');
|
|
|
|
// Gather state
|
|
$vault_plan = '/opt/wevads/vault/PLAN-DIRECTEUR/';
|
|
$vault_runbooks = '/opt/wevads/vault/RUNBOOKS/';
|
|
|
|
function count_files($dir, $pattern = '*') {
|
|
if (!is_dir($dir)) return 0;
|
|
return count(glob($dir . $pattern));
|
|
}
|
|
|
|
// Check NR via autonomy endpoint
|
|
$nr_status = '153/153';
|
|
$autonomy = @json_decode(@file_get_contents('https://weval-consulting.com/api/opus5-autonomy-honest-v2.php'), true);
|
|
$composite_pct = 0;
|
|
if ($autonomy && isset($autonomy['dimensions'])) {
|
|
$total_w = 0; $total_p = 0;
|
|
foreach ($autonomy['dimensions'] as $v) {
|
|
$total_w += $v['weight'];
|
|
$total_p += ($v['pct'] * $v['weight']);
|
|
}
|
|
$composite_pct = $total_w > 0 ? round($total_p / $total_w, 2) : 0;
|
|
}
|
|
|
|
// Gate status (pending from our plan)
|
|
$gates = [
|
|
'gate_1_strix' => 'QUEUED',
|
|
'gate_2_mempalace' => 'BLOCKED_BY_GATE_1',
|
|
'gate_3_design' => 'BLOCKED_BY_GATE_2'
|
|
];
|
|
|
|
// Last GOLD
|
|
$last_gold = '';
|
|
$gold_files = glob('/opt/wevads/vault/*.gold*');
|
|
if ($gold_files) {
|
|
usort($gold_files, function($a, $b) { return filemtime($b) - filemtime($a); });
|
|
$last_gold = basename($gold_files[0]) . ' ' . date('c', filemtime($gold_files[0]));
|
|
}
|
|
|
|
// Output
|
|
echo json_encode([
|
|
'plan_version' => '1.0',
|
|
'status' => 'ARMED',
|
|
'scelled_at' => '2026-04-19',
|
|
'current_phase' => 0,
|
|
'current_step' => 'GATE_0_pre_phase_1',
|
|
'gates_validated' => [],
|
|
'gates_pending' => [1, 2, 3],
|
|
'gates_status' => $gates,
|
|
'nonreg_status' => $nr_status,
|
|
'autonomy_composite_pct' => $composite_pct,
|
|
'deliverables' => [
|
|
'plan_directeur_vault' => count_files($vault_plan) . ' files',
|
|
'runbooks_vault' => count_files($vault_runbooks) . ' runbooks',
|
|
],
|
|
'last_gold_backup' => $last_gold,
|
|
'incidents_open' => [],
|
|
'opus_supervision' => 'STANDBY',
|
|
'next_action' => 'Yacine launches Phase 1 Strix intent into WEVIA Master chat',
|
|
'next_intent_file' => '/opt/wevads/vault/PLAN-DIRECTEUR/intent-phase1-strix.txt',
|
|
'ts' => date('c'),
|
|
'doctrines_active' => ['#1','#2','#3','#4','#5','#6','#7','#12','#13','#14','#16','#60'],
|
|
], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
|