Skip to content

fix: enforce exact review mutation leases - #462

Merged
steipete merged 5 commits into
mainfrom
fix/label-sweep-active-review-suppression
Jul 10, 2026
Merged

steipete merged 5 commits into
mainfrom
fix/label-sweep-active-review-suppression

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • elect one server-ordered exact-head or exact-source review lease and suppress duplicate label-sweep/routing work while it is active
  • carry the durable review tuple through trusted automation and enforce source-revision plus lease-owner CAS before label, comment, close, repair, and merge mutations
  • hold an owned apply mutation lease through the full item action, and publish exact-event state only after the requested item proves durable review sync or a verified terminal state
  • preserve legacy tuple-less backlog compatibility while refusing newer verdicts, active leases, and unsafe freshness exemptions

Safety

  • rebased onto 905636bdb8313a4e0be54dc4b4d22b4c38670362
  • workflow remains disabled; this PR does not re-enable it
  • final autoreview: clean after addressing all accepted findings

Verification

  • pnpm run build:all
  • focused exact-item/lease/publisher suite: 317/317
  • pnpm run test:unit: 754/754
  • pnpm run test:repair: 664/664
  • pnpm run lint
  • pnpm run format:check
  • pnpm run check:active-surface
  • pnpm run check:limits

@steipete
steipete requested a review from a team as a code owner July 10, 2026 02:47
@steipete
steipete merged commit d43deab into main Jul 10, 2026
6 checks passed
@steipete
steipete deleted the fix/label-sweep-active-review-suppression branch July 10, 2026 02:57

@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: 8c74c0e036

ℹ️ 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 src/clawsweeper.ts
}
lease = posted.lease;
}
activeApplyMutationLease = { itemNumber: number, lease };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Release apply leases when later mutations throw

When an apply run acquires or reuses a mutation lease here and a later GitHub mutation throws (for example the durable comment PATCH or the close API after the lease is active), applyDecisionsCommand only calls releaseActiveApplyMutationLease() on normal loop/yield paths. Non-budget exceptions bypass that cleanup, leaving the owned lease comment fresh until its timeout and blocking retries for the same head/revision even though no worker is still applying.

Useful? React with 👍 / 👎.

azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
* fix: suppress duplicate label-sweep reviews

* fix: block stale verdict replay during review

* fix: scope review lease checks to pull requests

* fix: enforce atomic review apply boundaries

* fix: harden review apply freshness
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.

1 participant