games-development-ai/contracts/play-loop/cost-reservation.schema.json
lili cbfd4d871b
Some checks failed
contract-gates / contract-gates (push) Has been cancelled
docs-gate / docs-gate (push) Has been cancelled
feat(acceptance): 闭合 playtest v3 与 A+ 可信消费链
固化 Match-3 生产者、视觉、音频与双 Judge 证据闭包。

将《山海行纪》r1.1 绑定新的不可变 release,并以生产预检现场核验 bundle、Registry/2 和 25 项 Writer 快照。

同步地图1平衡锁值、跨游戏回归修复、验收契约与 SoT 证据。
2026-07-28 20:16:13 -07:00

68 lines
2.7 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://wanxiang.ai/contracts/play-loop/cost-reservation.schema.json",
"title": "CostReservationV1",
"description": "CostReservation/1。成本账必须在同一锁内同时预留 Judge A/B随后才能并行发起模型请求。",
"type": "object",
"required": [
"schemaVersion", "reservationId", "ledgerVersion", "judgePackageHash", "pricingSnapshotHash",
"slots", "reservedRmb", "retryReservedRmb", "status", "settlements"
],
"properties": {
"schemaVersion": { "const": "CostReservation/1" },
"reservationId": { "type": "string", "minLength": 1 },
"ledgerVersion": { "type": "string", "minLength": 1 },
"judgePackageHash": { "$ref": "#/$defs/sha256" },
"pricingSnapshotHash": { "$ref": "#/$defs/sha256" },
"slots": {
"type": "array", "minItems": 2, "maxItems": 2,
"items": { "$ref": "#/$defs/slot" }
},
"reservedRmb": { "type": "number", "minimum": 0 },
"retryReservedRmb": { "type": "number", "minimum": 0 },
"status": { "enum": ["reserved", "partially_settled", "settled", "released", "failed"] },
"settlements": {
"type": "array", "maxItems": 4,
"items": { "$ref": "#/$defs/settlement" }
}
},
"additionalProperties": false,
"$defs": {
"sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
"slot": {
"type": "object",
"required": [
"slot", "requestBytes", "inputTokenUpperBound", "maxOutputTokens",
"reservedRmb", "retryReservedRmb"
],
"properties": {
"slot": { "enum": ["judge-a", "judge-b"] },
"requestBytes": { "type": "integer", "minimum": 1 },
"inputTokenUpperBound": { "type": "integer", "minimum": 1 },
"maxOutputTokens": { "const": 10000 },
"reservedRmb": { "type": "number", "minimum": 0 },
"retryReservedRmb": { "type": "number", "minimum": 0 }
},
"additionalProperties": false
},
"settlement": {
"type": "object",
"required": [
"slot", "attempt", "providerRequestId", "promptTokens", "completionTokens",
"contentReceived", "chargedRmb", "releasedRmb"
],
"properties": {
"slot": { "enum": ["judge-a", "judge-b"] },
"attempt": { "type": "integer", "minimum": 1, "maximum": 2 },
"providerRequestId": { "type": ["string", "null"], "minLength": 1 },
"promptTokens": { "type": "integer", "minimum": 0 },
"completionTokens": { "type": "integer", "minimum": 0 },
"contentReceived": { "type": "boolean" },
"chargedRmb": { "type": "number", "minimum": 0 },
"releasedRmb": { "type": "number", "minimum": 0 }
},
"additionalProperties": false
}
}
}