"""Run from each checkout after starting a fresh server with T3CODE_DEV_SEED=0.
Usage: python3 seed-project.py <synthetic-project-dir> <server-base-dir>
Then install that checkout's dev client with mobile:install, open its Metro URL,
pair through test-t3-mobile/scripts/pair-client.sh, and tap Pulls > header > Issues > Search issues.
Run search-driver.py <agent-device-session> <base|head> <capture-dir>.
"""
import pathlib, subprocess, sys
project, home = map(pathlib.Path, sys.argv[1:])
project.mkdir(parents=True, exist_ok=True)
def run(args, cwd=None): subprocess.run(args, cwd=cwd, check=True)
if not (project/'.git').exists():
    run(['git','init','-q','--initial-branch=main',str(project)])
    run(['git','remote','add','origin','https://github.com/pingdotgg/t3code.git'],project)
    run(['git','-c','user.name=Proof','-c','user.email=proof@example.invalid','commit','--allow-empty','-qm','Initial proof project'],project)
run(['node','apps/server/src/bin.ts','project','add',str(project),'--title','T3 Code','--base-dir',str(home)])
