Skip to content

fix(source-control): let adopted owner PRs request a whole review #9137

Description

@kyle-sexton

Summary

This is S&C finding L4 on #8999, a liveness issue deferred so #8999 could merge. The whole-review request (babysit_whole_review.py, wired through details["wholeReviewWanted"] in babysit_merge.py) never fires for an adopted owner PR. Such a PR held only by findings that a clean whole review would close therefore waits for a person instead of getting its one draft-to-ready toggle.

Likely mechanism, UNVERIFIED: the toggle converts the PR to a draft and marks it ready again. That refreshes updatedAt, and a draft is not adoptable, so the PR then refuses not-adopted:* for another adoption.idle-hours (default 24). The lane_queued_at_head exemption covers only the lane's queued entry. The PR also never reaches wanted() with reason is None. Confirm the actual cause before fixing it.

Fix

Make adopted owner PRs eligible for the whole-review request with the same bounds as lane PRs (once per head, MAX_TOGGLES, one per sweep, rate-limit share). A toggle the lane recorded (RECORD_RE line at the current head) must not reset the idle clock, in the same way the pin comment's refresh is exempted.

Verification

A test with an adopted owner PR whose only holds are findings with whole_review_clears gets wholeReviewWanted: true. After the recorded toggle, the next assessment still treats the PR as adopted.

Related

Refs #8999

Activity

  1. added theissue type on Oct 22, 2026
  2. github-actions commented on Oct 22, 2026

    @github-actions
    Contributor

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

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

    Understood: adopted owner PRs never get the whole-review request (the draft-to-ready toggle) in the source-control babysit flow. The likely cause is that the toggle refreshes updatedAt, which resets the adoption idle clock. The issue marks this cause as unverified. The fix is to make adopted PRs eligible with the same bounds as lane PRs, and to exempt a recorded toggle from the idle clock. Nothing is missing. The first step is to confirm the actual mechanism, which reading the code and a test should settle. No likely duplicates found among the open issues; #8999 is the parent.

    Automated triage, applied by the lanes App.

  3. added
    needs-human
    on Oct 22, 2026
  4. changed the issue type fromtoon Oct 22, 2026
  5. removed
    needs-human
    on Oct 25, 2026
  6. kyle-sexton commented on Oct 25, 2026

    @kyle-sexton
    MemberAuthor

    Released for re-triage under the owner's 2026-10-24 rule: an issue stops for a person only for an intent or vision question, a security call, a host or attended run, or spend outside prepaid credit. The hold label came off and intake triage runs again now; it re-applies a hold, with a numbered question, when one of those applies.

    To hold this issue again, add needs-human (or status: needs-decision) and say why in a comment.

  7. added
    needs-triage
    and removed
    needs-triage
    on Oct 25, 2026
  8. added
    status: ready
    needs-owner-decision
    and removed
    status: ready
    on Oct 25, 2026
  9. melodic-automation-lanes commented on Oct 25, 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).

  10. melodic-automation-lanes commented on Oct 25, 2026

    @melodic-automation-lanes
    Contributor

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

  11. melodic-automation-lanes commented on Oct 25, 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: An adopted owner PR held only by findings a clean whole review would close gets wholeReviewWanted true and its one bounded draft-to-ready toggle, and the lane's recorded toggle at the current head does not reset the adoption idle clock.

    Acceptance criteria

    • In babysit_merge.py _whole_review_record (around line 4032-4037), the author-equals-agent-identity condition no longer blocks an adopted owner PR; an adopted owner PR with wholeReviewWanted true and no record at the head gets {"toggle": True}.
    • The request keeps the same bounds for adopted PRs: once per head (whole_review.recorded), fewer than MAX_TOGGLES in record lines and timeline conversions, no RISK_ESCALATION_LINE, whole_review.limits(repo) rate-limit share, and one per sweep.
    • Fork, dependency-manager and non-adopted PRs (policy.reason not None) still never get a toggle.
    • adoption_refusal in babysit_merge_policy.py (around line 2541) treats a RECORD_RE toggle line at the current head, recorded by the lane, as not resetting updated_at idleness, like the pin comment's exemption; the head-committed idleness check is unchanged.
    • The draft state the toggle causes is not refused as 'draft' by adoption in the next assessment when the lane's record line at the current head exists, so the PR is still assessed as adopted.
    • A new test in tests/test_babysit_merge_unattended.py: an adopted owner PR whose only holds are findings with whole_review_clears gets details["wholeReviewWanted"] true and a toggle request.
    • A new test in tests/test_babysit_merge_policy.py: after the recorded toggle at the current head, the next assessment still treats the PR as adopted (no updated-fresh or draft refusal), while a toggle line at a different head, or one not by the lane, does not exempt it.
    • Existing tests for the lane PR whole-review path and the toggle cap still pass, and the docstrings of _whole_review_record and adoption_refusal describe the new behavior.
    • The actual cause is confirmed in the PR description (the author gate at babysit_merge.py:4034 versus the idle-clock mechanism the issue guessed).

    Dependencies

    • #​9136 (measure owner PR idleness from trusted activity only) touches the same adoption idle clock; sequence or rebase against it, not a hard block.

    Related work

    Sources read

    • plugins/source-control/skills/babysit-prs/scripts/babysit_merge.py:3252: wholeReviewWanted is set from whole_review.wanted(policy.reason, risk, lanes), so it needs policy.reason None.
    • plugins/source-control/skills/babysit-prs/scripts/babysit_merge.py:4032-4037: the toggle is skipped unless the PR author equals the agent identity, which excludes adopted owner PRs.
    • plugins/source-control/skills/babysit-prs/scripts/babysit_merge.py:4038-4050: toggle bounds (MAX_TOGGLES, timeline count, limits).
    • plugins/source-control/skills/babysit-prs/scripts/babysit_merge_policy.py:2515-2545: adoption_refusal refuses drafts and a fresh updated_at except while queued_at_head().
    • plugins/source-control/skills/babysit-prs/scripts/babysit_merge_policy.py:2558: lane_queued_at_head covers only the queued entry and pin comment.
    • plugins/source-control/skills/babysit-prs/scripts/babysit_whole_review.py:105-125: wanted() logic and RECORD_RE at line 46.

    Automated refinement by the lanes App. Admission counts only criteria a listed human wrote: to confirm these, post them as your own comment whose first line is **Decision recorded.**, which sends the issue back through intake.

  12. changed the issue type fromtoon Oct 25, 2026
  13. removed
    needs-owner-decision
    on Oct 25, 2026
  14. kyle-sexton commented on Oct 25, 2026

    @kyle-sexton
    MemberAuthor

    Released for re-triage under the owner's 2026-10-24 rule: an issue stops for a person only for an intent or vision question, a security call, a host or attended run, or spend outside prepaid credit. The hold label came off and intake triage runs again now; it re-applies a hold, with a numbered question, when one of those applies.

    To hold this issue again, add needs-human (or status: needs-decision) and say why in a comment.

  15. github-actions commented on Oct 26, 2026

    @github-actions
    Contributor

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

  16. added
    status: ready
    agent-ready
    needs-human
    and removed
    agent-ready
    on Oct 26, 2026
  17. melodic-automation-lanes commented on Oct 26, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue lane stopped partway through this issue and needs a person.

    Why, in the run's own words:

    The run reported done, but apply-issue-patch did not commit its patch (patch-protected-path): the patch changes a path the issue lane may not push: a workflow, a CODEOWNERS file, submodule config or a settings file. The run's log names the path or check.

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

    To retry, remove needs-human and add agent-ready again.

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-humanstatus: ready

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions