from pathlib import Path import hashlib import json root = Path('output') archive = root / 'original-submission' archive.mkdir(exist_ok=True) names = ['article.md', 'metadata.json', 'editor-notes.md', 'check_package.py'] manifest = {} for name in names: source = root / name dest = archive / name if dest.exists(): raise RuntimeError('Archive already exists; refusing to overwrite: ' + name) raw = source.read_bytes() dest.write_bytes(raw) assert dest.read_bytes() == raw manifest[name] = hashlib.sha256(raw).hexdigest() (archive / 'sha256.json').write_text(json.dumps(manifest, indent=2) + '\n', encoding='utf-8') path = root / 'article.md' article = path.read_text(encoding='utf-8') article = article.replace('USD 87 a month before tax.', 'USD 87 a month before tax and overages.') article = article.replace('For a scan-heavy business, include that add-on in the budget rather than treating scans as standard uploads.', 'If your business works with scans, budget for OCR rather than assuming it is included in the base subscription.') article = article.replace('## A sensible first trial', '## A sensible first evaluation') article = article.replace('Record correction time, not just how quickly text appears.', 'Record correction time, not just how quickly text appears. Decide in advance how much time the subscription needs to save to justify its cost. Have the person who normally checks these documents review the output, rather than judging it on readability alone.') path.write_text(article, encoding='utf-8') path = root / 'metadata.json' meta = json.loads(path.read_text(encoding='utf-8')) meta['excerpt'] = 'LumenDesk 2.0 starts at USD 87 a month for three seats before tax and overages, but access is limited. Here is what small teams should check about pricing, citations and data handling before trying it.' path.write_text(json.dumps(meta, indent=2, ensure_ascii=False) + '\n', encoding='utf-8') print('Preserved and byte-checked all four original files; revised article and excerpt.')