fix(agent): harden workbook patches against whole-file rewrites

Reject large whole-file FIND spans, narrow soft=True to miss-only, check
decompose CONTINUE patch counts, and unit-test workbook_solidify.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-28 16:22:39 +08:00
1 parent c36383bf28
commit d0b184939f
6 files changed
+146 -6

No files matched your search

+1 -1
View File
@@ -56,6 +56,6 @@ Exact FIND→REPLACE once in a UTF-8 text file. `find` must match exactly once.
Apply plan-style triple-angle FIND/REPLACE blocks from `text` to `path`.
Also accepts fenced find/replace pairs and minimal Begin Patch hunks.
When `soft=True`, FIND failures return `0` instead of aborting the run.
When `soft=True`, **only** “FIND not found” returns `0` (run continues). Empty FIND, multi-match, parse errors, and whole-file FIND still abort — whole-file rewrite is forbidden.
**> host_apply_patch_blocks path=`path` text=`text` soft=`soft`**