{"uid":"cap_3pNpHmTmigRL-o1DKH1_Q","slug":"halowerk-twin-diff-8ae16b97","name":"Halowerk Twin Diff","description":"Takes two state documents — target (what the twin should look like) and observed (what was measured) — and returns a leaf-by-leaf comparison. Every leaf path carries one of five states: in_tolerance, out_of_tolerance, missing_in_observed, unexpected_in_observed or type_mismatch.","url":"https://agent.halowerk.com/v1/twin-diff?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"target":{"type":"object","description":"The desired state document (the twin)."},"observed":{"type":"object","description":"The observed state document (the measurement)."},"max_fields":{"type":"integer","default":2000,"maximum":2000,"minimum":1,"description":"Reject the request if the two documents together hold more leaf paths than this."},"tolerances":{"type":"array","items":{"type":"object","required":["field"],"properties":{"unit":{"type":"string","maxLength":32,"description":"Unit of this field, echoed into the result. Declared by you, never inferred."},"field":{"type":"string","maxLength":400,"minLength":1,"description":"Leaf path as it appears in the result, e.g. /pump/pressure_bar. A trailing /* applies the entry to every leaf below that prefix."},"tolerance_abs":{"type":"number","minimum":0,"description":"Absolute tolerance in the unit of this field."},"tolerance_ratio":{"type":"number","maximum":1,"minimum":0,"description":"Relative tolerance as a ratio of the larger of the two values."}},"additionalProperties":false},"maxItems":200,"description":"Per-path tolerances. Give tolerance_abs or tolerance_ratio, not both."},"ignore_fields":{"type":"array","items":{"type":"string","maxLength":400,"minLength":1},"maxItems":200,"description":"Paths to leave out of the comparison. A trailing /* ignores everything below that prefix."},"default_tolerance_ratio":{"type":"number","default":0,"maximum":1,"minimum":0,"description":"Relative tolerance for numeric paths without their own entry. 0 means exact equality."},"case_insensitive_strings":{"type":"boolean","default":false,"description":"Compare string leaves without regard to case."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_6Fcu59yh6ODPanJThgH5Z","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compares two JSON state documents (target vs observed) leaf-by-leaf and returns a per-path status indicating tolerance, deviation, missing, unexpected, or type-mismatch conditions.","exampleAgentPrompt":"Compare these two JSON state documents for our pump assembly — the target is what the twin should look like, the observed is this morning's sensor reading — and flag every leaf that's out of tolerance, missing, or unexpected. Use a default tolerance ratio of 0.02 and apply an absolute tolerance of 0.5 bar on /pump/pressure_bar.","exampleUseCases":[{"title":"IoT sensor drift detection","prompt":"I have a target configuration JSON for our HVAC unit and a live telemetry snapshot from the field. Can you diff them leaf-by-leaf and tell me which values are out of tolerance by more than 5% and which fields are missing entirely?"},{"title":"Robot arm state audit","prompt":"Check whether our robot arm's observed joint angles and torque readings match the target state from the mission plan — use an absolute tolerance of 0.1 degrees on all angle fields under /joints/* and flag anything unexpected in the observed document."},{"title":"Firmware deployment validation","prompt":"After our firmware update, I need to verify the device's reported configuration matches the expected spec. Compare the target spec JSON against the device's reported state JSON, ignore anything under /diagnostics/*, and use exact equality for all string fields with case-insensitive comparison turned on."}],"resultDescription":"A leaf-by-leaf comparison result where every path in either document is assigned one of five statuses: in_tolerance (numeric values agree within threshold), out_of_tolerance (numeric deviation exceeds threshold), missing_in_observed (path exists in target but not observed), unexpected_in_observed (path exists in observed but not target), or type_mismatch (same path but different data types). Each result entry echoes the unit if declared in the tolerances input.","failureModes":["Request rejected if combined leaf count of both documents exceeds max_fields (default 2000)","Malformed or non-object target/observed inputs cause validation error","Providing both tolerance_abs and tolerance_ratio for the same field is disallowed","Field path strings exceeding 400 characters are rejected","Payment of 0.003 USDC required via x402 protocol; failure to pay results in 402 response"],"whenToPreferThis":"Choose this endpoint when you need a structured, tolerance-aware, leaf-level diff between two JSON state documents — especially in digital twin, IoT, or industrial automation contexts where numeric fields have defined acceptable ranges. It is preferable over generic JSON diff tools when you need per-field tolerance rules (absolute or ratio), path-based ignoring, and a clean enumerated status per leaf rather than a raw patch set.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T06:48:13.742Z","isFirstParty":false,"canonicalSlug":"halowerk-twin-diff-8ae16b97"}