Files
Investidor-V2/outputs/investmoz-parques-QA-20261016/prepare-final-fix.py
T
nala cef6e201c7
tests / ci (push) Canceled after 0s
versao nrgocios 2
2026-10-16 20:11:05 +02:00

12 lines
1.3 KiB
Python

from pathlib import Path
import json,hashlib,shutil
out=Path(__file__).resolve().parent;private=Path('C:/Users/macbook/.config/investmoz/parques-QA-20261016');qa=private/'source';history=out/'historico/antes-ajuste-localizacoes';history.mkdir(parents=True,exist_ok=True)
for name in ['COMPATIBILITY-PREPARED.json','REVERSAO-APLICADA-QA.json','PROVA-POS-USO-QA.json','CANDIDATA.json','FROZEN-CANDIDATE.json','T1-RESUMO-FINAL.json','EDITOR-ATIVOS-OBSERVADOS.json']:
shutil.copy2(out/name,history/name)
sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest();p=json.loads((out/'COMPATIBILITY-PREPARED.json').read_text('utf-8'))
for n in p['paths']:shutil.copy2(qa/n,private/'candidate-sources'/n);p['candidate'][n]=sha(qa/n)
shutil.copy2(qa/'app/Services/InvestmentZones.php',private/'compatibility-build-source/app/Services/InvestmentZones.php')
(out/'COMPATIBILITY-PREPARED.json').write_text(json.dumps(p,indent=2)+'\n','utf-8')
frozen=json.loads((out/'FROZEN-CANDIDATE.json').read_text('utf-8'));frozen['sources']={n:sha(qa/n)for n in p['paths']};frozen['delta_since_post_use_proof']='Pending-location control preserved by existing insertOrIgnore logic; post-use proof rerun on final retained service.';(out/'FROZEN-CANDIDATE.json').write_text(json.dumps(frozen,indent=2)+'\n','utf-8')
print('Final compatibility source updated; prior proofs preserved')