From a6597a0376650f03f34e41469392263e5e7b7331 Mon Sep 17 00:00:00 2001 From: Mario Tarosso Date: Mon, 7 Sep 2026 10:39:35 +0100 Subject: [PATCH] Close the install on a refresh and a deploy, not a blank page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A finished install leaves two things undone that nothing in the CLI can do for the user. The preview they are looking at loaded before the widget tag existed, so it renders no "Report a vulnerability" button. And every change setup makes is a source change, so the deployed site keeps serving its previous build until the next deploy. Both now get said out loud. The `guide` checklist ends with a refresh block and a deploy block, and `setup` closes with the same two lines addressed to the assistant, so it relays them rather than reporting success against a page that shows nothing. The refresh block only appears when the widget tag is really in the source with this project's UUID — there is no point sending someone to refresh a page that was never going to render a button. The deploy block appears whenever a site is provisioned, since the build hooks, guard and production marker still need a deploy even with "widget": false. The install prompt gets the same two asks, with an explicit bound: remind the user to deploy, do not deploy anything. Also realigns the prompt across README.md, GETTING-STARTED.md and field-test/prompt.txt. They are meant to be byte-identical and had not been since the sandbox/protection wording landed in README alone, which left the field-test gate measuring a prompt nobody pastes. tests/install-prompt.test.ts now fails on drift. Co-Authored-By: Claude Opus 5 --- AGENT-INSTALL.md | 7 ++- GETTING-STARTED.md | 8 ++- MAINTAINING.md | 2 +- README.md | 6 ++- field-test/prompt.txt | 2 +- src/cli.ts | 11 +++++ src/guide.ts | 33 +++++++++++++ tests/guide.test.ts | 94 ++++++++++++++++++++++++++++++++++++ tests/install-prompt.test.ts | 58 ++++++++++++++++++++++ 9 files changed, 216 insertions(+), 5 deletions(-) create mode 100644 tests/install-prompt.test.ts diff --git a/AGENT-INSTALL.md b/AGENT-INSTALL.md index 163df54d..3d53d90b 100644 --- a/AGENT-INSTALL.md +++ b/AGENT-INSTALL.md @@ -70,6 +70,10 @@ Only `map` reads your source, and only `map --upload` sends anything derived fro In a hosted builder, run setup with `PATCHSTACK_ENVIRONMENT=sandbox` scoped to the workspace process/command, ensure the CLI's on-disk edits are adopted into the platform's persisted project state, then restart any already-running preview/server process so it loads the guard. Do not persist `"environment": "sandbox"` in `.patchstackrc.json`: deployed builds use the same committed files and should default to `production`. A client-only SPA has no server request path to guard; do not call it protected unless `protect --check` succeeds after a real server or edge seam is wired. + **Finish by telling the user to refresh their preview.** The widget's "Report a vulnerability" button loads with the page, so a preview that was already open still shows the HTML from before setup — the button is missing there until it reloads. Nothing in the CLI can reach the user's browser, so relaying this is your job. Phrase it as a check rather than a required step: a builder that hot reloads, or a preview server you restarted, may have refreshed it already. + + **Then tell them to deploy.** Setup changes source files, and the deployed site keeps serving its previous build until the next deploy — so visitors get no widget, and on a server-rendered root no production marker, until the user deploys (or hits Publish) again. Say it as a reminder; do not deploy anything yourself. + ## Manual setup 1. **First scan** — provisions a Patchstack site automatically, writes the UUID to `.patchstackrc.json`, and installs the disclosure widget's `