{
  "id": "time-series-grid-compose",
  "name": "Exact supported time-series grid composer",
  "description": "Compose an aligned grid from supplied nonoverlapping piecewise-constant segments with exact rational integrals, means over supplied support and source contribution durations.",
  "category": "structured",
  "priceUsd": "0.005",
  "pricingStatus": "proposed-unverified",
  "pricing": {
    "unit": "one successful operation call",
    "proposedNominalUsd": "0.005",
    "sixDecimalTokenBaseUnits": "5000",
    "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."
  },
  "intents": [
    "resample piecewise-constant time series to an exact aligned grid",
    "calculate time-weighted means over explicit supplied support",
    "compose exact rational series cells with missing-support evidence"
  ],
  "whenToUse": [
    "resample piecewise-constant time series to an exact aligned grid",
    "calculate time-weighted means over explicit supplied support",
    "compose exact rational series cells with missing-support evidence"
  ],
  "whenNotToUse": [
    "Interpolation, zero filling, extrapolation or last-observation carry-forward",
    "Overlapping segments within one series or undeclared measurement validity",
    "Floating-point approximations, display rounding or inference of observation quality",
    "Accessing calendars, scheduling jobs, reserving meetings, network requests or external state changes"
  ],
  "capabilities": [
    "Exact reduced rational value-times-ticks integrals and support-only means; zero support yields null mean",
    "Per-cell support completeness and sorted source-duration contributions; complete result does not imply complete data support",
    "Canonical shortest signed decimal values: up to 12 integer digits and 6 fractional digits; no negative zero or trailing fractional zeros",
    "Nonoverlapping sources are clipped to the grid; empty series is valid and source order is irrelevant",
    "Caller-supplied data only; no current clock, randomness, environment or timezone-database reads",
    "Complete bounded validation before payment challenge; externalRequests=0"
  ],
  "limits": {
    "inputBytes": 100000,
    "outputBytes": 400000,
    "jsonNodes": 12000,
    "depth": 20,
    "profile": "explicit-support-grid-v1",
    "series": 8,
    "segments": 1000,
    "cellsPerSeries": 256,
    "aggregateCells": 512,
    "contributions": 2000,
    "endpointTicks": 1000000000000,
    "valueIntegerDigits": 12,
    "valueFractionalDigits": 6,
    "labelCodeUnits": 128
  },
  "related": [
    "time-series-inspect",
    "records-aggregate",
    "decimal-distribution-summarize"
  ],
  "errorCodes": [
    "INPUT_LIMIT",
    "OUTPUT_LIMIT",
    "COMPLEXITY_LIMIT",
    "INVALID_JSON",
    "INVALID_NUMBER",
    "INVALID_UNICODE",
    "UNSAFE_KEY",
    "INVALID_INTERVAL",
    "INVALID_GRID",
    "OVERLAPPING_SEGMENTS",
    "DUPLICATE_ID"
  ],
  "requirementsProfile": {
    "format": "declared-requirements-v1",
    "facts": {
      "execution.suppliedCode": false,
      "execution.remoteMutation": false,
      "execution.llmInference": false,
      "execution.paidMcp": false,
      "verification.semanticTruth": false,
      "verification.sourceAuthenticity": false,
      "verification.liveVulnerabilities": false,
      "numbers.arbitraryPrecisionJson": false,
      "numbers.model": "ieee754-binary64",
      "privacy.requestBodyPersisted": false,
      "execution.deterministic": true,
      "execution.networkAccess": false,
      "privacy.resultBodyPersisted": false,
      "payment.x402": true,
      "payment.mpp": true,
      "operation.id": "time-series-grid-compose",
      "operation.category": "structured",
      "limit.httpRequestBytes": 131072,
      "limit.requestBytes": 100000,
      "limit.responseBytes": 524288,
      "limit.resultBytes": 400000,
      "limit.jsonDepth": 20,
      "limit.jsonNodes": 12000,
      "timeGrid.profile": "explicit-support-grid-v1",
      "timeGrid.maxSeries": 8,
      "timeGrid.maxCellsPerSeries": 256,
      "timeGrid.maxTotalCells": 512,
      "timeGrid.maxSegments": 1000,
      "timeGrid.maxContributions": 2000,
      "timeGrid.maxDecimalIntegerDigits": 12,
      "timeGrid.maxDecimalFractionDigits": 6,
      "timeGrid.exactRationalArithmetic": true,
      "timeGrid.canonicalDecimals": "no-leading-zeros-or-fractional-trailing-zeros",
      "timeGrid.explicitSupport": true,
      "timeGrid.meanDenominator": "supplied-supported-ticks-only",
      "timeGrid.zeroFill": false,
      "timeGrid.interpolation": false,
      "timeGrid.extrapolation": false,
      "timeGrid.measurementQualityVerified": false,
      "timeGrid.overlappingSegments": false,
      "input.step.maximum": 1000000000000,
      "input.step.minimum": 1,
      "input.timeUnit.maxLength": 128,
      "input.timeUnit.minLength": 1,
      "input.valueUnit.maxLength": 128,
      "input.valueUnit.minLength": 1,
      "input.series.maxItems": 8,
      "input.series.minItems": 1
    },
    "unknownPolicy": "Undeclared requirements are unknown, never compatible. Matching declared facts does not establish semantic fit or input validity.",
    "preflight": "/preflight"
  },
  "documentation": "/reference/tools/time-series-grid-compose.md",
  "serviceContract": "/reference/services/time-series-grid-compose.json",
  "errors": [
    {
      "status": 400,
      "meaning": "Malformed JSON, missing/invalid idempotency key, or payment identifier mismatch",
      "retry": "Correct the request before payment"
    },
    {
      "status": 402,
      "meaning": "Payment challenge or rejected payment",
      "retry": "Use official protocol SDK; inspect payment outcome before another payment"
    },
    {
      "status": 409,
      "meaning": "Idempotency conflict, duplicate proof, or PAYMENT_UNCERTAIN",
      "retry": "Keep original key, body, and proof; reconcile uncertainty with operator; never blindly repay"
    },
    {
      "status": 413,
      "meaning": "Input or generated output too large",
      "retry": "Reduce input; no payment attempted for validation failure"
    },
    {
      "status": 415,
      "meaning": "Unsupported media type or compression",
      "retry": "Send uncompressed application/json"
    },
    {
      "status": 422,
      "meaning": "Schema or service-specific semantic validation failure",
      "retry": "Correct input using returned error code; no payment attempted"
    },
    {
      "status": 429,
      "meaning": "Request/payment-attempt rate exceeded",
      "retry": "Wait for rate limit window; preserve existing payment identity"
    },
    {
      "status": 503,
      "meaning": "Payment configuration/provider/state unavailable, or live DNS preparation failed before settlement",
      "retry": "Check readiness; DNS preparation failures may retry the identical key/body/credential only; uncertainty requires reconciliation"
    }
  ],
  "numericPrecision": "JavaScript IEEE-754 numbers; use strings for large integer IDs/exact decimals where the schema accepts strings. No lossless numeric parsing.",
  "paymentWorkflow": {
    "discoveryOnly": false,
    "supportedProtocols": [
      "x402",
      "mpp"
    ],
    "x402": {
      "credentialHeader": "PAYMENT-SIGNATURE",
      "challengeHeader": "PAYMENT-REQUIRED",
      "receiptHeader": "PAYMENT-RESPONSE",
      "version": 2,
      "scheme": "exact",
      "paymentIdentifier": "payment-identifier extension MUST equal the HTTP Idempotency-Key",
      "sdk": "@x402/core with @x402/evm"
    },
    "mpp": {
      "supported": true,
      "credentialHeader": "Authorization",
      "challengeHeader": "WWW-Authenticate",
      "receiptHeader": "Payment-Receipt",
      "method": "tempo",
      "intent": "charge",
      "sdk": "mppx",
      "tokenDecimals": 6
    },
    "steps": [
      "Check configured readiness and the exact service schema",
      "Generate a fresh random Idempotency-Key for this operation; never use a discovery probe fixture for purchases",
      "Send valid input without a credential to obtain the official protocol challenge",
      "Use the official SDK and authorized wallet to fulfill the challenge",
      "Retry only with identical key, body, protocol and credential",
      "On PAYMENT_UNCERTAIN stop and request operator reconciliation; never blindly pay again"
    ],
    "versionedRetries": "Request fingerprint includes service release version. Retries across a version upgrade can conflict; coordinate upgrades outside the 24-hour replay window and reconcile pending attempts.",
    "docs": "/llms.txt"
  },
  "method": "POST",
  "paths": {
    "x402": "/v1/x402/time-series-grid-compose",
    "mpp": "/v1/mpp/time-series-grid-compose"
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "window": {
        "type": "object",
        "properties": {
          "start": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000000
          },
          "end": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000000
          }
        },
        "required": [
          "start",
          "end"
        ],
        "additionalProperties": false
      },
      "step": {
        "type": "integer",
        "minimum": 1,
        "maximum": 1000000000000
      },
      "timeUnit": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128
      },
      "valueUnit": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128
      },
      "series": {
        "minItems": 1,
        "maxItems": 8,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
            },
            "segments": {
              "maxItems": 1000,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                  },
                  "start": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000000000000
                  },
                  "end": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000000000000
                  },
                  "value": {
                    "type": "string",
                    "maxLength": 20,
                    "pattern": "^(?!-0$)-?(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{0,5}[1-9])?$"
                  }
                },
                "required": [
                  "id",
                  "start",
                  "end",
                  "value"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "id",
            "segments"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "window",
      "step",
      "timeUnit",
      "valueUnit",
      "series"
    ],
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "operation",
      "version",
      "result",
      "provenance"
    ],
    "properties": {
      "operation": {
        "const": "time-series-grid-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": "explicit-support-grid-v1"
          },
          "timeUnit": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "valueUnit": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "series": {
            "minItems": 1,
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                },
                "cells": {
                  "minItems": 1,
                  "maxItems": 256,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "start": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000000
                      },
                      "end": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000000
                      },
                      "supportedTicks": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000000
                      },
                      "integral": {
                        "type": "object",
                        "properties": {
                          "numerator": {
                            "type": "string",
                            "pattern": "^(?:0|-?[1-9][0-9]*)$"
                          },
                          "denominator": {
                            "type": "string",
                            "pattern": "^[1-9][0-9]*$"
                          }
                        },
                        "required": [
                          "numerator",
                          "denominator"
                        ],
                        "additionalProperties": false
                      },
                      "meanOverSupport": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "numerator": {
                                "type": "string",
                                "pattern": "^(?:0|-?[1-9][0-9]*)$"
                              },
                              "denominator": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]*$"
                              }
                            },
                            "required": [
                              "numerator",
                              "denominator"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "completeSupport": {
                        "type": "boolean"
                      },
                      "contributions": {
                        "maxItems": 1000,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "segmentId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
                            },
                            "ticks": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000000000
                            }
                          },
                          "required": [
                            "segmentId",
                            "ticks"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "start",
                      "end",
                      "supportedTicks",
                      "integral",
                      "meanOverSupport",
                      "completeSupport",
                      "contributions"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "id",
                "cells"
              ],
              "additionalProperties": false
            }
          },
          "complete": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "profile",
          "timeUnit",
          "valueUnit",
          "series",
          "complete"
        ],
        "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
  },
  "exampleInput": {
    "window": {
      "start": 0,
      "end": 12
    },
    "step": 4,
    "timeUnit": "seconds",
    "valueUnit": "requests-per-second",
    "series": [
      {
        "id": "load",
        "segments": [
          {
            "id": "a",
            "start": 0,
            "end": 3,
            "value": "2"
          },
          {
            "id": "b",
            "start": 3,
            "end": 7,
            "value": "4"
          },
          {
            "id": "c",
            "start": 9,
            "end": 12,
            "value": "1"
          }
        ]
      }
    ]
  },
  "exampleResponse": {
    "operation": "time-series-grid-compose",
    "version": "0.29.0",
    "result": {
      "profile": "explicit-support-grid-v1",
      "timeUnit": "seconds",
      "valueUnit": "requests-per-second",
      "series": [
        {
          "id": "load",
          "cells": [
            {
              "start": 0,
              "end": 4,
              "supportedTicks": 4,
              "integral": {
                "numerator": "10",
                "denominator": "1"
              },
              "meanOverSupport": {
                "numerator": "5",
                "denominator": "2"
              },
              "completeSupport": true,
              "contributions": [
                {
                  "segmentId": "a",
                  "ticks": 3
                },
                {
                  "segmentId": "b",
                  "ticks": 1
                }
              ]
            },
            {
              "start": 4,
              "end": 8,
              "supportedTicks": 3,
              "integral": {
                "numerator": "12",
                "denominator": "1"
              },
              "meanOverSupport": {
                "numerator": "4",
                "denominator": "1"
              },
              "completeSupport": false,
              "contributions": [
                {
                  "segmentId": "b",
                  "ticks": 3
                }
              ]
            },
            {
              "start": 8,
              "end": 12,
              "supportedTicks": 3,
              "integral": {
                "numerator": "3",
                "denominator": "1"
              },
              "meanOverSupport": {
                "numerator": "1",
                "denominator": "1"
              },
              "completeSupport": false,
              "contributions": [
                {
                  "segmentId": "c",
                  "ticks": 3
                }
              ]
            }
          ]
        }
      ],
      "complete": true
    },
    "provenance": {
      "inputSha256": "aca420f4b753b855599d4f1fbe71cbae95db8b4c354530674f361c412b0151a1",
      "outputSha256": "8fd5e070be522a17b80a4916857c16ce588d5cd527fa2c39465dd7b00dfe31f1",
      "deterministic": true,
      "externalRequests": 0
    }
  },
  "requiredHeaders": {
    "Content-Type": "application/json",
    "Idempotency-Key": "random 16–128 character operation identifier"
  },
  "fixedExample": "/reference/examples/time-series-grid-compose.json",
  "execution": {
    "deterministic": true,
    "externalRequests": 0,
    "maxExternalRequests": 0,
    "resultSnapshotPersisted": false,
    "fixedExampleIsIllustrativeSnapshot": false,
    "requiresPayment": true,
    "supportsMcpExecution": false
  },
  "releaseSnapshot": {
    "format": "static-release-reference-v1",
    "sourceVersion": "0.29.0",
    "sourceRegistrySha256": "a2b5ec09bf6c38b9d2879d746a4fded374f5928b445377b0270ef6aa8e6cac65",
    "generatedAt": "2026-10-06T15:38:00Z",
    "releaseAcceptance": "not-verified-by-generator",
    "runtimeReadiness": "not-evaluated",
    "livePaymentsVerified": false,
    "indexingVerified": false,
    "apiOrigin": null,
    "notice": "Build-time release reference. Runtime readiness, deployment, payment settlement and external indexing are not evaluated here. Prices are proposed; this file cannot authorize execution or payment."
  }
}
