Skip to content

fix(dlq): force-unchanged recovery skips unchanged policy holds - #2189

Merged
obviyus merged 2 commits into
mainfrom
fix/force-unchanged-retry-only
Nov 8, 2026
Merged

obviyus merged 2 commits into
mainfrom
fix/force-unchanged-retry-only

Conversation

@obviyus

@obviyus obviyus commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Problem

exact-review-dead-letter-reconcile with force_unchanged=true is meant to reset a spent retry budget for parked reviews. The flag also skipped the source-change check for policy holds (maintainer_request_required, locked conversation, oversized PR). Those have no budget to reset, so an unchanged held review just re-parks. They still compete for the 5-per-run recovery cap.

Live on 2026-11-08: the parked inventory had 100 rows. 52 were maintainer_request_required, 44 review_retry_exhausted, 2 source_incompatible and 2 oversized_pull_request. Four forced runs recovered 5 targets each, but review_retry_exhausted only moved from 51 to 49.

Fix

--force-unchanged overrides the unchanged-identity check only for retry-budget reasons (review_retry_exhausted, dispatch_rejected), at both selection and the pre-mutation recheck. Holds still recover when their source changes. The Worker's override_retry_budget contract is unchanged.

Tests

  • Extended parked pull request reconciliation requires immutable source drift: a forced run on an unchanged maintainer_request_required row recovers nothing and reports unchanged_review_identity. It fails on main (recovered 1) and passes here. The existing forced review_retry_exhausted case still recovers with override_retry_budget: true.
  • exact-review-dead-letter-operator suite: 90/90. lint:scripts and oxfmt --check are clean.

--force-unchanged exists to reset a spent retry budget. It also bypassed
the source-change check for policy holds (maintainer_request_required,
locked conversation, oversized PR), which have no budget: an unchanged
held review only re-parks. In the 2026-11-08 drain, 52 of 100 parked rows
were maintainer holds competing for the 5-per-run recovery cap, and the
retry-exhausted backlog moved 51 -> 49 over four runs.

Apply the override only to retry-budget reasons; holds still need a
source change.

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 8, 2026
@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Restrict forced unchanged recovery to parked retry and source-drift budgets so unchanged policy holds do not consume recovery slots.

Example: A forced recovery with a cap of 2 inspects unchanged items 97801, 97802, and 97803: a maintainer hold, an exhausted retry, and a source-drift loop.

  • Before: The maintainer hold consumes a recovery slot, leaving one budget-exhausted item parked.
  • After: The hold stays parked while both budget-exhausted items return to pending.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused patch resolves the earlier finding and has useful regression coverage, but the repository's separate runtime-proof gate remains unmet.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Operators spend limited recovery slots requeueing unchanged policy holds while reviews with exhausted budgets remain parked.
Reason: The narrow correction restores useful recovery throughput and preserves all three established resettable budgets; the supplied host facts establish owner direction.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current recovery-slot starvation path and resolves the prior source-drift-loop finding; no new correctness defect was identified.

Priority: P2
Reviewed head: a5f365170c2a663ee65f2ad6e516bfb8c7d50b84

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide a controlled runtime trace of the operator recovering retry and loop budgets while leaving an unchanged hold parked, beyond the supplied test-harness run.
Agent review details

How this fits together

The operator CLI reads parked queue inventory and live GitHub source identities, selects bounded recoveries, and sends signed recovery requests to the exact-review queue.

flowchart LR
 Inventory[Parked inventory] --> Operator[Operator CLI]
 GitHub[Live GitHub identities] --> Operator
 Operator --> Filter[Budget and identity checks]
 Filter --> Recovery[Signed recovery request]
 Recovery --> Queue[Exact review queue]
 Queue --> Pending[Pending reviews]
Loading

Technical review

Best possible solution:

Keep one shared budget classification at both existing recovery checks while preserving source-change recovery for policy holds.

Do we have a high-confidence way to reproduce the issue?

Current main demonstrably selects unchanged policy holds when forced, and the contributor supplies a failing-main comparison; no target code was executed during this review.

Is this the best way to solve the issue?

The patch fixes selection in the existing owner, repeats the predicate before mutation, and preserves the previously established source-drift-loop recovery contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 199013e70e1e.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 7656448 adds scripts/exact-review-dead-letter-operator.mjs:730 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 765644804756; files: scripts/exact-review-dead-letter-operator.mjs)
  • Ayaan Zaidi: Raw commit f76bad3 adds scripts/exact-review-dead-letter-operator.mjs:32 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f76bad311e00; files: scripts/exact-review-dead-letter-operator.mjs)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Change distribution Production +23/-2; tests +212/-0; changelog +1 The production fix is narrow; integration coverage additionally checks cap allocation and the existing queue's loop-counter reset.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove merge-risk: 🚨 automation: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Forced operator recovery wastes bounded slots on unchanged holds, delaying eligible parked reviews without breaking ordinary review execution.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-08T05:07:19.217Z sha 363e404 :: needs changes before merge. :: [P2] Preserve forced recovery of source-drift loop budgets

Reviewed November 8, 2026, 12:13 AM ET / 05:13 UTC (Revision 2).

source_drift_loop has a budget the Worker restarts on operator recovery
(dashboard/exact-review-queue.ts, from #1732), so --force-unchanged must
still recover it. Add an operator-to-queue test: the real operator CLI
against the queue Durable Object harness over HTTP.

Co-authored-by: obviyus <[email protected]>
@obviyus

obviyus commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed the review on a5f3651:

  • Source-drift loop budget (P2) / original intent of feat(queue): park source-drift review loops and alert on runaway reviews #1732: correct. Operator recover-fresh intentionally restarts the loop counter. source_drift_loop is now a resettable budget with review_retry_exhausted and dispatch_rejected at both the selection check and the pre-mutation recheck. Policy holds (maintainer_request_required, locked conversation, oversized) and source_incompatible have nothing to reset, so they still need a source change.
  • Operator coverage: the source-fence test now forces an unchanged source_drift_loop row and expects override_retry_budget: true.
  • Operator-to-Worker proof: new test/exact-review-parked-operator-e2e.test.ts runs the real operator CLI (--execute --force-unchanged --max-recoveries 2) over HTTP against the exact-review queue Durable Object harness. It uses three parked issues with unchanged sources: a maintainer hold, an exhausted retry and a real source-drift loop. Results:
this head (a5f365170)
  operator summary: {"inspected":3,"recovered":2,"skip_reasons":{"unchanged_review_identity":1}}
  queue after: {"97801":"parked/maintainer_request_required","97802":"pending/-","97803":"pending/-"}
  loop row for 97803 cleared                                      -> pass
previous head (363e404, the reviewed regression)
  recovered 1; source_drift_loop stays parked                     -> fail
main
  recovered 2; the hold was selected and only the cap stopped it ({"recovery_cap":1})  -> fail

Suites exact-review-dead-letter-operator, exact-review-source-drift-loop and the new e2e: 121/121. lint:scripts and oxfmt --check are clean.

@obviyus

obviyus commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 8, 2026
@obviyus
obviyus merged commit 5139343 into main Nov 8, 2026
39 checks passed
@obviyus
obviyus deleted the fix/force-unchanged-retry-only branch November 8, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant