# Partial Forgejo label removal

Use a real Forgejo 11 instance, an application token for its synthetic `demo` user, and Forgejo CLI 0.7.0 (`fj`). The scenario uses Chromium at 1280×800 in light theme, with a fresh T3 database for each commit.

1. Start `codeberg.org/forgejo/forgejo:11` on `127.0.0.1:39135`, set `FORGEJO__security__INSTALL_LOCK=true` and `FORGEJO__server__ROOT_URL=http://127.0.0.1:39136/`. A tmpfs `/data` avoids SQLite locking on the container filesystem.
2. Create synthetic user `demo`, create an application token scoped to `all`, and save that token to a private file. Do not upload it.
3. Set `PROOF_TOKEN_FILE` to that file and run `python3 seed.py` once. This creates the real repository, branch, commit, PR, and labels through Forgejo's API.
4. Run `python3 proxy.py` in a separate terminal. It forwards all requests to real Forgejo except deletion of label 2, which returns HTTP 503, matching the reported failure injection. Label 1 is removed by Forgejo itself.
5. Authenticate the real `fj` CLI to `http://127.0.0.1:39136` using `fj auth add-token`, with an isolated `XDG_DATA_HOME`. Set `PROOF_FJ_BINARY` to its executable.
6. From the current-main runner checkout, set `T3CODE_DEV_SEED=0`, `T3_SCENARIO_INHERIT_ENV=XDG_DATA_HOME,PROOF_*` and the three variables above, then run:

```sh
vp run scenarios:prove scripts/scenarios/labels-after-partial-host-rejection.e2e.ts --base 72c5a9ea28cea26e77f8f13a7e4a53e457c9471d --head 7810d2b692daedf820972d22e8eb32ffada112c9 --upload-command "ghdrop upload"
```

The scenario resets both labels on the real host before each side. It opens PR 1, unchecks both labels, closes with Escape, waits for the error, checks the host retained only `needs review`, captures the Labels row, then reopens and captures the picker. Its assertions require documentation to be unchecked and needs review checked.
