games-development-ai/contracts/play-loop/proof-obligation-registry.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

300 lines
10 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/proof-obligation-registry.schema.json",
"title": "ProofObligationRegistry",
"description": "proof-obligations/2 注册表。可信编排器按 proofProfileId 选择 profile;机械层只按精确事件类型、payload 谓词和有序步骤选候选,不能据此签发玩法通过。",
"type": "object",
"required": ["schemaVersion", "registryVersion", "eventContractVersion", "profiles"],
"properties": {
"schemaVersion": { "const": "proof-obligations/2" },
"registryVersion": { "type": "string", "minLength": 1 },
"eventContractVersion": { "const": "game-event/1" },
"description": { "type": "string", "minLength": 1 },
"profiles": {
"type": "object",
"additionalProperties": { "$ref": "#/$defs/profile" }
}
},
"patternProperties": { "^_": {} },
"additionalProperties": false,
"$defs": {
"profile": {
"type": "object",
"required": [
"id", "genre", "templateRoute", "description", "obligations",
"interactionOptionalRules", "briefOptionalRules"
],
"properties": {
"id": { "$ref": "#/$defs/profileId" },
"genre": { "enum": ["narrative", "trpg", "heritage", "puzzle", "sim-business"] },
"templateRoute": { "type": "string", "pattern": "^_[a-z0-9-]+$" },
"description": { "type": "string", "minLength": 1 },
"obligations": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#/$defs/obligation" }
},
"interactionOptionalRules": {
"type": "array",
"items": { "$ref": "#/$defs/interactionRule" }
},
"briefOptionalRules": {
"type": "array",
"items": { "$ref": "#/$defs/briefRule" }
}
},
"additionalProperties": false
},
"obligation": {
"type": "object",
"required": ["id", "title", "description", "defaultRequired", "evidence", "visualCheck"],
"properties": {
"id": { "$ref": "#/$defs/obligationId" },
"title": { "type": "string", "minLength": 1 },
"description": { "type": "string", "minLength": 1 },
"defaultRequired": { "type": "boolean" },
"evidence": { "$ref": "#/$defs/evidence" },
"visualCheck": { "type": "string", "minLength": 1 }
},
"additionalProperties": false
},
"evidence": {
"oneOf": [
{
"type": "object",
"required": ["sequence"],
"properties": {
"sequence": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#/$defs/evidenceStep" }
},
"sameValue": { "$ref": "#/$defs/sameValue" }
},
"additionalProperties": false
},
{
"type": "object",
"required": ["orderedSeries"],
"properties": {
"orderedSeries": { "$ref": "#/$defs/orderedSeries" }
},
"additionalProperties": false
}
]
},
"evidenceStep": {
"type": "object",
"required": ["stepId", "title", "event", "allowedActionTypes", "postScreenshotRequired"],
"properties": {
"stepId": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
"title": { "type": "string", "minLength": 1 },
"event": { "$ref": "#/$defs/eventSelector" },
"allowedActionTypes": {
"type": "array",
"minItems": 1,
"items": { "enum": ["tap", "key", "drag", "wait"] }
},
"postScreenshotRequired": { "const": true }
},
"additionalProperties": false
},
"eventSelector": {
"type": "object",
"required": ["type", "predicates"],
"properties": {
"type": { "$ref": "game-event.schema.json#/$defs/eventType" },
"predicates": {
"type": "array",
"items": { "$ref": "#/$defs/predicate" }
}
},
"additionalProperties": false
},
"sameValue": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["path", "stepIds"],
"properties": {
"path": { "$ref": "#/$defs/jsonPointer" },
"stepIds": {
"type": "array",
"minItems": 2,
"items": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" }
}
},
"additionalProperties": false
}
},
"orderedSeries": {
"type": "object",
"required": [
"seriesId", "title", "event", "allowedActionTypes", "postScreenshotRequired",
"groupByPath", "indexPath", "itemIdPath", "totalPath", "judgementPath",
"minItems", "maxItems", "summary", "terminal"
],
"properties": {
"seriesId": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
"title": { "type": "string", "minLength": 1 },
"event": { "$ref": "#/$defs/eventSelector" },
"allowedActionTypes": {
"type": "array",
"minItems": 1,
"items": { "enum": ["tap", "key", "drag", "wait"] }
},
"postScreenshotRequired": { "const": true },
"groupByPath": { "$ref": "#/$defs/jsonPointer" },
"indexPath": { "$ref": "#/$defs/jsonPointer" },
"itemIdPath": { "$ref": "#/$defs/jsonPointer" },
"totalPath": { "$ref": "#/$defs/jsonPointer" },
"judgementPath": { "$ref": "#/$defs/jsonPointer" },
"minItems": { "const": 3 },
"maxItems": { "const": 12 },
"summary": { "$ref": "#/$defs/orderedSeriesSummary" },
"terminal": { "$ref": "#/$defs/orderedSeriesTerminal" }
},
"additionalProperties": false
},
"orderedSeriesSummary": {
"type": "object",
"required": [
"stepId", "title", "event", "allowedActionTypes", "postScreenshotRequired",
"groupByPath", "totalPath", "orderedItemIdsPath", "completedPath"
],
"properties": {
"stepId": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
"title": { "type": "string", "minLength": 1 },
"event": { "$ref": "#/$defs/eventSelector" },
"allowedActionTypes": {
"type": "array", "minItems": 1,
"items": { "enum": ["tap", "key", "drag", "wait"] }
},
"postScreenshotRequired": { "const": true },
"groupByPath": { "$ref": "#/$defs/jsonPointer" },
"totalPath": { "$ref": "#/$defs/jsonPointer" },
"orderedItemIdsPath": { "$ref": "#/$defs/jsonPointer" },
"completedPath": { "$ref": "#/$defs/jsonPointer" }
},
"additionalProperties": false
},
"orderedSeriesTerminal": {
"type": "object",
"required": [
"stepId", "title", "event", "allowedActionTypes", "postScreenshotRequired",
"groupByPath", "scorePath", "worksPath"
],
"properties": {
"stepId": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
"title": { "type": "string", "minLength": 1 },
"event": { "$ref": "#/$defs/eventSelector" },
"allowedActionTypes": {
"type": "array", "minItems": 1,
"items": { "enum": ["tap", "key", "drag", "wait"] }
},
"postScreenshotRequired": { "const": true },
"groupByPath": { "$ref": "#/$defs/jsonPointer" },
"scorePath": { "$ref": "#/$defs/jsonPointer" },
"worksPath": { "$ref": "#/$defs/jsonPointer" }
},
"additionalProperties": false
},
"predicate": {
"oneOf": [
{
"type": "object",
"required": ["path", "op"],
"properties": {
"path": { "$ref": "#/$defs/jsonPointer" },
"op": { "const": "exists" }
},
"additionalProperties": false
},
{
"type": "object",
"required": ["path", "op", "value"],
"properties": {
"path": { "$ref": "#/$defs/jsonPointer" },
"op": { "enum": ["equals", "oneOf", "gt", "gte", "lt", "lte"] },
"value": {}
},
"additionalProperties": false
},
{
"type": "object",
"required": ["op", "beforePath", "afterPath"],
"properties": {
"op": { "enum": ["changed", "increased"] },
"beforePath": { "$ref": "#/$defs/jsonPointer" },
"afterPath": { "$ref": "#/$defs/jsonPointer" }
},
"additionalProperties": false
}
]
},
"briefRule": {
"type": "object",
"required": ["id", "description", "when", "requireObligationIds"],
"properties": {
"id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
"description": { "type": "string", "minLength": 1 },
"when": { "$ref": "#/$defs/briefCondition" },
"requireObligationIds": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#/$defs/obligationId" }
}
},
"additionalProperties": false
},
"interactionRule": {
"type": "object",
"required": ["id", "description", "interactionProfileId", "requireObligationIds"],
"properties": {
"id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
"description": { "type": "string", "minLength": 1 },
"interactionProfileId": { "type": "string", "pattern": "^[a-z0-9.-]+$" },
"requireObligationIds": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#/$defs/obligationId" }
}
},
"additionalProperties": false
},
"briefCondition": {
"type": "object",
"properties": {
"anyKeywords": {
"type": "array",
"minItems": 1,
"items": { "type": "string", "minLength": 1 }
},
"allKeywords": {
"type": "array",
"minItems": 1,
"items": { "type": "string", "minLength": 1 }
}
},
"additionalProperties": false,
"anyOf": [
{ "required": ["anyKeywords"] },
{ "required": ["allKeywords"] }
]
},
"profileId": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9-]*$"
},
"obligationId": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9-]*$"
},
"jsonPointer": {
"type": "string",
"pattern": "^(?:|(?:/(?:[^~/]|~[01])*)+)$"
}
}
}