selectOne('SELECT current_database() AS database,inet_server_port() AS port'); if($target!==['database'=>'stability_consumers_20261011_084534_test','port'=>55441])throw new RuntimeException('QA isolation required'); $db->beginTransaction();$db->statement('SET TRANSACTION READ ONLY'); try { $o=App\Models\Opportunity::findOrFail(34);$w=$o->workflow_context; $proof=['at'=>gmdate('c'),'target'=>$target,'SQL_read_only'=>true,'id'=>34,'management_version'=>$o->management_version,'workflow_context'=>$w,'QA_data_changes'=>0,'active_changes'=>0]; $path=__DIR__.'/line05-history-readonly-20261015.json'; if(is_file($path))throw new RuntimeException('Preserve existing evidence'); file_put_contents($path,json_encode($proof,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_THROW_ON_ERROR).PHP_EOL); echo json_encode(['version'=>$o->management_version,'keys'=>array_keys($w),'state'=>$w['working_state']??null,'reviews'=>$w['reviews']??null,'publication'=>$w['publication']??null,'materiality'=>$w['materiality']??null],JSON_UNESCAPED_UNICODE|JSON_THROW_ON_ERROR).PHP_EOL; } finally {$db->rollBack();}