Skip to content

infra: Claim bot labels and assigns claimants, expires stale claims - #916

Merged
zackees merged 2 commits into
masterfrom
infra/claim-bot
Oct 15, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/claim-bot

Conversation

@zackees

@zackees zackees commented Oct 15, 2026

Copy link
Copy Markdown
Member

Fixes #909.

RED 282f2db: ci/test_claim_bot.py (30 tests) against a stub; 27 fail with NotImplementedError or the missing workflow.
GREEN 077b89a: tools/claim-bot/claim_bot.py, .github/workflows/claim-bot.yaml and the doc updates; all 30 pass and ./lint and the full ci/ suite (322 tests) are green.

What it does

  • Claiming: comment: adds claimed, assigns the commenter, replies. Refuses when someone else holds a fresh claim or the commenter already holds 2.
  • Releasing … from the claimant: removes the label and assignee.
  • Taking over stale claim from @x: moves the claim only if it is stale.
  • /reassign @y from OWNER/MEMBER/COLLABORATOR: moves any claim.
  • Stale means no claimant comment on the issue and no commit, comment or review on their open linked PR (drafts count) for 48 h, or 8 h on critical issues. The hourly sweep warns 2 h before, then expires the claim. claim-locked issues are skipped.

Security

Runs on issue_comment and schedule only, so master's copy always runs. It sparse-checks out tools/claim-bot from the default branch without persisted credentials and reads the comment from the event file. Token: issues: write, pull-requests: read. Tests assert no pull_request_target, no contents: write and no github.event.comment interpolation.

First run

A dry-run sweep against the live repo: 13 claimed issues, 4 would expire (#520, #516, #448, #143). None of them has an open PR or activity in more than 48 h.

Tiers 1-4 don't apply (no C or Rust code); ci/test_claim_bot.py is the test.

ci/test_claim_bot.py covers claiming, refusals, the two-claim cap,
release, stale takeover (48 h, 8 h on critical issues with an idle draft
PR), maintainer /reassign, claim-locked, the hourly sweep's warning and
expiry, and the workflow's permissions. Fails: the decision functions
raise NotImplementedError and the workflow does not exist yet.
…ixes #909)

Outside contributors cannot add the claimed label, so their claims
(#777, #809, #811, #815, #817) went unlabeled and the grind bot could
duplicate their work; the 48 h expiry was honor-system.

claim-bot.yaml runs tools/claim-bot/claim_bot.py on new issue comments
and hourly with GITHUB_TOKEN (issues: write). State comes from the
visible history: the bot's own comments, or a pre-bot Claiming: comment
on a labeled issue. coordination.md §2-3, the port template and the
obs-worker skill describe the new flow.
@zackees
zackees enabled auto-merge October 15, 2026 22:23
@zackees
zackees added this pull request to the merge queue Oct 15, 2026
@zackees
zackees removed this pull request from the merge queue due to a manual request Oct 15, 2026
@zackees
zackees added this pull request to the merge queue Oct 15, 2026
Merged via the queue into master with commit b1efe39 Oct 15, 2026
23 checks passed
@zackees
zackees deleted the infra/claim-bot branch October 26, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

infra: Claim bot labels and assigns claimants, expires stale claims

1 participant