#!/usr/bin/env bash
# Run from each independent worktree after vp i.
# Prerequisites: real Codex CLI 0.172.0 with working API access, Node, vp.
# Use a NEW worktree state directory for each commit, never copy a database.
set -eu
: "${PROOF_WRAPPER:?Set to the absolute path of drop-completion-portable.cjs}"
chmod +x "$PROOF_WRAPPER"
# Start in a retained terminal: T3CODE_DEV_SEED=0 T3CODE_ENVIRONMENT_LABEL='Proof environment' vp run dev
# Once the server is listening, run this script in another terminal.
node --input-type=module -e '
import fs from "node:fs";
const p=".t3/userdata/settings.json";
const s=JSON.parse(fs.readFileSync(p,"utf8"));
s.providerInstances.codex={driver:"codex",config:{binaryPath:process.env.PROOF_WRAPPER}};
fs.writeFileSync(p,JSON.stringify(s));
'
node apps/server/src/bin.ts thread start --base-dir .t3  --provider codex --model gpt-6.1-sol --option reasoningEffort=low  --title 'Missing command completion' apps/server  'Run exactly this shell command once and nothing else: cat /nonexistent-42175.txt Then reply in one line with its exit code. Do not retry.' --json
# Pair the real web client using its startup URL. Open the returned thread.
# Delete the auto-created empty New thread via the app; retain only the proof thread.
# Close the thread-details card on both sides.
# Start a browser recording. Submit the exact same prompt once more via the composer.
# Wait for the assistant reply and completed turn. Expand both Worked for rows.
# Expand both command rows where present. On base, inspect Details on the running card,
# then close its dialog for the final comparison still.
# Blur focus and clear text selection; require two identical screenshots 500ms apart.
# Capture at 1280x800 CSS pixels, DPR 2, light T3 Code theme.
# Read statev2.sqlite read-only; filter command_execution input for nonexistent-42175.
