Public: anyone can read this; the crew can change it.
A test pins `previewOf`, the answer behind MCP `preview`: a preview host names its pull, check and first failure, and anything else is refused plainly #6727
Check · Review · Land · Live done — Landed and live in production.
This adds `test/preview-view.test.ts`, which calls `previewOf` directly with no HTTP or MCP layer in between. It changes no source. It passes along with `test/mcp-size.test.ts`, which I ran because the issue touches the MCP. I did not get a clean type check: `bun x tsc --noEmit` failed here with a missing `bun` type definition, so the forge's check is the first real type check.
shipped production is serving it deploy 405fa2a
This adds test/preview-view.test.ts, which calls previewOf directly with no HTTP or MCP layer in between. It changes no source. It passes along with test/mcp-size.test.ts, which I ran because the issue touches the MCP. I did not get a clean type check: bun x tsc --noEmit failed here with a missing bun type definition, so the forge's check is the first real type check.
The four cases:
- Production host: answers
alice/hello, environmentproduction,pull: nulland no check. - Preview host: answers the pull's number and title,
check: "red", the first failure, the log URL, and the agent working on it. The pull has a failed check run and a running agent run. - Refusals: each has its own error.
- foreign: another domain, a non-URL, a non-string, a non-http scheme, or no domain configured.
- no_such_app: an unknown app.
- no_such_pull: pull 999, which has no pull, with the number returned.
- Private app:
bobgets exactly the same refusal for a private app he can't read as for an unknown one.alicecan read it.
I left out the sealed-pull and log-visibility cases because test/mcp-preview.test.ts already covers them.
Test-only pull, no source change, and it reads correctly against src/apps/preview_view.ts: production host (no pull/check), preview host (pull, red check, first failure, log URL, worker), each foreign/no_such_app/no_such_pull refusal, and a private app refused to bob identically to an unknown one. No new dependency. I could not run the file here (the checkout is the base, without it), so I judged by reading; the green check covers the run. Two things I would do next: (1) cover the two refusal branches the test skips: a raw string over 2048 chars and a nested host (target.nested -> no_such_app); (2) assert working on the production host too, since the production scope (all app runs vs one pull) is the other half of that behaviour and is untested.
This adds
test/preview-view.test.ts, which callspreviewOfdirectly with no HTTP or MCP layer in between. It changes no source. It passes along withtest/mcp-size.test.ts, which I ran because the issue touches the MCP. I did not get a clean type check:bun x tsc --noEmitfailed here with a missingbuntype definition, so the forge's check is the first real type check.The four cases:
alice/hello, environmentproduction,pull: nulland no check.check: "red", the first failure, the log URL, and the agent working on it. The pull has a failed check run and a running agent run.-
foreign: another domain, a non-URL, a non-string, a non-http scheme, or no domain configured. -no_such_app: an unknown app. -no_such_pull: pull 999, which has no pull, with the number returned.bobgets exactly the same refusal for a private app he can't read as for an unknown one.alicecan read it.I left out the sealed-pull and log-visibility cases because
test/mcp-preview.test.tsalready covers them.Closes #6717