<?php
$root=dirname(__DIR__);$v=json_decode(file_get_contents($root.'/DDB_VERSION.json'),true);$view=file_get_contents($root.'/app/Views/revenue/index.php');$css=file_get_contents($root.'/public/assets/css/executive-ui-core.css');
$c=['version'=>($v['version']??'')==='11.0.11.65','phase'=>($v['phase']??'')==='H11.0-P11.1-R45-P4','card'=>strpos($view,'eri-r45p4-controls')!==false,'head'=>strpos($view,'eri-r45p4-head')!==false,'active'=>strpos($view,'eri-r45p4-active-comparison')!==false,'years'=>substr_count($view,'eri-r45p4-year')>=2,'policy'=>strpos($view,'eri-r45p4-policy-note')!==false,'desktop'=>strpos($css,'minmax(150px,.9fr)')!==false,'tablet'=>strpos($css,'max-width:900px')!==false,'mobile'=>strpos($css,'max-width:560px')!==false,'no_oracle'=>(($v['r45_p4']['oracle_writes']??'')==='NONE')];$f=[];foreach($c as $n=>$ok){if(!$ok)$f[]=$n;}echo json_encode(['schema'=>'R45_P4_QA','checks'=>$c,'passed'=>count($c)-count($f),'failed'=>$f],JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES),PHP_EOL;exit(count($f)?1:0);
