18 lines
1.3 KiB
Python
18 lines
1.3 KiB
Python
from pathlib import Path
|
|
from hashlib import sha256
|
|
from datetime import datetime,timezone
|
|
import json
|
|
OUT=Path(__file__).resolve().parent;DOC=OUT.parents[1]/'docs/investmoz/v2/auditoria-portal';archive=OUT/'audit-history-before-B3-20261013'
|
|
p=OUT/'option-B-documents-reconciliation.json';backup=archive/'option-B-documents-reconciliation.before-format.json'
|
|
assert not backup.exists();backup.write_bytes(p.read_bytes());data=json.loads(p.read_text(encoding='utf-8'))
|
|
for entry in data['files']:entry['sha256']=sha256((DOC/entry['file']).read_bytes()).hexdigest()
|
|
data['current_report_hashes_refreshed_at']=datetime.now(timezone.utc).isoformat()
|
|
p.write_text(json.dumps(data,ensure_ascii=False,indent=2)+'\n',encoding='utf-8')
|
|
for name in ['matriz-requisitos.csv','backlog-priorizado.csv']:
|
|
(OUT/'para-revisao'/name).write_bytes((DOC/name).read_bytes())
|
|
old=OUT/'investmoz-B-QA-criterios-saida-revisao-20261013.zip'
|
|
assert sha256(old.read_bytes()).hexdigest()=='efbc830153426eb385e2df44e8c0e4807f6afee80db5335e732424cf357ced9e'
|
|
dest=archive/'review-before-document-hash-refresh.zip';assert not dest.exists();old.rename(dest)
|
|
p=OUT/'option-B3-package.json';dest=archive/'option-B3-package.before-document-hash-refresh.json';assert not dest.exists();p.rename(dest)
|
|
print('Review before metadata refresh preserved; current document hashes and review CSV copies reconciled.')
|