Skip to content

feat(pr-pipeline): review an oversize main-run diff in chunks instead of holding it for a person #11000

Description

@kyle-sexton

Problem

pr-review-main.yml cannot review a pull request whose diff exceeds MAX_DIFF_BYTES (300000). After #10961 part 1, that stop holds the PR for a person (main-review-stop:too-large): no lane can clear it. The owner's standing direction (§2) treats any stop that is not intent, design or HIGH/CRITICAL security as a defect to fix, so this person stop should not be permanent.

Proposal

Review an oversize diff in chunks under the cap: split by file, keeping each lane-source file whole, run the review per chunk, and bind the verdict only when every chunk returns a counted verdict (the max CRITICAL count across chunks wins; a missing or failed chunk keeps the PR unbound). The size stop then fires only for a single file over the cap.

Acceptance

  • A fixture diff over 300 KB split across files gets a bound verdict with no person hold.
  • A chunk that fails or returns no verdict keeps the PR held (fail closed).
  • A single file over the cap still records main-review-stop:too-large.
  • The run records chunk count and per-chunk bytes as metrics (§9).
  • An independent security review of the change finds no HIGH/CRITICAL (it edits a gate workflow).

Refs: #10961

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 29, 2026
  2. github-actions commented on Oct 29, 2026

    @github-actions
    Contributor

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

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

    Understood: change pr-review-main.yml so a diff over MAX_DIFF_BYTES is split by file into chunks under the cap and reviewed per chunk. The verdict binds only when every chunk returns a counted verdict, and the highest CRITICAL count wins. A failed or missing chunk fails closed. A single file over the cap still records main-review-stop:too-large, and chunk count and per-chunk bytes are recorded as metrics. The acceptance criteria are concrete and the approach is clear. The change edits a gate workflow, so the security review lane should judge the diff. I found no likely duplicates among the open issues.

    Automated triage, applied by the lanes App.

  3. added
    priority: mediumReal value, no hard deadline; normal backlog flow.
    and removed
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 29, 2026
  4. added
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    work-class: structuralRefactors, migrations, contract changes; cross-cutting and hard to reverse.
    admission-deferredAdmitted but waiting for WIP room; the hourly work-unblock sweep labels it agent-ready.
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    and removed
    admission-deferredAdmitted but waiting for WIP room; the hourly work-unblock sweep labels it agent-ready.
    on Oct 29, 2026
  5. melodic-automation-lanes commented on Oct 29, 2026

    @melodic-automation-lanes
    Contributor

    This records a re-fire of an earlier refusal, not a new refusal. The lanes kill switch stopped run 40934459461, the work-resolve-issue run that agent-ready started, before it did any work; that run ended at 2026-10-29T18:56:56Z. work-unblock has now removed and added agent-ready back to start a fresh run. A kill-switch refusal is no fault in this issue or the lanes, so it never counts against later re-fires; after limits.limit-stops-per-issue of them since a person last added agent-ready or a run last reported, work-unblock waits longer before each one, up to 24 hours.

  6. added
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    and removed
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    on Oct 29, 2026
  7. melodic-automation-lanes commented on Oct 29, 2026

    @melodic-automation-lanes
    Contributor

    This records a re-fire of an earlier refusal, not a new refusal. The lanes kill switch stopped run 40952840274, the work-resolve-issue run that agent-ready started, before it did any work; that run ended at 2026-10-29T20:56:11Z. work-unblock has now removed and added agent-ready back to start a fresh run. A kill-switch refusal is no fault in this issue or the lanes, so it never counts against later re-fires; after limits.limit-stops-per-issue of them since a person last added agent-ready or a run last reported, work-unblock waits longer before each one, up to 24 hours.

  8. added
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    host-runNeeds an unattended run on a host; the host runner takes it, not a person or the issue lane.
    and removed
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    on Oct 29, 2026
  9. melodic-automation-lanes commented on Oct 30, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue lane stopped on this issue (patch-protected-path): the change needs a path the issue lane may not push, which a maintainer session builds by hand.
    It added host-run and removed agent-ready: an agent run on a host builds it, and it waits on no decision from a person.

    In the run's words:

    The run stopped early (patch-protected-path): its change needs a path the issue lane may not push, which a person changes instead. In the run's words: patch-protected-path: .github/workflows/pr-review-main.yml. The size stop (stop too-large when diff.patch exceeds MAX_DIFF_BYTES) is inline shell in the 'Write the diff' step of each of the workflow's three review legs (lines 243-245, 732-734, 1216-1218). The single-pass review is one run-claude-cli step per leg (line 384 and its counterparts). Reviewing the diff in chunks with a per-chunk verdict that binds only when every chunk returns one means changing those steps, so the change needs .github/workflows/pr-review-main.yml, which this lane cannot patch.

    What the run says it did not do:

    • Chunked review in .github/workflows/pr-review-main.yml (per-chunk run-claude-cli review across the three legs, binding only when every chunk returns a counted verdict, max CRITICAL across chunks, fail closed on a missing chunk, keeping the too-large stop only for a single file over the cap): not sta
    • Chunk-count and per-chunk-bytes metrics (§9) and the fixture tests in .github/scripts/pr-review-main/workflow.test.mjs: not started, because they depend on the workflow change
    • Independent security review of the gate-workflow change: not run, because no change was made
    • tidy, review, verify and checks pipeline steps: skipped, because the run stopped before any edit

    Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40975913532

    To hand it back to the lane, remove host-run and add agent-ready again.

  10. kyle-sexton commented on Oct 30, 2026

    @kyle-sexton
    MemberAuthor

    #11160 delivers part of this issue and now refers to it (Refs: #11000) instead of closing it.

    What #11160 delivers

    • pr-review-main reviews a diff over its 300000-byte cap in chunks: up to 4 chunks of at most 300000 bytes each, cut at file boundaries, with each file reviewed whole in one chunk.
    • Each chunk gets its own review run. The lane's one verdict sums the chunks' findings and sets critical to the most CRITICAL findings any one chunk returned (the max), and binds as a single-pass verdict does.
    • A chunk that fails, leaves no result or skips a part writes no verdict; the leg records verdict=none reason=chunk-failed and binds nothing.

    What remains open here

    • A multi-file diff over MAX_CHUNKS × 300000 bytes (about 1.2 MB) still stops as too-large. This issue asks for the size stop to fire only for a single file over the cap. Any fixed slot count leaves some multi-file diff over the cap, so lifting this needs a dynamic chunk count (for example, a planning job that emits a chunk matrix), which feat(pr-pipeline): review an oversize main-run diff in chunks #11160 does not build.
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

    host-runNeeds an unattended run on a host; the host runner takes it, not a person or the issue lane.priority: mediumReal value, no hard deadline; normal backlog flow.status: readyTriaged, unblocked, and fully specified; eligible to pick up.work-class: structuralRefactors, migrations, contract changes; cross-cutting and hard to reverse.

    Fields

    No fields configured for Feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions