games-development-ai/contracts/play-loop/board-identity-check.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

200 lines
8.6 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://wanxiang.ai/contracts/play-loop/board-identity-check.schema.json",
"title": "BoardIdentityCheckV1",
"description": "BoardIdentityCheck/1。首 tap 后对 clean frame 重做 TargetSet、lattice 与匿名类别等价关系,确认第二端仍属于同一棋盘。",
"type": "object",
"required": [
"schemaVersion", "actionGroupId", "interactionProfileId", "interactionRegistryVersion",
"interactionBindingHash", "firstActionRef", "firstActionHash", "firstEndpoint",
"initial", "postFirst", "overlayNormalizer", "overlayNormalizationEvidence",
"equivalenceAlgorithm",
"result", "reasons", "checkHash"
],
"properties": {
"schemaVersion": { "const": "BoardIdentityCheck/1" },
"actionGroupId": { "type": "string", "pattern": "^action-group-[1-9][0-9]*$" },
"interactionProfileId": { "const": "match3.orthogonal-swap-v1" },
"interactionRegistryVersion": { "const": "2026-07-15.v2" },
"interactionBindingHash": { "$ref": "#/$defs/sha256" },
"firstActionRef": { "type": "string", "minLength": 1 },
"firstActionHash": { "$ref": "#/$defs/sha256" },
"firstEndpoint": { "$ref": "actor-selection-v2.schema.json#/$defs/swapEndpoint" },
"initial": { "$ref": "#/$defs/boardSide" },
"postFirst": { "$ref": "#/$defs/boardSide" },
"overlayNormalizer": { "$ref": "#/$defs/normalizer" },
"overlayNormalizationEvidence": { "$ref": "#/$defs/overlayNormalizationEvidence" },
"equivalenceAlgorithm": { "$ref": "#/$defs/equivalenceAlgorithm" },
"result": { "enum": ["equivalent", "changed", "indeterminate"] },
"reasons": { "type": "array", "maxItems": 16, "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
"checkHash": { "$ref": "#/$defs/sha256" }
},
"additionalProperties": false,
"allOf": [
{
"if": { "properties": { "result": { "const": "equivalent" } }, "required": ["result"] },
"then": { "properties": { "reasons": { "maxItems": 0 } } },
"else": { "properties": { "reasons": { "minItems": 1 } } }
}
],
"$defs": {
"sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
"dimensions": {
"type": "object", "required": ["rows", "columns"],
"properties": {
"rows": { "type": "integer", "minimum": 3, "maximum": 12 },
"columns": { "type": "integer", "minimum": 3, "maximum": 12 }
},
"additionalProperties": false
},
"latticeGeometry": {
"type": "object",
"required": ["latticeId", "dimensions", "rowCenters", "columnCenters"],
"properties": {
"latticeId": { "type": "string", "pattern": "^l[0-9]{2}$" },
"dimensions": { "$ref": "#/$defs/dimensions" },
"rowCenters": {
"type": "array", "minItems": 3, "maxItems": 12,
"items": { "type": "integer", "minimum": 0, "maximum": 843 }
},
"columnCenters": {
"type": "array", "minItems": 3, "maxItems": 12,
"items": { "type": "integer", "minimum": 0, "maximum": 389 }
}
},
"additionalProperties": false
},
"boardSide": {
"type": "object",
"required": [
"sourceFrameRef", "sourceFrameHash", "targetSetRef", "targetSetHash",
"projectionRef", "projectionHash", "lattice", "equivalenceMatrixHash"
],
"properties": {
"sourceFrameRef": { "type": "string", "minLength": 1 },
"sourceFrameHash": { "$ref": "#/$defs/sha256" },
"targetSetRef": { "type": "string", "minLength": 1 },
"targetSetHash": { "$ref": "#/$defs/sha256" },
"projectionRef": { "type": "string", "minLength": 1 },
"projectionHash": { "$ref": "#/$defs/sha256" },
"lattice": { "$ref": "#/$defs/latticeGeometry" },
"equivalenceMatrixHash": {
"anyOf": [{ "$ref": "#/$defs/sha256" }, { "type": "null" }]
}
},
"additionalProperties": false
},
"normalizer": {
"type": "object",
"required": ["id", "version", "config", "configHash"],
"properties": {
"id": { "const": "match3-selection-overlay-normalizer" },
"version": { "const": "1.0.0" },
"config": {
"type": "object",
"required": ["removeSelectionOverlay", "recomputeTargetSetAfterFirstTap"],
"properties": {
"removeSelectionOverlay": { "const": true },
"recomputeTargetSetAfterFirstTap": { "const": true }
},
"additionalProperties": false
},
"configHash": { "$ref": "#/$defs/sha256" }
},
"additionalProperties": false
},
"overlayNormalizationEvidence": {
"type": "object",
"required": [
"schemaVersion", "auditRef", "auditHash", "auditSchemaVersion",
"overlayReferenceFrameRef", "overlayReferenceFrameHash",
"postFirstFrameRef", "postFirstFrameHash", "selectedCell",
"perceptionConfigHash", "selectionOverlayConfigHash", "invocationCount",
"deterministic", "status", "changedPixelCount", "outsideSelectedCellCount",
"supportMaskHash", "maximumAlphaSpreadPermille", "maximumReplayResidual",
"reasonCodes", "resultHash"
],
"properties": {
"schemaVersion": { "const": "OverlayNormalizationEvidence/1" },
"auditRef": { "type": "string", "minLength": 1 },
"auditHash": { "$ref": "#/$defs/sha256" },
"auditSchemaVersion": { "const": "Match3PerceptionShadowAudit/1" },
"overlayReferenceFrameRef": { "type": "string", "minLength": 1 },
"overlayReferenceFrameHash": { "$ref": "#/$defs/sha256" },
"postFirstFrameRef": { "type": "string", "minLength": 1 },
"postFirstFrameHash": { "$ref": "#/$defs/sha256" },
"selectedCell": { "$ref": "actor-selection-v2.schema.json#/$defs/cell" },
"perceptionConfigHash": { "$ref": "#/$defs/sha256" },
"selectionOverlayConfigHash": { "$ref": "#/$defs/sha256" },
"invocationCount": { "const": 2 },
"deterministic": { "const": true },
"status": { "enum": ["normalized", "not-needed", "rejected"] },
"changedPixelCount": { "type": "integer", "minimum": 0 },
"outsideSelectedCellCount": { "type": "integer", "minimum": 0 },
"supportMaskHash": {
"anyOf": [{ "$ref": "#/$defs/sha256" }, { "type": "null" }]
},
"maximumAlphaSpreadPermille": {
"anyOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }]
},
"maximumReplayResidual": {
"anyOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }]
},
"reasonCodes": {
"type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true
},
"resultHash": { "$ref": "#/$defs/sha256" }
},
"additionalProperties": false,
"allOf": [
{
"if": { "properties": { "status": { "const": "normalized" } }, "required": ["status"] },
"then": {
"properties": {
"changedPixelCount": { "minimum": 1 },
"outsideSelectedCellCount": { "const": 0 },
"supportMaskHash": { "$ref": "#/$defs/sha256" },
"maximumAlphaSpreadPermille": { "type": "integer", "minimum": 0 },
"maximumReplayResidual": { "type": "integer", "minimum": 0 },
"reasonCodes": { "maxItems": 0 }
}
}
},
{
"if": { "properties": { "status": { "const": "not-needed" } }, "required": ["status"] },
"then": {
"properties": {
"changedPixelCount": { "const": 0 },
"outsideSelectedCellCount": { "const": 0 },
"supportMaskHash": { "type": "null" },
"maximumAlphaSpreadPermille": { "type": "null" },
"maximumReplayResidual": { "type": "null" },
"reasonCodes": { "maxItems": 0 }
}
}
}
]
},
"equivalenceAlgorithm": {
"type": "object",
"required": ["id", "version", "config", "configHash"],
"properties": {
"id": { "const": "anonymous-cell-equivalence" },
"version": { "const": "1.0.0" },
"config": {
"type": "object",
"required": ["representation", "classIdInvariant", "requireCompleteClassification"],
"properties": {
"representation": { "const": "pairwise-equality-matrix" },
"classIdInvariant": { "const": true },
"requireCompleteClassification": { "const": true }
},
"additionalProperties": false
},
"configHash": { "$ref": "#/$defs/sha256" }
},
"additionalProperties": false
}
}
}