#!/usr/bin/env python3
"""Synthetic fixture used for the Pi thinking proof. No credentials are uploaded.
Run: python3 seed.py OUTPUT_DIRECTORY
Then add thinking-demo using `t3 project add --base-dir YOUR_T3_HOME --title
'Thinking demo' OUTPUT_DIRECTORY/thinking-demo`.
Configure the Pi instance binaryPath to OUTPUT_DIRECTORY/pi-observer.py.
In Settings → Source control → Advanced, choose Pi, Claude Sonnet 4.6, Low.
Open a thread for this project and click Commit. The chat may be seeded using
Replay (dev); commit generation itself must use the real Pi writer above.
"""
import json, pathlib, shutil, subprocess, sys
root=pathlib.Path(sys.argv[1]).resolve(); root.mkdir(parents=True,exist_ok=True)
config=root/'pi-config';config.mkdir(exist_ok=True)
for filename in ['auth.json','models.json']:
 shutil.copyfile(pathlib.Path.home()/'.pi/agent'/filename,config/filename)
(config/'settings.json').write_text(json.dumps({'defaultThinkingLevel':'medium'}))
repo=root/'thinking-demo';repo.mkdir()
def git(*args):subprocess.run(['git','-C',str(repo),*args],check=True)
git('init','-b','main');git('config','user.name','Demo');git('config','user.email','demo@example.com')
(repo/'README.md').write_text('# Math utilities\n');git('add','.');git('commit','-m','Initial project')
(repo/'math.ts').write_text('export function add(a: number, b: number) {\n  return a + b;\n}\n')
print('Fixture created; Pi default is medium. Place pi-observer.py next to pi-config and make executable.')
