Repository navigation
fix: harden review-pr Step 11 confirmation gate against context compression - #371
Merged
em-redhat merged 4 commits intoJul 30, 2026
Merged
Conversation
Add OpenSpec change artifacts for hardening the /review-pr command's Step 11 confirmation gate to prevent bypass when sessions resume from compressed context. Ref: unbound-force#346
…ession Add session-resume guard and visual MANDATORY GATE markers to prevent agents from bypassing human consent when a session resumes from compressed context. - Session-resume guard: re-confirm via AskUserQuestion if prior confirmation cannot be verified in uncompressed history - Opening marker: >>> MANDATORY GATE: HUMAN CONFIRMATION REQUIRED <<< - Closing marker: >>> END MANDATORY GATE <<< Fixes: unbound-force#346
Update embedded asset to match the hardened confirmation gate in .opencode/commands/review-pr.md. Fixes drift detection in TestEmbeddedAssets_MatchSource.
This was referenced Jul 31, 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.
Summary
Fixes #346. The
/review-prcommand's Step 11 has a CRITICAL RULErequiring explicit human confirmation (via AskUserQuestion) before
posting any GitHub review. During a review of PR gaze#194, the agent
bypassed this gate when the session was resumed from compressed
context, posting an APPROVE review under the human's account without
consent.
This change adds defense-in-depth hardening to prevent bypass:
AskUserQuestion if the session was resumed from compressed context
or if prior confirmation cannot be verified. Uses negative-default
semantics: when in doubt, re-confirm.
>>> MANDATORY GATE: HUMAN CONFIRMATION REQUIRED <<</>>> END MANDATORY GATE <<<delimiters designed to survivecontext compression as high-salience ASCII tokens.
The change is purely additive (15 insertions, 0 deletions) and does
not alter the existing confirmation flow.
How to Test
Verify the
MANDATORY GATEmarker appears exactly twice:Verify the session-resume guard appears before the first marker:
grep -n "Session-resume guard\|MANDATORY GATE" \ .opencode/commands/review-pr.mdThe guard line number should be lower than the first marker.
Verify the CRITICAL RULE text is preserved within the marker
boundary:
grep "NEVER post reviews without explicit" \ .opencode/commands/review-pr.mdHow to Demo
Run
/review-pron any PR. At Step 11, observe:>>> MANDATORY GATE <<<markers visually delimit theconfirmation gate section
Key Files Changed
.opencode/commands/review-pr.mdopenspec/changes/review-pr-confirmation-gate/proposal.mdopenspec/changes/review-pr-confirmation-gate/design.mdopenspec/changes/review-pr-confirmation-gate/specs/confirmation-gate-hardening.mdopenspec/changes/review-pr-confirmation-gate/tasks.mdopenspec/changes/review-pr-confirmation-gate/.openspec.yamlThis PR was generated by /finale (AI-assisted).