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

34 lines
2.0 KiB
Python

from pathlib import Path
import hashlib, json, shutil, os, re
out=Path(__file__).resolve().parent
root=out.parents[1]
qa=root/'storage/app/private/investmoz-v2/portal-audit/portal-stability-source-20261011_083742'
before=out/'line07-triage-feedback-before-20261015'
prepared=qa/'public/build-line07-triage-feedback-prepared-20261015'
build=qa/'public/build'
sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest()
src=qa/'resources/js/pages/investment/business.tsx'
old=(before/'business.tsx').read_text(encoding='utf-8')
new=src.read_text(encoding='utf-8')
assert re.findall(r'disabled=\{[^}]*\}',old)==re.findall(r'disabled=\{[^}]*\}',new)
assert sha(build/'manifest.json')==sha(before/'manifest.json')
assert any('Para disponibilizar a ação' in p.read_text(encoding='utf-8') for p in (prepared/'assets').glob('business-*.js'))
for p in prepared.rglob('*'):
if not p.is_file() or p.name in ['manifest.json','fonts-manifest.json']: continue
d=build/p.relative_to(prepared)
if d.exists(): assert sha(d)==sha(p)
else:
d.parent.mkdir(parents=True,exist_ok=True)
shutil.copy2(p,d)
pending=build/'manifest.line07-triage.pending'
shutil.copy2(prepared/'manifest.json',pending)
os.replace(pending,build/'manifest.json')
shutil.copy2(src,out/'line07-triage-feedback-QA-business-20261015.tsx')
(out/'line07-triage-feedback-QA-20261015.json').write_text(json.dumps({
'scope':'QA only','old_manifest_sha256':sha(before/'manifest.json'),'new_manifest_sha256':sha(build/'manifest.json'),
'source_sha256':sha(src),'disabled_guards_unchanged':True,'policy_and_server_unchanged':True,
'previous_assets_preserved':True,'type_check_exit':0,'build_exit':0,'QA_database_changes':0,'active_changes':0,
'reversal':'Restore QA business.tsx and public/build/manifest.json from line07-triage-feedback-before-20261015; old chunks retained.'
},ensure_ascii=False,indent=2)+'\n',encoding='utf-8')
print('QA assets installed; guards unchanged; rollback source and manifest preserved')