#!/usr/bin/env python3
import argparse,subprocess,sys
ap=argparse.ArgumentParser(); ap.add_argument('--reset',action='store_true',help='Intentionally reset the owned primary workspace'); a=ap.parse_args()
cmd=[sys.executable,'setup_fixture.py','--workspace','workspace','--variant','primary']
if a.reset: cmd.append('--force')
r=subprocess.run(cmd)
if r.returncode:
    if not a.reset:
        print('Existing workspace was preserved. Use `python run_lab.py --reset` only when you intentionally want to discard this lab workspace.',file=sys.stderr)
    raise SystemExit(r.returncode)
print('\nFixture created. Inspect state before acting:')
subprocess.run([sys.executable,'inspect_state.py','--workspace','workspace'],check=True)
print('\nRead task_brief.json and fill release_aware_change_control_record.csv. The lab does not prescribe one transfer method.')
