Compare two Word documents and return the revision with tracked changes applied.
Use describe("docx.diff") when your code needs the complete live JSON Schemas.
At a glance
| Property | Value |
|---|---|
| Package | @runstamp/docx |
| Domain / verb | docx / diff |
| Customer jobs | compare, review |
| Deterministic | Yes |
| Side effects | none |
Availability
| Local | SDK | CLI | MCP | Managed API |
|---|---|---|---|---|
| public ga | public ga | public ga | public ga | public ga |
Managed API route: POST /api/v2/operations/docx/diff. Managed execution requires a free-trial workspace or an active Platform or Enterprise workspace, and an environment-bound API key.
Input and result
| Schema | Required fields | Optional fields |
|---|---|---|
| Input | none | none |
| Options | none | deterministic, deterministicSeed, timeoutMs, locale, lossPolicy, limits, author, date, archiveLimits |
| Result value | artifact, changes, summary, statistics | none |
Every success also carries losses, diagnostics, and a hash-bound receipt.
Defaults, limits, and format constraints
Defaults
| Path | Default |
|---|---|
$.deterministic | default=true |
$.lossPolicy | default="collect" |
Formats and profiles
No separate format selector is declared. Accepted artifacts are bounded by the exact input schema.
Other limits
| Path | Constraint |
|---|---|
$ | minItems=2maxItems=2 |
$.timeoutMs | minimum=1 |
$.limits.maxInputBytes | minimum=1maximum=9007199254740991 |
$.limits.maxOutputBytes | minimum=1maximum=9007199254740991 |
$.limits.maxPages | minimum=1maximum=9007199254740991 |
$.limits.maxElements | minimum=1maximum=9007199254740991 |
$.limits.maxArchiveEntries | minimum=1maximum=9007199254740991 |
$.limits.maxExpansionRatio | minimum=1 |
$.limits.maxDurationMs | exclusiveMinimum=0maximum=2147483647 |
$.archiveLimits.maxCompressedBytes | minimum=0 |
$.archiveLimits.maxEntries | minimum=0 |
$.archiveLimits.maxPartBytes | minimum=0 |
$.archiveLimits.maxTotalExpandedBytes | minimum=0 |
Invoke
const input = await fetch("https://runstamp.com/demo-evidence/operation-evidence/docx/docx.diff/input.json").then((response) => response.json());
const result = await runstamp.run("docx.diff", input);
if (!result.ok) throw new Error(`${result.error.code}: ${result.error.remediation}`);
console.log(result.value, result.losses, result.diagnostics, result.receipt);curl -fsS https://runstamp.com/demo-evidence/operation-evidence/docx/docx.diff/input.json -o input.json
npx -p @runstamp/sdk runstamp ops invoke docx.diff --input input.json{
"tool": "runstamp_invoke_operation",
"arguments": {
"operation": "docx.diff",
"input": "<JSON from https://runstamp.com/demo-evidence/operation-evidence/docx/docx.diff/input.json>",
"execution_mode": "local"
}
}Errors and losses
Declared errors (7)
common/SCHEMA_REJECTEDcommon/CONTRACT_VIOLATIONcommon/OPERATION_CANCELLEDcommon/OPERATION_TIMEOUTcommon/RESOURCE_LIMIT_EXCEEDEDdocx/DOC_INVALIDdocx/LOSS_POLICY_VIOLATED
Declared losses (10)
docx/DIFF_PART_DROPPEDdocx/DIFF_PART_CHANGEDdocx/DIFF_SECTION_CHANGEDdocx/DIFF_BODY_FEATURE_DROPPEDdocx/PLACEHOLDER_UNFILLEDdocx/PLACEHOLDER_SPLITdocx/PDF_BRIDGE_APPROXIMATEDdocx/HTML_CONSTRUCT_UNSUPPORTEDdocx/SERIALIZER_CONDITIONdocx/UNCLASSIFIED_CONDITION
SDK AbortSignal, CLI exit 130, and MCP cancellation return the typed common/OPERATION_CANCELLED failure envelope.
Verified example and exact contract
- Fixture:
icp-workflow(Original and approved Q2 business-review revisions). - Example input — SHA-256
963390d4c8cca43a27b8ea49300a13c6ae269a0e926fd2c8db307096b03f0efa. - Example result — SHA-256
c990a9c89e7a6bfb8e325287c269b232f9967f9be14f8a7bcd5163b3bf9687fc. - Verified result SHA-256:
59b237c14b382c5e3fb58cc57bc9cb5a45fb7528b114baa63c0dc1424f0901d3. - Qualification lane:
10-pptx-docx.
Contract fingerprints
- Descriptor:
b878612ba5dda290b369e138624f06fc14bce7303117e0ee36a02e2f7cf43bdc. - Input schema:
eecbef713539833541f710481d0b7b52bb091358d48537aa533353ceb015e769. - Options schema:
f0296dd4b50023b108fbffd0947ec470c4f828ea46737e7668a66ca168f659bd. - Result value schema:
5e827fcd5ee2536733af81f59a91ba94eacf5affb4148e68bb685c9845fa561b.
The machine-readable operation reference publishes the complete schemas, qualification results, and evidence bindings for every operation.