<?php
require __DIR__.'/run.php';$p=f27tail_reference();f27tail_gate($p);$local=$p;$local['recovery']['source_raw_path']='/tmp/cdx-prepay-full27-C-evidence-20261011/events-initial-stopped.jsonl';$local['recovery']['resume_raw_path']='/tmp/cdx-prepay-full27-C-evidence-20261011/events-resume-stopped.jsonl';$proof=f27tail_source($local);$checks=2;
function tail_red($fn,$name){global $checks;$bad=false;try{$fn();}catch(Throwable $e){$bad=true;}f27_assert($bad,'RED '.$name);$checks++;}
$meta=$proof['meta'];f27_schema($meta,$p,false);$checks++;
$fixture=$meta;$fixture['objects'][]=['object_name'=>$p['trigger'],'object_type'=>'TRIGGER','status'=>'VALID'];$fixture['triggers']=[['trigger_name'=>$p['trigger'],'table_name'=>$p['bare'],'table_owner'=>'ZHCT_APP','status'=>'Y','triggering_type'=>'BEFORE ROW','triggering_event'=>'UPDATE','trigger_body'=>$p['candidate_trigger']]];$fixture['trigger_ddl']=[['ddl'=>$p['candidate_trigger']]];f27_schema($fixture,$p,true);$checks++;
foreach(['status'=>'INVALID','table_owner'=>'FOREIGN']as $k=>$v){$bad=$meta;$bad['indexes'][0][$k]=$v;tail_red(static function()use($bad,$p){f27_schema($bad,$p,false);},'actual index '.$k);}
$bad=$fixture;$bad['triggers'][0]['status']='N';tail_red(static function()use($bad,$p){f27_schema($bad,$p,true);},'future trigger disabled');$bad=$fixture;$bad['trigger_ddl'][0]['ddl']=str_replace('V_POS := V_POS + 256','V_POS := V_POS + 255',$p['candidate_trigger']);tail_red(static function()use($bad,$p){f27_schema($bad,$p,true);},'future full body drift');
foreach(['SQL','binds','PDO_types','ordinal']as $k){$bad=$p;$bad['steps'][0][$k]='unknown';tail_red(static function()use($bad){f27tail_gate($bad);},'unknown remaining '.$k);}
echo f27_json(['status'=>'PURE_C_TAIL_TEST_GREEN','checks'=>$checks,'connections'=>0,'actual_original_completed_prefix'=>21,'actual_resume_completed_reads'=>12,'actual_full10_schema_gate_pass'=>true,'future_compiled_trigger_fixture_only'=>true])."\n";
