keyBy('id');foreach(['irps','inss']as$key){$ok($tax[$key]['state']==='partial'&&is_string($tax[$key]['available']),'existing internal capability acknowledged '.$key);$ok($tax[$key]['legal_use']===false&&preg_match('/leg(?:al|ais)/u',$tax[$key]['pending'])===1,'legal gap preserved '.$key);}$management=collect($c['management'])->keyBy('id');$ok(str_contains($management['human_resources']['available'],'autónomo')&&str_contains($management['human_resources']['available'],'férias'),'autonomous HR delivered operations in coverage');$ok(str_contains($management['accounting']['available'],'parciais')&&str_contains($management['accounting']['pending'],'Activos'),'partial statements present assets explicitly absent');$ok($tax['irpc']['state']==='pending'&&$tax['ice']['state']==='pending'&&!$c['legal_validation']&&!$c['official_submission_enabled'],'no unimplemented engine or legal activation inferred');file_put_contents($work.'/coverage-reconciliation.json',json_encode(['passed'=>true,'checks'=>$checks,'database_writes'=>0,'new_grants'=>0],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'checks'=>count($checks),'proof'=>$work.'/coverage-reconciliation.json']).PHP_EOL;