Repository navigation
test: cover native mutation scheduling and lost edits - #36
Merged
Merged
Conversation
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.
One assistant response can contain two edits to the same file. Add deterministic regression coverage proving that both successful edits survive Pebble's coding-agent dispatch, including profile aliases and permission middleware. A test-only scheduling override reproduces the original failure: both tools report success, but the last write loses the first edit.
Inspired by @denkhaus's lost-edit report and delayed-write regression in fabro-sh/fabro#787. The tests adapt that reproduction to Pebble's existing batch scheduling; this PR adds no production fix.
The six new tests cover same-file edits through Anthropic, Claude 5, and Kimi profiles; the negative control; different-file scheduling; overlapping apply_patch calls; ordered whole-file replacements; and Kimi append calls. They use scripted provider responses, mutable state, and paused-time delayed writes, with no paid model calls or two-reader barrier.
The assertions preserve the current scope: a mutation serializes the entire batch, including different-file calls; whole-file replacements remain last-write-wins; separate sessions and workflow stages are outside this guarantee.
Validation:
mise run testwith local socket access passed.