# Guest document extraction proof

The scenario drives real owner and guest web clients, a real server with a fresh database, the test T3 Connect relay, and the free Replay (dev) provider. A passive Node preload records the provider's incoming protocol without changing it. The scenario reads the real attachment directory and displays a sanitized observation report in the app's file viewer.

Use current main's scenario runner. Apply `relay-scenario-setup.patch` to enable authenticated relay startup, a web build for the remote guest client, and a readiness event. Copy `guest-document-text.e2e.ts` into `scripts/scenarios/`.

Load the supplied test relay environment and authenticate with `t3 connect login --headless` in a separate scratch T3 home. Set `T3_SCENARIO_CONNECT_TOKEN_FILE` to that home's `userdata/secrets/cloud-cli-oauth-token.bin`; this private credential is not included in these artifacts.

Set `NODE_OPTIONS` to `--import <absolute-path-to-tap.mjs>`, `T3_SCENARIO_PROMPT_LOG` to a scratch log path, and `T3_SCENARIO_ARTIFACT_ROOT` to a scratch output directory. Set `T3_SCENARIO_INHERIT_ENV` to `T3CODE_*,VITE_*,T3_SCENARIO_CONNECT_TOKEN_FILE,T3_SCENARIO_PROMPT_LOG,NODE_OPTIONS`. Keep `T3CODE_DEV_SEED=0`.

Run:

```sh
vp run scenarios:prove scripts/scenarios/guest-document-text.e2e.ts \
  --base 1e9f93a48e231db3ccc5bcde6c5d84a00d5b9e9a \
  --head d27c8bb7e90eea35bd2611f6f4f67d49e61a1033 \
  --upload-command 'ghdrop upload'
```

The only behavior assertions require the guest's extracted sentence and its extracted-text provider reference. Both sides use identical synthetic RTF files. Each side signs its isolated environment out in a `finally` block.

The report replaces the attachment directory and random guest attachment ID with `<attachments>` and `<guest-id>`; the sidecar presence, contents, and provider reference are observed values.
