Repository navigation
fix(review): serialize pending section approvals - #2111
Merged
Merged
Conversation
jeff-r2026
approved these changes
Nov 27, 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
Two approvals from the same review queue can each read the same version of the target Markdown file. Both commands report success and remove their entries, but the last write overwrites the other approved section.
Reuse the existing queue lock for the entire decision. Single and batch apply reload the pending entry while holding the lock, write the section, and remove the entry after a successful write. If another command already removed the entry, the apply reports it missing. Dry runs still preview changes without taking a write lock.
Type of Change
Test Plan
npm run typecheckandnpm run buildpassed.npx vitest run src/__tests__/iwiki-review-apply.test.ts src/__tests__/iwiki-dual.test.ts src/__tests__/review-store.test.ts src/__tests__/review-cmd.test.ts src/__tests__/review-cmd-output.test.tspassed all 41 tests. The added regression failed onda482cbbecause the glossary update was lost.npx vitest run --config vitest.e2e.config.ts src/__tests__/review-dry-run-e2e.test.tspassed, including the checks that preview leaves document and queue contents and timestamps unchanged.node scripts/check-docs.mjsandgit diff --checkpassed.teamai(family-facts)diagnostics in tool packages.npm run verify:worldrefuses native Windows. The isolated Windows CLI record is below.The concurrency probe pauses the first process after it reads the actual document. It releases that process after the second finishes on main or reaches the held lock on the PR build. The fixture used the CLI section writer with a supplied reply.
Related Issues
Fixes #2080.
Notes for Reviewers
The lock is scoped to a review queue and covers decisions against that queue. The entry point reads the workspace queue directly across team repo modes and does not depend on an AI tool, workflow driver, or resource layer. This extends the queue-write protection in #1786 to document application. The separate risk ceiling validation in #2105 applies cleanly alongside this diff.
Prepared with assistance from OpenAI Codex.