# Codex rollback retry proof

Environment: Linux web dev client, Chromium, 1280x800 CSS pixels, light theme, Codex CLI 0.172.0, real gpt-6-luna via configured API-key endpoint. Each commit used its own checkout and a fresh server database (T3CODE_DEV_SEED=0). No database rows were inserted or changed by the driver.

Base: f2254fd6c44df48fc04bfe694b4b8158951d6826
Head: 96e918f1e21ca89057e204868e58316900a72f81

1. Create a fresh Git repository with one committed notes.txt containing `Rollback retry proof` and add it with `node apps/server/src/bin.ts project add PROJECT --title 'Rollback retry proof' --base-dir .t3`.
2. `node apps/server/src/bin.ts thread start PROJECT 'Create x.txt containing exactly second A. Do not change other files. Reply A done.' --title 'Rollback retry proof' --provider codex --model gpt-6-luna --worktree main --branch BRANCH --wait --json --base-dir .t3`.
3. Send B and C with `node apps/server/src/bin.ts thread send THREAD PROMPT --wait --json --base-dir .t3`. Prompts: `Create y.txt containing exactly second B. Do not change other files. Reply B done.` and `Create z.txt containing exactly second C. Do not change other files. Reply C done.`
4. Read the native thread ID from the isolated app database's provider-thread projection, and use native-history.py to query Codex thread/turns/list. Both started with three completed turns.
5. Open the thread in the web app. Collapse sidebar and thread details to keep environment details out of captures. Expand the B prompt. Start recording. Click Edit from here.
6. Run `python3 rollback-watcher.py INDEX_LOCK ISOLATED_DATABASE NATIVE_THREAD_ID`. INDEX_LOCK is the thread worktree's `git rev-parse --git-path index.lock`. It creates that lock, observes the first persisted rollback failure, reads native history, removes the lock, and waits for terminal rollback status before reading native history again. This is the same watcher on each side; the published copy replaces local paths with arguments.
7. Click Revert files too. Both runs failed restoration with Git's index locked, and succeeded at attempt 5 after removing the lock. Both worktrees then contained only notes.txt and x.txt. Base native history was empty; head retained A.
8. Replace the restored B draft in the composer with: `Without reading any files or using tools, quote my previous file-creation request exactly. If you cannot see it in the conversation, say CANNOT SEE PREVIOUS REQUEST.` Submit through the UI.
9. Base answered `CANNOT SEE PREVIOUS REQUEST.` Head quoted the A prompt. Stop recording. Two final screenshots on each side separated by more than 500 ms had zero differing pixels. Inspect final screenshots and video contact sheets before uploading.

The runtime transcripts omit stack traces containing local paths. Native IDs and prompts are synthetic proof data. The watcher reads the database read-only; no test doubles or replay agent are involved.
