#!/usr/bin/env bash
set -euo pipefail
# Run from either app checkout after vp i. Use a fresh worktree .t3 home.
# Prerequisite: FX_PROOF_BINARY is an authenticated fx 0.0.16 launcher.
# Its account HOME contains .fx/mcp.json pointing to mcp-server.py.
: "${FX_PROOF_BINARY:?Set an authenticated fx launcher path}"
: "${PROOF_WORKSPACE:?Set the synthetic git workspace path}"
mkdir -p .t3/userdata
python3 - <<'SETTINGS'
import json,os,pathlib
providers={d:{'driver':d,'enabled':False} for d in ['codex','claudeAgent','cursor','grok','muse','pi','opencode','antigravity']}
providers['fx']={'driver':'fx','enabled':True,'config':{'binaryPath':os.environ['FX_PROOF_BINARY'],'enabled':True}}
pathlib.Path('.t3/userdata/settings.json').write_text(json.dumps({'defaultModelSelection':{'instanceId':'fx','model':'default'},'defaultRuntimeMode':'approval-required','providerInstances':providers}))
SETTINGS
"$FX_PROOF_BINARY" mcp show profile-proof --json
# In a separate terminal: T3CODE_DEV_SEED=0 vp run dev
# Pair the browser using this dev server's startup link.
node apps/server/src/bin.ts project add --base-dir .t3 --title 'MCP profile proof' "$PROOF_WORKSPACE"
node apps/server/src/bin.ts thread start --base-dir .t3 --provider fx --model default --title 'Profile MCP discovery' --wait --json "$PROOF_WORKSPACE" 'Use capability search to find the profile-proof MCP server and call its profile_ping tool. Do not use shell, files, code, or other tools to substitute for this MCP call. Report whether discovery succeeded and quote the exact tool result. If server_not_found, report that and stop.'
# Open the thread in the browser. Approve profile_ping if prompted.
# Open model picker > Permissions > Auto, dismiss picker, send in the UI:
# After switching to Auto and reloading this session, discover profile-proof again and call profile_ping using the actual MCP tool. Do not substitute shell or file access. Report the exact tool result, or server_not_found and stop.
# Then choose Permissions > Supervised and send in the UI:
# After switching back to Supervised and reloading this session, discover profile-proof again and call profile_ping using the actual MCP tool. Do not substitute shell or file access. Report the exact tool result, or server_not_found and stop.
# Approve profile_ping if prompted. Capture the result on each commit.
# Capture environment: Linux Chromium web client, 1280x800 CSS viewport,
# light theme, fresh database, synthetic workspace, actual fx provider.
# Public capture privacy: runtime model labels replaced with [redacted].
