ADR 0194: Anchor edit place=before|after (no silent wipe)¶
Статус: Accepted · Shipped (CDP 0.5.177)
Дата: 2026-07-25
Tags: #cdp #buffer #anchor #mutate #agent-ide #adr #cascade-ide
Резюме¶
cdp_buffer edit_op=anchorhistorically always replaced the resolved locus (ApplyReplaceRangeover full member span).- Tool schema advertised
place=for paste/put; agents reasonably passedplace=beforewithedit_op=anchorexpecting insert. - Silent ignore → member wiped (dogfood:
SceneMap/SceneJsonerased while insertingPulse). Ultra-critical mutate footgun.
Решение¶
edit_op=anchorhonorsplace=/at_place=:- replace (default) — overwrite locus (compat)
- before — insert at locus start (zero-width range)
- after — insert at locus end
- Unknown
place=→ hard error (no silent ignore). place=sniperon anchor → error (paste/put only).- XML
+K:Elementinsert:place=must be omit/replace (own insert axis). - Result meta includes
place=so dogfood can verify. - Schema/Meta text: place= applies to anchor, not only paste/put.
Related¶
- Buffer plane:
cdp-mcp/DocumentEditPlane.cs(ApplyAnchorEdit,ApplyPlacedRange) - Paste/put already had
EditorComfort.ApplyPlaced— same semantics, now shared contract for anchors - Regression tests:
cdp-mcp/CdpMcp.Tests/DocumentEditPlaneAnchorPlaceTests.cs(place=before keeps locus; after/replace/unknown/sniper)