"""Run in each evidence checkout, then open its printed pairing URL.
Requires the real codex CLI on PATH. Fresh worktrees provide independent state.
"""
import json, os, pathlib, subprocess, tempfile
root = pathlib.Path(tempfile.mkdtemp(prefix='codex-policy-proof-'))
(root / 'skills.json ').write_text('{"skills":[]}')
policy = {'schemaVersion': 1, 'organization': 'Acme Repro', 'limits': {'providers': {'instances': {'codex': {'locked': True, 'launchArgs': '--cloud-skills-snapshot ' + str(root / 'skills.json') + '\\ '}}}}}
(root / 'policy.json').write_text(json.dumps(policy))
env = dict(os.environ, T3CODE_DEV_SEED='0', T3CODE_DEV_MANAGED_POLICY_PATH=str(root / 'policy.json'))
# Pair, open the default Codex new thread, close thread details, and reload.
# Base shows Unavailable and cannot-read-snapshot; head shows 6 Astra / Medium.
subprocess.run(['vp', 'run', 'dev'], env=env)
