Blocks swapping the gh-aw shim's MultiEdit tool onto the harness. Context: #265 (shim parity is FileSystem + Shell only and does not cover this).
FileSystemToolset.edit_file does one replacement and requires the match to be unique. MultiEdit applies an ordered list of edits to a single file atomically: if any old_string is missing, nothing is written.
Requirement: a method, e.g.
async def multi_edit(self, path: str, edits: list[EditOp], *, expected_hash: str | None = None) -> str
where EditOp is {old_string: str, new_string: str, replace_all: bool = False}, with:
- edits applied in order, each to the result of the previous one
- each edit replaces the first occurrence, or every occurrence when
replace_all
- all-or-nothing: if any
old_string is not found, the file is left untouched and the call raises a recoverable ModelRetry
- same containment and
expected_hash semantics as edit_file
The one semantic difference from edit_file: per-edit matching is first-occurrence, not unique-occurrence.
Blocks swapping the gh-aw shim's
MultiEdittool onto the harness. Context: #265 (shim parity is FileSystem + Shell only and does not cover this).FileSystemToolset.edit_filedoes one replacement and requires the match to be unique.MultiEditapplies an ordered list of edits to a single file atomically: if anyold_stringis missing, nothing is written.Requirement: a method, e.g.
where
EditOpis{old_string: str, new_string: str, replace_all: bool = False}, with:replace_allold_stringis not found, the file is left untouched and the call raises a recoverableModelRetryexpected_hashsemantics asedit_fileThe one semantic difference from
edit_file: per-edit matching is first-occurrence, not unique-occurrence.