games-development-ai/contracts/play-loop/match3-producer-preflight.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

249 lines
11 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://wanxiang.ai/contracts/play-loop/match3-producer-preflight.schema.json",
"title": "Match3ProducerPreflightV1",
"description": "标准 Match-3 生产者在创建 Actor 与成本预留前签发的一次性隔离兼容性事实。",
"type": "object",
"required": [
"schemaVersion", "preflightId", "gameId", "artifactHash", "taskBindingHash",
"acceptanceRequestHash", "interactionProfileId", "interactionRegistryVersion",
"interactionBindingHash", "seed", "executionStage", "expectedCapability", "probedCapability",
"environment", "initialFrame", "postFrame", "eventInterval", "selectedEndpoint",
"lattice", "swapSet", "normalizerAudit", "result", "reasonCode", "factHash"
],
"properties": {
"schemaVersion": { "const": "Match3ProducerPreflight/1" },
"preflightId": { "type": "string", "pattern": "^match3-preflight-[a-z0-9][a-z0-9-]{0,63}$" },
"gameId": { "type": "string", "minLength": 1 },
"artifactHash": { "$ref": "#/$defs/sha256" },
"taskBindingHash": { "$ref": "#/$defs/sha256" },
"acceptanceRequestHash": { "$ref": "#/$defs/sha256" },
"interactionProfileId": { "const": "match3.orthogonal-swap-v1" },
"interactionRegistryVersion": { "const": "2026-07-15.v2" },
"interactionBindingHash": { "$ref": "#/$defs/sha256" },
"seed": { "type": "integer", "minimum": 0 },
"executionStage": {
"enum": [
"environment_setup", "browser_connected", "capability_probed",
"initial_frame_captured", "first_action_dispatched",
"post_frame_captured", "normalizer_completed"
]
},
"expectedCapability": { "$ref": "#/$defs/capability" },
"probedCapability": { "anyOf": [{ "$ref": "#/$defs/capability" }, { "type": "null" }] },
"environment": { "$ref": "#/$defs/environment" },
"initialFrame": { "anyOf": [{ "$ref": "#/$defs/frame" }, { "type": "null" }] },
"postFrame": { "anyOf": [{ "$ref": "#/$defs/frame" }, { "type": "null" }] },
"eventInterval": { "anyOf": [{ "$ref": "#/$defs/eventInterval" }, { "type": "null" }] },
"selectedEndpoint": { "anyOf": [{ "$ref": "#/$defs/endpoint" }, { "type": "null" }] },
"lattice": { "anyOf": [{ "$ref": "#/$defs/latticeEvidence" }, { "type": "null" }] },
"swapSet": { "anyOf": [{ "$ref": "#/$defs/swapSetEvidence" }, { "type": "null" }] },
"normalizerAudit": { "$ref": "#/$defs/normalizerAudit" },
"result": { "enum": ["compatible", "incompatible", "tester_error"] },
"reasonCode": {
"enum": [
"none", "profile_contract_incompatible", "profile_contract_error",
"board_perception_unresolved", "environment_error"
]
},
"factHash": { "$ref": "#/$defs/sha256" }
},
"additionalProperties": false,
"$defs": {
"sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
"capability": {
"type": "object", "required": ["id", "version", "config", "configHash"],
"properties": {
"id": { "type": "string", "minLength": 1 },
"version": { "type": "string", "minLength": 1 },
"config": {
"type": "object",
"required": ["viewport", "grid", "cellShell", "selectionOverlay", "themeSafeBounds"],
"properties": {
"viewport": {
"type": "object", "required": ["width", "height"],
"properties": {
"width": { "type": "integer", "minimum": 1 },
"height": { "type": "integer", "minimum": 1 }
},
"additionalProperties": false
},
"grid": {
"type": "object", "required": ["rows", "columns", "pitchPx", "originX", "originY"],
"properties": {
"rows": { "type": "integer", "minimum": 1 },
"columns": { "type": "integer", "minimum": 1 },
"pitchPx": { "type": "integer", "minimum": 1 },
"originX": { "type": "integer", "minimum": 0 },
"originY": { "type": "integer", "minimum": 0 }
},
"additionalProperties": false
},
"cellShell": {
"type": "object", "required": ["shape", "radiusPx", "fillStyle"],
"properties": {
"shape": { "type": "string", "minLength": 1 },
"radiusPx": { "type": "integer", "minimum": 1 },
"fillStyle": { "type": "string", "pattern": "^#[0-9a-f]{6}$" }
},
"additionalProperties": false
},
"selectionOverlay": {
"type": "object",
"required": ["shape", "maskSizePx", "strokeStyle", "expectedChangedPixelCount", "supportMaskHash"],
"properties": {
"shape": { "type": "string", "minLength": 1 },
"maskSizePx": { "type": "integer", "minimum": 1 },
"strokeStyle": { "type": "string", "pattern": "^#[0-9a-f]{6}$" },
"expectedChangedPixelCount": { "type": "integer", "minimum": 1 },
"supportMaskHash": { "$ref": "#/$defs/sha256" }
},
"additionalProperties": false
},
"themeSafeBounds": {
"type": "object", "required": ["insetPx"],
"properties": {
"insetPx": { "type": "integer", "minimum": 0 }
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"configHash": { "$ref": "#/$defs/sha256" }
},
"additionalProperties": false
},
"environment": {
"type": "object",
"required": [
"host", "browserVersion", "viewport", "runtimeIdentityHash", "contextId",
"contextIsolation", "freshContext", "contextDestroyed", "modelClientCreated",
"costReservationCreated"
],
"properties": {
"host": { "type": "string", "minLength": 1 },
"browserVersion": { "anyOf": [{ "type": "string", "minLength": 1 }, { "type": "null" }] },
"viewport": {
"type": "object", "required": ["width", "height", "dpr"],
"properties": {
"width": { "const": 390 },
"height": { "const": 844 },
"dpr": { "const": 1 }
},
"additionalProperties": false
},
"canvasBacking": {
"anyOf": [
{
"type": "object",
"required": [
"cssWidth", "cssHeight", "backingWidth", "backingHeight",
"scaleX", "scaleY", "devicePixelRatio"
],
"properties": {
"cssWidth": { "const": 390 },
"cssHeight": { "const": 844 },
"backingWidth": { "type": "integer", "minimum": 390 },
"backingHeight": { "type": "integer", "minimum": 844 },
"scaleX": { "type": "integer", "minimum": 1 },
"scaleY": { "type": "integer", "minimum": 1 },
"devicePixelRatio": { "type": "number", "exclusiveMinimum": 0 }
},
"additionalProperties": false
},
{ "type": "null" }
]
},
"runtimeIdentityHash": { "anyOf": [{ "$ref": "#/$defs/sha256" }, { "type": "null" }] },
"contextId": { "type": "string", "minLength": 1 },
"contextIsolation": { "enum": ["one-time-dedicated", "not-created"] },
"freshContext": { "type": "boolean" },
"contextDestroyed": { "type": "boolean" },
"modelClientCreated": { "const": false },
"costReservationCreated": { "const": false }
},
"additionalProperties": false
},
"frame": {
"type": "object", "required": ["ref", "hash"],
"properties": {
"ref": { "type": "string", "minLength": 1 },
"hash": { "$ref": "#/$defs/sha256" }
},
"additionalProperties": false
},
"eventInterval": {
"type": "object", "required": ["preEventSeq", "postEventSeq", "businessEventCount"],
"properties": {
"preEventSeq": { "type": "integer", "minimum": 0 },
"postEventSeq": { "type": "integer", "minimum": 0 },
"businessEventCount": { "type": "integer", "minimum": 0 }
},
"additionalProperties": false
},
"cell": {
"type": "object", "required": ["row", "column"],
"properties": {
"row": { "type": "integer", "minimum": 1, "maximum": 8 },
"column": { "type": "integer", "minimum": 1, "maximum": 8 }
},
"additionalProperties": false
},
"endpoint": {
"type": "object", "required": ["latticeId", "cell"],
"properties": {
"latticeId": { "type": "string", "pattern": "^l[0-9]{2}$" },
"cell": { "$ref": "#/$defs/cell" }
},
"additionalProperties": false
},
"latticeEvidence": {
"type": "object",
"required": ["targetSetRef", "targetSetHash", "latticeId", "dimensions", "geometryHash"],
"properties": {
"targetSetRef": { "type": "string", "minLength": 1 },
"targetSetHash": { "$ref": "#/$defs/sha256" },
"latticeId": { "type": "string", "pattern": "^l[0-9]{2}$" },
"dimensions": {
"type": "object", "required": ["rows", "columns"],
"properties": {
"rows": { "const": 8 },
"columns": { "const": 8 }
},
"additionalProperties": false
},
"geometryHash": { "$ref": "#/$defs/sha256" }
},
"additionalProperties": false
},
"swapSetEvidence": {
"type": "object", "required": ["ref", "hash", "candidateSetHash", "candidateId"],
"properties": {
"ref": { "type": "string", "minLength": 1 },
"hash": { "$ref": "#/$defs/sha256" },
"candidateSetHash": { "$ref": "#/$defs/sha256" },
"candidateId": { "type": "string", "pattern": "^ms[0-9]{2,3}$" }
},
"additionalProperties": false
},
"normalizerAudit": {
"type": "object",
"required": [
"ref", "hash", "status", "changedPixelCount", "outsideSelectedCellCount",
"maximumReplayResidual", "supportMaskHash"
],
"properties": {
"ref": { "anyOf": [{ "type": "string", "minLength": 1 }, { "type": "null" }] },
"hash": { "anyOf": [{ "$ref": "#/$defs/sha256" }, { "type": "null" }] },
"status": { "enum": ["normalized", "rejected", "not_run"] },
"changedPixelCount": { "anyOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] },
"outsideSelectedCellCount": { "anyOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] },
"maximumReplayResidual": { "anyOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] },
"supportMaskHash": { "anyOf": [{ "$ref": "#/$defs/sha256" }, { "type": "null" }] }
},
"additionalProperties": false
}
}
}