# RPC forward compatibility proof

The real web client is from commit 15cf8b122c, before fast-forward became a known merge method. The real server runs the selected base/head revision. For each side the harness copies that revision's packages/contracts/src/baseSchemas.ts into the older client before starting Vite. No RPC response is mocked. The only base/head change in the older client is the ForwardCompatibleArray fix.

A local Forgejo 11 container holds fjadmin/demo and PR 1, titled Add feature file. tea 0.16.0 is authenticated to it in isolated XDG_CONFIG_HOME. The scenario creates a fresh project via t3.project, adds the local Forgejo remote, opens Pull requests, and selects the PR. It asserts that the PR description renders and captures the detail panel even on assertion failure. The runner records both interactions at 1280x800.

The older client is deliberately rebuilt with each selected contract implementation: this proves the effect of backporting the fix to a client whose merge method enum predates fast-forward. It does not assert that an already installed, unchanged older client will repair itself after a server upgrade.

## Re-run

In a disposable current-main checkout with dependencies installed, create a fixture directory and set `PROOF_FIXTURE_DIR` to it. Export `XDG_CONFIG_HOME="$PROOF_FIXTURE_DIR/config"` for the proof run only. Extract `git archive 15cf8b122c` into `$PROOF_FIXTURE_DIR/legacy` and run `vp i` there. Download tea 0.16.0 for Linux amd64 from `https://dl.gitea.com/tea/0.16.0/tea-0.16.0-linux-amd64` to `$PROOF_FIXTURE_DIR/tea` and make it executable.

Start a fresh local container:

```sh
docker run -d --name proof-40490-forgejo -p 127.0.0.1:13987:3000 -e FORGEJO__security__INSTALL_LOCK=true -e FORGEJO__database__DB_TYPE=sqlite3 -e FORGEJO__server__ROOT_URL=http://127.0.0.1:13987/ codeberg.org/forgejo/forgejo:11
```

Once Forgejo is ready, run `python3 seed-forgejo.py "$PROOF_FIXTURE_DIR"`. Apply `legacy-client-harness.patch` in the runner checkout, and put `forward-compatible-array-rpc.e2e.ts` under `scripts/scenarios/`. The patch selects the legacy Vite source tree and copies the selected app revision's contract implementation into it; the server still starts in the runner-selected app checkout.

```sh
T3_SCENARIO_INHERIT_ENV='PROOF_FIXTURE_DIR,XDG_CONFIG_HOME,T3CODE_DEV_SEED' T3CODE_DEV_SEED=0 vp run scenarios:prove scripts/scenarios/forward-compatible-array-rpc.e2e.ts --base fcf50973f3353cb401450c5cc6b4a177746150b7 --head da25d26c1345627db24422e7cc5b9c363d4fb16c
```

Upload evidence with ghdrop outside the isolated XDG_CONFIG_HOME, so it sees its normal authentication. Stop and remove the fixture container and disposable files when finished.
