-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
When adding a comment via /api/agent/<slug>/ops with comment.add, the internal document state becomes corrupted with HTML annotations. Subsequent API operations (edit/v2, suggestion.add, find_replace_in_block) all fail with FRAGMENT_DIVERGENCE or ANCHOR_NOT_FOUND errors because text search can't find content that exists in clean markdown.
Steps to Reproduce
- Create a Proof document with text: "Hello whwat is this for"
- Add a comment anchoring to that text:
curl -X POST "https://www.proofeditor.ai/api/agent/<slug>/ops" \
-H "Authorization: Bearer <token>" \
-H "X-Agent-Id: claude-code-haiku" \
-H "Content-Type: application/json" \
-d '{
"type": "comment.add",
"by": "ai:claude-code-haiku",
"quote": "Hello whwat is this for",
"text": "This is a comment"
}'- Attempt subsequent edit with
/edit/v2:
curl -X POST "https://www.proofeditor.ai/api/agent/<slug>/edit/v2" \
-H "Authorization: Bearer <token>" \
-H "X-Agent-Id: claude-code-haiku" \
-d '{
"by": "ai:claude-code-haiku",
"baseRevision": 2,
"operations": [
{"op": "insert_after", "ref": "b1", "blocks": [{"markdown": "New content"}]}
]
}'Result
FRAGMENT_DIVERGENCE error. Snapshot shows HTML annotations in markdown: <span data-proof="comment" ...>Hellowhwat is this for</span>
Root Cause
Comment annotations corrupt the canonical markdown representation. Text search fails because it searches plain text but snapshot returns annotated HTML.
Impact
- Cannot chain comment + edit operations
- Document becomes read-only for programmatic edits after comment added
- Breaks agent workflows mixing comments and content changes
Environment
- Hosted Proof (proofeditor.ai) - 2026-03-11
- Verified with
/api/agent/endpoints
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels