Harden stale edit diagnostics and prompt lessons - #23
Closed
nvdorman wants to merge 2 commits into
Closed
Conversation
enowdev
pushed a commit
that referenced
this pull request
Aug 12, 2026
…savers The test asserted a guarantee the handler never made. handleModelSet saves in a detached goroutine, so twenty overlapping switches land on disk in any order; demanding that "model-19" specifically won the race failed whenever the scheduler finished the savers out of order. It reproduced reliably at GOMAXPROCS=2 and was the sole red check on PRs #23 and #24. Two changes: - Assert what IS ordered (the in-memory pointer swap must show the last switch) and only that SOME save landed, not which one. - Use a manual temp dir and drain the savers before removing it. The detached goroutines outlive the test body, so t.TempDir's RemoveAll was racing them into "directory not empty" — the failure the deleted mid-test os.Remove was papering over. Stress: 40x at GOMAXPROCS=2 green (was ~5 failures in 30), and 10x under -race. Runtime drops from 48s to 3s. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
enowdev
pushed a commit
that referenced
this pull request
Aug 12, 2026
…ob boundary Merges nvdorman's fix/edit-file-vps-tools. Supersedes PR #23, whose changes are wholly contained here. Reviewed and verified locally: - the byte-range splice genuinely fixes the wrong-occurrence corruption - configureProcessGroup preserves sandbox SysProcAttr (call ordering checked) - the grep/glob boundary change matches read_file's existing resolveRead; it is not a widening, only a consistency fix - majority fileEOL detection and verbatim-first matching are both correct Follow-up fixes for four defects found in review land in the next commit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Owner
|
Superseded by #24, which is now merged. Every change here — The work is in |
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
Evidence
Database review found 50 edit_file failures: 41 stale/not-found old_string values and 6 ambiguous matches. Read and grep failures were invalid paths, offsets, or regex inputs rather than silent file corruption.
Tests