From a137d10274996a9728f091d235baca388448ac10 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Wed, 2 Dec 2026 18:31:48 +1300 Subject: [PATCH] PR builds say which changes are main's unreviewed ones (sc-8770): a pull request build compared on top of an unreviewed default-branch build marks the changes that are exactly that build's unreviewed changes (models::inherited): get_build's on_main_unreviewed and inherited ('3 changes are already on main and unreviewed (build #77)'), and a notice on the build page linking to main's build. Approval and the check still go by approved baselines. Docs: Agents, design; plugin 0.1.31 --- .claude-plugin/marketplace.json | 2 +- .claude-plugin/plugin.json | 2 +- .cursor-plugin/plugin.json | 2 +- docs/design.md | 4 + gemini-extension.json | 2 +- server/frontend/content/docs/agents.md | 2 +- server/frontend/src/api/types.ts | 4 + server/frontend/src/pages/BuildPage.tsx | 9 +++ server/src/controllers/ui.rs | 5 ++ server/src/mcp.rs | 11 ++- server/src/models/inherited.rs | 99 +++++++++++++++++++++++++ server/src/models/mod.rs | 1 + server/tests/requests/comments.rs | 30 ++++++++ skills/visualci-review/SKILL.md | 2 +- 14 files changed, 168 insertions(+), 7 deletions(-) create mode 100644 server/src/models/inherited.rs diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 1ed1c602..0dbbe7ba 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -5,7 +5,7 @@ "plugins": [ { "name": "visualci", - "version": "0.1.30", + "version": "0.1.31", "description": "Visual regression and snapshot review for PDFs, screenshots, JSON, HTML and text: VisualCI's MCP server and its skills for each CI provider and test tool.", "author": { "name": "DocSpring", "url": "https://visualci.com" }, "homepage": "https://visualci.com/docs/skills/", diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 0718a07f..29ce2de1 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "visualci", - "version": "0.1.30", + "version": "0.1.31", "description": "Visual regression and snapshot review for PDFs, screenshots, JSON, HTML and text: VisualCI's MCP server and its skills for each CI provider and test tool.", "author": { "name": "DocSpring", "url": "https://visualci.com" }, "homepage": "https://visualci.com/docs/skills/", diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.json index e55229b9..8703afc3 100644 --- a/.cursor-plugin/plugin.json +++ b/.cursor-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "visualci", "displayName": "VisualCI", - "version": "0.1.30", + "version": "0.1.31", "description": "Visual regression and snapshot review for PDFs, screenshots, JSON, HTML and text: VisualCI's MCP server and its skills for each CI provider and test tool.", "author": { "name": "DocSpring" diff --git a/docs/design.md b/docs/design.md index 46c1a70c..abe4bb78 100644 --- a/docs/design.md +++ b/docs/design.md @@ -205,6 +205,10 @@ the same way as a screenshot: a change keeps the GitHub check pending instead of PR's build changed and approved (the same box, the same old and new pixels) points at that build (`snapshots.matches_build_id`, `models::matching`, found while processing): "matches PR #8's approved change", a hint that approves nothing; `review` with `only: "matching"` approves those (sc-8785). +- A pull request build compared on top of an unreviewed default-branch build shows that build's changes again. Those + that are exactly the base build's unreviewed change (the same snapshot and new content) are marked + (`models::inherited`, `on_main_unreviewed`) and the build says "N changes are already on main and unreviewed (build + #X)", linking there. Approval and the check still go by approved baselines (sc-8770). - Partial approval per snapshot. "Accept as variant" adds the image to the name's variants without replacing the baseline. "Ignore this change" stores the diff fingerprint. - GitHub App: check run per project and build name, named `VisualCI` (default build name) or `VisualCI: `, so a diff --git a/gemini-extension.json b/gemini-extension.json index c6d3f549..4a619ace 100644 --- a/gemini-extension.json +++ b/gemini-extension.json @@ -1,6 +1,6 @@ { "name": "visualci", - "version": "0.1.30", + "version": "0.1.31", "description": "Visual regression and snapshot review for PDFs, screenshots, JSON, HTML and text: VisualCI's MCP server and its skills for each CI provider and test tool.", "mcpServers": { "visualci": { diff --git a/server/frontend/content/docs/agents.md b/server/frontend/content/docs/agents.md index fb0bdd20..86af8f5d 100644 --- a/server/frontend/content/docs/agents.md +++ b/server/frontend/content/docs/agents.md @@ -195,7 +195,7 @@ failing in the repository instead of sending them. **Reviews** -- `review`: approve or reject a build's changes, some snapshots' changes (`snapshots`), or only its new or only its changed snapshots (`only: "added"` or `"changed"`). Add a `note` saying why ("The new header, as the issue asked"): it's kept with the review and shown in the build's reviews, `get_build` and the pull request comment. Every review says who made it and how: "Claude Code for Ada Lovelace" for an agent signed in as its person, "Ada Lovelace" in the web app, or "a project token (CI)", so an agent's approval never reads as the person's own. When two pull requests change the same screen and merge separately, the screen after both is one neither showed, so it shows as changed until someone reviews it. If the change is exactly another pull request's approved change (the same regions, from the same old pixels to the same new ones), `get_build` marks it `matches` ("matches PR #8's approved change"), and `only: "matching"` approves those in one call. +- `review`: approve or reject a build's changes, some snapshots' changes (`snapshots`), or only its new or only its changed snapshots (`only: "added"` or `"changed"`). Add a `note` saying why ("The new header, as the issue asked"): it's kept with the review and shown in the build's reviews, `get_build` and the pull request comment. Every review says who made it and how: "Claude Code for Ada Lovelace" for an agent signed in as its person, "Ada Lovelace" in the web app, or "a project token (CI)", so an agent's approval never reads as the person's own. When two pull requests change the same screen and merge separately, the screen after both is one neither showed, so it shows as changed until someone reviews it. If the change is exactly another pull request's approved change (the same regions, from the same old pixels to the same new ones), `get_build` marks it `matches` ("matches PR #8's approved change"), and `only: "matching"` approves those in one call. On a pull request's build whose base is a default-branch build nobody has reviewed yet, the changes that are main's own unreviewed ones are marked `on_main_unreviewed`, and `get_build`'s `inherited` says how many and which build: review those on main's build, and the pull request's own changes here. - `review_page`: accept one page as a variant, or ignore one exact change in later builds too. **Running a comparison** diff --git a/server/frontend/src/api/types.ts b/server/frontend/src/api/types.ts index 3b2d8151..e830431d 100644 --- a/server/frontend/src/api/types.ts +++ b/server/frontend/src/api/types.ts @@ -312,6 +312,8 @@ export type SnapshotRow = { approved_elsewhere: ApprovedElsewhere | null /** Every changed region is exactly a change a merged pull request approved: "matches PR #8's approved change". */ matches?: { build: number; branch: string; pr_number: number | null; label: string } | null + /** This pull request build's change is the default branch's own unreviewed change: review it on main's build. */ + on_main_unreviewed?: boolean thumbnail_url: string | null /** Its content flipped back and forth over the branch's recent builds: a hint only. */ flaky: boolean @@ -320,6 +322,8 @@ export type SnapshotRow = { export type BuildDetail = BuildSummary & { /** What changed, computed from the comparison ("invoice: page 1 changed (2 regions); 3 added"). */ summary: string | null + /** A pull request build's changes that are the default branch's own unreviewed ones ("3 changes are already on main and unreviewed (build #77)"). */ + inherited?: { build: number; branch: string; count: number; note: string } | null base_build_number: number | null ci_mode: CiMode error: string | null diff --git a/server/frontend/src/pages/BuildPage.tsx b/server/frontend/src/pages/BuildPage.tsx index 1607f0af..6154de5b 100644 --- a/server/frontend/src/pages/BuildPage.tsx +++ b/server/frontend/src/pages/BuildPage.tsx @@ -136,6 +136,14 @@ export function BuildPage() { visualci.yml: {w}

))} + {build.inherited && ( +

+ Not this pull request’s: {build.inherited.note}.{' '} + + Review them on #{build.inherited.build} + +

+ )} {build.summary &&

{build.summary}

}