19 lines
2.2 KiB
Python
19 lines
2.2 KiB
Python
# coding: utf-8
|
|
from pathlib import Path
|
|
import json,gzip,hashlib
|
|
R=Path('/Users/korizatou114/Projects/とりにく工房ゲーム制作部');A=R/'artifacts/original-completion-2026-10-02';D=R/'docs/plans/original-completion-2026-10-02';O=D/'checkpoints/current-phase-diagnostic-r338-r02';O.mkdir();(O/'.gdignore').write_bytes(b'')
|
|
paths=[]
|
|
for name in ['p23-02-current-phase-diagnostic-r338','p23-02-current-phase-diagnostic-r338-r02']:paths+=sorted((A/name).rglob('*'))
|
|
paths=[p for p in paths if p.is_file()]
|
|
paths += [A/n for n in ['p23-02-current-phase-diagnostic-r338.py','p23-02-current-phase-diagnostic-r338-r02.py','p23-02-current-phase-diagnostic-preexecution-independent-review-r338.json','p23-02-current-phase-diagnostic-preexecution-independent-review-r338-r02.json','p23-02-current-phase-diagnostic-actual-independent-review-r338-r02.json']]
|
|
paths += [Path('/private/tmp/thetree-prepare-residual-r338.py')]
|
|
rows=[]
|
|
for i,p in enumerate(paths):
|
|
raw=p.read_bytes();compress=len(raw)>32768 and p.suffix!='.zst';packed=gzip.compress(raw,mtime=0) if compress else raw;name='%03d-%s%s'%(i,p.name,'.gz' if compress else '');out=O/name
|
|
with out.open('xb') as f:f.write(packed)
|
|
assert (gzip.decompress(out.read_bytes()) if compress else out.read_bytes())==raw
|
|
rows.append(dict(original_path=str(p),stored_path=str(out),original_bytes=len(raw),original_sha256=hashlib.sha256(raw).hexdigest(),stored_bytes=len(packed),stored_sha256=hashlib.sha256(packed).hexdigest(),codec='gzip' if compress else 'identity',full_roundtrip_verified=True))
|
|
manifest=dict(plan_id='P23-02',candidate='r333/library334',files=rows,originals_retained=True,unit_accepted=False,performance_accepted=False,candidate_adopted=False)
|
|
(O/'manifest.json').write_text(json.dumps(manifest,ensure_ascii=False,indent=2)+'\n');(O/'README.md').write_text('# r338-r02 current phase diagnostic\n\nOne reviewed instrumented cold646 tick. All copies restore byte-for-byte; originals retained. This checkpoint preserves finite evidence and the rejected unexecuted16-check driver, not performance or unit acceptance.\n')
|
|
print(json.dumps(dict(files=len(rows),raw_bytes=sum(x['original_bytes'] for x in rows),stored_bytes=sum(x['stored_bytes'] for x in rows))))
|