Skip to content

feat(pr-pipeline): bind lane-source pull request reviews to a run from main #10780

Description

@kyle-sexton

Problem

A pull request that changes a lane source (a workflow, Claude Code settings, CLAUDE.md, AGENTS.md, REVIEW.md, docs/standards/**, .gitattributes, .mcp.json) can never bind its AI review, so it waits for the owner. The fix proposed in #10076, re-running the review lanes, cannot bind either:

  • The review lanes run on pull_request, which runs the head's own copy of their callers (.github/workflows/pr-review-hosted.yml and pr-review-security-hosted.yml). A head that edits a caller changes its own review.
  • The reviewed-head marker the gate reads is posted by github-actions[bot] (MARKER_AUTHOR in plugins/source-control/skills/babysit-prs/scripts/babysit_review_evidence.py), the same identity any write-token workflow the head adds posts as. A head can therefore forge it.
  • So bind() refuses every lane at such a head as lane-source-changed (babysit_review_evidence.py, bind, the lane_source and readonly_workflow checks). A re-run at the same head replays the same head's callers and still unbinds.

Design

Run both review lanes again from a workflow whose definition is always main's, and bind on that run's identity, never on a comment's author.

  • Main-run review. .github/workflows/pr-review-main.yml runs on pr-require-checks completion through workflow_run. It reviews the head's git diff --text as data, using each lane's criteria copied from main, with a read-only token and a model that may only Read. It uploads a verdict artifact keyed on the head's tree. A separate job with no model records each lane's counts as an undeletable check run.
  • Binding. For a lane-source pull request, the gate counts only a verdict whose run is that file, has event workflow_run, runs on the default branch with a head that main contains, and names the lane, the pull request and the tree. Only a verdict from a completed, successful run for the exact head binds. The CRITICAL findings any head recorded carry forward.
  • Floor and holds, part of this design. A review cannot judge the workflows that hold its own or other write credentials, nor the files that set what agents may do unattended or what later reviews judge against. Those stay with a person. The deterministic holds stop any widening an AI review alone must not clear. This is not separate work: without it the main-run review would clear changes to the credentials and criteria it runs on.

Acceptance criteria

  • pr-review-main.yml reviews every pull request whose changed files include a lane source, from main, as data, with no head code run. It writes no verdict for a binary or over-size patch.
  • A lane-source pull request binds each lane only on a main-run verdict for its exact head. A forged marker, a pull_request run, another head or tree, a non-main or non-workflow_run run, or an unsuccessful run does not bind. Findings count the most that any review of the tree reported. CRITICAL findings recorded on any head of the pull request hold.
  • The workflow gate floor class (held for a person) is derived from the workflow files: the review workflows, and each workflow that holds a credential beyond its job's GITHUB_TOKEN (a non-GITHUB_TOKEN secret, a lane token, an OIDC token), per owner decision Q11 (A).
  • Deterministic person holds: permission-widening-review, privileged-trigger-review (pull_request_target, workflow_run, issue, comment, review, discussion and repository_dispatch triggers), secret-exposure-review (also read from head text), agent-surface-review, and unreviewed-patch:<path> for a file with no patch that is not media.
  • review-path-unbindable is removed. An enforcement path beside a lane source waits for the main-run security review.
  • **/.claude/settings*.json, **/.mcp.json, **/CLAUDE.md, **/CLAUDE.local.md, **/AGENTS.md, REVIEW.md and docs/standards/** are gate floor paths, held for a person.

Supersedes the approach in #10076.

Owner decision (Q12): option (A), approve this design. Owner, 2026-10-28 ~22:25Z, on Q12: "AGAIN GO WITH WHATEVER IS IN LINE WITH THIS:" followed by the standing direction (sections 1-8). Parent session applied it as (A). Basis: babysit_review_evidence.py:313-318 on main raises Unbound("lane-source-changed") from the changed paths alone, so a re-run review at the same head unbinds again and #10076's done-when ("fresh reviews dispatched and no needs-human") cannot be met as written; (A) keeps #10076's intent (lane-source PRs merge without the owner) under §2, keeps the boundary under §3 (review counts only from a run of main's workflow; credentialed workflows, permission widening, privileged triggers, new secrets and model legs still hold for a person), and removes a stop no re-run can clear under §4.

Activity

  1. added
    needs-triage
    on Oct 28, 2026
  2. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: structural
    Basis: automated intake triage; the lanes App applied this class.

    Size: Large
    Complexity: High
    Uncertainty: Knowable
    Flags: none
    Blocked by: none

    I read this as a new main-run review workflow (pr-review-main.yml). It would let a pull request that changes a lane source bind its AI review on a verdict from a run whose definition comes from main. The binding would use the run's identity, not a comment author. It also covers the floor and hold changes. The acceptance criteria are specific.

    Notes:

    Automated triage, applied by the lanes App.

  3. added and removed
    needs-triage
    on Oct 28, 2026
  4. added
    status: ready
    status: confirmed
    and removed
    status: ready
    on Oct 28, 2026
  5. melodic-automation-lanes commented on Oct 28, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: a criterion names */.claude/settings.json, which the issue lane cannot push (patch-protected-path); a builder session takes it; Size large: the split into sub-issues at intake is pending (owner Q93). Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  6. melodic-automation-lanes commented on Oct 28, 2026

    @melodic-automation-lanes
    Contributor

    The latest triage verdict holds nothing: admission moved the issue to status: confirmed; its comment says why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: confirmed

    Fields

    No fields configured for Feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions