Skip to content

ci: watchdog retires a stale merge-ready conflict status - #10219

Merged
EffortlessSteven merged 6 commits into
mainfrom
claude/watchdog-retire-stale-10136
Oct 25, 2026
Merged

EffortlessSteven merged 6 commits into
mainfrom
claude/watchdog-retire-stale-10136

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Summary

  • Leftover 2 from ci: labeled PRs that conflict before or after the merge-ready label stay silent #10136. A failing merge-ready conflict status posted by this repository's actions bot stayed red on a head after the author removed merge-ready or converted the PR to a draft, because the sweep only looked at labeled, non-draft PRs. For a same-repo draft or unlabeled PR whose head still carries that bot failure, the sweep now posts a success status ("merge-ready is not requested on this PR").
  • Only the actions bot's latest failure on that exact context is retired; forks, other creators, other contexts and already-cleared heads are untouched. Cost is one statuses read per open same-repo draft or unlabeled PR per sweep.
  • Tests (two new), docs/CI.md, run-block budget, changelog fragment. Will be rebased onto main (merge) after ci: watchdog tells a head pushed after the label to re-apply merge-ready #10209, which edits the same workflow.

Source-of-truth Links

Governing issue or accepted claim: #10136 (leftover, follow-up requested in the project thread)
Acceptance delta (one sentence): a removed label or draft conversion no longer leaves a stale failing merge-ready conflict status.

Proof

10 watchdog tests and cargo xtask precommit pass locally on this head before the merge with main. Live check after merge: dispatch the watchdog and read a head's statuses.


Generated by Claude Code

…el is removed or the PR is a draft (#10136)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M1HLQzDSYhzcGBd9baf3RV
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 170 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 8719bde5-0fe1-4d12-a3e3-a9a18f66cf59
Commits

Reviewing files that changed from the base of the PR and between 2d1d629 and c771cb9.

Files selected for processing: 5
  • .github/workflows/pr-staleness-watchdog.yml
  • changelog.d/10136-watchdog-retires-stale-status.md
  • docs/CI.md
  • policy/workflow_allowlist.txt
  • xtask/tests/pr_staleness_watchdog_conflicts.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Member Author

Independent exact-head review: REPAIR_REQUIRED for 170b407edc1e7108c7762ee4a776b253714064f9.

[P2] Revalidate the PR's current request state before retiring its conflict failure — .github/workflows/pr-staleness-watchdog.yml:143–160.
retire_stale trusts draft/label fields captured by the initial open-PR list and never rereads the PR. Between that snapshot and retirement, the same head can become non-draft and receive merge-ready again; the label-time notice can then post a fresh bot merge-ready conflict failure for its real conflict. Retirement sees that latest failure and overwrites it with success, claiming “merge-ready is not requested,” although it now is. The notice and watchdog use different concurrency groups, so sweep serialization does not prevent this interleaving.

Observed isolated mock: initial list is same-repo/unlabeled, current PR fixture is same head/non-draft/labeled/dirty, statuses returns the bot conflict failure. Expected zero success writes; observed one success write, with no pulls/<number> reread. Regression assertion exited 101. Fix direction: revalidate current head/repository and draft/label admission immediately before retirement; skip if admission was renewed or identity moved, and retain this negative case. Preserve uncertainty around changes after any final read rather than claiming atomicity. Confidence: high.

Passed, directly observed

  • All 10 submitted watchdog tests on this exact head.
  • Added isolated wrong-context case: no writes.
  • Added isolated clean labeled head with active request: summary stays “in flight”; only the auxiliary conflict status clears; no comment, cancellation, dispatch, label mutation, or required-result status write.
  • Source confirms exact same-repo guard and exact context plus github-actions[bot] filter; newest matching returned bot status decides. Existing tests cover foreign creator/fork/newer bot success and static labeled dirty heads.

Binding and limits

  • Observed base 2d93df787c4f63120c1a9e34b0b48ba584c37f2d, tree a255ff0f9f98b21ca2cbcbaa64fd952feb9e0864.
  • Head 170b407edc1e7108c7762ee4a776b253714064f9, tree e130c28e6887c27dcc98a9d14e319c307e02b26c, parent bb475e9fa13174da53f910fcb1cb525ce128efcb; re-read unchanged before publication.
  • Test-only experimental tree 8b58b839e2f43b3018ddfa457d692799f91f0e09; patch SHA-256 154bf349f5b8e8761ccf98991bbe57c8b7971fd5ffdd993f1b678141ed42ed5e. Production workflow unchanged; experimental test edits restored, checkout clean.
  • Rust 1.95.0 installed under /workspace/.rustup/toolchains/1.95.0-x86_64-unknown-linux-gnu/bin; dependency-free harness compiled directly using rustc --edition 2024 --test and CARGO_MANIFEST_DIR=<review checkout>/xtask; real Bash/jq execute the shipped run block.
  • Inspected all five changed files and the label-time conflict writer. PR-body precommit is reported, not independently rerun. Full status history beyond the first 100 entries, live event behavior, hosted qualification, and final integration clearance remain unverified. No live status/label writes or dispatch experiments.

Ownership and dependency order
Canonical writer remains the Claude author lane, EffortlessSteven, claude/watchdog-retire-stale-10136. Current reads returned no requested reviewers, submitted reviews or inline threads; visible provider receipts are quota failures, not clean reviews. No duplicate same-slice technical review was visible.

This head does not contain #10209: these are sibling changes to the same workflow, with intended order #10209 then #10219, as the PR body states. Reuse the delayed-active-run counterexample as a composition discriminator rather than rerunning the old proof. Current read found #10209 has advanced from reviewed b187d545 to f445f8adbb3a6d7ec6acef8c435b84ec5e59ba36; this review does not assert the old finding persists or is repaired on that new head.

Owner's next action: repair #10219's stale-admission retirement in this candidate; obtain the separate current-head disposition for #10209; then reconcile/rebase #10219 after the accepted prerequisite and review the resulting combined tree against both race cases. No composed-tree or merge clearance is claimed.

The list snapshot can be stale: re-read the PR and retire only while the same head still makes no merge-ready request.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M1HLQzDSYhzcGBd9baf3RV

Copy link
Copy Markdown
Member Author

Repaired the P2 in 056b946. retire_stale now re-reads pulls/<n> immediately before writing the success status and retires only if the head SHA is unchanged, the head repo is this repository, and the PR is still a draft or carries no merge-ready label. A renewed request (relabeled, marked ready) or a moved head leaves the failure in place. New test a_request_renewed_since_the_list_call_keeps_its_conflict_failure covers relabel, ready, and moved head; removing the guard makes it fail. As you noted, a change after the final read is not excluded (no atomicity claimed). Workflow budget raised 110 to 115 for the added lines. This head still does not contain #10209; I'll merge main after it lands.


Generated by Claude Code

graphite-app[bot]

This comment was marked as resolved.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M1HLQzDSYhzcGBd9baf3RV
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M1HLQzDSYhzcGBd9baf3RV
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 25, 2026 10:28
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven EffortlessSteven self-assigned this Oct 25, 2026

Copy link
Copy Markdown
Member Author

Review of record, head 1c42116 (main 2d1d629 merged in; #10209 has landed).

Angles: (1) correctness of retirement (only the actions bot's newest merge-ready conflict failure on a same-repo draft or unlabeled PR is retired); (2) security shape (still no checkout, no dispatch, one fixed status context, statuses: write only for this path); (3) race review: retirement re-reads the PR and skips if the head moved, the repository differs, or the PR is a ready, labeled request again; (4) tests: 16 watchdog tests against a fake gh and real jq including the three retire cases and the renewed, relabeled and moved-head negatives, each with a sabotage run; (5) docs and policy parity after composing with #10209 (CI.md paragraph, allowlist budget 155, changelog fragment).

Findings and resolutions: Steven's P2 (stale snapshot could overwrite a fresh failure with success) is repaired in 056b946 with the re-read guard and a regression test; Graphite's split CI.md sentence is repaired and its thread resolved; the merge with #10209 kept both behaviors and the audit-row outcome handling from #10209. A change between the final re-read and the status write is not excluded; no atomicity is claimed. Bot output from Gemini, CodeRabbit and the github-actions advisory was quota or advisory only and is not counted as review.

Proof: cargo xtask precommit green on this head (local), no unresolved threads. Required hosted check is requested next; the composition with #10209 (the delayed-active-run case) is covered by the shared test file.


Generated by Claude Code

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 potential issues.

Devin Review

Comment thread docs/CI.md Resolved
…ict status (#10136)

Lookup errors in retire_stale now report 'retire failed' instead of reading as no failure; a failure on a head shared with a merge-ready PR is kept. Clarifies the CI.md skip wording.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M1HLQzDSYhzcGBd9baf3RV

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs verification checks before upstream.

Verification questions

  • Confirm the new shared-head guard depends on the initial open-PR list being complete; pagination or filtering gaps could permit retirement despite another request on the same SHA.
  • Confirm the shared-head guard depends on the initial PR list being complete and on its draft/label fields being current, so a concurrently added labeled PR using the same SHA may not be visible before retirement.

Refuted

  • The retirement helper needs to be generalized into a shared policy module before this focused fix.; refuted because: Only one workflow consumes the helper, the behavior is deliberately narrow, and extracting policy across workflows would enlarge the change and introduce broader coupling without reducing the current defect's scope.

Parked follow-ups

  • A renewed merge-ready request after the final PR read can still be overwritten by the retirement POST; the next sweep restores the failure.
  • The workflow-specific helper remains embedded in the scheduled step rather than a shared script, keeping the change local but duplicating status-policy knowledge already held by the label-time notice workflow.

Evidence gaps

  • The changed workflow behavior is not fully proven in the available packet because cargo-test is late and ripr failed.

Copy link
Copy Markdown
Member Author

Review of record update, head c771cb9 (supersedes the 1c42116 record for the changed behavior).

Changed since the earlier record: retire_stale now fails closed when the status lookup or the live PR read errors ("retire failed", no write), and keeps the failure when another open, non-draft, merge-ready PR shares the head SHA (checked in both scan orders). CI.md wording clarified. Each guard has a test that fails when the guard is removed (18 watchdog tests). Devin's relabel-between-read-and-write finding is accepted as the documented bounded limit: the next sweep restores the failure.

Proof on this exact head: Ripr Rust Small Result, Rust gates, Admit PR Candidate and workflow policy all green; cargo xtask precommit green locally; 0 unresolved review threads. Bot reviews (Gemini quota, CodeRabbit rate limit, github-actions advisory) are not counted as review. Not established until the post-merge dispatch: live event behavior.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven merged commit f4bf86f into main Oct 25, 2026
54 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/watchdog-retire-stale-10136 branch October 25, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants