commit melhorias sgf

This commit is contained in:
2026-11-11 09:00:17 +02:00
parent 0b05a1192c
commit 1d11a5e57b
736 changed files with 40746 additions and 210 deletions
+3
View File
@@ -0,0 +1,3 @@
<?php
$book='8085';require __DIR__.'/sgf-single-bootstrap.php';$decision=json_decode(file_get_contents($repo.'/docs/integration/sgf-multi-line-included-proposal.json'),true);if(($decision['approved']??false)!==true||($decision['authorization']['decision']??null)!=='Autorizar a modalidade QA e a política apresentada')throw new LogicException('Explicit representation policy approval required');foreach([$run['root'].'/private/receipt-composition-b4093c6f6707/single-integration/20261110-195444-c0e2a14a/document-math-result.json',$run['root'].'/private/receipt-composition-b4093c6f6707/document-math-concurrency/result.json',$run['root'].'/private/receipt-composition-b4093c6f6707/single-integration/20261110-195644-d598bace/document-math-recovery.json']as$file)if((json_decode(file_get_contents($file),true)['passed']??false)!==true)throw new LogicException('Valid affected proofs required');if(!is_file($s['root'].'/document-math-backup-pointer.json'))throw new LogicException('Preserve baseline first');
$files=['app/Modules/Services/FiscalDocumentMath.php','app/Modules/Services/FiscalRules.php','app/Modules/Services/Http/FiscalRulesController.php','routes/web.php','public/sgf-fiscal-rules.mjs','resources/views/fiscal/rules.blade.php'];foreach($files as$file)if(str_ends_with($file,'.php'))(new Symfony\Component\Process\Process([PHP_BINARY,'-l',$repo.'/'.$file]))->mustRun();$hashes=[];$copy=function($src,$file)use($s,$work,&$hashes){$dest=$s['app'].'/'.$file;$backup=$work.'/before/'.$file;if(is_file($dest)){if(!is_dir(dirname($backup)))mkdir(dirname($backup),0700,true);copy($dest,$backup);}if(!is_dir(dirname($dest)))mkdir(dirname($dest),0700,true);copy($src,$dest);$hashes[$file]=hash_file('sha256',$dest);};foreach($files as$file)$copy($repo.'/'.$file,$file);$config=require $s['app'].'/config/fiscal_rules_qa.php';$config['document_enabled']=true;$file=$work.'/fiscal_rules_qa.php';file_put_contents($file,"<?php\nreturn ".var_export($config,true).";\n");$copy($file,'config/fiscal_rules_qa.php');file_put_contents($work.'/document-math-installation.json',json_encode(['passed'=>true,'hashes'=>$hashes,'new_grants'=>0,'new_schema'=>0,'new_demo'=>false,'cache_cleared'=>false,'native_writes'=>0],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'proof'=>$work.'/document-math-installation.json']).PHP_EOL;