from pathlib import Path
import json,hashlib,zipfile,shutil,sys
R=Path(__file__).resolve().parent.parent;W=R.parent
sources={}
for prefix in ['36','31','18','09','16','21','38','15','30','08','11','24','14','04','23','26','25','32','33','35','20','07','01']:
for p in (W/'project_sources').glob(prefix+'-*.md'):sources[p.name]=p
sources.update({'File51a.md':W/'project_sources/39-File_51a.Rounded_Scaffold_Mod5_Architecture.md','File52c_latest.md':W/'upload/File_52c.Rounded_Whole_Span_Inverse_Detailed_Study_Draft (2)(1).md','Strategy.md':W/'c482_c531/evidence/sources/Strategy.md','C531_checkpoint.md':W/'490d_Research_Checkpoint_After_C531_20260927.md','C531_synthesis.md':W/'490d_How_Chronological_Families_Fit_Together_Draft_20260927.md'})
for name,p in sources.items():
dest=R/'evidence/sources'/name
if not dest.exists():shutil.copyfile(p,dest)
manifest={name:hashlib.sha256((R/'evidence/sources'/name).read_bytes()).hexdigest() for name in sources}
(R/'evidence/SOURCE_MANIFEST.json').write_text(json.dumps(manifest,indent=2)+'\n')
pred=json.loads((W/'c482_c531/journal.json').read_text())[-1]
(R/'evidence/C531_PREDECESSOR.json').write_text(json.dumps(pred,indent=2,ensure_ascii=False)+'\n')
rows=json.loads((R/'journal.json').read_text());last=rows[-1]['step'];first=int(sys.argv[1]) if len(sys.argv)>1 else 532
out=W/f'490d_C{first}_C{last}_Research_20260928.md'
lines=[f'# 490d — C{first}–C{last}: sequential research record','','Research begun27 September2026 in the user’s local timezone; packet dated28 September UTC. Working continuation of C531. No canonical source is changed; second-order inversion and quarantined primers remain deferred.','','Each step records a question before its calculation, frozen inputs, exact result, finding, and reassessment. Preparatory source extraction and review were delegated; the numbered sequence was evaluated in order. These are bounded research actions, not independent discoveries.','']
for x in rows:
if x['step']<first:continue
lines += [f"## C{x['step']} — {x['title']}",'',f"**Question.** {x['question']}",'',f"**Sources.** {'; '.join(x['sources'])}",'','**Inputs**','','```json',json.dumps(x['inputs'],indent=2,ensure_ascii=False),'```','','**Results**','','```json',json.dumps(x['results'],indent=2,ensure_ascii=False),'```','',f"**Finding.** {x['finding']}",'',f"**Reassessment.** {x['reassessment']}",'']
lines+=['## Evidence','',f'Current completion:C532–C{last}. The accompanying archive includes the sequential journal, exact scripts, source snapshots and independent reviews. Some carried source snapshots provide future or inherited context; only the sections cited by a step are claimed as its evidence.','']
out.write_text('\n'.join(lines));shutil.copyfile(out,R/out.name)
payloads=[p for p in R.rglob('*') if p.is_file() and '__pycache__' not in p.parts and p.name!='MANIFEST.sha256']
(R/'MANIFEST.sha256').write_text(''.join(f'{hashlib.sha256(p.read_bytes()).hexdigest()} {p.relative_to(R)}\n' for p in sorted(payloads)))
z=W/f'490d_C532_Through_C{last}_Evidence_20260928.zip'
with zipfile.ZipFile(z,'w',zipfile.ZIP_DEFLATED) as f:
for p in sorted(R.rglob('*')):
if p.is_file() and '__pycache__' not in p.parts:f.write(p,str(p.relative_to(R)))
print(json.dumps({'report':str(out),'evidence':str(z),'completed_steps':len(rows),'last_step':last,'zip_sha256':hashlib.sha256(z.read_bytes()).hexdigest()}))
Evidence
package.py
Linked sources and evidence
Edition and provenance
package.py
SHA-256 0c73873ee809a17a66b9a62503818fb7798be57d5d073dbeb45bc344def2d809
C480–C1634/Research_Cycles/C0532_C0631/evidence/package.py