Browse operation contracts · Static machine index · OpenAPI release reference · Build manifest

Exact typed record crosstab

Compose first-occurrence typed row/column axes, dense counts, exact decimal-string sums and per-measure missing/null/valid coverage with aligned margins.

data-assurance · Operation ID: records-crosstab-compose

Choose this operation when

Outside this profile

Exact release references

Static JSON contract · Markdown reference · Fixed example response

Complete input schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "records": {
      "maxItems": 1000,
      "type": "array",
      "items": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      }
    },
    "rowPointers": {
      "minItems": 1,
      "maxItems": 2,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 2048,
        "pattern": "^(?:\\/(?:[^~]|~[01])*)*$"
      }
    },
    "columnPointers": {
      "minItems": 1,
      "maxItems": 2,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 2048,
        "pattern": "^(?:\\/(?:[^~]|~[01])*)*$"
      }
    },
    "measures": {
      "maxItems": 4,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "pointer": {
            "type": "string",
            "maxLength": 2048,
            "pattern": "^(?:\\/(?:[^~]|~[01])*)*$"
          }
        },
        "required": [
          "name",
          "pointer"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "records",
    "rowPointers",
    "columnPointers",
    "measures"
  ],
  "additionalProperties": false
}

Complete output-envelope schema

{
  "type": "object",
  "required": [
    "operation",
    "version",
    "result",
    "provenance"
  ],
  "properties": {
    "operation": {
      "const": "records-crosstab-compose",
      "type": "string"
    },
    "version": {
      "const": "0.29.0",
      "type": "string"
    },
    "result": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "typed-exact-decimal-crosstab-v1"
        },
        "axisOrder": {
          "type": "string",
          "const": "first-occurrence"
        },
        "rowAxes": {
          "maxItems": 128,
          "type": "array",
          "items": {
            "minItems": 1,
            "maxItems": 2,
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "missing"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "null"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "string"
                    },
                    "value": {
                      "type": "string",
                      "maxLength": 100000
                    }
                  },
                  "required": [
                    "type",
                    "value"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "number"
                    },
                    "value": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "type",
                    "value"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "boolean"
                    },
                    "value": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "type",
                    "value"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "columnAxes": {
          "maxItems": 128,
          "type": "array",
          "items": {
            "minItems": 1,
            "maxItems": 2,
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "missing"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "null"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "string"
                    },
                    "value": {
                      "type": "string",
                      "maxLength": 100000
                    }
                  },
                  "required": [
                    "type",
                    "value"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "number"
                    },
                    "value": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "type",
                    "value"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "boolean"
                    },
                    "value": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "type",
                    "value"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "counts": {
          "type": "object",
          "properties": {
            "cells": {
              "maxItems": 128,
              "type": "array",
              "items": {
                "maxItems": 128,
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1000
                }
              }
            },
            "rowTotals": {
              "maxItems": 128,
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              }
            },
            "columnTotals": {
              "maxItems": 128,
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              }
            },
            "grandTotal": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000
            }
          },
          "required": [
            "cells",
            "rowTotals",
            "columnTotals",
            "grandTotal"
          ],
          "additionalProperties": false
        },
        "measures": {
          "maxItems": 4,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "pointer": {
                "type": "string",
                "maxLength": 2048,
                "pattern": "^(?:\\/(?:[^~]|~[01])*)*$"
              },
              "sums": {
                "type": "object",
                "properties": {
                  "cells": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "maxItems": 128,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 47,
                        "pattern": "^(?:0|-?[1-9]\\d{0,26}|-?(?:0|[1-9]\\d{0,26})\\.\\d{0,17}[1-9])$"
                      }
                    }
                  },
                  "rowTotals": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 47,
                      "pattern": "^(?:0|-?[1-9]\\d{0,26}|-?(?:0|[1-9]\\d{0,26})\\.\\d{0,17}[1-9])$"
                    }
                  },
                  "columnTotals": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 47,
                      "pattern": "^(?:0|-?[1-9]\\d{0,26}|-?(?:0|[1-9]\\d{0,26})\\.\\d{0,17}[1-9])$"
                    }
                  },
                  "grandTotal": {
                    "type": "string",
                    "maxLength": 47,
                    "pattern": "^(?:0|-?[1-9]\\d{0,26}|-?(?:0|[1-9]\\d{0,26})\\.\\d{0,17}[1-9])$"
                  }
                },
                "required": [
                  "cells",
                  "rowTotals",
                  "columnTotals",
                  "grandTotal"
                ],
                "additionalProperties": false
              },
              "validCounts": {
                "type": "object",
                "properties": {
                  "cells": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "maxItems": 128,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000
                      }
                    }
                  },
                  "rowTotals": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  },
                  "columnTotals": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  },
                  "grandTotal": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  }
                },
                "required": [
                  "cells",
                  "rowTotals",
                  "columnTotals",
                  "grandTotal"
                ],
                "additionalProperties": false
              },
              "nullCounts": {
                "type": "object",
                "properties": {
                  "cells": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "maxItems": 128,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000
                      }
                    }
                  },
                  "rowTotals": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  },
                  "columnTotals": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  },
                  "grandTotal": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  }
                },
                "required": [
                  "cells",
                  "rowTotals",
                  "columnTotals",
                  "grandTotal"
                ],
                "additionalProperties": false
              },
              "missingCounts": {
                "type": "object",
                "properties": {
                  "cells": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "maxItems": 128,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000
                      }
                    }
                  },
                  "rowTotals": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  },
                  "columnTotals": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  },
                  "grandTotal": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  }
                },
                "required": [
                  "cells",
                  "rowTotals",
                  "columnTotals",
                  "grandTotal"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "name",
              "pointer",
              "sums",
              "validCounts",
              "nullCounts",
              "missingCounts"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "profile",
        "axisOrder",
        "rowAxes",
        "columnAxes",
        "counts",
        "measures"
      ],
      "additionalProperties": false
    },
    "provenance": {
      "type": "object",
      "required": [
        "inputSha256",
        "outputSha256",
        "deterministic",
        "externalRequests"
      ],
      "properties": {
        "inputSha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "outputSha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "deterministic": {
          "const": true
        },
        "externalRequests": {
          "const": 0
        }
      }
    }
  },
  "additionalProperties": false
}

Fixed example

One accepted fixed example, not a custom-input trial. No operation runs when this static page is requested.

Example input

{
  "records": [
    {
      "team": "A",
      "status": "open",
      "amount": "0.1"
    },
    {
      "team": "A",
      "status": "open",
      "amount": "0.2"
    },
    {
      "team": "A",
      "status": "closed",
      "amount": null
    },
    {
      "team": "B",
      "status": "open"
    },
    {
      "team": "B",
      "status": "closed",
      "amount": "-0.3"
    }
  ],
  "rowPointers": [
    "/team"
  ],
  "columnPointers": [
    "/status"
  ],
  "measures": [
    {
      "name": "amount",
      "pointer": "/amount"
    }
  ]
}

Example response

{
  "operation": "records-crosstab-compose",
  "version": "0.29.0",
  "result": {
    "profile": "typed-exact-decimal-crosstab-v1",
    "axisOrder": "first-occurrence",
    "rowAxes": [
      [
        {
          "type": "string",
          "value": "A"
        }
      ],
      [
        {
          "type": "string",
          "value": "B"
        }
      ]
    ],
    "columnAxes": [
      [
        {
          "type": "string",
          "value": "open"
        }
      ],
      [
        {
          "type": "string",
          "value": "closed"
        }
      ]
    ],
    "counts": {
      "cells": [
        [
          2,
          1
        ],
        [
          1,
          1
        ]
      ],
      "rowTotals": [
        3,
        2
      ],
      "columnTotals": [
        3,
        2
      ],
      "grandTotal": 5
    },
    "measures": [
      {
        "name": "amount",
        "pointer": "/amount",
        "sums": {
          "cells": [
            [
              "0.3",
              "0"
            ],
            [
              "0",
              "-0.3"
            ]
          ],
          "rowTotals": [
            "0.3",
            "-0.3"
          ],
          "columnTotals": [
            "0.3",
            "-0.3"
          ],
          "grandTotal": "0"
        },
        "validCounts": {
          "cells": [
            [
              2,
              0
            ],
            [
              0,
              1
            ]
          ],
          "rowTotals": [
            2,
            1
          ],
          "columnTotals": [
            2,
            1
          ],
          "grandTotal": 3
        },
        "nullCounts": {
          "cells": [
            [
              0,
              1
            ],
            [
              0,
              0
            ]
          ],
          "rowTotals": [
            1,
            0
          ],
          "columnTotals": [
            0,
            1
          ],
          "grandTotal": 1
        },
        "missingCounts": {
          "cells": [
            [
              0,
              0
            ],
            [
              1,
              0
            ]
          ],
          "rowTotals": [
            0,
            1
          ],
          "columnTotals": [
            1,
            0
          ],
          "grandTotal": 1
        }
      }
    ]
  },
  "provenance": {
    "inputSha256": "72b700a118cc9572364a507b93986dd707aadd075e3d697f3242807d7313db75",
    "outputSha256": "450697aed2f4eb568f1bb009e8db63f0e30a8691f3538227936e23d6345d8b68",
    "deterministic": true,
    "externalRequests": 0
  }
}

Bounds and precision

JavaScript IEEE-754 numbers; use strings for large integer IDs/exact decimals where the schema accepts strings. No lossless numeric parsing.

{
  "global": {
    "requestBytes": 131072,
    "responseBytes": 524288,
    "jsonDepth": 32,
    "jsonNodes": 20000,
    "requestsPerMinute": 60,
    "paidAttemptsPerMinute": 20,
    "idempotencyHours": 24
  },
  "operation": {
    "inputBytes": 100000,
    "outputBytes": 300000,
    "jsonNodes": 10000,
    "depth": 20,
    "profile": "typed-exact-decimal-crosstab-v1",
    "records": 1000,
    "rowPointers": 2,
    "columnPointers": 2,
    "measures": 4,
    "axisTuples": 128,
    "denseCells": 1024,
    "metricSlotsIncludingMargins": 4096,
    "pointerSteps": 64000,
    "decimalParses": 4000,
    "decimalIntegerDigits": 24,
    "decimalFractionDigits": 18,
    "pointerCharacters": 2048,
    "measureNameCharacters": 128
  }
}

Complete schemas, descriptions and cross-field validation may impose additional limits.

Proposed price and protocol definitions

{
  "unit": "one successful operation call",
  "proposedNominalUsd": "0.006",
  "sixDecimalTokenBaseUnits": "6000",
  "subscription": false,
  "includesPayerWalletOrNetworkFees": false,
  "liveQuoteVerified": false,
  "condition": "Actual SDK challenge is authoritative only within the caller's explicit authorization; configured six-decimal token peg is an operator assertion, not a conversion guarantee."
}

Protocol definitions: x402, mpp. MPP uses Tempo charge. Paid MCP execution is unsupported. All runtime readiness is not evaluated in this build.

API path templates, not endpoints on this documentation host

{
  "x402": "/v1/x402/records-crosstab-compose",
  "mpp": "/v1/mpp/records-crosstab-compose"
}

Required headers

{
  "Content-Type": "application/json",
  "Idempotency-Key": "random 16–128 character operation identifier"
}

Actual SDK challenge amount, asset, network, recipient and wallet costs must pass independent authorization. Preserve identical key, body, protocol and credential on retries; on PAYMENT_UNCERTAIN stop and reconcile.

Execution profile and provider conditions

{
  "deterministic": true,
  "externalRequests": 0,
  "maxExternalRequests": 0,
  "resultSnapshotPersisted": false,
  "fixedExampleIsIllustrativeSnapshot": false,
  "requiresPayment": true,
  "supportsMcpExecution": false
}

Deterministic supplied-input operation with no external requests or stored request/result bodies. Payment infrastructure retains payment metadata and hashes.

Failure handling

Declared requirements

Before any paid call, refresh the live operation contract and POST the complete bounded budgeted plan to the separate API's /preflight. Unknown requirements block selection; compatible preflight is not permission to spend.

Related contracts