Repository navigation
app/: nothing becomes a baseline unreviewed: no cross-branch fallback; only the default branch's first build is auto-approved - #121
Merged
Conversation
…; only the default branch's first build is auto-approved A pull request branch's first CI build with no base now waits for review (it was auto-approved on any branch and its snapshots recorded as baselines). baselines::resolve no longer takes any branch's latest CI approval for a snapshot with no baseline on its history, and the exact-match passes in compare.rs count only the build's own branch's approvals and the default branch's CI ones. A pull request's approvals reach its base branch only through record_merge, at the merge commit.
ndbroadbent
force-pushed
the
app-baselines-no-cross-branch
branch
from
December 3, 2026 06:45
52f01f5 to
71cf4ef
Compare
VisualCIdocspring/visualci · build #24 · 1 changed, 332 unchanged · approved by visualci features agent for Nathan Broadbent This PR vs base: nothing since #12, across 2 builds
Updated as builds change. Agents can review with VisualCI's MCP tools. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
In production, an unreviewed pull request branch's snapshots became the baseline for unrelated branches. Two rules did it together:
processing::concludeauto-approved any CI build with no base (("ci", _, false) => "auto_approved") and recorded its snapshots as baselines (approval = 'auto'), whatever its branch. A PR branch's build was the project's first to conclude, so its 333 snapshots became baselines.baselines::resolveended with a pass that gave a snapshot with no baseline on the build's history the suite's latest CI approval of it from any branch. Builds on other branches picked up that PR branch's approvals and came back "unchanged".That fallback was there for squash merges, but
baselines::record_mergehas covered them since sc-8806: a merged PR's approvals are copied to the base branch at the merge commit, andresolvecounts them through that commit's place in the build's history.What changed
The rule is now nothing becomes a baseline unreviewed.
concludetakes the project's default branch. A CI build with no base is auto-approved only onproject.default_branch. On any other branch it concludesreview_state = "pending", like any change. A build with no changes is still auto-approved on any branch, since it records nothing.baselines::resolveis deleted. A PR's approvals reach the base branch only throughrecord_merge.compare.rs(a changed text or page image that exactly matches an approved one passes as a variant). They took current CI approvals from any branch, and the text pass's comment said that was for squash-merged PR branches. That's the same cross-branch leak by another route: test 3 caught a main build before the merge passing on the PR branch's approval. Production's existingautorows from the PR branch would also have kept feeding it. Both passes now count only the build's own branch's rows and the default branch's CI rows, which includemergedrows. Matching across environments works as before on those branches.checks.rs,builds::passed,pr_comment.rsorchangeset.rsneeded changing, because they all key onreview_state. A pending first PR build gets the same check as any pending build:in_progress"N changes waiting for review" (failureinstrictmode), with the CI step passing inreviewmode and waiting inwaitmode.recountonly auto-approves a pending build whose changes all went away (ignored or accepted as variants), which is the "unchanged" case, so it stays.Docs
docs/design.md: a new "Nothing becomes a baseline unreviewed" bullet, the merge bullet says it's the only way a PR's approvals reach the base branch, and the exact-match wording no longer says "approved anywhere in the suite".quick-start.md(Review the changes) and the "first build becomes the baseline" line on the snapshot pages (jest, vitest, syrupy, insta, rspec-snapshot, laravel-rust) now say it's the default branch's first build, and that a PR's first build waits for review.skills/is regenerated and the plugin version goes to 0.1.47.Tests
New
app/tests/baselines.rs:a_pull_request_branchs_first_build_waits_for_review_and_records_no_baselinesthe_default_branchs_first_build_is_approved_and_becomes_the_baseline(and the next build on main is unchanged)a_build_never_takes_an_unrelated_branchs_approvals: after afeaturebuild is approved, a build on an unrelated branch, and a main build before any merge, see the snapshots as added.a_squash_merged_pull_requests_approvals_reach_the_default_branch_at_the_merge: main's baseline, a PR change approved, a main build before the merge still shows it changed, then afterrecord_mergeat squash commits1a main build withs1in its ancestry is unchanged.cargo fmt --check,cargo clippy --locked --all-targets -D warningsandcargo test --lockedall pass in app/ (agents-build-2).Goldens and existing tests changed: none. Every existing test whose first build is auto-approved runs on
main, and none relied on the fallback or the cross-branch exact match.Production follow-up (not in this PR)
The
autobaseline rows that PR #102's branch recorded are still in production. This change stops every path that read them for other branches (resolve and the exact-match passes), andrecord_mergewould copy them to main only if that PR merges. Deleting them is a data change for a separate decision.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.