#!/usr/bin/env python3
from pathlib import Path
import argparse,hashlib,json
BASE=Path(__file__).resolve().parent
CASES={'baseline':('workspace_baseline',['root','alternate']),'transfer':('workspace_transfer',['north','south'])}
def h(p): return hashlib.sha256(p.read_bytes()).hexdigest() if p.exists() else None
p=argparse.ArgumentParser();p.add_argument('--case',choices=sorted(CASES),default='baseline');a=p.parse_args();name,dirs=CASES[a.case];work=BASE/name
if not (work/'.maknow_fnd008_workspace').exists(): raise SystemExit('Run setup_fixture.py first')
rows=[]
for d in dirs:
 for fn in ['input.txt','output.txt']:
  q=(work/d/fn).resolve();rows.append({'path':str(q),'sha256':h(q)})
print(json.dumps({'case':a.case,'files':rows},ensure_ascii=False,sort_keys=True))
