# Run from each installed checkout after its fresh dev server is ready.
# Set EVIDENCE_MODEL to an available OpenCode model with question-tool support.
import pathlib,subprocess,os
root=pathlib.Path.cwd()
p=root/'.t3'/'review-demo'
p.mkdir(parents=True,exist_ok=True)
f=p/'notes.md'
f.write_text("line one\nline two\nline three\n")
def git(*args): subprocess.run(['git','-C',str(p),*args],check=True,capture_output=True)
git('init','-q');git('add','notes.md');git('-c','user.name=Evidence','-c','user.email=evidence@example.invalid','commit','-qm','Initial notes')
f.write_text("line one\nline two revised\nline three\nline four added\n")
cli=['node','apps/server/src/bin.ts']
subprocess.run(cli+['project','add',str(p),'--title','Review comment proof','--base-dir',str(root/'.t3')],check=True)
prompt="Use your question tool now to ask exactly: Which name should line two use? Give options alpha and beta and allow a typed custom answer. Do not read any files or run tools other than the question tool. After receiving the answer, report exactly what the answer contains: quote the review comment text and the referenced diff lines if they are included; if they are absent, say that the comment text and diff lines are missing. Do not infer or invent missing content, do not read files, and do not ask another question."
subprocess.run(cli+['thread','start',str(p),prompt,'--title','Question review evidence','--provider','opencode','--model',os.environ['EVIDENCE_MODEL'],'--base-dir',str(root/'.t3'),'--json'],check=True)
