Files
Investidor-V2/outputs/investmoz-audit-current-20261012/line07-QA24-preflight-readonly-20261015.php
T
nala c13f250b87
tests / ci (push) Canceled after 0s
versao compilada
2026-10-15 17:37:00 +02:00

41 lines
3.2 KiB
PHP

<?php
ini_set('zend.exception_ignore_args', '1');
putenv('STABILITY_QA_MODE=consumers');
$taskRoot = dirname(__DIR__, 2);
$app = require $taskRoot.'/storage/app/private/investmoz-v2/portal-audit/portal-stability-source-20261011_083742/tools/portal-stability-runtime.php';
$db = Illuminate\Support\Facades\DB::connection();
$target = (array) $db->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.'); }
$proofPath = __DIR__.'/line07-QA24-preflight-readonly-20261015.json';
if (is_file($proofPath)) { throw new RuntimeException('Preserve existing evidence.'); }
$db->beginTransaction();
$db->statement('SET TRANSACTION READ ONLY');
try {
$business = app(App\Services\Mne\BusinessRepository::class)->find('172aa874-98fc-4bf6-b78f-d2e9a386d345');
$actors = [];
foreach ([24,25] as $id) {
$actor = App\Models\User::findOrFail($id);
$gate = Illuminate\Support\Facades\Gate::forUser($actor);
$abilities = ['current_can_view'=>$gate->allows('view',$business)];
foreach (['submitted'=>['triage'],'triage'=>['review'],'in_review'=>['review'],'approval_l1'=>['approveLevelOne'],'approval_l2'=>['approveLevelTwo'],'approved'=>['publish']] as $state=>$checks) {
$hypothetical = clone $business;
$hypothetical->status = $state;
foreach ($checks as $ability) { $abilities[$state.':'.$ability] = $gate->allows($ability,$hypothetical); }
}
$actors[] = ['QA_account'=>$id,'abilities'=>$abilities];
}
$proof = ['at'=>gmdate('c'),'target'=>$target,'SQL_read_only'=>true,'line'=>7,'phase'=>2,
'business_id'=>$business->id,'current_state'=>$business->status,'version'=>$business->version_no,
'actors'=>$actors,'hypothetical_states_evaluated_on_unsaved_clones_only'=>true,
'actual_transitions'=>$db->table('business_workflow_transitions')->where('existing_business_id',$business->id)
->orderByDesc('created_at')->limit(6)->get(['from_status','to_status','actor_id','created_at']),
'UI_attempt'=>['stage'=>'sky.list_apps','error'=>'Computer Use native pipe is unavailable; failed to connect native pipe; os error 2',
'QA24_page_opened'=>false,'authenticated_transitions_executed'=>0,'credentials_or_MFA_read'=>false,'resets_or_TLS_bypass'=>0],
'existing_technical_dependencies'=>['submitted requires triage before review/information request',
'Current intake contains two approval levels with different actors, and publishing must use another actor; this is an implementation dependency, not newly authorized organizational policy.'],
'dependent_actions_not_observed'=>['correction request','QA21 correction and resubmission','QA24 review/approval','QA25 publication'],
'QA_database_changes'=>0,'active_changes'=>0];
file_put_contents($proofPath,json_encode($proof,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_THROW_ON_ERROR).PHP_EOL);
echo json_encode($proof,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_THROW_ON_ERROR).PHP_EOL;
} finally { $db->rollBack(); }