from pathlib import Path
import subprocess,json
root=Path(__file__).resolve().parent
for name in ['projA','projB']:
 p=root/name;p.mkdir(exist_ok=True);subprocess.run(['git','init','-q',str(p)],check=True)
 (p/'README.md').write_text('Synthetic '+name+' workspace\n')
 if name=='projA':
  (p/'.codex').mkdir(exist_ok=True)
  (p/'.codex/config.toml').write_text('[mcp_servers.projapp]\ncommand = "python3"\nargs = ['+json.dumps(str(root/'mcp.py'))+']\n')
 subprocess.run(['git','-C',str(p),'add','.'],check=True)
 subprocess.run(['git','-C',str(p),'-c','user.name=Evidence','-c','user.email=evidence@example.test','commit','--allow-empty','-qm','Seed synthetic project'],check=True)
print('Trust projA and projB in each isolated CODEX_HOME config before starting the app. Preserve your authorized provider endpoint and credential configuration; never upload them.')
