Skip to content

fix(source-control): keep the PR monitor's check baseline when a check read fails #7986

Closed

Description

@kyle-sexton

Refs: #6877

Agent Brief

Type: Bug
Summary: A failed check read in the PR monitor poll must not reset the baseline, so finished checks are never emitted twice.

Current behavior:
The Monitor poll script reads checks with errors discarded, so a failed read yields an empty check list. The script then stores that empty list as the baseline, and the next good poll emits every finished check again. The first-poll guard counts polls, not successful reads, so a failed first read makes the second poll emit every check that had already finished before the watch started.

Desired behavior:

  • A poll whose check read fails (any call in the read errors) leaves the stored baseline unchanged and emits no check lines.
  • The baseline-only poll is the first poll whose check read succeeds. A re-arm still emits nothing for checks finished before the watch started.
  • A check that finishes after the baseline is emitted exactly once, whether or not failed reads came between.
  • Rate-limit handling, comment watermarks and the review-thread read are unchanged.
  • The poll contract in the pull-request monitor guidance says the baseline is recorded on the first successful check read.

Key interfaces:

  • Monitor poll script contract (name: bucket lines; first poll records only).

Acceptance criteria:

  • A new test file, run with scripts/run-test-file.sh, drives the poll script with a stub gh: first check read fails, second returns two completed checks, third adds one more, then the PR reports merged. The test asserts no line for the first two checks and exactly one line for the third.
  • The same test covers a failed read between two good polls and asserts no check is emitted twice.
  • scripts/check-changelog-fragments.sh passes.

Out of scope:

  • The Monitor timeout_ms cap in -p runs (a separate item).
  • Comment and review-thread polling.
  • The cloud-session fallback poll.

This was generated by AI during backlog shaping. Split from #6877; the owner approved filing it in an attended backlog-shaping session on 2026-10-18.

Activity

  1. added
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.
    on Oct 18, 2026
  2. added theissue type on Oct 18, 2026
  3. added
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    and removed
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Oct 18, 2026
  4. added
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Oct 18, 2026
  5. melodic-automation-lanes commented on Oct 18, 2026

    @melodic-automation-lanes
    Contributor

    The lanes App's pull request #8150 links this issue with Refs:, not Closes, so the merge lane never merges it. report-outcome added needs-human so a person merges or closes it. When it merges, work-unblock removes this needs-human and agent-ready and adds needs-triage, so triage decides what work is left. To keep the issue held after the merge, add needs-owner-decision.

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

    @melodic-automation-lanes
    Contributor

    The lanes App's pull request #8150 merged with Refs:, so this issue stays open and nothing starts the lane on it again. work-unblock added needs-triage and removed agent-ready, so triage decides what work is left.

  7. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    and removed
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    on Oct 18, 2026
  8. kyle-sexton commented on Oct 19, 2026

    @kyle-sexton
    MemberAuthor

    Done by #8150; every criterion verified on main.

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

    needs-triageNot yet classified. Floor until a type and one priority tier are set.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions