"""Seed the synthetic context used for issue 40925 evidence.
Run from an installed, isolated checkout with its fresh dev server already running:
  T3CODE_DEV_SEED=0 vp run dev
  python3 reproduce.py
Then open the printed thread in the web app. Temporarily replace
`input.resumeCompactionTokens !== null &&` with `true &&` in
apps/web/src/components/ChatView.logic.ts (same HMR gate used in triage).
Send: use webgpu. Reply with just the word WEBGPU-ACK.
Restore ChatView.logic.ts. Run show-evidence.sh THREAD_ID from the checkout.
Run capture-mcp.py CHECKOUT THREAD_ID OUTPUT_DIRECTORY for both MCP views.
The server and provider adapters are never patched.
"""
from pathlib import Path
import random,subprocess,json
root=Path('.t3/compaction-demo');root.mkdir(parents=True,exist_ok=True)
r=random.Random(40925)
for n in range(7):
 text=''.join(f'{i:04d} '+''.join(r.choice('abcdefghijklmnopqrstuvwxyz0123456789') for _ in range(85))+'\n' for i in range(560))
 (root/f'context-{n+1}.txt').write_text(text)
subprocess.run(['git','init','-q',str(root)],check=True)
subprocess.run(['git','-C',str(root),'add','.'],check=True)
subprocess.run(['git','-C',str(root),'-c','user.name=Evidence','-c','user.email=evidence@example.invalid','commit','-qm','Synthetic context'],check=True)
cli=['node','apps/server/src/bin.ts']
subprocess.run(cli+['project','add',str(root),'--title','Compaction evidence','--base-dir','.t3'],check=True)
subprocess.run(cli+['thread','start',str(root),'Read all seven context-1.txt through context-7.txt files completely with the Read tool. Do not summarize or quote their content. Reply only READY after reading all seven.','--provider','claudeAgent','--model','claude-haiku-5-5','--title','Compaction evidence','--base-dir','.t3','--wait','--json'],check=True)
