"""Run from a checked-out application with dependencies and its isolated server running.
Usage: python3 seed-and-run.py CHECKOUT T3_HOME SYNTHETIC_REPOSITORY
Configure proofAgent as local ACP with command `node proof-agent.mjs OUTPUT.json`.
The repository must have an initial commit on main. The agent uses the real
thread-scoped MCP credential injected by the application, with no mocks.
"""
import subprocess,sys
checkout,home,repo=sys.argv[1:]
cli=['node','apps/server/src/bin.ts']
subprocess.run(cli+['project','add',repo,'--title','Ref cache evidence','--base-dir',home],cwd=checkout,check=True)
subprocess.run(cli+['thread','start',repo,'Capture local refs before and after external checkout','--title','External branch ref cache','--provider','proofAgent','--model','proof','--wait','--json','--base-dir',home],cwd=checkout,check=True)
