Skip to content

Add optimistic mutation preconditions (#447) - #476

Merged
JSv4 merged 1 commit into
mainfrom
agent/issue-447-preconditions
Aug 14, 2026
Merged

Add optimistic mutation preconditions (#447)#476
JSv4 merged 1 commit into
mainfrom
agent/issue-447-preconditions

Conversation

@JSv4

@JSv4 JSv4 commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Closes #447.

What changed

  • Added a monotonic session version that advances once per committed mutation and successful undo/redo, while failed guards, rollbacks, and no-ops leave it unchanged.
  • Added reusable optimistic preconditions for expected version, anchor content hash, exact text/range, anchor kind/scope, and exact match count.
  • Added structured conflict responses carrying expected/actual values, current version, and current target metadata.
  • Routed the capability through the .NET ops facade, JSON/WASM bridge, npm, Python, and MCP surfaces.
  • Made guarded range replacement atomic under the session mutation gate and kept MCP preview version-neutral.
  • Documented the inspect/guard/mutate/retry workflow and migration-compatible optional parameters.

Validation

  • Coordinator: focused DocxSessionPreconditionTests — 7/7 passed.
  • Implementer: 69 focused .NET tests covering preconditions and MCP dispatch passed.
  • npm TypeScript typecheck passed.
  • Python precondition test passed.
  • Core, WASM, Python host, and MCP server builds passed.

Review notes

The process-facing transports are serialized end-to-end: stdio and Python handle one request at a time, MCP HTTP gates complete requests, and WASM calls are synchronous. Direct .NET mutations enforce guards under the session mutation gate.

@JSv4
JSv4 force-pushed the agent/issue-447-preconditions branch from b05578b to e467c0d Compare August 14, 2026 09:49
@JSv4
JSv4 changed the base branch from main to agent/issue-450-table-addressing August 14, 2026 09:49
@JSv4
JSv4 force-pushed the agent/issue-447-preconditions branch from e467c0d to 9222540 Compare August 14, 2026 10:03
@JSv4
JSv4 force-pushed the agent/issue-447-preconditions branch from 9222540 to a666aa3 Compare August 14, 2026 11:11
@JSv4
JSv4 changed the base branch from agent/issue-450-table-addressing to main August 14, 2026 13:34
@JSv4
JSv4 marked this pull request as ready for review August 14, 2026 13:34
@JSv4
JSv4 merged commit bb4d130 into main Aug 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Agent] Add optimistic preconditions to mutations

1 participant