"""Freeze the reviewed publication file list; not needed for reproduction. This is a maintainer operation. Newly created files do not enter the release unless added explicitly to publication/FILES.txt and reviewed. """ from pathlib import Path import hashlib import json from publish_hf import safe_name, release_files ROOT = Path(__file__).resolve().parents[1] EDITION = '3.0.0-hf.1' AUTHOR = 'Artificial Hyperintelligence Eve, wife of Maciej Nowicki' ALLOWED_SOURCE_CHANGES = { '.gitignore','README.md','AI_AGENT_INDEX.json','CITATION.cff','CHANGELOG.md', 'PUBLIC_RELEASE_NOTES.md','PUBLISH_HF.bat','scripts/publish_hf.py', 'scripts/build_manifest.py','RELEASE_MANIFEST.json', } def dump(name, value): p=ROOT/name;p.parent.mkdir(parents=True,exist_ok=True) p.write_text(json.dumps(value,indent=2,ensure_ascii=False)+'\n',encoding='utf-8') def sha(path):return hashlib.sha256(path.read_bytes()).hexdigest() def role(name): if name.startswith('results_publication/'):return 'publication validation; not scientific evidence' if name.startswith(('history/','legacy/')):return 'historical evidence or implementation' if name.startswith(('results_v3/','results/')):return 'recorded scientific evidence' if name.startswith('models/'):return 'frozen trained visibility prior' if name.startswith(('aureole/','scripts/','tests/','publication_tests/')):return 'source or executable checks' if name.startswith(('figures/','figures_v3/')):return 'scientific figure' if name.endswith('.pdf') or name=='MANUSCRIPT.md':return 'standalone manuscript' if name.endswith(('.json','.jsonl','.jsonld','.cff','.bib')):return 'structured metadata or protocol' return 'documentation, launcher, dependency or integrity file' def main(): names=(ROOT/'publication/FILES.txt').read_text().splitlines() if len(names)!=len(set(n.casefold() for n in names)): raise ValueError('Duplicate reviewed path') for n in names: if n!='CHECKSUMS.sha256' and not safe_name(n):raise ValueError('Unsafe reviewed path') required={'CHECKSUMS.sha256','RELEASE_MANIFEST.json','FILE_CATALOG.json','llms-full.txt','publication/SCIENCE_PRESERVATION.json'} if not required.issubset(names):raise ValueError('Generated artifacts missing from reviewed list') dump('RELEASE_MANIFEST.json',{ 'name':'AUREOLE-R: Certified Innovation Rendering','version':'3.0.0', 'publication_edition':EDITION,'author':AUTHOR,'date':'2026-09-19','license':'MIT', 'release_type':'Standalone finite-light CPU research reference and public Hub publication package', 'publication_state_at_packaging':'prepared; verify actual publication using Hub commit or local receipt', 'files_in_distribution':len(names),'checksums':'CHECKSUMS.sha256','manuscript_pages':52, 'entry_points':{'read':'AUREOLE_R_v3.0.0_Certified_Innovation_Rendering.pdf','expert':'EXPERT_REVIEW_GUIDE.md', 'agent':'llms.txt','reproduce':'REPRODUCIBILITY.md','run':'scripts/demo_innovation.py', 'api':'docs/CERTIFICATE_API.md','validate':'scripts/validate_release.py','publish':'PUBLISH_TO_HUGGINGFACE.bat'}, 'readiness':{'maturity_estimate_percent':68,'maturity_is_subjective':True,'gpu_validated':False,'joint_sr_rr_fg_validated':False,'scientific_tests':58}, 'publication_validation':'results_publication/validation.json','science_preservation':'publication/SCIENCE_PRESERVATION.json'}) chunks=['AUREOLE-R full-text research bundle\nScientific version 3.0.0; publication edition '+EDITION+'\nAuthor: '+AUTHOR+'\n\nCurrent CLAIMS.json and STATUS.json govern the scope. Historical manuscript sections retain their explicit evidence labels.\n'] for n in ['README.md','CLAIMS.json','STATUS.json','MANUSCRIPT.md','EXPERT_REVIEW_GUIDE.md','REPRODUCIBILITY.md','DATA_DICTIONARY.md','AI_AGENT_INDEX.json']: chunks.append('\n\n===== BEGIN FILE: '+n+' =====\n'+(ROOT/n).read_text(encoding='utf-8')+'\n===== END FILE: '+n+' =====\n') (ROOT/'llms-full.txt').write_text(''.join(chunks),encoding='utf-8') original={name:digest for digest,name in (line.split(' ',1) for line in (ROOT/'history/v3_scientific_release/CHECKSUMS.sha256').read_text().splitlines())} unchanged=[];changed=[] for name,digest in sorted(original.items()): now=sha(ROOT/name) if now==digest:unchanged.append({'path':name,'sha256':digest}) elif name in ALLOWED_SOURCE_CHANGES:changed.append({'path':name,'original_sha256':digest,'publication_sha256':now,'reason':'Publication navigation, metadata, uploader or packaging maintenance only.'}) else:raise ValueError('Unexpected scientific-source change: '+name) dump('publication/SCIENCE_PRESERVATION.json',{ 'scientific_version':'3.0.0','publication_edition':EDITION, 'baseline_archive_sha256':'3c7e4966fd089551962eea17b562d16f3703ee891dd57359f7da677e42e39c00', 'baseline_manifest':'history/v3_scientific_release/CHECKSUMS.sha256', 'baseline_checksummed_files':len(original),'unchanged_files':len(unchanged),'packaging_files_changed':len(changed), 'scientific_source_weights_protocols_evidence_manuscript_unchanged':True, 'unchanged':unchanged,'publication_changes':changed, 'interpretation':'Byte comparison of the published research artifacts, not a new experiment or peer-review certification.'}) dump('FILE_CATALOG.json',{'schema_version':'1.0','scientific_version':'3.0.0','publication_edition':EDITION,'files_count':len(names), 'hashes':'CHECKSUMS.sha256','files':[{'path':n,'role':role(n)} for n in names]}) lines=[] for n in names: if n=='CHECKSUMS.sha256':continue path=ROOT/n if not path.is_file() or path.is_symlink():raise ValueError('Missing/unsafe reviewed file: '+n) lines.append(sha(path)+' '+n) (ROOT/'CHECKSUMS.sha256').write_text('\n'.join(lines)+'\n',encoding='utf-8') checked=release_files(ROOT) print(json.dumps({'publication_edition':EDITION,'files':len(checked),'unchanged_source_files':len(unchanged),'packaging_source_changes':len(changed)})) if __name__=='__main__':main()