"""Run from either checkout after `vp i` and `T3CODE_DEV_SEED=0 vp run dev`.
Usage: python3 reproduce.py <scratch-directory>
In Settings > Providers, add a Cursor instance (uses CURSOR_API_KEY).
Open the resulting project, start a Composer 2.5 thread, and paste PROMPT.
Record submission through completion at 1280x800, dark theme, details closed.
Use the same scratch-directory and prompt for both commits.
"""
from pathlib import Path
import subprocess
import sys

PROMPT = "Without reading files or using any tools, tell me the workspace canary word, the parent canary word, and the parent-rules canary word from the instructions already in your context. If a word is not in your context, say unknown. Reply with only those three labeled words."
parent = Path(sys.argv[1]).resolve() / 'parent'
workspace = parent / 'ws'
workspace.mkdir(parents=True, exist_ok=True)
(parent / '.cursor/rules').mkdir(parents=True, exist_ok=True)
(workspace / 'AGENTS.md').write_text('The workspace canary word is kiwi-canary.\n')
(parent / 'AGENTS.md').write_text('The parent canary word is banana-canary.\n')
(parent / '.cursor/rules/canary.mdc').write_text('---\nalwaysApply: true\n---\nThe parent-rules canary word is mango-canary.\n')
subprocess.run(['git', 'init', '-q', str(workspace)], check=True)
subprocess.run(['node', 'apps/server/src/bin.ts', 'project', 'add', '--base-dir', '.t3', '--title', 'Cursor rules proof', str(workspace)], check=True)
print(PROMPT)
