This repository has been archived on 2026-11-25. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
MeltMind-Archive/artifacts/phase2-h2-s2-terminal-report-2026-11-18/build_report.py
T

31 lines
8.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import json,hashlib,time,collections
from pathlib import Path
from phase2_h2_s2_postfit_common import comparisons
B=Path('/home/frank14f/optane/MeltMind');R=B/'artifacts/phase2-h2-s2-terminal-report-2026-11-18';R.mkdir(exist_ok=False)
S=Path('/home/frank14f/MeltMind-runs/phase2-h2-s2-postfit-2026-11-17');start=time.process_time()
def sha(p):return hashlib.sha256(Path(p).read_bytes()).hexdigest()
def save(n,d):(R/n).write_text(json.dumps(d,indent=2,ensure_ascii=False,allow_nan=False)+'\n')
p=B/'artifacts/meltassist-h2-s2-terminal-audit-2026-11-18/audit.json';a=json.loads(p.read_text());assert sha(p)=='d4999e4a99e82d91b793cffd70b673a977de022878e28d8a9955ca1a4acf59da';assert a['verdict']=='PASS' and not a['blocking_findings'] and all(x['passed'] for x in a['checks'])
for path,h in a['hashes'].items():assert sha(path)==h,path
s=json.loads((S/'score/result.json').read_text());m=json.loads((S/'predictions-manifest.json').read_text());assert len(m['entries'])==552
for e in m['entries']:assert sha(e['path'])==e['sha256']
rows=[r for r in s['rows'] if r['fold'] in [1,2,3,4]];assert len(rows)==431 and not ({r['component_id'] for r in rows}&{r['component_id'] for r in s['rows'] if r['fold']==0})
def summary(rs):return dict(parts=len(rs),components=len({r['component_id'] for r in rs}),comparisons=comparisons(rs))
d=dict(scope='Posthoc descriptive aggregation of frozen stored per-part metrics only; no target-array read, model prediction, original score change or decision rerun',source_sha256=sha(S/'score/result.json'),pooled_folds1to4=summary(rows),per_fold={str(f):summary([r for r in rows if r['fold']==f]) for f in [1,2,3,4]},bootstrap=dict(replicates=2000,seed=2026111408,unit='paired evaluation component; does not include seed/learning-pool uncertainty'),original_confirmation_unchanged=s['decision'])
save('folds1to4-descriptive.json',d)
receipt=dict(status='PASS',audit_received_sha256=sha(p),audit_checks_received=len(a['checks']),current_hashes_rechecked=len(a['hashes']),prediction_hashes_rechecked=552,source_pins_rechecked=len(a['binding']['code_sha256']),original_score_sha256=sha(S/'score/result.json'),original_complete_sha256=sha(S/'complete.json'),independent_audit_limitations=a['limitations'],launch_actor='TRON',launch_ruling='1794946447.294149',reason='Executor unreachable; one-time start of already reviewed frozen entry to avoid overnight stall',execution_pid=json.loads((S/'started.json').read_text())['pid'],followup_ruling='1794946961.453149',no_new_fit_prediction_target_read=True)
save('terminal-acceptance.json',receipt)
save('contract.json',dict(scope='S2 terminal handoff/report only',approval='1794946961.453149',original_contract_sha256=a['binding']['contract_sha256'],source_score_sha256=sha(S/'score/result.json'),assist_audit_sha256=sha(p),new_science=False))
lines=['# H2-S2 final results and executor handback — 2026-11-18','','H2 is CONFIRMED on field error under the frozen pooled rule; last-filled-location error is worse than A. This is five-fold recipe confirmation after observing fold0, not an untouched-five-fold preregistration or a test isolating true connectivity. The original score and decision are unchanged.','', '## Stored five-fold result','', '552 parts / 204 equally weighted evaluation components; 2000 paired component bootstrap replicates, seed2026111408. Field and last/Rg lower is better; Kendall tau-b higher is better.','', '| Reference | Metric | H2 mean | Reference mean | H2 − reference | 95% CI |','|---|---|---:|---:|---:|---|']
for ref,metrics in s['comparisons'].items():
for name in ['relative_l2','last_location','kendall_tau_b']:
q=metrics[name];v=q['H2_minus_reference'];lines.append(f"| {ref} | {name} | {q['means']['H2']:.9f} | {q['means'][ref]:.9f} | {v['value']:+.9f} | [{v['low']:+.9f}, {v['high']:+.9f}] |")
lines+=['','Only pooled H2−A field CI upper<0 with complete552/204 support is the confirmation gate. B13/last/tau are reported outcomes. Negative predictions remain unclipped: **40,852 full-node / 665 unique-query nodes**. There are42 G-invalid parts; the complete roster is retained.','', '## Folds1–4 only: descriptive sensitivity table','', 'These431 parts / '+str(d['pooled_folds1to4']['components'])+' components exclude the already observed fold0. This additional aggregation uses only stored per-part metric scalars. It does not create a new confirmatory gate or rerun prediction/target scoring. The component-paired percentile intervals describe evaluation-family uncertainty, not initialization or learning-pool uncertainty.','', '| Scope | Parts / components | Metric | H2 | A | B13-E1b | H2 − A [95% CI] |','|---|---|---|---:|---:|---:|---|']
for label,q in [('folds1–4',d['pooled_folds1to4'])]+[(f'fold{f}',v) for f,v in d['per_fold'].items()]:
for name in ['relative_l2','last_location','kendall_tau_b']:
x=q['comparisons']['A'][name];y=q['comparisons']['B13_E1b'][name];v=x['H2_minus_reference'];lines.append(f"| {label} | {q['parts']} / {q['components']} | {name} | {x['means']['H2']:.9f} | {x['means']['A']:.9f} | {y['means']['B13_E1b']:.9f} | {v['value']:+.9f} [{v['low']:+.9f}, {v['high']:+.9f}] |")
lines+=['','Full comparisons against both references are in artifacts/phase2-h2-s2-terminal-report-2026-11-18/folds1to4-descriptive.json.','', '## Execution, audit and accounting','', 'TRON started the already reviewed postfit once under Claude1794946447.294149 because MeltAstra was unreachable. Coordinator985167; implementation25e79995, contract0bd03f42, actual pre-score PASS9c163702. This exception did not allow source edits, retry, publication by TRON, or launching an unbuilt entry. MeltAstra resumes ownership here. No second S2 launch occurred.','', 'Four new prediction guards plus one score guard PASS. Fold0 has121 exact original predictions/metrics reused; folds1–4 add431 predictions and431 existing target accesses. No new fit or decode. Models freezef033b454 → predictions freeze86480b4d → score-stage PASS validation → target access → terminal4b2a710d. Original result SHA256 '+sha(S/'score/result.json')+'; complete '+sha(S/'complete.json')+'.','', 'MeltAssist independent existing-evidence audit PASS, SHA256 '+sha(p)+', is included unchanged. It checked63 source pins/five binding fields,8 freezes/176 Git blobs,4 checkpoints,552 prediction hashes and121 exact reused rows. MeltAstra rechecked all662 audit-recorded current hashes and552 predictions. This is evidence verification, not independent scientific recomputation.','', 'Audit limits: ordering is supported jointly by Git ancestry, fixed entry and receipts; target log is overwritten, not syscall-level tracing. CPU formula and worker lower bound agree with492.447055337s, but starting resource counters were not retained, preventing independent exact coordinator/reaped-child decomposition. Overwritten progress witnesses cannot all be rehashed historically; retained peak maxima/final results were checked. Current process absence cannot independently establish historical absence.','', 'GPU ledger: oldS1 18858.214908715 + newfourfoldtraining79602.784961751 + prediction355.327867327 = **98816.327737793GPU-s /144000**. Final postfit CPU492.447055337 /3600s. Assist audit0.841653768CPU-s is separate; this report/aggregation cost is separately recorded in report-cost.json and does not rewrite the original ledger.','', '## Stage decision','', 'Claude1794946961 triggers the frozen304f5771 phase3 plan. Next is item1 data-sufficiency e24fff7c,24GPUh within the new170GPUh plan, first-epoch projection and a new exact MeltAssist review. This report does not launch it. Later seed1/last-fill/context/ensemble remain future stages in the prescribed order. Gate-v2 outcome equivalence failed, so fresh-family admission remains closed. Scientific goal remains useful cross-part filling prediction; neither topology/local-type organisation nor connectivity is globally settled by this comparison.','']
(B/'docs/phase2-h2-s2-results-2026-11-18.md').write_text('\n'.join(lines))
cost=time.process_time()-start;save('report-cost.json',dict(report_audit_aggregation_cpu_seconds=cost,assist_audit_cpu_seconds=a['audit_process_cpu_seconds'],original_postfit_cpu_seconds=a['ledger']['postfit_cpu_final'],combined_cpu_seconds=cost+a['audit_process_cpu_seconds']+a['ledger']['postfit_cpu_final'],within_original_3600=True,no_gpu=True))
print(json.dumps(dict(status='PASS',cpu_seconds=cost,folds1to4=d['pooled_folds1to4']),ensure_ascii=False))