Reject reviewer handoffs with contradictory mutation ledger or ambiguous final decision state #501

Closed
opened 2026-07-08 02:25:00 -05:00 by jcwalker3 · 0 comments
Owner

Problem

A reviewer handoff for PR #472 reported that the single terminal mutation budget had already been consumed by merging PR #411, but the mutation ledger only listed acquiring the PR #472 reviewer lease. The same handoff also claimed Gitea review submission was blocked, while the tool log showed gitea_mark_final_review_decision was invoked. This leaves the next controller/reviewer unable to know whether the review state was actually mutated, whether the terminal mutation budget was consumed, or whether the approval is safe to submit.

Required behavior

  • Reviewer/final-review handoffs must be rejected or flagged when they contain inconsistent mutation claims.
  • If a merge, close, approve, request-changes, final-decision mark, lease acquisition, label change, branch update, or comment post occurs, it must appear in the mutation ledger.
  • If a tool fails closed before mutation, the handoff must explicitly say:
    • tool called
    • mutation attempted
    • mutation rejected
    • no server-side state changed
    • proof/source of that conclusion
  • If the model claims a single-mutation gate blocked action, the handoff must identify the exact prior mutation that consumed the budget and include it in the ledger.
  • Final-review state must distinguish between:
    • local intent prepared
    • server-side final decision marked
    • Gitea review submitted
    • Gitea review rejected/blocked

Acceptance criteria

  1. Add validation for canonical reviewer handoff comments that detects contradiction between narrative claims and mutation ledger.
  2. Add tests covering:
  • claimed merge missing from mutation ledger
  • claimed review blocked but final decision marked
  • lease listed but review decision omitted
  • attempted mutation rejected with no proof
  1. Ensure the validator fails closed and asks the LLM to rewrite the handoff before posting.
  2. Add a ready-to-paste corrected handoff template for blocked review submissions.
  3. Confirm existing reviewer/merge safety gates still pass.
## Problem A reviewer handoff for PR #472 reported that the single terminal mutation budget had already been consumed by merging PR #411, but the mutation ledger only listed acquiring the PR #472 reviewer lease. The same handoff also claimed Gitea review submission was blocked, while the tool log showed `gitea_mark_final_review_decision` was invoked. This leaves the next controller/reviewer unable to know whether the review state was actually mutated, whether the terminal mutation budget was consumed, or whether the approval is safe to submit. ## Required behavior - Reviewer/final-review handoffs must be rejected or flagged when they contain inconsistent mutation claims. - If a merge, close, approve, request-changes, final-decision mark, lease acquisition, label change, branch update, or comment post occurs, it must appear in the mutation ledger. - If a tool fails closed before mutation, the handoff must explicitly say: - tool called - mutation attempted - mutation rejected - no server-side state changed - proof/source of that conclusion - If the model claims a single-mutation gate blocked action, the handoff must identify the exact prior mutation that consumed the budget and include it in the ledger. - Final-review state must distinguish between: - local intent prepared - server-side final decision marked - Gitea review submitted - Gitea review rejected/blocked ## Acceptance criteria 1. Add validation for canonical reviewer handoff comments that detects contradiction between narrative claims and mutation ledger. 2. Add tests covering: - claimed merge missing from mutation ledger - claimed review blocked but final decision marked - lease listed but review decision omitted - attempted mutation rejected with no proof 3. Ensure the validator fails closed and asks the LLM to rewrite the handoff before posting. 4. Add a ready-to-paste corrected handoff template for blocked review submissions. 5. Confirm existing reviewer/merge safety gates still pass.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#501