Skip to content

Mirror agent lane claims to an agent-claimed GitHub label (#210) - #220

Merged
justin808 merged 7 commits into
mainfrom
jg/210-agent-claimed-label
Jul 22, 2026
Merged

Mirror agent lane claims to an agent-claimed GitHub label (#210)#220
justin808 merged 7 commits into
mainfrom
jg/210-agent-claimed-label

Conversation

@justin808

@justin808 justin808 commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

Completes the assignment-aware series (#208 selection, #209 human sweep) by making agent ownership visible and symmetric. An active lane claim is mirrored to a visible agent-claimed GitHub label so humans and other agents can see that a lane is working an issue/PR — owned means skip for agents just as for humans.

Behavior (documented in workflows/pr-processing.md Coordination State + skills/pr-batch/SKILL.md)

skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb locks these invariants (registered in bin/validate).

Acceptance criteria (issue #210)

Closes #210. Completes the symmetry with #208 and #209.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Documented the visible agent-claimed label for active agent work on GitHub issues and pull requests, including default behavior and symmetry with human reservations.
    • Clarified label mirroring is a visible hint (not the durable claim source) and that backend heartbeats/TTL are the source of truth.
    • Added end-to-end guidance for applying/removing the label on claim/release, skipping mirroring when coordination_backend is n/a, and handling stale labels after interruptions.
  • Tests
    • Added a contract test to validate label-mirroring semantics across workflow and skill prompts.

Mirror an active lane claim on the claimed issue/PR with a visible agent-claimed
label: apply after a successful agent-coord claim, remove on release, and let the
coordination daemon reconcile labels for claims that expire without a clean
release. Like codex-wip, it is a visible hint, not the durable lock — the backend
claim and heartbeat TTL remain the source of truth (a stale label after a restart
is expected until the daemon reconciles). Skip label mirroring when
coordination_backend is n/a. State the symmetric owned-means-skip decay rule once:
a human assignee or an agent-claimed label both mean skip; humans decay via the
stale-assignment sweep, agents via heartbeat TTL, and the sweep skips
agent-claimed items.

Contract test locks the invariants; registered in bin/validate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@justin808, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

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).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e3745bed-1e74-47e0-b1b9-9ceae1d3cf6e

📥 Commits

Reviewing files that changed from the base of the PR and between 83201f4 and fa7bed5.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • skills/address-review/SKILL.md
  • skills/pr-batch/SKILL.md
  • skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb
  • workflows/address-review.md
  • workflows/pr-processing.md

Walkthrough

The PR documents mirroring active agent claims to GitHub with a configurable agent-claimed label, defines ownership and decay rules, updates selection and review guidance, and adds a contract test invoked by validation.

Changes

Agent claim label mirroring

Layer / File(s) Summary
Workflow coordination rules
.agents/agent-workflow.yml, workflows/pr-processing.md, workflows/address-review.md, docs/coordination-backend.md
Defines configurable label mirroring, claim and release behavior, backend TTL reconciliation, cancellation cleanup, and symmetric ownership semantics.
Selection and triage reservation rules
docs/issue-evaluation.md, docs/pr-batch-skills.md, skills/plan-issue-triage/SKILL.md, skills/plan-pr-batch/SKILL.md, skills/triage/SKILL.md, skills/pr-batch/SKILL.md, skills/address-review/SKILL.md
Treats items carrying the seam-configured claim label as reserved and skips them during planning, triage, batch selection, and review flows.
Contract validation and release notes
skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb, bin/validate, CHANGELOG.md
Adds documentation contract assertions, runs them in helper validation, and records the new behavior in the changelog.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • #221: The claim-label configuration and reservation behavior overlap with ensuring stale-assignment handling uses the seam-configured label.

Suggested reviewers: ihabadham

Sequence Diagram(s)

sequenceDiagram
  participant AgentLane
  participant CoordinationBackend
  participant GitHubIssuePR
  participant ReconciliationDaemon
  AgentLane->>CoordinationBackend: Claim issue or PR lane
  CoordinationBackend->>GitHubIssuePR: Apply configured agent claim label
  AgentLane->>CoordinationBackend: Release or cancel claim
  CoordinationBackend->>GitHubIssuePR: Remove claim label
  ReconciliationDaemon->>GitHubIssuePR: Remove label after heartbeat TTL expiry
Loading
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive Most claim-mirroring and skip behavior is covered, but the summary doesn't clearly show target-repo label creation during setup. Add or confirm the setup step that creates the agent-claimed label in target repos, and ensure the sweep uses the same config value.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately describes the main change: mirroring agent lane claims to an agent-claimed GitHub label.
Out of Scope Changes check ✅ Passed All changes relate to claim-label mirroring, skipping logic, docs, and validation for the linked issue.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jg/210-agent-claimed-label

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Comment thread workflows/pr-processing.md Outdated
Comment thread workflows/pr-processing.md Outdated
@claude

claude Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review

Overview: Docs-and-test-only PR that closes out #210 — mirrors coordination-backend lane claims to a visible agent-claimed GitHub label (apply on claim, remove on release, daemon-reconciled on expiry), states the symmetric owned-means-skip decay rule once, and locks the invariants with a new contract test (skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb), wired into bin/validate. No runtime/CLI code changes — this repo's workflows/*.md / skills/*/SKILL.md files are the actual behavior spec consumed by agents, and contract tests assert exact (whitespace-normalized) substrings exist in them, which is the established pattern here (matches assignee-exclusion-contract-test.rb etc.).

Verified:

  • The PR's claim that "the sweep (Add a stale-assignment sweep: warn-then-release ownership decay for human-assigned work #209) already skips agent-claimed items" checks out — stale-assignment-sweep already has AGENT_CLAIMED_LABEL handling and tests for it; this PR only documents/asserts the existing behavior, doesn't reimplement it.
  • All five text fragments the new contract test asserts against workflows/pr-processing.md and skills/pr-batch/SKILL.md are present verbatim (checked by hand against the diff).
  • CHANGELOG.md entry and bin/validate wiring follow the existing style/placement conventions in this file.

Findings (posted inline):

  1. (Moderate — drift risk) The apply/remove/daemon-backstop rule for agent-claimed is stated in full at workflows/pr-processing.md:1183-1192 (test-locked) and restated at :1243-1246, which adds an ad-hoc-lane carve-out that exists only in the second location and isn't covered by the contract test. Two copies of the same behavioral rule with asymmetric detail is exactly the kind of drift this repo's contract-test pattern exists to prevent — worth consolidating or extending the test to cover both.
  2. (Nit) "Create the agent-claimed label in target repos as part of coordination setup" references a "coordination setup" process that isn't defined anywhere in the repo. Same gap already exists for codex-ready/codex-wip, so not new, but flagging since none of the three labels have an actionable creation step.

Security/performance: N/A — no executable logic changed, only prose the agent reads and a Ruby test that does string containment checks against local files.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 97a664ef4c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread workflows/pr-processing.md
Comment thread workflows/pr-processing.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/pr-batch/SKILL.md`:
- Line 467: Update skills/pr-batch/SKILL.md at lines 467-467 to document
target-repository agent-claimed label creation during setup and daemon removal
after an unclean claim expires, while preserving backend n/a skipping and the
stated ownership semantics. Update
skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb at lines 28-38 to
assert the complete mirrored rule set: setup, expiry cleanup, backend n/a
skipping, symmetric human/agent decay, and stale-assignment sweep behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 01b94253-d601-4863-b6b5-115e7c06955a

📥 Commits

Reviewing files that changed from the base of the PR and between 7eb2641 and 97a664e.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • bin/validate
  • skills/pr-batch/SKILL.md
  • skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb
  • workflows/pr-processing.md

Comment thread skills/pr-batch/SKILL.md Outdated
… selection

Round 1 review (validate + claude + codex P2):
- Fix validate: the agent-claimed rule no longer bloats the size-limited Codex
  goal-prompt template — it lives canonically in pr-processing.md, with a brief
  reference in the SKILL.md Coordination State prose.
- Route the claim label through a seam (`agent_claimed_label`, default
  `agent-claimed`) instead of hardcoding a mandatory label in a portable pack.
- Selection and triage (plan-pr-batch, triage, plan-issue-triage) now skip
  `agent-claimed` items, so the mirrored label is actually respected as an
  ownership marker — closing the owned-means-skip symmetry.
- Drop the duplicated claim-step rule (now a pointer to the label-mirror rule);
  soften the label-creation reference to a repo-adopted `gh label create` like
  codex-ready/codex-wip.
- Contract test updated: seam-configurable label, selection skips agent-claimed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c09dc667a3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/plan-pr-batch/SKILL.md Outdated
Comment thread skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb
Comment thread workflows/pr-processing.md
@claude

claude Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review: Mirror agent lane claims to an agent-claimed label (#220)

This is a docs/spec-only change (this repo's own coordination_backend: n/a, so nothing here actually runs the mirroring logic itself — it specifies the contract that consumer repos and their agent-coord backend/daemon must implement). It follows the repo's existing "prose contract + Ruby substring test" pattern well.

What it does

  • Adds the agent_claimed_label seam value (default agent-claimed).
  • Documents apply-on-claim / remove-on-release / daemon-backstop-on-expiry semantics in workflows/pr-processing.md, with the label explicitly stated as a hint, not the lock (backend claim + heartbeat TTL remain authoritative) — consistent with the existing codex-wip treatment.
  • States the symmetric "owned means skip" rule once and points batch selection/triage skills at it.
  • Adds skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb, wired into bin/validate, to lock these invariants via exact-text assertions against the docs — same pattern as assignee-exclusion-contract-test.rb.

Findings (posted inline)

  1. Doc drift risk: docs/pr-batch-skills.md:63 and docs/issue-evaluation.md:96-97 restate the assignee-based selection-skip rule for $plan-pr-batch/$triage/$plan-issue-triage but weren't updated to mention the new agent-claimed skip, and the new contract test doesn't check those doc pages the way the sibling assignee-exclusion-contract-test.rb does for its rule. Given the whole point of these contract tests is to prevent exactly this kind of asymmetry between skills and docs, this looks like a gap worth closing in this PR.
  2. Undefined "coordination daemon": the new label-reconciliation-on-expiry behavior is attributed to "the coordination daemon," but docs/coordination-backend.md (this repo's canonical backend-contract doc) has no daemon concept or label-reconciliation capability listed. A consumer repo implementing the backend contract from that doc alone wouldn't discover this requirement.

Other notes

  • Verified the new Ruby test's substring assertions by hand against the actual diff text (including whitespace-normalization behavior of assert_rule) — they match; I wasn't able to execute the test directly in this sandbox, but the logic checks out.
  • No security or performance concerns — this PR only changes prose/docs, YAML config, and a validation test.

Overall: solid, well-scoped continuation of the #208/#209 series. The two doc-sync gaps above are the only things I'd want addressed before merge.

…ract

Round 2 review (codex P2 + claude + coderabbit):
- Selection and triage now resolve the claim label through the seam
  (`agent_claimed_label`, default `agent-claimed`) instead of a hardcoded name,
  so a renamed consumer label is respected.
- Add the agent-claimed selection skip to docs/pr-batch-skills.md and
  docs/issue-evaluation.md (parity with the assignee rule) and assert it in the
  contract test.
- Document claim-label reconciliation plus the daemon expiry backstop as an
  optional backend capability in docs/coordination-backend.md, giving the daemon
  dependency a canonical home.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@claude

claude Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Summary

This PR extends the assignment-aware selection series (#208, #209) with a symmetric agent-claimed GitHub label that mirrors active agent lane claims. Like the rest of this repo, the "implementation" is the spec text agents follow, backed by a contract test (agent-claimed-mirror-contract-test.rb) that asserts specific rule strings exist across the relevant docs/skills files.

Verified: I checked every string constant in the new contract test against the diff text (after whitespace normalization) — all match, and .agents/agent-workflow.yml, bin/validate, and the CHANGELOG entry are wired up consistently with the existing conventions (e.g. the assignee-exclusion contract test this one is modeled on).

Findings

  1. "Remove on release" isn't wired into the actual release call sites (workflows/pr-processing.md). The new Coordination State bullet states the policy — apply on claim / remove on release / daemon backstop — as a general rule, but the two concrete places that actually invoke agent-coord release (the Worker drain rule, ~line 1774, and the Hard escape hatch step 3, ~line 1790) were not updated to mention removing the agent-claimed label. As written, an agent following those procedural steps literally would release the claim but leave the label in place, relying entirely on the daemon backstop — which is presented in the PR/CHANGELOG as one of three paths, not the only one. Consider threading the label removal into those two call sites the same way "apply" was threaded into the concrete claim step (~line 1242-1244), for symmetry.

  2. Output/report format specs weren't updated for the new reservation category. skills/triage/SKILL.md:292 and skills/plan-issue-triage/SKILL.md:50,95 still say Reserved (human-assigned) items, each with its assignee name in their required-output sections, even though those same files now also reserve items via the agent-claimed label (which has no assignee). An agent producing the report has no guidance on how to represent an agent-claimed reserved item in that field — omit it, invent a placeholder, or relabel the bucket. Worth a small tweak to those output specs (e.g. "assignee name or agent-claimed") for consistency with the new skip rule added just above them.

Both are documentation-completeness gaps rather than functional bugs (nothing in this repo executes the label mirroring itself), but they weaken the "clean release" and "reserved item visibility" guarantees the PR advertises. No security or performance concerns — this is a docs/skill-spec change with a purely textual contract test.

Comment thread workflows/pr-processing.md Outdated
Comment thread skills/triage/SKILL.md
Comment thread skills/plan-issue-triage/SKILL.md
…in reserved output

Round 3 review (claude):
- Add "remove the mirrored claim label" to the two agent-coord release sites
  (worker drain rule, hard escape hatch step 3) so the remove-on-release policy
  is actually wired into the steps that release the claim.
- Broaden the reserved-output buckets in triage and plan-issue-triage to cover
  agent-claimed items (surfaced by the seam's claim label), not just
  human-assigned items with an assignee name.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@claude

claude Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review: Mirror agent lane claims to an agent-claimed GitHub label (#220)

Overview

This is a docs/skill-text-only change (no application code) that completes the assignment-aware series (#208, #209) by documenting a symmetric agent-claimed label mirror: applied after a successful agent-coord claim, removed on release, reconciled by the coordination daemon on lease expiry, and skipped by both batch selection/triage and the stale-assignment sweep. It adds a new seam key (agent_claimed_label), updates workflows/pr-processing.md, skills/pr-batch/SKILL.md, skills/triage/SKILL.md, skills/plan-pr-batch/SKILL.md, skills/plan-issue-triage/SKILL.md, and two docs/*.md files, plus a new contract test wired into bin/validate.

Strengths

  • The new contract test (skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb) verifies the exact invariant phrases exist across all five selection/triage docs plus the canonical pr-processing.md definition — I checked each asserted string against the diff and they all match (including after the test's whitespace-normalization gsub). This closes the loop so the "apply the label" behavior and the "skip labeled items" behavior can't silently drift apart.
  • The "owned means skip" symmetry is stated once in pr-processing.md (per the PR's stated goal) rather than duplicated with different wording per skill file — the per-skill docs just point at the seam label consistently.
  • Consistent with the existing codex-wip precedent already in the file: label is explicitly documented as a hint, not the lock, with the backend claim + heartbeat TTL as source of truth. Matches this repo's established "labels are advisory, backend is authoritative" pattern.
  • agent-claimed as a literal string was already referenced by the Add a stale-assignment sweep: warn-then-release ownership decay for human-assigned work #209 stale-assignment-sweep test fixtures before this PR landed; this PR is consistent with that prior usage rather than introducing a colliding/duplicate convention.

Minor nit

  • In .agents/agent-workflow.yml, every other seam key that's inert under this repo's own coordination_backend: "n/a" is explicitly valued "n/a" (benchmark_labels, merge_ledger, ci_parity_environment, hosted_ci_trigger, ci_change_detector, default_simplify_model). agent_claimed_label, whose mirroring is itself gated on a coordination backend being in use, instead gets the concrete default "agent-claimed". That's not wrong (it usefully documents the default for consumer repos), but it breaks the file's own convention of marking backend-dependent-and-currently-unused keys as "n/a". Consider either aligning it with that convention or adding a one-line comment noting it's a documented default rather than an active value in this repo (similar to the existing coordination_backend comment).

Risks / correctness

  • No functional/runtime risk — this PR only changes markdown instructions and a doc-contract test (this repo has no agent-coord implementation of its own; that's an external per-repo backend), so there's nothing to unit test beyond the string-presence contract, which passes on inspection.
  • No security implications — no secrets, no code execution paths changed.

Overall: small, well-scoped, internally consistent, and the new contract test meaningfully guards the invariant. Nit above is optional polish, not blocking.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 87cfcb81b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/plan-issue-triage/SKILL.md
Comment thread docs/coordination-backend.md
Comment thread workflows/pr-processing.md
…-review mirror

Round 4 review (codex P2 x3):
- Add the agent-claimed skip to plan-issue-triage's emitted prompt template
  (Triage rules), so a generated triage prompt actually reserves claimed items.
- Gate label mirroring on the backend providing claim-label expiry reconciliation
  — without it a crashed claim would leave a stale label that excludes a released
  item indefinitely.
- Mirror/release the claim label in address-review's private-claim loop
  (workflows/address-review.md + skills/address-review), so its PR claims are
  visible to selection/triage too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread workflows/pr-processing.md Outdated
@claude

claude Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review

Docs-only PR (14 files, +146/-11) that closes the assignment-aware series (#208, #209) by mirroring active agent-lane claims to a visible agent-claimed GitHub label. This repo's "code" is the markdown workflow/skill instructions consumed by agents, so the bar here is documentation correctness/consistency plus the accompanying contract test — both look solid.

What the PR does

  • Adds an agent_claimed_label seam key (default agent-claimed) to .agents/agent-workflow.yml.
  • Documents apply-on-claim / remove-on-release / daemon-backstop-on-expiry semantics in workflows/pr-processing.md, with the same "hint not lock" caveat already used for codex-wip, and an explicit "skip mirroring when coordination_backend: n/a" escape hatch — correctly gates on the daemon actually reconciling expiry, avoiding a stale-label-forever failure mode.
  • States the symmetric "owned means skip" rule once (human assignee vs. agent-claimed label, decaying via sweep vs. heartbeat TTL) and threads "skip agent-claimed items" through every selection/triage surface: docs/issue-evaluation.md, docs/pr-batch-skills.md, skills/plan-pr-batch/SKILL.md, skills/plan-issue-triage/SKILL.md, skills/triage/SKILL.md.
  • Adds skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb (registered in bin/validate) that locks the exact wording of these invariants across files via whitespace-normalized substring assertions — consistent with the existing contract-test pattern in this repo (assignee-exclusion-contract-test.rb, etc.).

Verification performed

  • Manually diffed every string constant in the new contract test (SEAM_LABEL, APPLY_REMOVE_DAEMON, HINT_NOT_LOCK, BACKEND_NA_SKIP, OWNED_SYMMETRY, SWEEP_SKIPS_CLAIMED, SELECTION_SKIP) against the actual diff hunks in workflows/pr-processing.md, skills/pr-batch/SKILL.md, .agents/agent-workflow.yml, and all five selection/triage docs — all match after the same gsub(/\s+/, " ") normalization the test applies, so the test should pass against this diff.
  • Checked .agents/agent-workflow.yml — the new agent_claimed_label key isn't in bin/agent-workflow-seam-doctor's REQUIRED_POLICY_KEYS, and that script only checks required keys are present, not that no extra keys exist, so it won't break seam validation.
  • Confirmed "coordination daemon" (referenced as the backstop reconciler) is an existing concept already documented in docs/pr-batch-skills.md:124, not a new undefined term.
  • No security concerns — this only prescribes gh label add/remove semantics for an agent to follow; no new executable surface beyond the doc-consistency test.

Nit (left as inline comment)

  • workflows/pr-processing.md line 1796 runs to ~102 chars vs. the ~78-80 char prose wrap used everywhere else in that paragraph — looks like the appended clause wasn't rewrapped. Purely cosmetic.

Overall: well-scoped, internally consistent, and the new contract test meaningfully guards the invariants the PR body claims. No functional/correctness issues found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 225b030c47

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .agents/agent-workflow.yml
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread .agents/agent-workflow.yml
@claude

claude Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review

Overview

This PR extends the assignment-aware series (#208, #209) by mirroring an active agent lane claim to a visible agent-claimed GitHub label, and updates selection/triage docs so agent-claimed items are treated as reserved (owned means skip) symmetrically with human assignees. It's a purely documentation/spec change (14 files, mostly .md) plus one new Ruby contract test (skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb) that asserts specific literal sentences exist verbatim across the touched docs.

Code quality / consistency

  • The new contract test follows the exact same pattern as the existing assignee-exclusion-contract-test.rb (literal substring checks after whitespace-squashing across pr-batch/SKILL.md, plan-pr-batch/SKILL.md, triage/SKILL.md, plan-issue-triage/SKILL.md, and the two docs/*.md files). I traced each asserted string against the corresponding diff hunk and they all match — the test should pass as written.
  • The rule is stated consistently across all the surfaces that need it (workflows/pr-processing.md as the canonical source, skills/pr-batch/SKILL.md, skills/address-review/SKILL.md, workflows/address-review.md, and the four selection/triage docs), which matches this repo's existing convention of restating shared rules per-surface rather than a single cross-reference.
  • docs/coordination-backend.md: the new "claim-label reconciliation" bullet is two full sentences where the surrounding list items are terse noun phrases ending in semicolons — minor stylistic inconsistency, not a correctness issue.

Potential issue (flagged inline)

The PR introduces agent_claimed_label in .agents/agent-workflow.yml as a configurable seam value (default agent-claimed) and documents it extensively as such throughout. However, skills/pr-batch/bin/stale-assignment-sweep — the one piece of actual executable code that implements "skip agent-claimed items" (referenced by this PR's own acceptance criteria) — hardcodes AGENT_CLAIMED_LABEL = "agent-claimed" rather than reading the seam config. The repo already has a convention for scripts to read .agents/agent-workflow.yml (bin/agent-workflow-seam-doctor's POLICY_CONFIG, bin/push-downstream), so a consumer repo that customizes agent_claimed_label would find the sweep silently never recognizing its custom label — undermining the very symmetry guarantee this PR documents. Left a detailed inline comment on .agents/agent-workflow.yml:10.

Security

No security-relevant surface here — this is instruction/spec text for AI agents plus a doc-consistency test; nothing executes GitHub mutations as part of this diff.

Test coverage

The new contract test meaningfully locks the documented invariants in place (as the existing pattern in this repo does), but — like its sibling tests — it only checks that specific strings exist in prose, not that any runtime behavior is correct. That's consistent with how this repo already tests other "policy" changes, so not a new gap introduced by this PR, but worth being aware of given the finding above: a contract test passing here doesn't guarantee the stale-assignment-sweep binary actually honors a customized agent_claimed_label.

Summary

Solid, well-cross-referenced documentation change that keeps the existing repo conventions. The one substantive gap is the disconnect between the newly-formalized configurable agent_claimed_label seam and the hardcoded label string in the actual sweep script — worth resolving or explicitly scoping out before merge.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/address-review/SKILL.md`:
- Around line 702-705: Update the private-claim release handling in the
address-review workflow to remove the mirrored claim label only when the
released claim’s holder/generation still matches the active claim, using the
same claim-specific cleanup rule as the processing workflow. Preserve label
mirroring, expiry-reconciliation gating, and the coordination_backend: n/a skip
behavior.

In `@skills/pr-batch/SKILL.md`:
- Around line 562-565: Update the backend reconciliation routing summary in
SKILL.md to reference the configurable agent_claimed_label seam key instead of
hardcoding agent-claimed. Preserve the existing claim, release, skip, and
backend-n/a guidance, while deferring the default label value to the canonical
workflow/configuration.

In `@workflows/address-review.md`:
- Around line 552-557: Update the private-claim release and cleanup flow
described in workflows/address-review.md so label removal is conditional on the
exact released claim/target generation still being current; do not remove a
label if a replacement or retry has already reclaimed the target. Apply the same
generation-verified cleanup to rollback handling for every acquired target,
while preserving the existing backend and n/a coordination rules.

In `@workflows/pr-processing.md`:
- Around line 1183-1187: Make mirrored-label cleanup claim-specific: in
workflows/pr-processing.md lines 1183-1187, require confirmed release plus
matching holder/generation before removing the label; at lines 1777-1779, remove
it only after a successful release; at lines 1794-1798, avoid manual clearing
when cancellation or ownership is UNKNOWN; apply the same guarded cleanup to
normal and rollback release paths in workflows/address-review.md lines 702-705.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 20a1a864-18ff-48ef-b646-391413595efe

📥 Commits

Reviewing files that changed from the base of the PR and between 97a664e and 83201f4.

📒 Files selected for processing (13)
  • .agents/agent-workflow.yml
  • CHANGELOG.md
  • docs/coordination-backend.md
  • docs/issue-evaluation.md
  • docs/pr-batch-skills.md
  • skills/address-review/SKILL.md
  • skills/plan-issue-triage/SKILL.md
  • skills/plan-pr-batch/SKILL.md
  • skills/pr-batch/SKILL.md
  • skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb
  • skills/triage/SKILL.md
  • workflows/address-review.md
  • workflows/pr-processing.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb
  • CHANGELOG.md

Comment thread skills/address-review/SKILL.md Outdated
Comment thread skills/pr-batch/SKILL.md Outdated
Comment thread workflows/address-review.md Outdated
Comment thread workflows/pr-processing.md Outdated
#221

Round 6 review (coderabbit Major x3 + claude + minor):
- Make claim-label removal claim-specific: verify this lane is still the claim
  holder (holder/generation check) before removing, so a replacement or retried
  claim that reapplied the label is not cleared. Applied in the canonical rule
  and both address-review references.
- Make the pr-batch SKILL.md routing summary seam-driven (agent_claimed_label).
- Note in the CHANGELOG that the stale-assignment sweep still matches the default
  label literally; wiring it to the agent_claimed_label seam is tracked in #221.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread workflows/address-review.md
Comment thread skills/address-review/SKILL.md
@claude

claude Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review

This PR is entirely documentation/prompt changes (no application logic runs the actual gh label calls — that's delegated to the AI agent following these instructions, consistent with how this repo works elsewhere) plus one new Ruby contract test. Overall this is well-executed and follows the repo's established conventions closely.

What it does

Adds a new seam key agent_claimed_label (default agent-claimed), documents applying it on claim / removing it on release / daemon backstop on expiry, wires selection & triage (plan-pr-batch, triage, plan-issue-triage, and the two docs/*.md restatements) to skip items carrying that label, and locks all of this down with skills/pr-batch/bin/agent-claimed-mirror-contract-test.rb, registered in bin/validate.

Strengths

  • New contract test follows the exact same pattern as the existing assignee-exclusion-contract-test.rb (constants + whitespace-normalized assert_includes across the same five selection/triage sources) — good consistency with repo conventions.
  • Manually cross-checked the literal strings the test asserts against the diff hunks for workflows/pr-processing.md, skills/pr-batch/SKILL.md, .agents/agent-workflow.yml, and all five selection/triage files — they line up.
  • Correctly scopes the label to backends that provide expiry reconciliation, and explicitly skips mirroring under coordination_backend: n/a (this repo's own setting), so the change is a no-op here by design.
  • Nice honesty in the CHANGELOG: it flags that stale-assignment-sweep still matches agent-claimed literally rather than reading the new agent_claimed_label seam, tracked as a followup (stale-assignment-sweep: resolve the claim label from the agent_claimed_label seam (not hardcoded) #221), instead of silently leaving the gap undocumented.
  • No schema/parser reads .agents/agent-workflow.yml programmatically, so adding the new key is safe.

Issue found (posted as inline comments)

workflows/address-review.md and skills/address-review/SKILL.md each add a bullet stating the label is removed "on release," but the actual concrete release action a few lines later (At a stable stop, ... release the claims on normal completion) wasn't updated to mention the label at all. Compare with workflows/pr-processing.md's cancellation-hatch section in this same PR, where the concrete agent-coord release steps were explicitly updated with "removes the mirrored claim label if one was applied." As written, an agent following the address-review release checklist has no direct cue to clean up the label at that step — worth folding the removal instruction into the actual release bullet in both files rather than leaving it only in the earlier, more abstract statement.

Minor style note

The new bullet in workflows/pr-processing.md (lines 1183-1201) bundles quite a few distinct concerns (when to apply, holder/generation check on removal, daemon backstop, hint-not-lock rationale, gating on reconciliation support, skip-on-n/a, one-time label setup) into a single dense bullet. Not a blocker — matches the file's existing dense-bullet style — but splitting it into sub-bullets would improve scannability given how much it's carrying.

No security or performance concerns — this is pure documentation/config with no code path executing label mutations in this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mirror agent lane claims to GitHub with an agent-claimed label

1 participant