Skip to content

fix(pr-pipeline): fork run floods can hide failures from the monitoring lane's run read #8534

Closed

Description

@kyle-sexton

Refs: #8508

Problem

The monitoring lane reads failed workflow runs from one page of 100 (.github/scripts/maintenance-monitor-signals/collect.mjs around line 96) and only then drops runs whose head repository is not this repository. A flood of failing fork pull_request runs can fill that page and hide real failures from the lane. It fails safe: no false issue is filed, but real failures go unreported for that window.

Proposed change

Page past 100 until the window is covered (with a page cap), or query per trusted event (push, schedule, workflow_dispatch) so fork runs never occupy the page.

Acceptance

  • 100+ failing fork runs in the window do not hide a failing main run.
  • The read stays within a stated page cap.

Found by the GitHub Security & Cost pass on #8508 (P4).

Activity

  1. github-actions commented on Oct 20, 2026

    @github-actions
    Contributor

    The triage sweep dispatched intake triage for this issue (attempt 2 of 2).

  2. github-actions commented on Oct 20, 2026

    @github-actions
    Contributor

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

    Size: Small
    Complexity: Low
    Uncertainty: Known
    Flags: none
    Blocked by: none

    Decision recorded. The owner answered in the Refinement and Issue Triage sessions (2026-10-25), deciding the open items below on the facts:

    go with whatever the facts/data/metrics + /discovery:research says and ensure we're aligned with SOLID, DRY/SSOT principles

    [quote truncated; the full decision is at the link]

    #8534 (comment)

    The decision settles the open questions: page with a cap, add a LIMITS entry of 5 pages, and record a gap when the cap is hit. I understood the issue as a defect in the failed-runs read in collect.mjs: fork-run floods can fill the single page of 100 and hide real failures. The acceptance criteria are in the decision comment. I found no duplicates; #9018 is related but not the same.

    Automated triage, applied by the lanes App.

  3. added
    status: ready
    needs-owner-decision
    and removed
    status: ready
    on Oct 26, 2026
  4. melodic-automation-lanes commented on Oct 26, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: no trusted-human acceptance criteria: a listed human must put the confirmed - [ ] criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  5. melodic-automation-lanes commented on Oct 26, 2026

    @melodic-automation-lanes
    Contributor

    The latest triage verdict holds nothing: the issue is at status: ready.

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

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: The failed-runs read in collect.mjs pages up to a stated cap, so 100+ failing fork runs cannot hide a failing own-repo run.

    Related work

    Open questions

    1. Which approach: page past 100 with a cap, or query per trusted event?
      RECOMMENDED: Page with a cap, filtering own-head runs per page. Per-event queries would miss failures from events the read deliberately keeps, such as workflow_run and issue_comment (the test at collect.test.mjs:295-297 uses a pr-unblock run on those events), and the status=failure query takes only one event value per call. Basis: collect.mjs:100-102
    2. What page cap should the read use, and should it be a named constant in LIMITS?
      RECOMMENDED: A named constant of 5 pages (500 runs), stated in the code comment. The read stops early when a page returns fewer than 100 runs or when its oldest run is older than the window lookback. If the cap is hit, push a gap into gaps so truncation is reported rather than silent. Basis: judgment
    3. Should a read that hits the page cap record a gap?
      RECOMMENDED: Yes. Add an entry to gaps such as 'failed runs: page cap reached', matching how the other source failures are reported at collect.mjs:61-67. Basis: collect.mjs:61-67
    4. Is the issue exact enough to run unattended given its status: needs-decision label and its two priority labels?
      RECOMMENDED: Yes once the approach and cap above are confirmed. Remove the conflicting priority label (priority: low and priority: medium both appear), and add a task-list of acceptance items. Proposed items: a test in collect.test.mjs where page 1 holds 100 fork runs and page 2 holds a failing main run, and the main run is returned; a test that the read makes at most the capped number of requests; and the existing fork-skip test still passes. Basis: judgment

    Sources read

    • /home/runner/work/_temp/refine-data/context.json: issue 8534 has no decision recorded, no comments, and no duplicate or fixed-by candidate
    • /home/runner/work/claude-code-plugins/claude-code-plugins/.base/.github/scripts/maintenance-monitor-signals/collect.mjs:100: failed runs are read as one page with status=failure and per_page=100, with no page parameter
    • /home/runner/work/claude-code-plugins/claude-code-plugins/.base/.github/scripts/maintenance-monitor-signals/collect.mjs:102: the filter for fork head (ownHead), skipped events and paths, and window runs the filter only after the page is fetched
    • /home/runner/work/claude-code-plugins/claude-code-plugins/.base/.github/scripts/maintenance-monitor-signals/collect.mjs:223: the comments read already pages with &page=, so a paging pattern exists in the file
    • /home/runner/work/claude-code-plugins/claude-code-plugins/.base/.github/scripts/maintenance-monitor-signals/collect.test.mjs:289: the existing test for skipping fork-head failed runs, which would need a paging counterpart

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  7. removed
    needs-owner-decision
    on Oct 26, 2026
  8. kyle-sexton commented on Oct 26, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. The owner answered in the Refinement and Issue Triage sessions (2026-10-25), deciding the open items below on the facts:

    go with whatever the facts/data/metrics + /discovery:research says and ensure we're aligned with SOLID, DRY/SSOT principles

    I should only ever be in the loop ONLY when necessary (intent/vision changed, something came up during implementation that impacts trajectory/alignment, OR a high security risk) - I've covered this all before

    No owner ledger (.work/*/interview-checklist.md, .work/gh-monitor-owner-decisions/) names this issue. This answers the four questions in the refinement (#8534 (comment)).

    Not fixed on main. The failed-runs read in .github/scripts/maintenance-monitor-signals/collect.mjs:100 fetches one page (status=failure&...&per_page=100, no page). It drops skipped events, skipped paths and fork heads only after the fetch (:102), and keeps at most LIMITS.failedRuns (12, :11).

    1. Page with a cap, or query per trusted event?
      Decided: Page with a cap. The read keeps every event except pull_request and merge_group (SKIP_FAILED_EVENTS, :21, applied at :102). The fork-skip test feeds workflow_run and issue_comment runs (collect.test.mjs:295-296). A query per push, schedule and workflow_dispatch would drop the kept events. The same file already pages one read: "lane stops" loops page up to LIMITS.commentPages (:219-237).
    2. Which cap, and where?
      Decided: A LIMITS entry for failed-run pages, set to 5 to match commentPages: 5 (:16). The body asks for "a stated page cap". Paging stops early when a page returns fewer than 100 runs, when it reaches runs created before the read's created range, or once LIMITS.failedRuns runs are kept. Every request goes through get, which "spends the run's call budget" (:4).
    3. Record a gap at the cap?
      Decided: Yes, the way "lane stops" does (:237). It uses the existing gaps channel (:1-4, :61-67), so no new report is added.
    4. Labels?
      Decided: The fetched data shows one priority label, priority: medium, so there is nothing to clean up.

    Acceptance criteria:

    • A test in collect.test.mjs serves 100 failing fork-head runs on page 1 and a failing own-repo run on page 2, and asserts the own-repo run is in data.failedRuns.
    • A test asserts the failed-runs read makes no more page requests than the stated LIMITS cap, and that hitting the cap with full pages pushes a failed runs entry to gaps.
    • The existing tests "failed runs from a fork head are skipped" and "a failed source is a gap; the rest still read" still pass.
  9. added
    status: ready
    agent-ready
    and removed on Oct 26, 2026
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

    agent-readystatus: ready

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions