Repository navigation
fix: keep review dedupe off the poll path, require open Bitbucket PRs, and retry failed heads - #109
Merged
OkiriGabriel merged 5 commits intoOct 22, 2026
Conversation
Restore review trigger regressions, restrict terminal webhook payloads, and retain durable evidence through queue and retention interruptions. Co-Authored-By: GPT-6.1 Sol <[email protected]>
Persist each failed attempt before releasing its marker, preserve completed-head dedupe, and keep retention cleanup scoped to the attempt. Co-Authored-By: GPT-6.1 Sol <[email protected]>
Co-Authored-By: GPT-6.1 Sol <[email protected]>
Co-Authored-By: GPT-6.1 Sol <[email protected]>
Co-Authored-By: GPT-6.1 Sol <[email protected]>
Contributor
Author
|
Thanks for merging. Some context on how this PR happened: it came out of spare weekly AI-coding-subscription usage. I built Overflow (free, MIT, no money involved) so maintainers can price issues for people with spare usage to pick up, and credit for merged work pays for your own issues later: https://github.com/Nitjsefnie/Overflow. This and any future PRs don't depend on any of that, and nothing changes whether you look at it or not. If you'd like more people with spare usage picking up your issues, registering a public repo is one form. No reply needed, and I won't bring it up again. |
This was referenced Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Moves the permanent review dedupe record off the queue prefix the poll loop scans, ignores Bitbucket pull requests that are no longer open, and lets a review that ended
failedbe retried by a later delivery for the same head. Restores the review-trigger regression tests that #104 added and that the merge ofmaininto that branch dropped.Fixes #108
Type of Change
Platform/Component
Testing
Test Configuration
What was actually run:
python -m pytest tests/test_security.py tests/test_services.py tests/test_storage.py tests/test_api.py -q— 291 passed, 2 skipped. The two skips are the completed-outcome rows of failure-only crash stages.flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics—0.bandit -r . -ll— no issues at medium or higher.e651862b77ce89629fd9ff9d6d43af41d6ff6853is green, including the Python 3.10, 3.11 and 3.12 unit jobs, Lint, Security Scan and Docker Build. The full suite was not run locally.The boundedness claim is pinned by a recording backend: an idle
list_pending_org_ids+recover_stale_processing+claim_nextpass performs zero review-object reads and four listings, at 100 and at 1000 seeded terminal reviews, for both completed and failed history. Each new guarantee has a source mutation that makes its test fail by assertion, and the crash matrix performs 26 realos._exit(19)child exits rather than injecting exceptions.Checklist
Screenshots (if applicable)
Not applicable.
Breaking Changes
Two deployment-visible changes, both deliberate:
queue/(review_heads/<head>/<sequence>.json,review_dedupe/<attempt>.json,review_releases/<attempt>.json,review_claims/<attempt>.json) plus a normalqueue/pending/<attempt>.jsonindex. A one-time adoption pass runs at startup and converts non-terminal legacyqueue/reviews/records into the new layout, so work queued before the upgrade is claimed normally. It runs once per process start, is idempotent across concurrent starts and interrupted runs, and leaves terminal legacy records to ordinary retention. No manual migration step is required. A terminal legacy record is compacted in place, and its claim is compacted before it, exactly as the previous retention helper did; a failed legacy review's source record is then removed, with the minimal terminal claim remaining as its evidence.S3Storage.put_json_if_absentpreviously fell back to a non-atomic check-then-write when the SDK rejectedIfNoneMatch, and treated a 409ConditionalRequestConflictas proof that the object existed. Both are now explicit failures, andexistsno longer reports a failed HEAD request as absence. A deployment on an S3 SDK too old to support conditional writes will now fail loudly at the first conditional create instead of silently running without dedupe.Additional Notes
What is bounded, and what is not:
list_pending_org_idsfor org discovery, the one-time startup adoption scan, retention's own sweep, and the retained minimal metadata (slots, terminal receipts, terminal fences). The first two were already history-dependent before this change; they are disclosed rather than fixed, because removing them needs a separate org-discovery design.Two policy notes:
failedreleases its head so the next delivery enqueues exactly one fresh attempt. A completed head dedupes permanently. If the release's marker delete fails, the failure is propagated, the failed record and the marker remain, and the head stays deduped — no duplicate run, no lost failure record.head_shadedupe is not added; it was out of scope for [BUG] Bitbucket webhook queues a review for every pullrequest:* event, including the agent's own comments #93/[BUG] GitLab MR label/title edits and approvals re-run code review without new commits #95 and remains so.The review-trigger regression tests from #104 are restored against the new layout.
TestBitbucketWebhookSignatureand every other pre-existing class intests/test_security.pyare byte-identical tomain, and the six imports left dangling by the merge are used again.Reviewer Checklist
Generated by DeepSeek V4.1 Flash 1017 (lead), GPT-6.1 Sol (implementation), GPT-6 Astra (review)