import os, pathlib, subprocess, sys
checkout, workspace = map(pathlib.Path, sys.argv[1:3])
workspace.mkdir(parents=True, exist_ok=True)
(workspace/'README.md').write_text('Unicode PR search evidence\n')
def git(*args): subprocess.run(['git',*args],cwd=workspace,check=True,capture_output=True)
if not (workspace/'.git').exists():
 git('init','--initial-branch=main'); git('add','README.md'); git('-c','user.name=Scenario','-c','user.email=scenario@example.invalid','commit','-m','Initial commit'); git('remote','add','origin','https://github.com/moregeo-it/ceos-ard-testing.git')
def cli(*args): subprocess.run(['node','apps/server/src/bin.ts',*args,'--base-dir','.t3'],cwd=checkout,check=True)
cli('project','add',str(workspace),'--title','Accented PR title')
cli('thread','start',str(workspace),'Hello','--provider','devReplay','--model','showcase','--title','Canonical title matching','--wait','--json')
