feat(nano): staleness-gate soft refresh (PR 12) - #891
Merged
Conversation
The first TB 2.1 nano run hit 'file must be read first and be unchanged' 7 times (tune-mjcf 2x, build-cython-ext 3x, ...), each a full model round-trip on a wall-clocked task, always in the same shape: the agent's own script or build touched the file after the last Read. Nano's Edit now discriminates via file_read_status(): never-read keeps the hard error (blind-edit protection intact), but read-then-modified proceeds against the CURRENT bytes and lets the ladder arbitrate — every old_string must still match uniquely in the current content, so an external change that touched the target region still fails with the actionable not-found error, while changes elsewhere no longer cost a ceremonial re-Read. Fingerprint refreshes on success. Stock Edit unchanged; pi has no gate at all. Tests: changed-elsewhere proceeds + follow-up edit passes the refreshed gate; changed-target still blocked; never-read still blocked. 63 pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
7 staleness blocks in the TB run were all the same shape: the agent's own script touched a file after Read, then Edit demanded a ceremonial re-Read round-trip. Nano now soft-refreshes on read-then-modified files — proceeds against current bytes, ladder arbitrates (changed target region still errors actionably); never-read keeps the hard block. Stock Edit untouched. 63 tests pass.
🤖 Generated with Claude Code