{
  "id": "assignment-cost-optimize",
  "name": "Exact fixed-slot cost assignment",
  "description": "Choose an exact minimum-cost complete one-job-per-slot assignment over caller-declared nonoverlapping slots and admissible edges, with lexical ties and a verifiable optimum or Hall-deficiency certificate. No live availability check, reservation or job dispatch.",
  "category": "workflow-assurance",
  "priceUsd": "0.01",
  "pricingStatus": "proposed-unverified",
  "pricing": {
    "unit": "one successful operation call",
    "proposedNominalUsd": "0.01",
    "sixDecimalTokenBaseUnits": "10000",
    "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": [
    "Assign independent jobs to fixed slots at minimum total cost",
    "Optimize exact one-to-one job and slot pairing with forbidden assignments"
  ],
  "whenToUse": [
    "Caller declares all admissible edges and pairwise nonoverlapping slots in one time coordinate system"
  ],
  "whenNotToUse": [
    "General precedence or resource scheduling, overlapping slots, travel-time or skill inference",
    "Live calendar availability, slot reservation, real job dispatch, payments or currency conversion"
  ],
  "capabilities": [
    "Exact decimal BigInt optimization with lexical slot-ID ties in sorted job order",
    "Complete assignments and start-ordered inert schedules with residual-potential optimum certificates",
    "Maximum cardinality and a Hall-deficient job-set witness when no complete schedule exists",
    "Pure full evaluation before payment challenge; valid infeasible results contain no usable schedule"
  ],
  "related": [
    "workflow-resource-plan",
    "interval-analyze"
  ],
  "limits": {
    "inputBytes": 100000,
    "outputBytes": 400000,
    "jsonNodes": 12000,
    "depth": 20,
    "jobs": 16,
    "slots": 32,
    "edges": 512,
    "tickMaximum": 1000000000000,
    "decimalIntegerDigits": 12,
    "decimalFractionDigits": 6,
    "vertices": 50,
    "residualArcs": 1120,
    "augmentations": 16,
    "maximumVertexSelectionChecks": 40000,
    "maximumEdgeRelaxationChecks": 17920
  },
  "errorCodes": [
    "INPUT_LIMIT",
    "OUTPUT_LIMIT",
    "COMPLEXITY_LIMIT",
    "INVALID_JSON",
    "INVALID_NUMBER",
    "INVALID_UNICODE",
    "UNSAFE_KEY",
    "DUPLICATE_ID",
    "INVALID_SLOT",
    "OVERLAPPING_SLOTS",
    "UNKNOWN_EDGE_ID",
    "DUPLICATE_EDGE",
    "INTERNAL_CERTIFICATE"
  ],
  "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": "assignment-cost-optimize",
      "operation.category": "workflow-assurance",
      "limit.httpRequestBytes": 131072,
      "limit.requestBytes": 100000,
      "limit.responseBytes": 524288,
      "limit.resultBytes": 400000,
      "limit.jsonDepth": 20,
      "limit.jsonNodes": 12000,
      "assignment.profile": "fixed-slot-exact-assignment-v1",
      "assignment.maxJobs": 16,
      "assignment.maxSlots": 32,
      "assignment.maxEdges": 512,
      "assignment.maxDecimalIntegerDigits": 12,
      "assignment.maxDecimalFractionDigits": 6,
      "assignment.slotModel": "pairwise-nonoverlapping-half-open-fixed-slots",
      "assignment.objective": "minimum-total-caller-declared-cost",
      "assignment.tieBreak": "lexicographic-slot-id-vector-in-utf16-job-id-order",
      "assignment.exactOptimality": true,
      "assignment.feasibilityGuaranteed": false,
      "assignment.binaryFloatCosts": false,
      "assignment.generalResourceScheduling": false,
      "assignment.dependenciesInferred": false,
      "assignment.availabilityVerified": false,
      "assignment.reservesSlots": false,
      "assignment.executesSchedule": false,
      "input.jobIds.maxItems": 16,
      "input.jobIds.minItems": 1,
      "input.slots.maxItems": 32,
      "input.slots.minItems": 1,
      "input.edges.maxItems": 512,
      "input.timeUnit.maxLength": 100,
      "input.timeUnit.minLength": 1,
      "input.timeOrigin.maxLength": 100,
      "input.timeOrigin.minLength": 1,
      "input.costUnit.maxLength": 100,
      "input.costUnit.minLength": 1
    },
    "unknownPolicy": "Undeclared requirements are unknown, never compatible. Matching declared facts does not establish semantic fit or input validity.",
    "preflight": "/preflight"
  },
  "documentation": "/reference/tools/assignment-cost-optimize.md",
  "serviceContract": "/reference/services/assignment-cost-optimize.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/assignment-cost-optimize",
    "mpp": "/v1/mpp/assignment-cost-optimize"
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "jobIds": {
        "minItems": 1,
        "maxItems": 16,
        "type": "array",
        "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        }
      },
      "slots": {
        "minItems": 1,
        "maxItems": 32,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "start": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000000000
            },
            "end": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000000000
            }
          },
          "required": [
            "id",
            "start",
            "end"
          ],
          "additionalProperties": false
        }
      },
      "edges": {
        "maxItems": 512,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "jobId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "slotId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "cost": {
              "type": "string",
              "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$"
            }
          },
          "required": [
            "jobId",
            "slotId",
            "cost"
          ],
          "additionalProperties": false
        }
      },
      "timeUnit": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "timeOrigin": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "costUnit": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      }
    },
    "required": [
      "jobIds",
      "slots",
      "edges",
      "timeUnit",
      "timeOrigin",
      "costUnit"
    ],
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "operation",
      "version",
      "result",
      "provenance"
    ],
    "properties": {
      "operation": {
        "const": "assignment-cost-optimize",
        "type": "string"
      },
      "version": {
        "const": "0.29.0",
        "type": "string"
      },
      "result": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "profile": {
                "type": "string",
                "const": "fixed-slot-exact-assignment-v1"
              },
              "externalRequests": {
                "type": "number",
                "const": 0
              },
              "execution": {
                "type": "boolean",
                "const": false
              },
              "availabilityVerified": {
                "type": "boolean",
                "const": false
              },
              "timeUnit": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "timeOrigin": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "costUnit": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "jobIds": {
                "minItems": 1,
                "maxItems": 16,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "slotIds": {
                "minItems": 1,
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "status": {
                "type": "string",
                "const": "optimal"
              },
              "assignments": {
                "minItems": 1,
                "maxItems": 16,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "jobId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "slotId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "start": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000000000000
                    },
                    "end": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000000000000
                    },
                    "cost": {
                      "type": "string",
                      "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$"
                    }
                  },
                  "required": [
                    "jobId",
                    "slotId",
                    "start",
                    "end",
                    "cost"
                  ],
                  "additionalProperties": false
                }
              },
              "schedule": {
                "minItems": 1,
                "maxItems": 16,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "jobId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "slotId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "start": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000000000000
                    },
                    "end": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000000000000
                    },
                    "cost": {
                      "type": "string",
                      "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$"
                    }
                  },
                  "required": [
                    "jobId",
                    "slotId",
                    "start",
                    "end",
                    "cost"
                  ],
                  "additionalProperties": false
                }
              },
              "unusedSlotIds": {
                "maxItems": 31,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "totalCost": {
                "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
              },
              "certificate": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "min-cost-flow-potentials"
                  },
                  "scale": {
                    "type": "string",
                    "pattern": "^(?:0|[1-9][0-9]*)$"
                  },
                  "primaryMultiplier": {
                    "type": "string",
                    "pattern": "^(?:0|[1-9][0-9]*)$"
                  },
                  "tieBase": {
                    "type": "integer",
                    "minimum": 2,
                    "maximum": 33
                  },
                  "combinedCost": {
                    "type": "string",
                    "pattern": "^(?:0|[1-9][0-9]*)$"
                  },
                  "vertexPotentials": {
                    "minItems": 4,
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^(?:0|-?[1-9][0-9]*)$"
                    }
                  },
                  "requiredFlow": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 16
                  },
                  "achievedFlow": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 16
                  }
                },
                "required": [
                  "kind",
                  "scale",
                  "primaryMultiplier",
                  "tieBase",
                  "combinedCost",
                  "vertexPotentials",
                  "requiredFlow",
                  "achievedFlow"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "profile",
              "externalRequests",
              "execution",
              "availabilityVerified",
              "timeUnit",
              "timeOrigin",
              "costUnit",
              "jobIds",
              "slotIds",
              "status",
              "assignments",
              "schedule",
              "unusedSlotIds",
              "totalCost",
              "certificate"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "profile": {
                "type": "string",
                "const": "fixed-slot-exact-assignment-v1"
              },
              "externalRequests": {
                "type": "number",
                "const": 0
              },
              "execution": {
                "type": "boolean",
                "const": false
              },
              "availabilityVerified": {
                "type": "boolean",
                "const": false
              },
              "timeUnit": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "timeOrigin": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "costUnit": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "jobIds": {
                "minItems": 1,
                "maxItems": 16,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "slotIds": {
                "minItems": 1,
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "status": {
                "type": "string",
                "const": "infeasible"
              },
              "schedule": {
                "type": "null"
              },
              "maximumCardinality": {
                "type": "integer",
                "minimum": 0,
                "maximum": 15
              },
              "witness": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "hall-deficiency"
                  },
                  "jobIds": {
                    "minItems": 1,
                    "maxItems": 16,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    }
                  },
                  "neighborSlotIds": {
                    "maxItems": 32,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    }
                  },
                  "deficiency": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 16
                  },
                  "maximumMatching": {
                    "maxItems": 15,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "jobId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "slotId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        }
                      },
                      "required": [
                        "jobId",
                        "slotId"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "kind",
                  "jobIds",
                  "neighborSlotIds",
                  "deficiency",
                  "maximumMatching"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "profile",
              "externalRequests",
              "execution",
              "availabilityVerified",
              "timeUnit",
              "timeOrigin",
              "costUnit",
              "jobIds",
              "slotIds",
              "status",
              "schedule",
              "maximumCardinality",
              "witness"
            ],
            "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": {
    "jobIds": [
      "a",
      "b",
      "c"
    ],
    "slots": [
      {
        "id": "s1",
        "start": 0,
        "end": 10
      },
      {
        "id": "s2",
        "start": 10,
        "end": 20
      },
      {
        "id": "s3",
        "start": 20,
        "end": 30
      }
    ],
    "edges": [
      {
        "jobId": "a",
        "slotId": "s1",
        "cost": "7"
      },
      {
        "jobId": "a",
        "slotId": "s2",
        "cost": "1"
      },
      {
        "jobId": "a",
        "slotId": "s3",
        "cost": "4"
      },
      {
        "jobId": "b",
        "slotId": "s1",
        "cost": "2"
      },
      {
        "jobId": "b",
        "slotId": "s2",
        "cost": "6"
      },
      {
        "jobId": "b",
        "slotId": "s3",
        "cost": "5"
      },
      {
        "jobId": "c",
        "slotId": "s1",
        "cost": "3"
      },
      {
        "jobId": "c",
        "slotId": "s2",
        "cost": "4"
      },
      {
        "jobId": "c",
        "slotId": "s3",
        "cost": "1"
      }
    ],
    "timeUnit": "minute",
    "timeOrigin": "caller-defined zero",
    "costUnit": "model cost units"
  },
  "exampleResponse": {
    "operation": "assignment-cost-optimize",
    "version": "0.29.0",
    "result": {
      "profile": "fixed-slot-exact-assignment-v1",
      "externalRequests": 0,
      "execution": false,
      "availabilityVerified": false,
      "timeUnit": "minute",
      "timeOrigin": "caller-defined zero",
      "costUnit": "model cost units",
      "jobIds": [
        "a",
        "b",
        "c"
      ],
      "slotIds": [
        "s1",
        "s2",
        "s3"
      ],
      "status": "optimal",
      "assignments": [
        {
          "jobId": "a",
          "slotId": "s2",
          "start": 10,
          "end": 20,
          "cost": "1"
        },
        {
          "jobId": "b",
          "slotId": "s1",
          "start": 0,
          "end": 10,
          "cost": "2"
        },
        {
          "jobId": "c",
          "slotId": "s3",
          "start": 20,
          "end": 30,
          "cost": "1"
        }
      ],
      "schedule": [
        {
          "jobId": "b",
          "slotId": "s1",
          "start": 0,
          "end": 10,
          "cost": "2"
        },
        {
          "jobId": "a",
          "slotId": "s2",
          "start": 10,
          "end": 20,
          "cost": "1"
        },
        {
          "jobId": "c",
          "slotId": "s3",
          "start": 20,
          "end": 30,
          "cost": "1"
        }
      ],
      "unusedSlotIds": [],
      "totalCost": {
        "numerator": "4",
        "denominator": "1"
      },
      "certificate": {
        "kind": "min-cost-flow-potentials",
        "scale": "1",
        "primaryMultiplier": "64",
        "tieBase": 4,
        "combinedCost": "274",
        "vertexPotentials": [
          "0",
          "48",
          "0",
          "62",
          "128",
          "128",
          "128",
          "128"
        ],
        "requiredFlow": 3,
        "achievedFlow": 3
      }
    },
    "provenance": {
      "inputSha256": "f9e5201837d942fee4208f1463702123eb7efe360904719bc8393f0680cdfd7f",
      "outputSha256": "e078060ea2c9b79dfff96c4e2bcff3a77cd038736ab4285f0d4d4561e1e2065f",
      "deterministic": true,
      "externalRequests": 0
    }
  },
  "requiredHeaders": {
    "Content-Type": "application/json",
    "Idempotency-Key": "random 16–128 character operation identifier"
  },
  "fixedExample": "/reference/examples/assignment-cost-optimize.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."
  }
}
