#!/usr/bin/env bash
# Run from either installed evidence checkout with its dev server running on fresh state.
# The external server is: opencode serve --port 19496 --hostname 127.0.0.1
# Run proxy.mjs on port 19497 before seeding. Requires configured OpenCode model access.
set -eu
: "${PROOF_WORKSPACE:?Set PROOF_WORKSPACE to an empty synthetic workspace}"
python3 - <<'PY'
import json
p='.t3/userdata/settings.json'
with open(p) as f: settings=json.load(f)
settings.setdefault('providerInstances',{})['opencode']={
 'driver':'opencode','enabled':True,
 'config':{'enabled':True,'serverUrl':'http://127.0.0.1:19497'}}
with open(p,'w') as f: json.dump(settings,f,indent=2)
PY
node apps/server/src/bin.ts project add "$PROOF_WORKSPACE" --title 'Abort timeout proof' --base-dir .t3
node apps/server/src/bin.ts thread start "$PROOF_WORKSPACE" 'Run sleep 240 using the bash tool now. Do not run it in the background. Do nothing else until it completes.' --title 'Unanswered stop proof' --provider opencode --model openai/gpt-6-luna --base-dir .t3 --json
