# Issue URL port isolation proof

Use the scenario runner from current main. The scenario has one test and runs the
real web app, server, MCP issue tools, and two Gitea 1.25.1 servers. The deterministic
ACP agent supplies the same prompts and calls on both commits; it does not mock
issue resolution, forge HTTP, tool results, or client link handling.

1. Set `PROOF_FIXTURE_DIR` to an empty fixture directory. Place `agent.mjs` there.
2. Resolve `gitea.test` to `127.0.0.1`. Run `python3 setup-forges.py "$PROOF_FIXTURE_DIR"`.
   Docker publishes HTTPS ports 443 and 8443. Each server has acme/web issue 3,
   with a distinct title. No production account or data is used.
3. Trust `tls/cert.pem` in Chromium and set `NODE_EXTRA_CA_CERTS` to that file.
4. Install tea 0.16.0. Set `XDG_CONFIG_HOME` to fixture/tea-config and add only
   `https://gitea.test` as a tea login, using fixture/default/token. No login for
   `https://gitea.test:8443` is added. Tokens must stay local.
5. Put `issue-port-isolation.e2e.ts` under `scripts/scenarios/` and run:

```sh
T3CODE_DEV_SEED=0 \
T3_SCENARIO_INHERIT_ENV='NODE_EXTRA_CA_CERTS,XDG_CONFIG_HOME,T3CODE_DEV_SEED' \
vp run scenarios:prove scripts/scenarios/issue-port-isolation.e2e.ts \
  --base 6ec1d31b1ebade38fdc6bf88c7401d0ea35a1180 \
  --head b9d53b11151fc1a3aff511a69e9130e685bf9c64 \
  --upload-command 'ghdrop upload'
```

Export `PROOF_FIXTURE_DIR`, `NODE_EXTRA_CA_CERTS`, and `XDG_CONFIG_HOME` before that
command. Each side receives a fresh T3 database from its own app version. The
same scenario clears both synthetic comment lists, adds only the default-port
checkout, opens one identically named thread, clicks the ported issue link,
requests read and comment, and records the results. The same video then visits
the default-port issue and port-8443 issue and ends on the port-8443 forge page.

The agent calls real `read_issue` and `comment_on_issue` tools with the ported URL.
Successful read output includes the returned issue title, URL, and writable flag;
successful comment output names the actual host, repository, and key. Rejections
show the real error text. The final assertion checks client isolation, both
rejections, and zero comments on both servers, after all captures have been taken.

The browser viewport is 1280×800 and the theme is light on both sides. This proof
covers web client routing and server operations; it does not run the native
mobile client or alternate SSH remote/alias configurations.

Afterwards stop and remove the two `proof38010-default` and `proof38010-ported`
containers, remove their local credentials and certificate trust, and remove the
temporary worktree. Keep only uploaded synthetic evidence.
