Skip to content

feat: implement issue #1589 — review-one-pr: metadata-digest re-review path has no atomic claim — concurrent triggers can both launch the cascade - #1603

Merged
don-petry merged 3 commits into
mainfrom
dev-lead/issue-1589-20260831-0411
Aug 31, 2026
Merged

don-petry merged 3 commits into
mainfrom
dev-lead/issue-1589-20260831-0411

Conversation

@don-petry

@don-petry don-petry commented Aug 31, 2026 •

Copy link
Copy Markdown
Collaborator

User description

Closes #1589

Implemented by dev-lead agent. Please review.


CodeAnt-AI Description

Make concurrent metadata re-reviews observable

What Changed

  • Metadata-triggered re-reviews now post a claim marker tied to the PR's commit and current metadata.
  • When another run has already claimed the same re-review, the run records a concurrent-claim-detected outcome while continuing as before.
  • Claims for different commits, metadata, or the current run are ignored.
  • Added coverage for claim detection and the observe-only re-review behavior; claim comments are excluded from maintainer findings.

Impact

✅ Detectable duplicate re-review launches
✅ Clearer concurrent-run diagnostics
✅ No change to metadata re-review execution

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

…w path has no atomic claim — concurrent triggers can both launch the cascade
@don-petry
don-petry requested a review from a team as a code owner August 31, 2026 04:22
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@codeant-ai

codeant-ai Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 5bd73fa Aug 31, 2026 · 04:22 04:24

@codeant-ai

codeant-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 24 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 29182fe3-ffd2-4342-9f83-39a3998f5896

📥 Commits

Reviewing files that changed from the base of the PR and between 45e0ca3 and 8c8b36d.

📒 Files selected for processing (18)
  • .github/workflows/lint.yml
  • interaction-contracts/dev-lead.yml
  • personas/dev-lead/interaction.yml
  • scripts/dev-lead-intent.sh
  • scripts/initiative-driver.sh
  • scripts/lib/hold-gate.sh
  • scripts/lib/hold-release-audit.sh
  • scripts/lib/maintainer-comment-gate.sh
  • scripts/lib/pr-review-claim.sh
  • scripts/needs-human-review-release-audit.sh
  • scripts/review-one-pr.sh
  • tests/dev-lead/fixtures/events/issues_labeled_dev_lead_needs_human_review.json
  • tests/dev-lead/unit/test_intent_hold.bats
  • tests/test_hold_gate.bats
  • tests/test_hold_release_audit.bats
  • tests/test_initiative_driver.bats
  • tests/test_pr_review_claim.bats
  • tests/test_review_one_pr_claim_observe.bats

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.

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Aug 31, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces an observe-only per-PR review-claim primitive to detect and record concurrent same-SHA re-review races. It adds the pr-review-claim.sh library, integrates claim marker posting and detection into review-one-pr.sh, and includes comprehensive unit and integration tests. The review feedback highlights a critical issue where guarding the gh pr view command masks API failures under set -euo pipefail, and suggests improving portability by using POSIX-compliant tail -n 1 instead of tail -1. Additionally, it recommends removing redundant manual cleanup of BATS_TEST_TMPDIR in the test teardown.

Comment thread scripts/review-one-pr.sh Outdated
Comment thread scripts/lib/pr-review-claim.sh Outdated
Comment thread scripts/lib/pr-review-claim.sh Outdated
Comment thread scripts/lib/pr-review-claim.sh Outdated
Comment thread tests/test_review_one_pr_claim_observe.bats
Comment thread scripts/lib/maintainer-comment-gate.sh Outdated
@codeant-ai

codeant-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. The comment read can lag the claim write, so concurrent runs may both miss each other and silently lose the intended concurrency telemetry.

Api mismatch · scripts/review-one-pr.sh:571-572

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) August 31, 2026 04:28
@donpetry-bot

Copy link
Copy Markdown
Contributor

CI checks on this PR are still running. Once they complete, re-mention @donpetry-bot to trigger a fresh review.

Posted by the donpetry-bot PR-review cascade.

@don-petry
don-petry disabled auto-merge August 31, 2026 04:29
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) August 31, 2026 04:32
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge August 31, 2026 04:34
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
Files changed: None
Skipped (informational): 1 (Quality Gate passed—no issues detected)
```

@don-petry
don-petry enabled auto-merge (squash) August 31, 2026 04:35

@donpetry-bot donpetry-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.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: d6c685256718d3704c0b6fcddaf2dea3ab1685d8
Cascade: triage → deep (triage: haiku 4.5 → deep: opus 4.8 + duck: o4-mini → audit: fable 5)

Summary

PR #1603 implements #1589 slice-1 (observe-only concurrent re-review claim markers) and #1595 (a shared hold-gate predicate so needs-human-review blocks release/pickup across the driver and intent classifier). Change is well-scoped, heavily tested (5 new .bats files), and all gates pass (shellcheck, actionlint, CodeQL, gitleaks, SonarCloud clean, Agent Security Scan). Downstream impact: (none).

Findings

  • minor: gh pr view '... || echo []' masks API failures and falls back to an empty comments list under set -euo pipefail (Gemini HIGH). Acceptable here: slice-1 is observe-only, so the cascade proceeds regardless; a masked failure only drops the concurrent-claim-detected telemetry signal, it does not change execution. Author deliberately does NOT mask failures in the correctness-critical needs-human-review-release-audit.sh, confirming this is an intentional trade-off. Recommend hardening in slice 2 when the claim becomes arbitrating (compare-and-set).
  • info: Gemini LOW: prefer POSIX 'tail -n 1' over 'tail -1' in pr-review-claim.sh (lines 52, 63, 74). Non-blocking; GNU/BSD both accept 'tail -1' and shellcheck passes.
  • info: Gemini LOW: manual teardown() rm -rf is redundant since BATS auto-cleans $BATS_TEST_TMPDIR. Cosmetic; no functional impact.
  • info: hold-gate refactor is sound: initiative-driver forces needs-human-review into HOLD_GATE_LABELS even when an override narrows the set, preventing a caller from re-opening the #1532 silent-release path. hold_gate_first_match uses exact per-line matching (no substring/regex) so 'needs-human' cannot match 'needs-humanization'. dev-lead-intent fail-closes on dispatch label-lookup errors.

Reviewed by the PR-review cascade (triage: haiku 4.5 → deep: opus 4.8 + duck: o4-mini → audit: fable 5). Reply if you need a human review.

@don-petry
don-petry merged commit 2858826 into main Aug 31, 2026
59 of 60 checks passed
@don-petry
don-petry deleted the dev-lead/issue-1589-20260831-0411 branch August 31, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review-one-pr: metadata-digest re-review path has no atomic claim — concurrent triggers can both launch the cascade

2 participants