Skip to content

fix(git): fail closed on pending operation replay - #95

Merged
Qiyuanqiii merged 1 commit into
mainfrom
codex/fix-git-pending-replay
Aug 18, 2026
Merged

Qiyuanqiii merged 1 commit into
mainfrom
codex/fix-git-pending-replay

Conversation

@Qiyuanqiii

Copy link
Copy Markdown
Member

Summary

  • distinguish completed idempotent replays from write-ahead intents that never received a terminal receipt
  • fail incomplete local Git mutation replays closed and require repository reconciliation
  • apply the same rule to remote Git and PR operations, where blind retry could duplicate an external side effect
  • add regression coverage for stale local review failure and unavailable PR-client failure

Root cause

Both services persisted an intent before the side effect, but every matching operation-key replay returned success immediately. If execution, the remote API, or receipt persistence failed, the durable row remained incomplete and all later retries falsely looked successful with an empty receipt.

Recovery semantics

The service does not automatically rerun an incomplete intent because the original Git/API side effect may already have happened. It returns FAILED_PRECONDITION; the operator must reconcile observable state and then use a new operation key if a fresh action is appropriate. Completed records keep their existing idempotent replay behavior.

Verification

  • go test -count=1 -v ./internal/application -run "TestGitMutationService|TestGitRemoteService"
  • go test -count=1 ./internal/store ./internal/repository
  • go vet ./internal/application
  • git diff --check

@Qiyuanqiii
Qiyuanqiii marked this pull request as ready for review August 18, 2026 07:38
@Qiyuanqiii
Qiyuanqiii merged commit db6c356 into main Aug 18, 2026
5 checks passed
@Qiyuanqiii
Qiyuanqiii deleted the codex/fix-git-pending-replay branch August 18, 2026 07:38
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.

1 participant