The replay store is the connector's one durable ledger. begin reserves the request's worst case in the Active record it claims the request with, in one write: a ledger that cannot be written means nothing runs. complete settles the reservation to the charge derived from the outcome's usage under the service's price table; a backend reports usage only, never cost, and a receipt carrying any other cost is answered with the Provider stand-in at the whole reservation. Amounts are integer micro-USD, prices micro-USD per million tokens, rounded up once per request. Refusals: CostBound (the worst case exceeds the invocation's max_cost_micro_usd, decided before the replay lookup) and SpendCeiling (the caller's window cannot hold the reservation, after the replay lookup). Each caller's config carries a spend ceiling and window length, both required nonzero; windows are fixed and aligned to the unix epoch, and a request belongs to the window it was admitted in. The per-window spend is re-derived from the records at open. gamecult.model.replay_record.v1 is replaced by v2 (no reader survives). The published invocation, receipt and result schemas and their wire goldens are regenerated; provider_request and input_reasoning_state stay byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
318 lines
7.4 KiB
JSON
318 lines
7.4 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"title": "TransportInvocation",
|
|
"type": "object",
|
|
"properties": {
|
|
"caller_runtime_id": {
|
|
"type": "string"
|
|
},
|
|
"expires_at_unix_ms": {
|
|
"type": "integer",
|
|
"format": "uint64",
|
|
"minimum": 0
|
|
},
|
|
"max_cost_micro_usd": {
|
|
"description": "The most this request may cost, in micro-USD: the caller's own bound\non it. Required nonzero. It is part of the invocation's identity, so a\nchanged budget under a recorded request id is a `ReplayConflict`.",
|
|
"type": "integer",
|
|
"format": "uint64",
|
|
"minimum": 0
|
|
},
|
|
"native_request_sha256": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer",
|
|
"format": "uint8",
|
|
"maximum": 255,
|
|
"minimum": 0
|
|
},
|
|
"maxItems": 32,
|
|
"minItems": 32
|
|
},
|
|
"provider_request_sha256": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer",
|
|
"format": "uint8",
|
|
"maximum": 255,
|
|
"minimum": 0
|
|
},
|
|
"maxItems": 32,
|
|
"minItems": 32
|
|
},
|
|
"request": {
|
|
"$ref": "#/$defs/ProviderRequest"
|
|
},
|
|
"schema_id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"schema_id",
|
|
"caller_runtime_id",
|
|
"expires_at_unix_ms",
|
|
"native_request_sha256",
|
|
"provider_request_sha256",
|
|
"max_cost_micro_usd",
|
|
"request"
|
|
],
|
|
"$defs": {
|
|
"CacheRetention": {
|
|
"type": "string",
|
|
"enum": [
|
|
"short",
|
|
"long"
|
|
]
|
|
},
|
|
"InputItem": {
|
|
"oneOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"UserText": {
|
|
"type": "object",
|
|
"properties": {
|
|
"text": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"text"
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"UserText"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"AssistantText": {
|
|
"type": "object",
|
|
"properties": {
|
|
"text": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"text"
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"AssistantText"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"ToolCall": {
|
|
"type": "object",
|
|
"properties": {
|
|
"arguments": {
|
|
"type": "string"
|
|
},
|
|
"call_id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"call_id",
|
|
"name",
|
|
"arguments"
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"ToolCall"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"ToolResult": {
|
|
"type": "object",
|
|
"properties": {
|
|
"call_id": {
|
|
"type": "string"
|
|
},
|
|
"output": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"call_id",
|
|
"output"
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"ToolResult"
|
|
]
|
|
},
|
|
{
|
|
"description": "One provider reasoning block, opaque to every caller: `state` is the\nconnector's own encoding of the whole block. Callers replay it\nverbatim in transcript order and never inspect or branch on it; only\nthe connector of `provider` reads it, and the service drops or refuses\nthe state of any other provider before a backend sees the request.",
|
|
"type": "object",
|
|
"properties": {
|
|
"ReasoningState": {
|
|
"type": "object",
|
|
"properties": {
|
|
"model": {
|
|
"type": "string"
|
|
},
|
|
"provider": {
|
|
"type": "string"
|
|
},
|
|
"state": {
|
|
"description": "MessagePack bin: raw bytes, never an array of integers",
|
|
"type": "string",
|
|
"format": "binary"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"provider",
|
|
"model",
|
|
"state"
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"ReasoningState"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"ProviderRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"cache_retention": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/$defs/CacheRetention"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"conversation_id": {
|
|
"type": "string"
|
|
},
|
|
"input": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/$defs/InputItem"
|
|
}
|
|
},
|
|
"instructions": {
|
|
"type": "string"
|
|
},
|
|
"max_output_tokens": {
|
|
"type": "integer",
|
|
"format": "uint32",
|
|
"minimum": 0
|
|
},
|
|
"model": {
|
|
"type": "string"
|
|
},
|
|
"output_schema_json": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"parallel_tool_calls": {
|
|
"type": "boolean"
|
|
},
|
|
"reasoning_effort": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/$defs/ReasoningEffort"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"request_id": {
|
|
"type": "string"
|
|
},
|
|
"schema_id": {
|
|
"type": "string"
|
|
},
|
|
"tool_choice": {
|
|
"$ref": "#/$defs/ToolChoice"
|
|
},
|
|
"tools": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/$defs/ToolDefinition"
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"schema_id",
|
|
"request_id",
|
|
"conversation_id",
|
|
"model",
|
|
"instructions",
|
|
"input",
|
|
"tools",
|
|
"tool_choice",
|
|
"parallel_tool_calls",
|
|
"max_output_tokens"
|
|
]
|
|
},
|
|
"ReasoningEffort": {
|
|
"type": "string",
|
|
"enum": [
|
|
"low",
|
|
"medium",
|
|
"high",
|
|
"max"
|
|
]
|
|
},
|
|
"ToolChoice": {
|
|
"type": "string",
|
|
"enum": [
|
|
"auto",
|
|
"required"
|
|
]
|
|
},
|
|
"ToolDefinition": {
|
|
"type": "object",
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"parameters_json": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"name",
|
|
"description",
|
|
"parameters_json"
|
|
]
|
|
}
|
|
}
|
|
}
|