from pathlib import Path
import json
R=Path(__file__).resolve().parent
cases=json.loads((R/'fixtures/cases.json').read_text(encoding='utf-8'))['cases']
assert len(cases)==8
assert all(c.get('id') and c.get('architectural_concern') and 'significance' in c for c in cases)
assert any(c['prior_status']=='ACCEPTED' and c['prior_original_sha']!=c['prior_current_sha'] for c in cases if c['prior_id'])
assert any(c['candidate_status']=='ACCEPTED' and not c['candidate_supersedes'] for c in cases if c['candidate_id'])
assert any(c['implementation_evidence'] and c['implementation_observed']!=c['implementation_expected'] for c in cases)
assert any(c['significance']=='TRIVIAL' for c in cases)
assert any(c['candidate_status']=='PROPOSED' for c in cases if c['candidate_id'])
assert any(c['candidate_status']=='REJECTED' for c in cases if c['candidate_id'])
assert any(c['transfer'] and len(c['alternatives'])>=3 and not c['implementation_evidence'] for c in cases)
print('PASS: 8 synthetic ADR fixtures are structurally valid; implement the change-control analysis in starter.py')
