# Forgejo SSH / HTTP origin proof

The fixture uses the real Forgejo 13.0.5 Docker image (pinned by digest), gt 2.0.0 and fj 0.7.0. The two app commits are [687e359e36](https://github.com/pingdotgg/t3code/commit/687e359e3637fe7d9a65031140c33ff611a7652f) and [9d9dd08864](https://github.com/pingdotgg/t3code/commit/9d9dd0886406db7fcd8002add07873d5b5d12f55). No app source was changed.

1. Set `FORGEJO_PROOF_DIR` to a fresh scratch directory. Run `setup-forgejo.py`, wait for Forgejo's HTTP endpoint, then run `setup-forgejo.py --seed`. Keep ports 13885 (HTTP) and 12285 (SSH). The generated token and private SSH key stay in scratch and must not be uploaded.
2. Expose the downloaded real `gt` and `fj` on the existing executable search path. For tracing, rename them to `gt-real` and `fj-real` and expose `record-gt.py` and `record-fj.py` as `gt` and `fj`. These wrappers only record real command results and forward input/output unchanged. They do not emulate Forgejo.
3. For each commit, install dependencies with `vp i`. Set `T3_PROOF_CHECKOUT` to that checkout, `GITEA_CLI_CONFIG_DIR` to `$FORGEJO_PROOF_DIR/auth/gt`, and `XDG_DATA_HOME` to `$FORGEJO_PROOF_DIR/auth/fj`. Set `GIT_SSH_COMMAND` to use the generated SSH key with a disposable known-hosts file. Give the app these same variables and `T3CODE_DEV_SEED=0`.
4. Run `manual-driver.py prepare base` (or `head`). Start the checkout's `scripts/scenarios/start-app.ts web <printed-home> 127.0.0.1 <web-port>` with Node. This runs the real server and Vite client on a fresh database. Base used web port 14385; head used 14386.
5. Wait until Replay advertises the Question model, then run `manual-driver.py seed`. Pair the browser using the home's reusable browser development credential. Open Issues in a 1280x800 CSS viewport, light theme. The driver keeps the repository's existing recorded Replay question pending, so its real thread-scoped MCP credential can write links.
6. Start recording. Run `signin`; refresh Issues and attempt `number`. After at least 65 seconds from sign-in, refresh Issues again, then run `list`, `number`, `unlink`, and `url`. Observe the issue list and the issue badge on the existing thread. Capture each final state only after two PNGs at least 500 ms apart have identical pixels.
7. Run `fresh` to add a second clone of the same SSH remote. Refresh Issues. Stop the app through its retained session. Restart without clearing its home: put `restart-app.ts` beside `scripts/scenarios/shell.ts` and run it with the same arguments. This is the repository's app launcher with only the initial home reset omitted. Pair again with the renewed development credential, run `resume` to keep the recorded question active, and open Issues.
8. Record the fresh-discovery comparison. Run `list`, `number`, and `url` again. Run `missing` to move the matching CLI profiles aside and attempt another link; refresh Issues to see the authentication error. The fixture's SSH remote is unchanged throughout.

`base-transcript.jsonl` and `head-transcript.jsonl` contain the actual MCP JSON-RPC results. `actual-fj-invocations.json` records the real fj host arguments, exits and responses during the manual runs. `fixture-versions.json` records versions and binary hashes. The four MP4 files are original browser recordings: part 1 covers sign-in and linking; part 2 covers fresh discovery and missing profiles. Recordings are not retimed or composited. All published data is synthetic.
