Conflicts between two to four RFC 6902 JSON Patches made against the same document
Takes one base document and 2 to 4 JSON Patch (RFC 6902) operation lists written against it and reports, per pair, whether they commute: same-path writes, ancestor/descendant overlaps, array-index shifts (an insert or remove moves the elements a later patch addressed by index), concurrent `-` appends whose final order depends on application order, `test` operations invalidated by another patch, and operations that fail after the other patch ran. Each witness gives the exact JSON pointer and, for index shifts, the element the patch meant versus the element it would hit. It actually applies both orders and compares the results. For agents merging concurrent edits to one JSON document. It does not merge the patches and does not support JSON Merge Patch (RFC 7396).
What you get
Two patches that each apply cleanly can still corrupt a document when applied in sequence. 4 patches of 100 operations per $0.005 call.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/json-patch-conflict. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/json-patch-conflict \
-H 'content-type: application/json' \
-d '{"document":{"tags":["a","b","c"],"title":"x"},"patches":[{"name":"editor-1","ops":[{"op":"add","path":"/tags/0","value":"new"}]},{"name":"editor-2","ops":[{"op":"replace","path":"/tags/1","value":"B"}]}]}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
document | any | yes | The base document both patches were written against (any JSON value). |
patches | array<object>; max 4 items | yes |
Example request body
{
"document": {
"tags": [
"a",
"b",
"c"
],
"title": "x"
},
"patches": [
{
"name": "editor-1",
"ops": [
{
"op": "add",
"path": "/tags/0",
"value": "new"
}
]
},
{
"name": "editor-2",
"ops": [
{
"op": "replace",
"path": "/tags/1",
"value": "B"
}
]
}
]
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
patches | array<object> | no | |
pairs | array<object> | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the data-contract-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent