Seal Phase 4AG author-APL audit and fixed CAL failure
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
"""Publish small sealed AG evidence without claiming bulk remote backup."""
|
||||
import json
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
ROOT=Path('/data/digital-drosophila')
|
||||
MODEL=ROOT/'models/male-cns-lif/author-apl-lab-v2'
|
||||
EXP=ROOT/'experiments/phase4ag-author-apl-r2'
|
||||
sys.path.insert(0,str(MODEL))
|
||||
from context import save,digest,check
|
||||
sys.path.insert(0,str(ROOT/'models/male-cns-lif/terminal-scope-diagnostic-v1'))
|
||||
from diagnostic import manifest_check
|
||||
|
||||
|
||||
def main():
|
||||
check();verification={str(p.relative_to(ROOT)):manifest_check(p,digest) for p in (MODEL,EXP)}
|
||||
assert all(v['pass'] for v in verification.values())
|
||||
registry=ROOT/'registry/phase4ag-author-apl-r2';registry.mkdir(exist_ok=False);records=[]
|
||||
manifest=json.loads((EXP/'manifest.json').read_text())
|
||||
for p in [EXP/r['path'] for r in manifest['files']]+[EXP/'manifest.json',EXP/'checksums.sha256']:
|
||||
if p.stat().st_size>4*1024**2 or p.suffix not in ('.json','.csv','.md','.sha256'):continue
|
||||
if p.name in ('completeness.csv','requests.csv'):continue
|
||||
dst=registry/'evidence'/p.relative_to(EXP);dst.parent.mkdir(parents=True,exist_ok=True)
|
||||
with p.open('rb') as src,dst.open('xb') as out:shutil.copyfileobj(src,out)
|
||||
assert digest(dst)==digest(p)
|
||||
records.append(dict(source=str(p.relative_to(ROOT)),copy=str(dst.relative_to(registry)),sha256=digest(p),bytes=p.stat().st_size))
|
||||
save(registry/'evidence-index.json',records);save(registry/'seal-verification.json',verification)
|
||||
target=ROOT/'docs/progress/phase4ag-author-apl-r2.md'
|
||||
with (EXP/'REPORT.md').open('rb') as src,target.open('xb') as out:shutil.copyfileobj(src,out)
|
||||
print(json.dumps(dict(copied=len(records),verification=verification),ensure_ascii=False))
|
||||
|
||||
|
||||
if __name__=='__main__':main()
|
||||
Reference in New Issue
Block a user