import subprocess, pathlib, sys, json
checkout=pathlib.Path(sys.argv[1]);home=checkout/'.t3/manual';repo=home/'workspaces/proj'
def call(args,cwd=checkout):
 return subprocess.run(args,cwd=cwd,text=True,capture_output=True,check=True).stdout
repo.mkdir(parents=True,exist_ok=True)
(repo/'README.md').write_text('ACP session ownership proof\n')
call(['git','init','-q','--initial-branch=main'],repo)
call(['git','add','README.md'],repo)
call(['git','-c','user.name=Proof','-c','user.email=proof@example.invalid','commit','-qm','Initial commit'],repo)
print(call(['node','apps/server/src/bin.ts','project','add',str(repo),'--title','proj','--base-dir',str(home)]))
