From 851e972863a6beec82aaaccfbe1a91f8d4c780bd Mon Sep 17 00:00:00 2001 From: Mario Tarosso Date: Mon, 24 Aug 2026 11:13:41 +0100 Subject: [PATCH] [docs] Disclose the marker edit that scan now makes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The docs said scan makes one source edit, in an HTML shell, only after a successful post. Since scan started writing the production marker all three clauses are wrong: there are two edits, the marker goes into a JSX root, and it is written before the post so an offline build still gets the flag. Agents read these files and treat an undisclosed capability as misrepresentation, so leaving the old text in place is worse than the gap it described. Also documents the marker in the command-reference rows for `scan` and `setup`, in the first-scan summary, and in the manual-placement step for code roots — which is the step that shipped a widget tag with no marker beside it. Co-Authored-By: Claude Opus 5 (1M context) --- AGENT-INSTALL.md | 12 +++++++----- README.md | 10 +++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/AGENT-INSTALL.md b/AGENT-INSTALL.md index 0134a452..f895ac6e 100644 --- a/AGENT-INSTALL.md +++ b/AGENT-INSTALL.md @@ -8,8 +8,8 @@ Every command at a glance — what it does, whether it reads your source, what i | Command | What it does | Reads your source? | Writes to your project | Sends over the network | |---|---|---|---|---| -| `scan` | Provision (or reuse) the site and POST the dependency list for vulnerability matching. Also runs automatically via `setup` and the install/build hooks. | No — lockfile only (bun: enumerates `node_modules/`) | `.patchstackrc.json`; the widget ` diff --git a/README.md b/README.md index 4c86cd39..dec21c64 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ That's it. `setup`: 2. POSTs the package list to Patchstack with **no** UUID. 3. Patchstack provisions a fresh site and returns its UUID. 4. The connector writes the UUID to `.patchstackrc.json` so the next `scan` targets the same site. -5. The connector installs the disclosure widget's ` ``` +- **`scan`** also adds the production marker when the root shell is JSX rather than HTML (`src/routes/__root.tsx`, `app/layout.tsx`, …), above the widget tag and guarded by the framework's production expression. A server-rendered app emits no built HTML for `mark-build` to stamp, so without it the widget reads the published site as build mode and shows the claim flow to visitors instead of the report form. + Re-runs update the tag in place (the `data-patchstack-connect-widget` attribute marks it as connector-managed); a pre-existing manual widget tag is left untouched. `--dry-run` and failed posts never edit anything. Projects whose root layout is code rather than HTML (Next.js, Nuxt, Astro, …) get the exact snippet and target file printed instead — `guide` shows framework-specific placement. - **`mark-build`** ensures the same tag in built HTML output, covering builds whose source shell the connector couldn't edit, and stamps `window.__PATCHSTACK_PROD__` so the widget hides the claim/login UI on the published site (owners reach it by appending `#patchstack` to the live URL).