<?php
require_once __DIR__ . '/runtime/wr_bootstrap.php';
@set_time_limit(1200); @ini_set('memory_limit','1536M');
require_once __DIR__ . '/config/config.php';
if (!wr_db_guard_normalize()) { throw new RuntimeException('DB connection unavailable'); }
require_once __DIR__ . '/Chairman/memory/ChairmanPatternMemoryEngineV53.php';
require_once __DIR__ . '/Chairman/runtime/wr_chairman_os_scheduler_v60_0.php';
function wr_v53_h($v){return htmlspecialchars((string)$v,ENT_QUOTES,'UTF-8');}
function wr_v53_date(){foreach(array('race_date','date','review_date') as $k){if(!isset($_GET[$k]))continue;$v=trim((string)$_GET[$k]);$d=DateTimeImmutable::createFromFormat('!Y-m-d',$v);$e=DateTimeImmutable::getLastErrors();if($d instanceof DateTimeImmutable&&($e===false||((int)$e['warning_count']===0&&(int)$e['error_count']===0))&&$d->format('Y-m-d')===$v)return$v;}return(new DateTimeImmutable('now',new DateTimeZone('Asia/Hong_Kong')))->format('Y-m-d');}
$date=wr_v53_date();$venue=isset($_GET['venue'])?preg_replace('/[^A-Za-z0-9_\-]/','',trim((string)$_GET['venue'])):'';$action=isset($_GET['action'])?trim((string)$_GET['action']):'latest';
$engine=new ChairmanPatternMemoryEngineV53($conn);$data=$action==='build'?$engine->build($date,$venue):$engine->latest($date,$venue);$osEngine=new ChairmanOSSchedulerV60();$os=$osEngine->build(is_array($data)?$data:array(),$date,$venue);$oss=isset($os['os_summary'])&&is_array($os['os_summary'])?$os['os_summary']:array();$osq=isset($os['priority_queue'])&&is_array($os['priority_queue'])?$os['priority_queue']:array();$osw=isset($os['execution_waves'])&&is_array($os['execution_waves'])?$os['execution_waves']:array();$osg=isset($os['resource_governor'])&&is_array($os['resource_governor'])?$os['resource_governor']:array();$ost=isset($os['runtime_telemetry'])&&is_array($os['runtime_telemetry'])?$os['runtime_telemetry']:array();$s=isset($data['memory_summary'])&&is_array($data['memory_summary'])?$data['memory_summary']:array();$records=isset($data['memory_records'])&&is_array($data['memory_records'])?$data['memory_records']:array();$votes=isset($data['memory_votes'])&&is_array($data['memory_votes'])?$data['memory_votes']:array();$clusters=isset($data['pattern_clusters'])&&is_array($data['pattern_clusters'])?$data['pattern_clusters']:array();$cs=isset($data['pattern_cluster_summary'])&&is_array($data['pattern_cluster_summary'])?$data['pattern_cluster_summary']:array();$gs=isset($data['relationship_graph_summary'])&&is_array($data['relationship_graph_summary'])?$data['relationship_graph_summary']:array();$gedges=isset($data['relationship_graph_edges'])&&is_array($data['relationship_graph_edges'])?$data['relationship_graph_edges']:array();$gmetrics=isset($data['relationship_graph_node_metrics'])&&is_array($data['relationship_graph_node_metrics'])?$data['relationship_graph_node_metrics']:array();$es=isset($data['experience_summary'])&&is_array($data['experience_summary'])?$data['experience_summary']:array();$experiences=isset($data['chairman_experiences'])&&is_array($data['chairman_experiences'])?$data['chairman_experiences']:array();$xs=isset($data['context_awareness_summary'])&&is_array($data['context_awareness_summary'])?$data['context_awareness_summary']:array();$contexts=isset($data['context_profiles'])&&is_array($data['context_profiles'])?$data['context_profiles']:array();$evs=isset($data['pattern_evolution_summary'])&&is_array($data['pattern_evolution_summary'])?$data['pattern_evolution_summary']:array();$evolution=isset($data['pattern_evolution'])&&is_array($data['pattern_evolution'])?$data['pattern_evolution']:array();$mfs=isset($data['multi_race_fusion_summary'])&&is_array($data['multi_race_fusion_summary'])?$data['multi_race_fusion_summary']:array();$fusion=isset($data['multi_race_fusion_profiles'])&&is_array($data['multi_race_fusion_profiles'])?$data['multi_race_fusion_profiles']:array();$sos=isset($data['strategy_optimizer_summary'])&&is_array($data['strategy_optimizer_summary'])?$data['strategy_optimizer_summary']:array();$strategies=isset($data['chairman_strategies'])&&is_array($data['chairman_strategies'])?$data['chairman_strategies']:array();$xsum=isset($data['explainable_ai_summary'])&&is_array($data['explainable_ai_summary'])?$data['explainable_ai_summary']:array();$explanations=isset($data['chairman_explanations'])&&is_array($data['chairman_explanations'])?$data['chairman_explanations']:array();$dss=isset($data['decision_simulator_summary'])&&is_array($data['decision_simulator_summary'])?$data['decision_simulator_summary']:array();$sims=isset($data['decision_simulations'])&&is_array($data['decision_simulations'])?$data['decision_simulations']:array();$cfs=isset($data['counterfactual_ai_summary'])&&is_array($data['counterfactual_ai_summary'])?$data['counterfactual_ai_summary']:array();$counterfactuals=isset($data['counterfactual_analysis'])&&is_array($data['counterfactual_analysis'])?$data['counterfactual_analysis']:array();$dbs=isset($data['self_debate_summary'])&&is_array($data['self_debate_summary'])?$data['self_debate_summary']:array();$debates=isset($data['chairman_debates'])&&is_array($data['chairman_debates'])?$data['chairman_debates']:array();$dss2=isset($data['debate_stabilizer_summary'])&&is_array($data['debate_stabilizer_summary'])?$data['debate_stabilizer_summary']:array();$stabs=isset($data['debate_stabilizers'])&&is_array($data['debate_stabilizers'])?$data['debate_stabilizers']:array();$sts=isset($data['stress_test_summary'])&&is_array($data['stress_test_summary'])?$data['stress_test_summary']:array();$stress=isset($data['scenario_stress_tests'])&&is_array($data['scenario_stress_tests'])?$data['scenario_stress_tests']:array();$dgs=isset($data['decision_gate_summary'])&&is_array($data['decision_gate_summary'])?$data['decision_gate_summary']:array();$gates=isset($data['chairman_decision_gates'])&&is_array($data['chairman_decision_gates'])?$data['chairman_decision_gates']:array();$das=isset($data['decision_audit_summary'])&&is_array($data['decision_audit_summary'])?$data['decision_audit_summary']:array();$audits=isset($data['decision_audits'])&&is_array($data['decision_audits'])?$data['decision_audits']:array();$sgs=isset($data['safety_governor_summary'])&&is_array($data['safety_governor_summary'])?$data['safety_governor_summary']:array();$safety=isset($data['safety_governor'])&&is_array($data['safety_governor'])?$data['safety_governor']:array();$frs=isset($data['final_ranking_summary'])&&is_array($data['final_ranking_summary'])?$data['final_ranking_summary']:array();$ranking=isset($data['final_chairman_ranking'])&&is_array($data['final_chairman_ranking'])?$data['final_chairman_ranking']:array();$uds=isset($data['ultimate_dashboard_summary'])&&is_array($data['ultimate_dashboard_summary'])?$data['ultimate_dashboard_summary']:array();$ud=isset($data['ultimate_dashboard'])&&is_array($data['ultimate_dashboard'])?$data['ultimate_dashboard']:array();$release=isset($data['final_release'])&&is_array($data['final_release'])?$data['final_release']:array();
?><!doctype html><html lang="zh-Hant"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>WinRacing V60.0 Chairman OS + V54.9 Ultimate Dashboard</title><style>:root{--bg:#050914;--p:#0b1424;--c:#08101d;--l:#304765;--g:#ffc107;--gr:#36f2a3;--cy:#5edbff;--r:#ff7589;--m:#9eb0c7}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:#eef6ff;font:13px Arial,'Microsoft JhengHei',sans-serif}.w{max-width:1880px;margin:auto;padding:18px}.p{background:var(--p);border:1px solid #31486b;border-radius:14px;padding:15px;margin-bottom:12px}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.g3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.c{background:var(--c);border:1px solid var(--l);border-radius:12px;padding:12px}.gold{color:var(--g)}.green{color:var(--gr)}.cyan{color:var(--cy)}.red{color:var(--r)}.muted{color:var(--m)}.k{font-size:27px;font-weight:900}.b{display:inline-block;padding:3px 8px;border-radius:999px;background:#162942;border:1px solid #36577e;font-weight:700}.bar{height:7px;background:#101d30;border-radius:99px;overflow:hidden}.bar span{display:block;height:100%;background:linear-gradient(90deg,#5edbff,#36f2a3)}.edge-positive{border-left:4px solid #36f2a3}.edge-negative{border-left:4px solid #ff7589}.edge-conflict{border-left:4px solid #ffc107}.edge-support{border-left:4px solid #5edbff}input{background:#07111f;color:#fff;border:1px solid #345;padding:8px}button{background:#ffc107;border:0;padding:9px 14px;font-weight:900;border-radius:6px}@media(max-width:1100px){.grid,.g3{grid-template-columns:1fr 1fr}}@media(max-width:700px){.grid,.g3{grid-template-columns:1fr}}</style></head><body><div class="w"><div class="p"><h1>🏆 V60.0 — <span class="gold">Chairman OS Scheduler + Resource Manager</span></h1><div class="muted">保留完整 V54.9 Dashboard；新增 Priority Queue、Dependency Graph、Resource Governor、Smart Skip 與 Runtime Telemetry。Advisory Only，不改正式權重。</div></div><div class="p"><form>Race Date <input type="date" name="race_date" value="<?=wr_v53_h($date)?>"> <strong class="cyan">Selected: <?=wr_v53_h($date)?></strong> Venue <input name="venue" value="<?=wr_v53_h($venue)?>"> <button name="action" value="build">Build V53 Snapshot</button></form></div><div class="p muted">Source Date: <b class="cyan"><?=wr_v53_h(isset($data['source_race_date'])?$data['source_race_date']:$date)?></b> ｜ Source V50 Run: <b class="cyan"><?=wr_v53_h(isset($data['source_v50_run'])?$data['source_v50_run']:'')?></b> ｜ Source V52: <b class="green"><?=wr_v53_h(isset($data['source_v52_version'])?$data['source_v52_version']:'')?></b> ｜ V54.9: <b class="green">54.9.0</b></div>
<div class="p"><h2>V60.0 Chairman OS Command Center</h2><div class="grid"><div class="c"><small>OS State</small><div class="k cyan"><?=wr_v53_h(isset($oss['os_state'])?$oss['os_state']:'GUARDED')?></div><p>Health <?=number_format((float)(isset($oss['health_score'])?$oss['health_score']:0),1)?></p></div><div class="c"><small>Ready / Waiting Jobs</small><div class="k"><span class="green"><?=wr_v53_h(isset($oss['ready_count'])?$oss['ready_count']:0)?></span> / <span class="red"><?=wr_v53_h(isset($oss['waiting_count'])?$oss['waiting_count']:0)?></span></div><p>Total <?=wr_v53_h(isset($oss['job_count'])?$oss['job_count']:0)?></p></div><div class="c"><small>CPU / Memory Pressure</small><div class="k gold"><?=number_format((float)(isset($oss['cpu_pressure_pct'])?$oss['cpu_pressure_pct']:0),1)?>% / <?=number_format((float)(isset($oss['memory_pressure_pct'])?$oss['memory_pressure_pct']:0),1)?>%</div><p><?=number_format((float)(isset($oss['estimated_memory_mb'])?$oss['estimated_memory_mb']:0),1)?> MB estimated</p></div><div class="c"><small>Execution Waves</small><div class="k cyan"><?=wr_v53_h(isset($oss['execution_wave_count'])?$oss['execution_wave_count']:0)?></div><p>Parallel Capacity <?=wr_v53_h(isset($oss['parallel_capacity'])?$oss['parallel_capacity']:0)?> ｜ Smart Skip <?=wr_v53_h(isset($oss['smart_skip_count'])?$oss['smart_skip_count']:0)?></p></div></div></div>
<div class="p"><h2>V60.0 Engine Priority Queue</h2><div class="g3"><?php foreach($osq as $job):?><div class="c"><h3 class="gold"><?=wr_v53_h($job['job_id'])?> · <?=wr_v53_h($job['job_name'])?></h3><div class="k"><?=wr_v53_h($job['priority'])?></div><p><span class="b"><?=wr_v53_h($job['state'])?></span> <span class="b"><?=wr_v53_h($job['execution_policy'])?></span></p><p>Cost <?=number_format((float)$job['estimated_cost_units'],2)?> ｜ Memory <?=number_format((float)$job['estimated_memory_mb'],1)?> MB</p><p class="muted">Depends: <?=wr_v53_h($job['dependencies']?implode(' → ',$job['dependencies']):'NONE')?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>V60.0 Resource Governor + Runtime Telemetry</h2><div class="grid"><div class="c"><small>Governor State</small><div class="k green"><?=wr_v53_h(isset($osg['governor_state'])?$osg['governor_state']:'OPEN')?></div><p><?=wr_v53_h(isset($osg['policy'])?$osg['policy']:'READ_ONLY_ADVISORY')?></p></div><div class="c"><small>Budgets</small><div class="k gold"><?=number_format((float)(isset($osg['cpu_budget_pct'])?$osg['cpu_budget_pct']:0),0)?>%</div><p>Memory <?=number_format((float)(isset($osg['memory_budget_mb'])?$osg['memory_budget_mb']:0),1)?> MB ｜ Parallel <?=wr_v53_h(isset($osg['max_parallel_jobs'])?$osg['max_parallel_jobs']:0)?></p></div><div class="c"><small>PHP Runtime</small><div class="k cyan"><?=wr_v53_h(isset($ost['php_version'])?$ost['php_version']:'')?></div><p>Peak <?=number_format((float)(isset($ost['peak_memory_mb'])?$ost['peak_memory_mb']:0),2)?> MB ｜ Current <?=number_format((float)(isset($ost['current_memory_mb'])?$ost['current_memory_mb']:0),2)?> MB</p></div><div class="c"><small>Safety Contract</small><p><span class="b">ADVISORY ONLY</span></p><p><span class="b">NO SCHEMA CHANGE</span> <span class="b">NO WEIGHT CHANGE</span></p></div></div></div>
<?php if(!$s):?><div class="p"><p class="red"><?=wr_v53_h(isset($data['message'])?$data['message']:'No memory data.')?></p></div><?php else:?><div class="p"><h2>Memory Command Center</h2><div class="grid"><div class="c"><small>Memory State</small><div class="k cyan"><?=wr_v53_h($s['memory_state'])?></div><p>Snapshots <?=wr_v53_h(isset($data['history_snapshot_count'])?$data['history_snapshot_count']:0)?></p></div><div class="c"><small>Memory Records</small><div class="k gold"><?=wr_v53_h($s['memory_record_count'])?></div><p>Avg Strength <?=number_format((float)$s['average_memory_strength'],1)?></p></div><div class="c"><small>Positive / Negative</small><div class="k"><span class="green"><?=wr_v53_h($s['positive_memory_count'])?></span> / <span class="red"><?=wr_v53_h($s['negative_memory_count'])?></span></div><p>Neutral <?=wr_v53_h($s['neutral_memory_count'])?></p></div><div class="c"><small>Recommendations</small><p>PROMOTE <?=wr_v53_h($s['promote_count'])?> ｜ GUARD <?=wr_v53_h($s['guard_count'])?></p><p>CAUTION <?=wr_v53_h($s['caution_count'])?></p></div></div></div>
<div class="p"><h2>Chairman Memory Votes</h2><div class="grid"><div class="c"><h3 class="green">Top Positive Memory</h3><div class="cyan"><?=wr_v53_h($s['top_positive_memory'])?></div></div><div class="c"><h3 class="red">Top Negative Memory</h3><div class="cyan"><?=wr_v53_h($s['top_negative_memory'])?></div></div><div class="c"><h3 class="gold">Learning Mode</h3><span class="b"><?=wr_v53_h(isset($data['learning_mode'])?$data['learning_mode']:'ADVISORY_ONLY')?></span></div><div class="c"><h3 class="gold">Safety</h3><p>Live Weights Changed: <b class="green">NO</b></p><p>DB Schema Changed: <b class="green">NO</b></p></div></div></div>

<div class="p"><h2>Pattern Cluster Command Center</h2><div class="grid"><div class="c"><small>Clusters</small><div class="k gold"><?=wr_v53_h(isset($cs['cluster_count'])?$cs['cluster_count']:0)?></div><p>Mapped <?=wr_v53_h(isset($cs['mapped_memory_count'])?$cs['mapped_memory_count']:0)?> memories</p></div><div class="c"><small>Average Cohesion</small><div class="k cyan"><?=number_format((float)(isset($cs['average_cohesion'])?$cs['average_cohesion']:0),1)?></div><div class="bar"><span style="width:<?=min(100,max(0,(float)(isset($cs['average_cohesion'])?$cs['average_cohesion']:0)))?>%"></span></div></div><div class="c"><small>Promote / Guard</small><div class="k"><span class="green"><?=wr_v53_h(isset($cs['promote_cluster_count'])?$cs['promote_cluster_count']:0)?></span> / <span class="red"><?=wr_v53_h(isset($cs['guard_cluster_count'])?$cs['guard_cluster_count']:0)?></span></div><p>Caution <?=wr_v53_h(isset($cs['caution_cluster_count'])?$cs['caution_cluster_count']:0)?></p></div><div class="c"><small>Top Cluster</small><div class="k gold"><?=wr_v53_h(isset($cs['top_cluster'])?$cs['top_cluster']:'NONE')?></div></div></div></div>

<div class="p"><h2>V54.8 Ultimate Dashboard</h2><div class="grid"><div class="c"><small>Dashboard State</small><div class="k cyan"><?=wr_v53_h(isset($uds['dashboard_state'])?$uds['dashboard_state']:'CONTROLLED')?></div></div><div class="c"><small>Actionable</small><div class="k green"><?=wr_v53_h(isset($uds['actionable_count'])?$uds['actionable_count']:0)?></div></div><div class="c"><small>Watch / Guarded</small><div class="k"><span class="gold"><?=wr_v53_h(isset($uds['watchlist_count'])?$uds['watchlist_count']:0)?></span> / <span class="red"><?=wr_v53_h(isset($uds['guarded_count'])?$uds['guarded_count']:0)?></span></div></div><div class="c"><small>Top Cluster</small><div class="k gold" style="font-size:17px"><?=wr_v53_h(isset($uds['top_cluster'])?$uds['top_cluster']:'NONE')?> · <?=number_format((float)(isset($uds['top_score'])?$uds['top_score']:0),1)?></div></div></div><div class="g3" style="margin-top:10px"><?php foreach(array_slice($ud,0,12) as $x):?><div class="c"><h3 class="gold">#<?=wr_v53_h($x['final_rank'])?> · <?=wr_v53_h($x['cluster_id'])?></h3><div class="k"><?=number_format((float)$x['final_score'],1)?></div><p><span class="b"><?=wr_v53_h($x['decision_bucket'])?></span> <span class="cyan"><?=wr_v53_h($x['decision'])?></span> · x<?=number_format((float)$x['multiplier'],2)?></p><p>Safety <?=number_format((float)$x['safety_score'],1)?> / <?=wr_v53_h($x['safety_state'])?> ｜ Audit <?=number_format((float)$x['audit_score'],1)?> / <?=wr_v53_h($x['audit_status'])?></p><p class="muted"><?=wr_v53_h($x['dashboard_reason'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>V54.9 Final Release Certification</h2><div class="grid"><div class="c"><small>Release State</small><div class="k cyan" style="font-size:20px"><?=wr_v53_h(isset($release['release_state'])?$release['release_state']:'REVIEW')?></div></div><div class="c"><small>Readiness</small><div class="k green"><?=number_format((float)(isset($release['release_readiness'])?$release['release_readiness']:0),1)?>%</div></div><div class="c"><small>Checks</small><div class="k gold"><?=wr_v53_h(isset($release['passed_checks'])?$release['passed_checks']:0)?> / <?=wr_v53_h(isset($release['total_checks'])?$release['total_checks']:0)?></div></div><div class="c"><small>Safety Contract</small><div><span class="b">ADVISORY ONLY</span> <span class="b">NO SCHEMA CHANGE</span> <span class="b">NO LIVE WEIGHT CHANGE</span></div></div></div><div class="c" style="margin-top:10px"><h3 class="gold"><?=wr_v53_h(isset($release['release_name'])?$release['release_name']:'WinRacing V54 Final Release')?></h3><p class="cyan"><?=wr_v53_h(isset($release['release_note'])?$release['release_note']:'')?></p></div></div>
<div class="p"><h2>V54.5 Decision Audit</h2><div class="grid"><div class="c"><small>Audit Ready</small><div class="k cyan"><?=!empty($das['audit_ready'])?'YES':'NO'?></div></div><div class="c"><small>Pass / Warning</small><div class="k"><span class="green"><?=wr_v53_h(isset($das['pass_count'])?$das['pass_count']:0)?></span> / <span class="gold"><?=wr_v53_h(isset($das['warning_count'])?$das['warning_count']:0)?></span></div></div><div class="c"><small>Fail</small><div class="k red"><?=wr_v53_h(isset($das['fail_count'])?$das['fail_count']:0)?></div></div><div class="c"><small>Average Audit</small><div class="k cyan"><?=number_format((float)(isset($das['average_audit_score'])?$das['average_audit_score']:0),1)?></div></div></div><div class="g3" style="margin-top:10px"><?php foreach(array_slice($audits,0,12) as $x):?><div class="c"><h3 class="gold"><?=wr_v53_h($x['audit_id'])?> · <?=wr_v53_h($x['audit_status'])?></h3><div class="k"><?=number_format((float)$x['audit_score'],1)?></div><p>Action <span class="cyan"><?=wr_v53_h($x['final_advisory_action'])?></span> ｜ Gate <?=wr_v53_h($x['gate_status'])?></p><p class="muted"><?=wr_v53_h($x['audit_reason'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>V54.6 Safety Governor</h2><div class="grid"><div class="c"><small>Overall Safety</small><div class="k cyan"><?=wr_v53_h(isset($sgs['overall_safety_state'])?$sgs['overall_safety_state']:'GUARDED')?></div></div><div class="c"><small>Open / Capped</small><div class="k"><span class="green"><?=wr_v53_h(isset($sgs['open_count'])?$sgs['open_count']:0)?></span> / <span class="gold"><?=wr_v53_h(isset($sgs['capped_count'])?$sgs['capped_count']:0)?></span></div></div><div class="c"><small>Locked</small><div class="k red"><?=wr_v53_h(isset($sgs['locked_count'])?$sgs['locked_count']:0)?></div></div><div class="c"><small>Average Safety</small><div class="k cyan"><?=number_format((float)(isset($sgs['average_safety_score'])?$sgs['average_safety_score']:0),1)?></div></div></div><div class="g3" style="margin-top:10px"><?php foreach(array_slice($safety,0,12) as $x):?><div class="c"><h3 class="gold"><?=wr_v53_h($x['governor_id'])?> · <?=wr_v53_h($x['safety_state'])?></h3><div class="k"><?=number_format((float)$x['safety_score'],1)?></div><p>Action <span class="cyan"><?=wr_v53_h($x['governed_action'])?></span> ｜ x<?=number_format((float)$x['governed_multiplier'],2)?></p><p class="muted"><?=wr_v53_h($x['safety_reason'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>V54.7 Final Chairman Ranking</h2><div class="grid"><div class="c"><small>Ranked</small><div class="k gold"><?=wr_v53_h(isset($frs['ranked_count'])?$frs['ranked_count']:0)?></div></div><div class="c"><small>Support / Review</small><div class="k"><span class="green"><?=wr_v53_h(isset($frs['support_count'])?$frs['support_count']:0)?></span> / <span class="cyan"><?=wr_v53_h(isset($frs['review_count'])?$frs['review_count']:0)?></span></div></div><div class="c"><small>Guard</small><div class="k red"><?=wr_v53_h(isset($frs['guard_count'])?$frs['guard_count']:0)?></div></div><div class="c"><small>Top Ranked</small><div class="k gold" style="font-size:17px"><?=wr_v53_h(isset($frs['top_ranked'])?$frs['top_ranked']:'NONE')?> · <?=number_format((float)(isset($frs['top_score'])?$frs['top_score']:0),1)?></div></div></div><div class="g3" style="margin-top:10px"><?php foreach(array_slice($ranking,0,12) as $x):?><div class="c"><h3 class="gold">#<?=wr_v53_h($x['final_rank'])?> · <?=wr_v53_h($x['cluster_id'])?></h3><div class="k"><?=number_format((float)$x['final_score'],1)?></div><p>Action <span class="cyan"><?=wr_v53_h($x['final_action'])?></span> ｜ x<?=number_format((float)$x['final_multiplier'],2)?></p><p><?=wr_v53_h($x['safety_state'])?> ｜ <?=wr_v53_h($x['gate_status'])?> ｜ <?=wr_v53_h($x['strategy'])?></p><p class="muted"><?=wr_v53_h($x['ranking_reason'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>V54.2 Debate Consensus Stabilizer</h2><div class="grid"><div class="c"><small>Average Stability</small><div class="k cyan"><?=number_format((float)(isset($dss2['average_stability'])?$dss2['average_stability']:0),1)?></div></div><div class="c"><small>Stable / Controlled</small><div class="k"><span class="green"><?=wr_v53_h(isset($dss2['stable_count'])?$dss2['stable_count']:0)?></span> / <span class="cyan"><?=wr_v53_h(isset($dss2['controlled_count'])?$dss2['controlled_count']:0)?></span></div></div><div class="c"><small>Volatile / Unstable</small><div class="k"><span class="gold"><?=wr_v53_h(isset($dss2['volatile_count'])?$dss2['volatile_count']:0)?></span> / <span class="red"><?=wr_v53_h(isset($dss2['unstable_count'])?$dss2['unstable_count']:0)?></span></div></div><div class="c"><small>Verdicts Changed</small><div class="k gold"><?=wr_v53_h(isset($dss2['verdicts_changed'])?$dss2['verdicts_changed']:0)?></div></div></div><div class="g3" style="margin-top:10px"><?php foreach(array_slice($stabs,0,12) as $x):?><div class="c"><h3 class="gold"><?=wr_v53_h($x['stabilizer_id'])?> · <?=wr_v53_h($x['stability_state'])?></h3><div class="k"><?=number_format((float)$x['stability_score'],1)?></div><p><?=wr_v53_h($x['original_verdict'])?> → <span class="cyan"><?=wr_v53_h($x['stabilized_verdict'])?></span></p><p>Agreement <?=number_format((float)$x['agent_agreement'],1)?> ｜ Dispersion <?=number_format((float)$x['debate_dispersion'],1)?></p><p class="muted"><?=wr_v53_h($x['stabilization_reason'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>V54.3 Scenario Stress Test</h2><div class="grid"><div class="c"><small>Stress Tests</small><div class="k gold"><?=wr_v53_h(isset($sts['stress_test_count'])?$sts['stress_test_count']:0)?></div></div><div class="c"><small>Grade A / B</small><div class="k"><span class="green"><?=wr_v53_h(isset($sts['grade_a'])?$sts['grade_a']:0)?></span> / <span class="cyan"><?=wr_v53_h(isset($sts['grade_b'])?$sts['grade_b']:0)?></span></div></div><div class="c"><small>Grade C / D</small><div class="k"><span class="gold"><?=wr_v53_h(isset($sts['grade_c'])?$sts['grade_c']:0)?></span> / <span class="red"><?=wr_v53_h(isset($sts['grade_d'])?$sts['grade_d']:0)?></span></div></div><div class="c"><small>Top Resilient</small><div class="k cyan" style="font-size:17px"><?=wr_v53_h(isset($sts['top_resilient'])?$sts['top_resilient']:'NONE')?></div></div></div><div class="g3" style="margin-top:10px"><?php foreach(array_slice($stress,0,12) as $x):?><div class="c"><h3 class="gold"><?=wr_v53_h($x['stress_id'])?> · Grade <?=wr_v53_h($x['stress_grade'])?></h3><div class="k"><?=number_format((float)$x['resilience_score'],1)?></div><p>Pass <?=wr_v53_h($x['pass_count'])?> / <?=wr_v53_h($x['scenario_count'])?> ｜ Worst <?=number_format((float)$x['worst_case_score'],1)?></p><p class="cyan"><?=wr_v53_h($x['stress_recommendation'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>V54.4 Chairman Decision Gate</h2><div class="grid"><div class="c"><small>Overall Gate</small><div class="k cyan"><?=wr_v53_h(isset($dgs['overall_gate_status'])?$dgs['overall_gate_status']:'REVIEW')?></div></div><div class="c"><small>Approved / Review</small><div class="k"><span class="green"><?=wr_v53_h(isset($dgs['approved_count'])?$dgs['approved_count']:0)?></span> / <span class="cyan"><?=wr_v53_h(isset($dgs['review_count'])?$dgs['review_count']:0)?></span></div></div><div class="c"><small>Limited / Blocked</small><div class="k"><span class="gold"><?=wr_v53_h(isset($dgs['limited_count'])?$dgs['limited_count']:0)?></span> / <span class="red"><?=wr_v53_h(isset($dgs['blocked_count'])?$dgs['blocked_count']:0)?></span></div></div><div class="c"><small>Top Approved</small><div class="k gold" style="font-size:17px"><?=wr_v53_h(isset($dgs['top_approved'])?$dgs['top_approved']:'NONE')?></div></div></div><div class="g3" style="margin-top:10px"><?php foreach(array_slice($gates,0,12) as $x):?><div class="c"><h3 class="gold"><?=wr_v53_h($x['gate_id'])?> · <?=wr_v53_h($x['gate_status'])?></h3><div class="k"><?=number_format((float)$x['gate_score'],1)?></div><p>Action <span class="cyan"><?=wr_v53_h($x['final_advisory_action'])?></span> ｜ Multiplier x<?=number_format((float)$x['approved_multiplier'],2)?></p><p>Stress <?=wr_v53_h($x['stress_grade'])?> ｜ Stability <?=wr_v53_h($x['stability_state'])?></p><p class="muted"><?=wr_v53_h($x['gate_reason'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>V53.9 Chairman Decision Simulator</h2><div class="grid"><div class="c"><small>Simulations</small><div class="k gold"><?=wr_v53_h(isset($dss['simulation_count'])?$dss['simulation_count']:0)?></div></div><div class="c"><small>Promote / Guard / Ignore Best</small><div class="k"><span class="green"><?=wr_v53_h(isset($dss['promote_best_count'])?$dss['promote_best_count']:0)?></span> / <span class="red"><?=wr_v53_h(isset($dss['guard_best_count'])?$dss['guard_best_count']:0)?></span> / <span class="cyan"><?=wr_v53_h(isset($dss['ignore_best_count'])?$dss['ignore_best_count']:0)?></span></div></div><div class="c"><small>Top Simulation</small><div class="k cyan" style="font-size:17px"><?=wr_v53_h(isset($dss['top_simulation'])?$dss['top_simulation']:'NONE')?></div></div></div><div class="g3" style="margin-top:10px"><?php foreach(array_slice($sims,0,12) as $x):?><div class="c"><h3 class="gold"><?=wr_v53_h($x['simulation_id'])?> · <?=wr_v53_h($x['best_scenario'])?></h3><div class="k"><?=number_format((float)$x['best_expected_gain'],2)?></div><p>Expected Gain ｜ Confidence <?=number_format((float)$x['simulation_confidence'],1)?></p><p>Baseline <?=number_format((float)$x['baseline_score'],1)?> ｜ Risk <?=number_format((float)$x['baseline_risk'],1)?></p><p class="muted"><?=wr_v53_h($x['reason'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>V54.0 Counterfactual AI</h2><div class="grid"><div class="c"><small>Counterfactuals</small><div class="k gold"><?=wr_v53_h(isset($cfs['counterfactual_count'])?$cfs['counterfactual_count']:0)?></div></div><div class="c"><small>Essential</small><div class="k green"><?=wr_v53_h(isset($cfs['essential_count'])?$cfs['essential_count']:0)?></div></div><div class="c"><small>Fake Important</small><div class="k red"><?=wr_v53_h(isset($cfs['fake_important_count'])?$cfs['fake_important_count']:0)?></div></div><div class="c"><small>Top Essential Pattern</small><div class="k cyan" style="font-size:17px"><?=wr_v53_h(isset($cfs['top_essential_pattern'])?$cfs['top_essential_pattern']:'NONE')?></div></div></div><div class="g3" style="margin-top:10px"><?php foreach(array_slice($counterfactuals,0,12) as $x):?><div class="c"><h3 class="gold"><?=wr_v53_h($x['counterfactual_id'])?> · <?=wr_v53_h($x['importance_class'])?></h3><div class="k"><?=number_format((float)$x['essentiality_score'],1)?></div><p>Promote vs Ignore <?=number_format((float)$x['promote_vs_ignore_impact'],2)?> ｜ Spread <?=number_format((float)$x['outcome_spread'],2)?></p><p class="muted"><?=wr_v53_h($x['counterfactual_answer'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>V54.1 Chairman Self-Debate</h2><div class="grid"><div class="c"><small>Debates</small><div class="k gold"><?=wr_v53_h(isset($dbs['debate_count'])?$dbs['debate_count']:0)?></div></div><div class="c"><small>Promote / Support</small><div class="k"><span class="green"><?=wr_v53_h(isset($dbs['promote_count'])?$dbs['promote_count']:0)?></span> / <span class="cyan"><?=wr_v53_h(isset($dbs['support_count'])?$dbs['support_count']:0)?></span></div></div><div class="c"><small>Reduce / Guard</small><div class="k"><span class="gold"><?=wr_v53_h(isset($dbs['reduce_count'])?$dbs['reduce_count']:0)?></span> / <span class="red"><?=wr_v53_h(isset($dbs['guard_count'])?$dbs['guard_count']:0)?></span></div></div><div class="c"><small>Top Debate</small><div class="k cyan" style="font-size:17px"><?=wr_v53_h(isset($dbs['top_debate'])?$dbs['top_debate']:'NONE')?></div></div></div><div class="g3" style="margin-top:10px"><?php foreach(array_slice($debates,0,12) as $x):?><div class="c"><h3 class="gold"><?=wr_v53_h($x['debate_id'])?> · <?=wr_v53_h($x['chairman_verdict'])?></h3><div class="k"><?=number_format((float)$x['chairman_confidence'],1)?></div><p>Debate Margin <?=number_format((float)$x['debate_margin'],1)?> ｜ Allocation x<?=number_format((float)$x['final_allocation_multiplier'],2)?></p><p class="green">Advocate <?=number_format((float)$x['agent_a']['score'],1)?></p><p class="red">Skeptic <?=number_format((float)$x['agent_b']['score'],1)?> ｜ Risk Guard <?=number_format((float)$x['agent_c']['score'],1)?></p><p class="muted"><?=wr_v53_h($x['chairman_reason'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>Multi-Race Memory Fusion Command Center</h2><div class="grid"><div class="c"><small>Fusion Profiles</small><div class="k gold"><?=wr_v53_h(isset($mfs['fusion_profile_count'])?$mfs['fusion_profile_count']:0)?></div><p>History Snapshots <?=wr_v53_h(isset($mfs['history_snapshot_count'])?$mfs['history_snapshot_count']:0)?></p></div><div class="c"><small>Average Fusion Confidence</small><div class="k cyan"><?=number_format((float)(isset($mfs['average_fusion_confidence'])?$mfs['average_fusion_confidence']:0),1)?></div><div class="bar"><span style="width:<?=min(100,max(0,(float)(isset($mfs['average_fusion_confidence'])?$mfs['average_fusion_confidence']:0)))?>%"></span></div></div><div class="c"><small>Promote / Guard / Caution</small><div class="k"><span class="green"><?=wr_v53_h(isset($mfs['promote_count'])?$mfs['promote_count']:0)?></span> / <span class="red"><?=wr_v53_h(isset($mfs['guard_count'])?$mfs['guard_count']:0)?></span> / <span class="gold"><?=wr_v53_h(isset($mfs['caution_count'])?$mfs['caution_count']:0)?></span></div></div><div class="c"><small>Top Fused Memory</small><div class="k gold" style="font-size:16px"><?=wr_v53_h(isset($mfs['top_fused_memory'])?$mfs['top_fused_memory']:'NONE')?></div></div></div></div>
<div class="p"><h2>Chairman Strategy Optimizer</h2><div class="grid"><div class="c"><small>Strategies</small><div class="k gold"><?=wr_v53_h(isset($sos['strategy_count'])?$sos['strategy_count']:0)?></div></div><div class="c"><small>Aggressive / Selective</small><div class="k"><span class="green"><?=wr_v53_h(isset($sos['aggressive_count'])?$sos['aggressive_count']:0)?></span> / <span class="cyan"><?=wr_v53_h(isset($sos['selective_count'])?$sos['selective_count']:0)?></span></div></div><div class="c"><small>Reduced / Guard</small><div class="k"><span class="gold"><?=wr_v53_h(isset($sos['reduced_count'])?$sos['reduced_count']:0)?></span> / <span class="red"><?=wr_v53_h(isset($sos['guard_count'])?$sos['guard_count']:0)?></span></div></div><div class="c"><small>Top Strategy</small><div class="k gold" style="font-size:17px"><?=wr_v53_h(isset($sos['top_strategy'])?$sos['top_strategy']:'NONE')?></div></div></div><div class="g3" style="margin-top:10px"><?php foreach(array_slice($strategies,0,15) as $s):?><div class="c"><h3 class="gold"><?=wr_v53_h($s['strategy_id'])?> · <?=wr_v53_h($s['strategy_name'])?></h3><p><span class="b"><?=wr_v53_h($s['recommendation'])?></span> <span class="b">x<?=number_format((float)$s['allocation_multiplier'],2)?></span></p><div class="k"><?=number_format((float)$s['strategy_score'],1)?></div><p>Confidence <?=number_format((float)$s['strategy_confidence'],1)?> ｜ Risk <?=number_format((float)$s['risk_score'],1)?></p><div class="bar"><span style="width:<?=min(100,max(0,(float)$s['strategy_score']))?>%"></span></div><p class="muted"><?=wr_v53_h($s['reason'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>Explainable Chairman AI</h2><div class="grid"><div class="c"><small>Explanations</small><div class="k gold"><?=wr_v53_h(isset($xsum['explanation_count'])?$xsum['explanation_count']:0)?></div></div><div class="c"><small>High Confidence</small><div class="k green"><?=wr_v53_h(isset($xsum['high_confidence_count'])?$xsum['high_confidence_count']:0)?></div></div><div class="c"><small>Top Explanation</small><div class="k cyan" style="font-size:17px"><?=wr_v53_h(isset($xsum['top_explanation'])?$xsum['top_explanation']:'NONE')?></div></div></div><div class="g3" style="margin-top:10px"><?php foreach(array_slice($explanations,0,15) as $x):?><div class="c"><h3 class="gold"><?=wr_v53_h($x['explanation_id'])?> · <?=wr_v53_h($x['final_strategy'])?></h3><div class="k"><?=number_format((float)$x['final_score'],1)?></div><p>Confidence <?=number_format((float)$x['confidence'],1)?></p><p class="green"><?=wr_v53_h($x['top_positive_reason'])?></p><p class="red"><?=wr_v53_h($x['top_caution_reason'])?></p><p class="muted"><?=wr_v53_h($x['decision_summary'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>Chairman Experience Command Center</h2><div class="grid"><div class="c"><small>Experiences</small><div class="k gold"><?=wr_v53_h(isset($es['experience_count'])?$es['experience_count']:0)?></div><p>Avg <?=number_format((float)(isset($es['average_experience_score'])?$es['average_experience_score']:0),1)?></p></div><div class="c"><small>Trust / Avoid</small><div class="k"><span class="green"><?=wr_v53_h(isset($es['trust_count'])?$es['trust_count']:0)?></span> / <span class="red"><?=wr_v53_h(isset($es['avoid_count'])?$es['avoid_count']:0)?></span></div><p>Caution <?=wr_v53_h(isset($es['caution_count'])?$es['caution_count']:0)?></p></div><div class="c"><small>Context Support / Block</small><div class="k"><span class="green"><?=wr_v53_h(isset($xs['support_count'])?$xs['support_count']:0)?></span> / <span class="red"><?=wr_v53_h(isset($xs['block_count'])?$xs['block_count']:0)?></span></div><p>Reduce <?=wr_v53_h(isset($xs['reduce_count'])?$xs['reduce_count']:0)?> ｜ Monitor <?=wr_v53_h(isset($xs['monitor_count'])?$xs['monitor_count']:0)?></p></div><div class="c"><small>Evolution Growing / Stable</small><div class="k"><span class="green"><?=wr_v53_h(isset($evs['growing_count'])?$evs['growing_count']:0)?></span> / <span class="cyan"><?=wr_v53_h(isset($evs['stable_count'])?$evs['stable_count']:0)?></span></div><p>Declining <?=wr_v53_h(isset($evs['declining_count'])?$evs['declining_count']:0)?> ｜ Retire <?=wr_v53_h(isset($evs['retire_candidate_count'])?$evs['retire_candidate_count']:0)?></p></div></div></div>
<div class="p"><h2>Chairman Experience Library</h2><div class="g3"><?php foreach(array_slice($experiences,0,18) as $e):?><div class="c"><h3 class="gold"><?=wr_v53_h($e['experience_id'])?> · <?=wr_v53_h($e['cluster_label'])?></h3><p><span class="b"><?=wr_v53_h($e['verdict'])?></span> <span class="b"><?=wr_v53_h($e['graph_role'])?></span></p><div class="k"><?=number_format((float)$e['experience_score'],1)?></div><p>Experience Score ｜ Confidence <?=number_format((float)$e['experience_confidence'],1)?></p><div class="bar"><span style="width:<?=min(100,max(0,(float)$e['experience_score']))?>%"></span></div><p>Samples <?=wr_v53_h($e['sample_size'])?> ｜ Graph Risk <?=number_format((float)$e['graph_risk_score'],1)?></p><p class="muted"><?=wr_v53_h($e['lesson'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>Context Awareness Profiles</h2><div class="g3"><?php foreach(array_slice($contexts,0,18) as $x):?><div class="c"><h3 class="gold"><?=wr_v53_h($x['cluster_id'])?> · <?=wr_v53_h($x['context_action'])?></h3><div class="k cyan"><?=number_format((float)$x['context_fit_score'],1)?></div><p>Context Fit</p><div class="bar"><span style="width:<?=min(100,max(0,(float)$x['context_fit_score']))?>%"></span></div><p><?=wr_v53_h($x['sentiment'])?> ｜ <?=wr_v53_h($x['strength_band'])?> ｜ Risk <?=wr_v53_h($x['risk_band'])?> ｜ <?=wr_v53_h($x['sample_band'])?></p><p class="muted"><?=wr_v53_h($x['context_reason'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>Dynamic Pattern Evolution</h2><div class="g3"><?php foreach(array_slice($evolution,0,24) as $e):?><div class="c"><h3 class="gold"><?=wr_v53_h($e['memory_name'])?></h3><p><span class="b"><?=wr_v53_h($e['evolution_state'])?></span> <span class="b"><?=wr_v53_h($e['recommendation'])?></span></p><div class="k"><?=number_format((float)$e['evolution_score'],1)?></div><p>Evolution Score</p><div class="bar"><span style="width:<?=min(100,max(0,(float)$e['evolution_score']))?>%"></span></div><p>Momentum <?=number_format((float)$e['momentum_score'],1)?> ｜ Maturity <?=number_format((float)$e['maturity_score'],1)?> ｜ Context <?=wr_v53_h($e['context_action'])?></p><p class="muted"><?=wr_v53_h($e['reason'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>Pattern Relationship Graph Command Center</h2><div class="grid"><div class="c"><small>Nodes / Edges</small><div class="k gold"><?=wr_v53_h(isset($gs['node_count'])?$gs['node_count']:0)?> / <?=wr_v53_h(isset($gs['edge_count'])?$gs['edge_count']:0)?></div><p>Density <?=number_format((float)(isset($gs['graph_density_pct'])?$gs['graph_density_pct']:0),1)?>%</p></div><div class="c"><small>Positive / Conflict</small><div class="k"><span class="green"><?=wr_v53_h(isset($gs['positive_edge_count'])?$gs['positive_edge_count']:0)?></span> / <span class="red"><?=wr_v53_h(isset($gs['conflict_edge_count'])?$gs['conflict_edge_count']:0)?></span></div><p>Support <?=wr_v53_h(isset($gs['support_edge_count'])?$gs['support_edge_count']:0)?> ｜ Negative <?=wr_v53_h(isset($gs['negative_edge_count'])?$gs['negative_edge_count']:0)?></p></div><div class="c"><small>Hub / Bridge</small><div class="k cyan"><?=wr_v53_h(isset($gs['hub_node'])?$gs['hub_node']:'NONE')?></div><p>Bridge <?=wr_v53_h(isset($gs['bridge_node'])?$gs['bridge_node']:'NONE')?></p></div><div class="c"><small>Risk Node</small><div class="k red"><?=wr_v53_h(isset($gs['risk_node'])?$gs['risk_node']:'NONE')?></div><p>Top Link <?=wr_v53_h(isset($gs['top_relationship'])?$gs['top_relationship']:'NONE')?></p></div></div></div>
<div class="p"><h2>Relationship Edge Library</h2><div class="g3"><?php foreach(array_slice($gedges,0,30) as $edge):$ec=strtolower((string)$edge['relationship_type']);?><div class="c edge-<?=$ec?>"><h3 class="gold"><?=wr_v53_h($edge['edge_id'])?> · <?=wr_v53_h($edge['source'])?> → <?=wr_v53_h($edge['target'])?></h3><p><span class="b"><?=wr_v53_h($edge['relationship_type'])?></span> <span class="b"><?=wr_v53_h($edge['direction'])?></span></p><div class="k"><?=number_format((float)$edge['relationship_strength'],1)?></div><p>Relationship Strength</p><div class="bar"><span style="width:<?=min(100,max(0,(float)$edge['relationship_strength']))?>%"></span></div><p>Similarity <?=number_format((float)$edge['token_similarity'],1)?>% ｜ Support <?=wr_v53_h($edge['support_samples'])?> samples</p><p class="muted"><?=wr_v53_h($edge['reason'])?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>Graph Node Intelligence</h2><div class="g3"><?php foreach(array_slice($gmetrics,0,18) as $metric):?><div class="c"><h3 class="gold"><?=wr_v53_h($metric['node_id'])?> · <?=wr_v53_h($metric['node_role'])?></h3><div class="k cyan"><?=number_format((float)$metric['centrality_score'],1)?></div><p>Centrality</p><div class="bar"><span style="width:<?=min(100,max(0,(float)$metric['centrality_score']))?>%"></span></div><p>Degree <?=wr_v53_h($metric['degree'])?> ｜ Bridge <?=number_format((float)$metric['bridge_score'],1)?> ｜ Risk <?=number_format((float)$metric['risk_score'],1)?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>Pattern Cluster Library</h2><div class="g3"><?php foreach(array_slice($clusters,0,24) as $c):?><div class="c"><h3 class="gold"><?=wr_v53_h($c['cluster_id'])?> · <?=wr_v53_h($c['cluster_label'])?></h3><p><span class="b"><?=wr_v53_h($c['dominant_sentiment'])?></span> <span class="b"><?=wr_v53_h($c['recommendation'])?></span></p><div class="k"><?=number_format((float)$c['cluster_strength'],1)?></div><p>Cluster Strength</p><div class="bar"><span style="width:<?=min(100,max(0,(float)$c['cluster_strength']))?>%"></span></div><p>Size <?=wr_v53_h($c['cluster_size'])?> ｜ Samples <?=wr_v53_h($c['total_samples'])?> ｜ Cohesion <?=number_format((float)$c['cohesion_score'],1)?> ｜ Conflict <?=number_format((float)$c['conflict_pct'],1)?>%</p><p class="cyan">Leader: <?=wr_v53_h($c['representative_pattern'])?></p><p class="muted"><?=wr_v53_h(implode(' · ',array_slice($c['member_keys'],0,4)))?></p></div><?php endforeach;?></div></div>
<div class="p"><h2>Pattern Memory Library</h2><div class="g3"><?php foreach(array_slice($records,0,30) as $r):?><div class="c"><h3 class="gold"><?=wr_v53_h($r['memory_name'])?></h3><p><span class="b"><?=wr_v53_h($r['memory_type'])?></span> <span class="b"><?=wr_v53_h($r['sentiment'])?></span> <span class="b"><?=wr_v53_h($r['recommendation'])?></span></p><div class="k"><?=number_format((float)$r['memory_strength'],1)?></div><p>Memory Strength</p><div class="bar"><span style="width:<?=min(100,max(0,(float)$r['memory_strength']))?>%"></span></div><p>Samples <?=wr_v53_h($r['sample_size'])?> ｜ Recency <?=number_format((float)$r['recency_score'],1)?> ｜ Conflict <?=number_format((float)$r['conflict_pct'],1)?>%</p><p>Votes +<?=wr_v53_h($r['positive_votes'])?> / -<?=wr_v53_h($r['negative_votes'])?> / =<?=wr_v53_h($r['neutral_votes'])?></p><p class="muted"><?=wr_v53_h($r['first_seen'])?> → <?=wr_v53_h($r['last_seen'])?></p></div><?php endforeach;?></div></div><?php endif;?></div></body></html>
