Files
Investidor-V2/outputs/investmoz-editorial-QA-20261018/receipt.py
T
nala cf003c8623
tests / ci (push) Canceled after 0s
versao nrgocios 4
2026-10-18 15:57:06 +02:00

22 lines
2.7 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from pathlib import Path
import json,hashlib,re
r=Path.cwd();o=Path(__file__).resolve().parent;q=Path('C:/Users/macbook/.config/investmoz/editorial-QA-20261018/source');sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest()
m=json.loads((o/'MANIFESTO-QA.json').read_text('utf8'));before=json.loads((o/'ATIVO-ANTES.json').read_text('utf8'))
assert all(sha(r/n)==v for n,v in before.items())
assert all(sha(q/d['path'])==d['after'] for d in m['sources'])
assert all(sha(q/n)==v for n,v in m['build'].items())
manual=r/'docs/investmoz/unification/traceability-and-manual.md'
for p in (o/'capturas').glob('*.png'):
assert p.read_bytes().startswith(b'\xff\xd8\xff')
for doc in [manual,o/'RELATORIO-QA.md']:
text=doc.read_text('utf8');doc.write_text(text.replace(p.name,p.with_suffix('.jpg').name),'utf8')
p.rename(p.with_suffix('.jpg'))
text=manual.read_text('utf8');section=text.split('## Formação editorial em QA')[1].split('## Gestão autónoma de conteúdos')[0]
for path in re.findall(r'\]\(([^)]+)\)',section):assert (manual.parent/path).resolve().exists(),path
captures=list((o/'capturas').glob('*.jpg'));assert len(captures)==8
assert all(p.read_bytes().startswith(b'\xff\xd8\xff') for p in captures)
files=['ADAPTACAO-MINIMA.md','RELATORIO-QA.md','MANIFESTO-QA.json','DELTA.patch','PROVAS-HTTP-QA.json','PROVAS-DELTA-QA.json','PROVAS-PREENCHIMENTO-QA.json','PROVA-LEITOR-LEGADO-QA.json','PRESERVACAO-ATIVO.json',m['candidate']+'.zip']
proof={'candidate':m['candidate'],'revision_sha256':m['revision_sha256'],'status':'QA: percursos HTTP demonstrados; visual parcial','functional_checks_passed':25,'legacy_reader_delta_passed':True,'visual_observed':['sector creation/publication/catalogue/withdrawal','article body save/history/publication/anonymous visit/withdrawal'],'visual_pending':['file upload blocked by extension','complete document registration/edit/publication visual sequence'],'blocker_origin':'Browser tool fileChooser.setFiles requires extension Allow access to file URLs; not bypassed','active_sources_build_unchanged':True,'active_changes':0,'accepted_tests_repeated':False,'installed_QA_only':['2026_10_18_160000_add_portal_editorial_content'],'source_files':len(m['sources']),'generated_source_files':sum(d['generated'] for d in m['sources']),'build_files':len(m['build']),'estimate':'12–20 h initial planning, not consumed hours; no fresh global remaining estimate','files':{n:sha(o/n) for n in files},'guide_sha256':sha(manual),'captures':{p.name:sha(p) for p in captures}}
(o/'RECIBO-QA.json').write_text(json.dumps(proof,ensure_ascii=False,indent=2),'utf8');(o/'manual-atual.md').write_bytes(manual.read_bytes())
print(json.dumps({k:v for k,v in proof.items() if k not in ['files','captures','visual_observed','visual_pending']},ensure_ascii=True,indent=2))