"""Synthetic reproduction driver. Run from either installed checkout with its dev server up.

Environment: PROOF_PROJECT, PROOF_CODEX_HOME, PROOF_MODEL, PROOF_T3_HOME.
Before starting the server, set its isolated settings.json providerInstances.codex to
{"driver":"codex","enabled":true,"config":{"homePath":PROOF_CODEX_HOME}}.
Provide authentication privately; never upload authentication or server settings.
Start with T3CODE_DEV_SEED=0 vp run dev --home-dir <isolated T3 home>.
"""
import subprocess, os, json
from pathlib import Path
from datetime import datetime,timezone
out=Path(__file__).parent/datetime.now(timezone.utc).strftime('run-%Y%m%d-%H%M%S');out.mkdir()
home=os.environ['PROOF_T3_HOME']; project=os.environ['PROOF_PROJECT']
def cli(*args):
 r=subprocess.run(['node','apps/server/src/bin.ts',*args,'--base-dir',home],check=True,capture_output=True,text=True)
 return r.stdout
cli('project','add',project,'--title','Project MCP trust')
started=json.loads(cli('thread','start',project,'Is issue15140_probe available in your tool list? Answer briefly using only the tools exposed to you. Do not run commands, change files, or change project trust.','--provider','codex','--model',os.environ['PROOF_MODEL'],'--title','Project configuration check','--json'))
(out/'thread.json').write_text(json.dumps(started))
print(started['threadId'])
# In the paired web client, open this thread. Close Thread details, then perform:
# 1. Click [data-v2-item-type="system_notice"][role="button"] if present.
# 2. Reload the same thread URL.
# 3. Expand the notice again and expand the user prompt.
# 4. Blur the input; capture twice 500 ms apart and require identical pixels.
# Record the expansion/reload sequence on both commits at the same viewport/theme.
