Skip to content

test(review): cover reapproval after superseded verdicts - #664

Merged
zzwong merged 3 commits into
mainfrom
test/569-superseded-approval
Oct 22, 2026
Merged

zzwong merged 3 commits into
mainfrom
test/569-superseded-approval

Conversation

@zzwong

@zzwong zzwong commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Refs #569.

Current production on 999e59ddfc74a67ffeef3c4b4a78a8528365afe6 already handles approvals superseded by a newer change request from the same posting identity. This test-only PR locks down that behavior across the review-run lifecycle. Production code is unchanged.

  • Cover approval at A, changes requested at B, and a clean review at C through the real gate, action planner, ledger, and outbox.
  • Verify plain review and --rerun post exactly one APPROVE at C, with the correct head/base marker and persisted event.
  • Preserve the completed-verdict behavior of a marked legacy COMMENT, then verify --rerun recovers to approval.
  • Verify a superseded approval permits the author-override path.
  • Verify a subsequent plain review exits as already approved without another review submission or persisted run. An unused run ID can still be generated before that early exit.

Validation

On the exact proposed tree, using the standard keyring_nopassage build tag:

go test -json -p 2 -timeout=3m -run '^TestRunSupersededApproval' ./internal/reviewrun -count=1
go test -json -p 2 -timeout=6m ./internal/gateio ./internal/reviewrun -count=1
go test -json -p 2 -race -timeout=8m ./internal/gateio ./internal/reviewrun -count=1

All passed. The two-package runs each reported 164 passing test/subtest results and no skips. The same normal and race commands passed on clean main, with 159 passing results each. Formatting and whitespace checks passed.

An isolated negative-control copy changed only activeApprovalByPostingIdentity to accept any historical same-identity approval, ignoring later verdicts. The new tests then failed by the three intended assertions: plain review, the legacy-comment preflight, and author override. The ordinary rerun case still passed. The negative-control mutation is not part of this PR.

Validation limits

These are fixture-backed checks. The repository-wide suite, make check, lint, standalone build, and live GitHub/provider or branch-protection verification were not run locally. This PR does not claim a new production fix or close #569.

@zzwong
zzwong marked this pull request as ready for review October 21, 2026 23:26
@zzwong
zzwong marked this pull request as draft October 21, 2026 23:32

@monit-reviewer monit-reviewer 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.

Automated PR Review

Reviewed commit: 4d48796e239e
Profile: open-cli-collective-review - Posting as: monit-reviewer

Summary

Reviewer Findings
go:implementation-tests 0

Reviewer Coverage

Complete coverage details are retained in the local coverage.json artifact.

  • go:implementation-tests — complete (broad); scope: 1 file; examples: internal/reviewrun/superseded_approval_test.go; body-inspected: 1 file; examples: internal/reviewrun/superseded_approval_test.go; skipped: none; context (not coverage): 2 files; examples: internal/gateio/gateio.go, internal/reviewrun/reviewrun_test.go; constraints: Static review only; tests were not executed. Review scope was the assigned lifecycle regression test file.

0 PR discussion threads considered. 0 summarized; 0 resolved.


Completed in 39s | $0.07 | openai-codex/gpt-6.1-sol | cr 0.10.342
Field Value
Model openai-codex/gpt-6.1-sol
Reviewers go:implementation-tests
Engine pi_rpc · openai-codex/gpt-6.1-sol
Reviewed by cr · monit-reviewer
Duration 39s wall · 27s compute
Cost $0.07
Tokens 28.0k in / 483 out

Per-workstream usage

  • orchestrator-selection — openai-codex/gpt-6.1-sol
    • In: 2.6k
    • Out: 105
    • Cache read: 0
    • Cache create: 0
    • Cost: $0.01
    • Duration: 3s
  • go:implementation-tests — openai-codex/gpt-6.1-sol
    • In: 24.8k
    • Out: 334
    • Cache read: 89.2k
    • Cache create: 0
    • Cost: $0.06
    • Duration: 20s
  • orchestrator-rollup — openai-codex/gpt-6.1-sol
    • In: 696
    • Out: 44
    • Cache read: 0
    • Cache create: 0
    • Cost: $0.00
    • Duration: 3s

@zzwong
zzwong marked this pull request as ready for review October 22, 2026 00:06
@zzwong
zzwong marked this pull request as draft October 22, 2026 00:46

@monit-reviewer monit-reviewer 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.

Automated PR Review

Reviewed commit: 40f8410e9e3b
Profile: open-cli-collective-review - Posting as: monit-reviewer

Summary

Reviewer Findings
go:implementation-tests 0

Reviewer Coverage

Complete coverage details are retained in the local coverage.json artifact.

  • go:implementation-tests — complete (constrained); scope: 1 file; examples: internal/reviewrun/superseded_approval_test.go; body-inspected: 1 file; examples: internal/reviewrun/superseded_approval_test.go; skipped: none; context (not coverage): 3 files; examples: docs/development.md, internal/reviewrun/reviewrun.go, internal/reviewrun/reviewrun_test.go; constraints: Static review of the assigned test file and nearby implementation context only; tests and race checks were not executed.

0 PR discussion threads considered. 0 summarized; 0 resolved.


Completed in 30s | $0.06 | openai-codex/gpt-6.1-sol | cr 0.10.342
Field Value
Model openai-codex/gpt-6.1-sol
Reviewers go:implementation-tests
Engine pi_rpc · openai-codex/gpt-6.1-sol
Reviewed by cr · monit-reviewer
Duration 30s wall · 18s compute
Cost $0.06
Tokens 23.1k in / 359 out

Per-workstream usage

  • go:implementation-tests — openai-codex/gpt-6.1-sol
    • In: 22.4k
    • Out: 309
    • Cache read: 54.1k
    • Cache create: 0
    • Cost: $0.05
    • Duration: 15s
  • orchestrator-rollup — openai-codex/gpt-6.1-sol
    • In: 697
    • Out: 50
    • Cache read: 0
    • Cache create: 0
    • Cost: $0.00
    • Duration: 2s

@zzwong
zzwong marked this pull request as ready for review October 22, 2026 00:48
@zzwong
zzwong merged commit bf3131a into main Oct 22, 2026
12 checks passed
@zzwong
zzwong deleted the test/569-superseded-approval branch October 22, 2026 00:52
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.

Stale-approval deadlock: approve -> request_changes -> fix -> re-approve is impossible without manual review dismissal

2 participants