{
  "id": "dependency-version-select",
  "name": "Exact finite dependency version selector",
  "description": "Select the lexicographically highest jointly compatible stable versions in caller-declared package priority from a complete supplied finite catalogue, with first-failure witnesses for every earlier combination. Valid infeasibility is a normal paid result; never contacts a registry or installs packages.",
  "category": "data-assurance",
  "priceUsd": "0.008",
  "pricingStatus": "proposed-unverified",
  "pricing": {
    "unit": "one successful operation call",
    "proposedNominalUsd": "0.008",
    "sixDecimalTokenBaseUnits": "8000",
    "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": [
    "select compatible finite dependency versions",
    "pin closed supplied release catalogue",
    "prove lexicographic finite version selection or catalogue infeasibility"
  ],
  "whenToUse": [
    "Choosing one supplied version of every package for a bounded offline release fixture",
    "Resolving conditional version requirements, including self-dependencies and cycles",
    "Regenerating and checking every rejected higher-priority combination from explicit evidence"
  ],
  "whenNotToUse": [
    "Registry lookup, download, installation, native npm lockfile generation or unseen releases",
    "Prerelease/build metadata or npm/pnpm/yarn range, peer, optional, workspace, platform or engine semantics",
    "Authenticity, vulnerability or license checks; minimum-change objectives; installation ordering",
    "Fetching sources, changing external state or executing supplied data"
  ],
  "capabilities": [
    "Typed stable version intervals with union arms and conjunctive active constraints",
    "Exact raw Cartesian domain bounded before enumeration, with last package varying fastest",
    "Input package priority and numeric descending candidates define deterministic selection",
    "Original candidate indexes and flattened source pointers make rejection witnesses reproducible",
    "Valid selected and infeasible outcomes each incur the proposed per-result price",
    "Deterministic supplied-input-only inert artifact; no network, clock, randomness or external state change"
  ],
  "related": [
    "semver-evaluate",
    "lockfile-inventory",
    "contract-version-route"
  ],
  "limits": {
    "inputBytes": 100000,
    "outputBytes": 300000,
    "jsonNodes": 10000,
    "depth": 20,
    "profile": "closed-set-stable-semver-selection-v1",
    "packages": 16,
    "candidatesPerPackage": 8,
    "candidates": 64,
    "reachableCandidatesUnderJointCaps": 44,
    "constraints": 128,
    "intervalsPerConstraint": 4,
    "intervals": 512,
    "versionComponentMaximum": 1000000000,
    "identifierUtf8Bytes": 128,
    "completeCombinations": 4096,
    "constraintVisits": 524288,
    "membershipTests": 4096,
    "endpointTriples": 1024,
    "packagePositions": 65536
  },
  "errorCodes": [
    "INPUT_LIMIT",
    "OUTPUT_LIMIT",
    "COMPLEXITY_LIMIT",
    "INVALID_JSON",
    "INVALID_NUMBER",
    "INVALID_UNICODE",
    "UNSAFE_KEY",
    "INVALID_INPUT",
    "VERSION_CATALOGUE_DUPLICATE",
    "VERSION_CANDIDATE_LIMIT",
    "VERSION_CONSTRAINT_LIMIT",
    "VERSION_INTERVAL_LIMIT",
    "VERSION_INTERVAL",
    "VERSION_TARGET",
    "VERSION_SEARCH_LIMIT",
    "STATE_WORK_LIMIT"
  ],
  "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": "dependency-version-select",
      "operation.category": "data-assurance",
      "limit.httpRequestBytes": 131072,
      "limit.requestBytes": 100000,
      "limit.responseBytes": 524288,
      "limit.resultBytes": 300000,
      "limit.jsonDepth": 20,
      "limit.jsonNodes": 10000,
      "dependencySelection.profile": "closed-set-stable-semver-selection-v1",
      "dependencySelection.objective": "input-package-priority-highest-stable-version",
      "dependencySelection.versionSyntax": "stable-integer-triples-only",
      "dependencySelection.constraintSyntax": "union-of-half-open-version-intervals",
      "dependencySelection.everyListedPackageSelected": true,
      "dependencySelection.exactWithinSuppliedCatalogue": true,
      "dependencySelection.firstFailureCertificate": true,
      "dependencySelection.maxPackages": 16,
      "dependencySelection.maxCandidatesPerPackage": 8,
      "dependencySelection.maxCandidates": 64,
      "dependencySelection.maxRawCombinations": 4096,
      "dependencySelection.maxConstraints": 128,
      "dependencySelection.maxIntervals": 512,
      "dependencySelection.versionComponentMaximum": 1000000000,
      "dependencySelection.validInfeasibilityIsPaidResult": true,
      "dependencySelection.registryLookup": false,
      "dependencySelection.packageInstallation": false,
      "dependencySelection.nativeLockfile": false,
      "dependencySelection.npmRangeSemantics": false,
      "dependencySelection.prereleases": false,
      "dependencySelection.optionalPackageActivation": false,
      "dependencySelection.installationOrder": false,
      "dependencySelection.minimumChangeObjective": false,
      "dependencySelection.unseenReleasesVerified": false,
      "input.packages.maxItems": 16,
      "input.packages.minItems": 1,
      "input.requirements.maxItems": 128
    },
    "unknownPolicy": "Undeclared requirements are unknown, never compatible. Matching declared facts does not establish semantic fit or input validity.",
    "preflight": "/preflight"
  },
  "documentation": "/reference/tools/dependency-version-select.md",
  "serviceContract": "/reference/services/dependency-version-select.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/dependency-version-select",
    "mpp": "/v1/mpp/dependency-version-select"
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "packages": {
        "minItems": 1,
        "maxItems": 16,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "versions": {
              "minItems": 1,
              "maxItems": 8,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^(?:0|[1-9]\\d{0,8}|1000000000)\\.(?:0|[1-9]\\d{0,8}|1000000000)\\.(?:0|[1-9]\\d{0,8}|1000000000)$"
                  },
                  "requires": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "package": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "anyOf": {
                          "minItems": 1,
                          "maxItems": 4,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "minInclusive": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "maxLength": 32,
                                    "pattern": "^(?:0|[1-9]\\d{0,8}|1000000000)\\.(?:0|[1-9]\\d{0,8}|1000000000)\\.(?:0|[1-9]\\d{0,8}|1000000000)$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "maxExclusive": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "maxLength": 32,
                                    "pattern": "^(?:0|[1-9]\\d{0,8}|1000000000)\\.(?:0|[1-9]\\d{0,8}|1000000000)\\.(?:0|[1-9]\\d{0,8}|1000000000)$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "minInclusive",
                              "maxExclusive"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "package",
                        "anyOf"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "version",
                  "requires"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "id",
            "versions"
          ],
          "additionalProperties": false
        }
      },
      "requirements": {
        "maxItems": 128,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "package": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "anyOf": {
              "minItems": 1,
              "maxItems": 4,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "minInclusive": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32,
                        "pattern": "^(?:0|[1-9]\\d{0,8}|1000000000)\\.(?:0|[1-9]\\d{0,8}|1000000000)\\.(?:0|[1-9]\\d{0,8}|1000000000)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "maxExclusive": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32,
                        "pattern": "^(?:0|[1-9]\\d{0,8}|1000000000)\\.(?:0|[1-9]\\d{0,8}|1000000000)\\.(?:0|[1-9]\\d{0,8}|1000000000)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "minInclusive",
                  "maxExclusive"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "package",
            "anyOf"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "packages",
      "requirements"
    ],
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "operation",
      "version",
      "result",
      "provenance"
    ],
    "properties": {
      "operation": {
        "const": "dependency-version-select",
        "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": "closed-set-stable-semver-selection-v1"
              },
              "selectionPolicy": {
                "type": "string",
                "const": "input-package-priority-highest-stable-version"
              },
              "candidateSourceOrders": {
                "minItems": 1,
                "maxItems": 16,
                "type": "array",
                "items": {
                  "minItems": 1,
                  "maxItems": 8,
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 7
                  }
                }
              },
              "constraintSourcePointers": {
                "maxItems": 128,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 64,
                  "pattern": "^(?:\\/requirements\\/\\d+|\\/packages\\/\\d+\\/versions\\/\\d+\\/requires\\/\\d+)$"
                }
              },
              "status": {
                "type": "string",
                "const": "selected"
              },
              "selected": {
                "minItems": 1,
                "maxItems": 16,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "packageIndex": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 15
                    },
                    "packageId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "candidateIndex": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 7
                    },
                    "version": {
                      "type": "string",
                      "maxLength": 32,
                      "pattern": "^(?:0|[1-9]\\d{0,8}|1000000000)\\.(?:0|[1-9]\\d{0,8}|1000000000)\\.(?:0|[1-9]\\d{0,8}|1000000000)$"
                    }
                  },
                  "required": [
                    "packageIndex",
                    "packageId",
                    "candidateIndex",
                    "version"
                  ],
                  "additionalProperties": false
                }
              },
              "proof": {
                "type": "object",
                "properties": {
                  "profile": {
                    "type": "string",
                    "const": "mixed-radix-first-failure-v1"
                  },
                  "searchSpaceSize": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4096
                  },
                  "rejectionConstraintIndexes": {
                    "maxItems": 4096,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 127
                    }
                  },
                  "selectedOrdinal": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4095
                  }
                },
                "required": [
                  "profile",
                  "searchSpaceSize",
                  "rejectionConstraintIndexes",
                  "selectedOrdinal"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "profile",
              "selectionPolicy",
              "candidateSourceOrders",
              "constraintSourcePointers",
              "status",
              "selected",
              "proof"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "profile": {
                "type": "string",
                "const": "closed-set-stable-semver-selection-v1"
              },
              "selectionPolicy": {
                "type": "string",
                "const": "input-package-priority-highest-stable-version"
              },
              "candidateSourceOrders": {
                "minItems": 1,
                "maxItems": 16,
                "type": "array",
                "items": {
                  "minItems": 1,
                  "maxItems": 8,
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 7
                  }
                }
              },
              "constraintSourcePointers": {
                "maxItems": 128,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 64,
                  "pattern": "^(?:\\/requirements\\/\\d+|\\/packages\\/\\d+\\/versions\\/\\d+\\/requires\\/\\d+)$"
                }
              },
              "status": {
                "type": "string",
                "const": "infeasible"
              },
              "selected": {
                "type": "null"
              },
              "proof": {
                "type": "object",
                "properties": {
                  "profile": {
                    "type": "string",
                    "const": "mixed-radix-first-failure-v1"
                  },
                  "searchSpaceSize": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4096
                  },
                  "rejectionConstraintIndexes": {
                    "maxItems": 4096,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 127
                    }
                  },
                  "selectedOrdinal": {
                    "type": "null"
                  }
                },
                "required": [
                  "profile",
                  "searchSpaceSize",
                  "rejectionConstraintIndexes",
                  "selectedOrdinal"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "profile",
              "selectionPolicy",
              "candidateSourceOrders",
              "constraintSourcePointers",
              "status",
              "selected",
              "proof"
            ],
            "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": {
    "packages": [
      {
        "id": "renderer",
        "versions": [
          {
            "version": "2.0.0",
            "requires": [
              {
                "package": "core",
                "anyOf": [
                  {
                    "minInclusive": "2.0.0",
                    "maxExclusive": "3.0.0"
                  }
                ]
              }
            ]
          },
          {
            "version": "1.5.0",
            "requires": [
              {
                "package": "core",
                "anyOf": [
                  {
                    "minInclusive": "1.0.0",
                    "maxExclusive": "2.0.0"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "id": "exporter",
        "versions": [
          {
            "version": "1.0.0",
            "requires": [
              {
                "package": "core",
                "anyOf": [
                  {
                    "minInclusive": "1.0.0",
                    "maxExclusive": "2.0.0"
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "id": "core",
        "versions": [
          {
            "version": "2.1.0",
            "requires": []
          },
          {
            "version": "1.9.0",
            "requires": []
          }
        ]
      }
    ],
    "requirements": []
  },
  "exampleResponse": {
    "operation": "dependency-version-select",
    "version": "0.29.0",
    "result": {
      "profile": "closed-set-stable-semver-selection-v1",
      "selectionPolicy": "input-package-priority-highest-stable-version",
      "candidateSourceOrders": [
        [
          0,
          1
        ],
        [
          0
        ],
        [
          0,
          1
        ]
      ],
      "constraintSourcePointers": [
        "/packages/0/versions/0/requires/0",
        "/packages/0/versions/1/requires/0",
        "/packages/1/versions/0/requires/0"
      ],
      "status": "selected",
      "selected": [
        {
          "packageIndex": 0,
          "packageId": "renderer",
          "candidateIndex": 1,
          "version": "1.5.0"
        },
        {
          "packageIndex": 1,
          "packageId": "exporter",
          "candidateIndex": 0,
          "version": "1.0.0"
        },
        {
          "packageIndex": 2,
          "packageId": "core",
          "candidateIndex": 1,
          "version": "1.9.0"
        }
      ],
      "proof": {
        "profile": "mixed-radix-first-failure-v1",
        "searchSpaceSize": 4,
        "rejectionConstraintIndexes": [
          2,
          0,
          1
        ],
        "selectedOrdinal": 3
      }
    },
    "provenance": {
      "inputSha256": "1a43376351d4e6394d1bd8a5ba6158ade9566c0f0245f59a982bc40329a54d24",
      "outputSha256": "8d93e328f273dc0a99e6a07467368db39f5e7fafd216896d368194aea13ff6a6",
      "deterministic": true,
      "externalRequests": 0
    }
  },
  "requiredHeaders": {
    "Content-Type": "application/json",
    "Idempotency-Key": "random 16–128 character operation identifier"
  },
  "fixedExample": "/reference/examples/dependency-version-select.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."
  }
}
