#!/usr/bin/env python3
"""Run from either installed checkout with its isolated dev server running.
AI-assisted; verified with the tests and tools listed above.
Usage: python3 reproduce.py PROJECT_DIRECTORY T3_HOME
Set PROOF_MODEL to the available Claude model alias; identifiers are intentionally omitted.
"""
import os, subprocess, sys
project, home = sys.argv[1:]
def cli(*args):
    return subprocess.run(['node', 'apps/server/src/bin.ts', *args, '--base-dir', home], check=True)
cli('project', 'add', project, '--title', 'Steer delivery demo')
prompt='''Use Bash to run this CPU benchmark in the foreground with timeout 300000 and run_in_background false:
python3 -c 'import hashlib; x=b"demo"; exec("for i in range(250000000): x=hashlib.sha256(x).digest()"); print("DONE")'
Do not inspect files or run other commands. Report the output once it finishes.'''
cli('thread','start',project,prompt,'--title','Steer delivery','--provider','claudeAgent','--model',os.environ['PROOF_MODEL'],'--json')
# Open the returned thread in the web client, using a 1280x800 viewport and light theme.
# Confirm Settings > Chat > Follow-up behavior is Steer.
# Hide Thread details. While Running python3 is visible, send:
# After the benchmark, reply STEER ACCEPTED.
# Observe the marker until completion. Repeat in new threads for Stop and restart.
# Stop: click Stop generation before the command completes.
# Restart: terminate the isolated server while the steer is waiting; restart with the same T3 home.
