<?php
declare(strict_types=1);
namespace App\Services\Pipeline\Steps;
use App\Services\Pipeline\AbstractPipelineStep; use App\Services\Policy\PackagePolicyService;
final class PolicyPipelineStep extends AbstractPipelineStep {
 public function code():string{return 'policy';} public function label():string{return 'Package Policy Engine';} public function order():int{return 40;}
 public function execute(array $c):array {$r=(new PackagePolicyService())->evaluatePackageFile((string)$c['zip_path'],$c['package_id'],$c['user_id'],false);$d=(string)($r['decision']??'DENIED');return $this->result($d,(int)($r['score']??0),'Package Policy Engine : '.$d.'.',(array)($r['issues']??[]),(array)($r['warnings']??[]),['environment'=>$r['environment']??'','policy_runtime'=>$r['policy_runtime']??[]],$d==='DENIED');}
}
