# Usage: python3 seed-branches.py <base|head> <checkout> <output-directory>
# Start that checkout with T3CODE_DEV_SEED=0 vp run dev --host 0.0.0.0 first.
import subprocess, pathlib, sys
side, checkout, output = sys.argv[1:]
repo = pathlib.Path(output) / ('branches-'+side)
repo.mkdir()
def git(*args): subprocess.run(['git', '-C', str(repo), *args], check=True, stdout=subprocess.DEVNULL)
git('init','-b','main')
(repo/'README.md').write_text('Branch pagination reproduction\n')
git('add','README.md')
git('-c','user.name=Evidence','-c','user.email=evidence@example.invalid','commit','-m','Initial commit')
for n in range(1,105): git('branch',f'feature/branch-{n:03}')
def cli(*args): return subprocess.run(['node','apps/server/src/bin.ts',*args,'--base-dir',checkout+'/.t3'],cwd=checkout,check=True)
cli('project','add',str(repo),'--title','Branch pagination')
cli('thread','start',str(repo),'Start','--title','Branches repro','--provider','devReplay','--model','multi-turn','--wait','--json')
