Whether two metric definitions measure the same thing, and which fields differ

$0.005 USDC per call · Developer and security · POST /api/v1/metric-comparability · Id metric-comparability

Compares two structured metric definitions field by field (numerator, denominator, aggregation, weighting, population, filters, exclusions, period grain and calendar, timezone, currency, FX and tax basis, unit) and returns which differences make the numbers not comparable, which are adjustable with raw data, and which fields are missing from one side. In drift mode a is the old and b the new definition: a changed definition under an unchanged name is reported as definition-drift. For agents about to put two dashboards, reports or experiments side by side. It compares descriptions you supply after Unicode and punctuation normalization; it does not read data and cannot tell whether two differently worded definitions are equivalent.

What you get

Stops 'revenue' in one report being compared with 'revenue' in another. Instant, deterministic, $0.005.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/metric-comparability. 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/metric-comparability \
  -H 'content-type: application/json' \
  -d '{"a":{"name":"conversion rate","numerator":"orders","denominator":"sessions","aggregation":"ratio-of-sums","exclusions":["internal traffic"],"period":{"granularity":"week","calendar":"iso-week","timezone":"UTC"}},"b":{"name":"Conversion Rate","numerator":"orders","denominator":"unique visitors","aggregation":"mean-of-ratios","exclusions":["internal traffic","bots"],"period":{"granularity":"week","calendar":"us-week","timezone":"America/New_York"}},"mode":"drift"}'

Input

FieldTypeRequiredDescription
aobjectyes
bobjectyes
modestring; one of "compare", "drift"nodrift: a is the previous definition and b the current one under the same name.

Example request body

{
  "a": {
    "name": "conversion rate",
    "numerator": "orders",
    "denominator": "sessions",
    "aggregation": "ratio-of-sums",
    "exclusions": [
      "internal traffic"
    ],
    "period": {
      "granularity": "week",
      "calendar": "iso-week",
      "timezone": "UTC"
    }
  },
  "b": {
    "name": "Conversion Rate",
    "numerator": "orders",
    "denominator": "unique visitors",
    "aggregation": "mean-of-ratios",
    "exclusions": [
      "internal traffic",
      "bots"
    ],
    "period": {
      "granularity": "week",
      "calendar": "us-week",
      "timezone": "America/New_York"
    }
  },
  "mode": "drift"
}

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.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: 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.
verdictstring; one of "identical", "comparable-with-adjustment", "not-comparable", "incomplete"no
nameMatchbooleanno
driftbooleannoSame name (after normalization) but at least one blocking or adjustable difference.
differencesarray<object>no
comparedFieldsintegerno
skippedFieldsone ofno
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways 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