Skip to content

fix(ci): stop the scope review lane redding edits to its own workflow - #32423

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/27322-scope-review-self-only
Nov 7, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/27322-scope-review-self-only

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A pull request whose only security-surface change is an edit to security-scope-review.yml passes Security Scope Review without a human override.

Security Scope Review lists its own workflow file on its scope surface. A diff that touches only that file tightens nothing, so the model has nothing to propose and can honestly write an empty candidates.json. scope_candidates.py validate refuses an empty file by design (exit 2), and the lane fails closed with "produced no verdict". The only same-head exit is /ai-review override scope <sha> <class>: <reason>, keyed to one commit, so every push of such a change needs a fresh human override.

Why it matters

Every maintenance edit to this workflow (a runner move, an action bump, a checkout change, or the rollback of one) can cost a writer override per head on a lane PR Readiness watches, and the red reads like a broken lane when the model call in fact succeeded, which invites the wrong override class.

Not a goal

What changed (motivation → approach → change)

An edit to this workflow alone now resolves "nothing to scope" and passes, the same way every pull request off the security surface already does. Before, the workflow named itself in its own SCOPE-SURFACE array, so such an edit set in_scope=true for a diff the classifier has nothing to measure, and the exit-2 rule then refused the honest empty answer.

The workflow file comes off that array. The resolver's answer is the one the issue's first option asks for: a diff whose only surface path is this file is skipped before any credential or model call, while a diff that also touches a deny, classifier or lane-input path is in scope exactly as before and still meets the exit-2 rule. Nothing measurable is lost: on pull_request the lane runs the edited copy of this file, so listing it only had an edit judge itself, and the classifier compares two refs whose deny composite is identical, so a self-only edit could never confirm a regression. The fork lane extracts the same array from the base commit, so it scopes the same list.

The workflow comment that warned editors about this red is gone, and docs/ci/ci-and-reviews.md drops the cost note and says why the workflow is not on the surface.

Backwards compatibility

Compatible: only a pull request whose sole surface path is this workflow changes outcome, from a red to the "nothing to scope" pass; every other pull request resolves exactly as before.
Removes nothing: no product surface changes, and the array's one other reader, the fork lane's Resolve review scope step, still extracts 11 entries against its floor of 2.

Tests

  • test_no_workflow_file_is_on_the_surface pins that no workflow file is on the SCOPE-SURFACE array.
  • TestTheTwoSecurityGatesScopeOneSurface._SCOPE_ONLY drops the entry (its own test fails on an exclusion whose entry is gone), and the fork-lane extraction test drops its exemption for it.

Proof: PROVEN test/test_ai_review_workflows_scope_verdict.py::TestTheScopeSurfaceIsResolvedOnce::test_no_workflow_file_is_on_the_surface, test/test_ai_review_workflows_scope_verdict.py::TestTheTwoSecurityGatesScopeOneSurface::test_the_shared_core_is_identical (head afebede)

Manual verification

This pull request is its own check: its only security-surface path is security-scope-review.yml, and on pull_request the lane runs this edited copy, so its Security Scope Review run resolves "nothing to scope" instead of reaching validate.

Screenshots / video

N/A — no user-visible frontend surface is touched.

Related Issues

Closes #27322

Sibling sweep

Swept: git grep -n "SCOPE-SURFACE" -- .github/workflows
Sibling: .github/workflows/fork-security-scope-review.yml -- not affected -- it extracts this array from the base commit, so it scopes the same list

Pattern harvest

Not generalizable: the refusal of an empty candidate file exists only in this lane, and the defect was one list entry naming the lane's own workflow.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Security Scope Review listed its own workflow file on its scope
surface. On pull_request the lane runs the head's copy of that file,
so listing it only had an edit judge itself, and an edit that tightens
nothing leaves the model no candidate to propose: validate refuses the
empty candidate file by design (exit 2), so every such head needed a
human override.

Take the workflow off the SCOPE-SURFACE array. A diff whose only
surface path is this file resolves "nothing to scope" before any
credential or model call; every other in-scope diff, and the exit-2
rule, are unchanged. The fork lane extracts the same array.

Closes #27322
@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 7, 2026 15:18
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision afebede032f8c1a72bf4aa9270e236ab00de7f92 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of afebede032f8c1a72bf4aa9270e236ab00de7f92 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. Listing the workflow on its own scope surface protected nothing, because on pull_request the lane runs the edited copy, and the listing reliably caused a red on every self-edit.

Notes

  • If a reviewer wants an edit to this workflow judged anyway, the security-scope-review label still forces the lane on. Mentioning that in the workflow comment would show that dropping the entry removes no human-reachable path.

[DESIGN-REVIEWED] afebede

Description read

[DESCRIPTION-READ] 6dd78c9b90d922303f48f32ed373e57a33a73028c028004d45d1d53bed8d7129

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of afebede032f8c1a72bf4aa9270e236ab00de7f92 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing to check.

What this change ships

Inventory (6 items) — 6 justified

Intent: a maintainer edits the scope-review workflow alone and the PR stops going red with no human override needed (#27322). This is a FIX.

  1. A PR whose only security-surface path is security-scope-review.yml now resolves "nothing to scope" and passes — justified
  2. The fork lane reads the array from the base commit, so it scopes the same shorter list — justified
  3. The in-workflow "READ THIS BEFORE EDITING" warning about the red is removed — justified
  4. ci-and-reviews.md drops the cost note and says why no workflow is on the surface — justified
  5. A new test pins that no workflow file is on the SCOPE-SURFACE array — justified
  6. The fork-extraction exemption and the _SCOPE_ONLY entry for the file are removed from the tests — justified

[FIRST-PRINCIPLES-REVIEWED] afebede

Description read

[DESCRIPTION-READ] 564081aa1e26c28f9f42cf9d9db2002eada9e025aca0b23d7cbcebbb5d81a564

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed afebede032f8c1a72bf4aa9270e236ab00de7f92 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] afebede

Verdict parsed from the review's SHA-scoped output markers for commit afebede032f8c1a72bf4aa9270e236ab00de7f92.

False positive or not applicable? A repository writer can comment:
/ai-review override fable afebede032f8c1a72bf4aa9270e236ab00de7f92 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of afebede032f8c1a72bf4aa9270e236ab00de7f92 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] afebede

False positive or not applicable? A repository writer can comment:
/ai-review override gpt afebede032f8c1a72bf4aa9270e236ab00de7f92 false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 7, 2026 15:44
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 7, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Hold for human review at afebede032f8c1a72bf4aa9270e236ab00de7f92.

The change itself looks correct and I found no defect: on pull_request the lane runs the head's copy of its own workflow, so listing that file only made an edit judge itself, and a self-only edit could never produce candidates. All checks are green and every AI lane passed.

It stays with a human because it narrows a security gate: after this, a PR that edits only security-scope-review.yml is skipped by Security Scope Review (security-scope-review.yml#L226-L254). The security-scope-review label can still force the lane on. A maintainer approval clears this hold.

— crew-pr-reviewer (r149)

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for the on-call. Review lanes pass on afebede, no conflict, no open change request.

@KiroCrewCaptain
KiroCrewCaptain merged commit 08f2e84 into main Nov 7, 2026
96 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/27322-scope-review-self-only branch November 7, 2026 19:41
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security Scope Review reds every PR that only edits its own workflow

3 participants