zizi e6dbc3bb5a feat(runner-v2): P3 L0 brick-2 后端 engineBundle 真值通路+gameConfig 占位+prompt registry 脚手架(additive·未点亮)
① DifyCallbackReqVO 加 engineBundle additive 字段(@Data 自动访问器)② DifyCallbackTxService.resolveEngineBundleText 真值切换(:398 return reqVO.getEngineBundle())③ validateSucceededPayload gameConfig 占位=逻辑零改(既有非空校验已满足 meta 占位{templateId,title,theme,engineDriven},仅补注释)④ prompt registry:generic-coder.md stub + generic.schema.json(合规落 contracts/templates)+ registry.yaml 条目 + eval 目录。未点亮 generic 路(SUPPORTED_TEMPLATE_IDS 仍 List.of()、TEMPLATE_RESOURCES 无 generic)→ 现状生成路径零变。本地验:yaml/json parse + Lombok 访问器确认;**full mvn 编译验留 L0 整合步(派发面)一起做**。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 12:47:14 +00:00

43 lines
2.7 KiB
JSON
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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/templates/generic.schema.json",
"title": "GenericBundleMeta",
"description": "P3 生成主线 generic 模板 schema(W-G1,2026-06-14)。⚠️ 语义与旧四模板 schema 不同:旧 schema 校验「GameConfig 玩法字段」,本 schema 校验「bundle 形态/元数据」——P3 走引擎 bundle 路,游戏逻辑全在 __GameBundle iife bundle 内、不再填参 GameConfig,故本 schema 的校验对象是 worker 产出的 bundle 文本及其自检元数据(全局名/体量/默认导出)。后端 parseAndValidate 的 config 校验在 bundle 路退场,但本文件仍须就位,否则 PromptResourceLoader.isReady() 因资源缺失卡 false(getAllTemplateSchemaTexts 链)。bundleSize 双阈值权威 = B1 入场券(tech-decisions.md:14,§10.2 门②′):raw≤1.5MB ∧ gz≤350KB。",
"type": "object",
"required": ["bundleText", "hasGlobalName", "bundleRawBytes"],
"additionalProperties": true,
"properties": {
"bundleText": {
"description": "worker 产出的 iife bundle 全文。顶层全局名固定 __GameBundle(宿主据此从 window.__GameBundle 取 GameHostFactory,见 game-runtime/src/core/game-host.d.ts)。校验:文本须含 __GameBundle 全局名字面量(pattern 守门,避免产物缺全局名导致宿主取不到工厂)。",
"type": "string",
"minLength": 1,
"pattern": "__GameBundle"
},
"hasGlobalName": {
"description": "worker 自检:bundle 顶层全局名 __GameBundle 是否存在(§6.1 selfCheck.hasGlobalName,须为 true 方可交件)。",
"type": "boolean",
"const": true
},
"bundleRawBytes": {
"description": "bundle 原始字节数(raw,未压缩)。B1 入场券上界 = 1.5MB(1572864 字节,tech-decisions.md:14);下界取 1KB 防空 bundle/截断产物。超上界 worker 即回 failed 不交件(§6.1 selfCheck)。",
"type": "integer",
"minimum": 1024,
"maximum": 1572864
},
"bundleGzBytes": {
"description": "bundle gzip 压缩后字节数(gz)。B1 入场券上界 = 350KB(358400 字节,tech-decisions.md:14);下界 256 字节防异常。可选(worker 自检若提供则后端据此核 B1 门②′)。",
"type": "integer",
"minimum": 256,
"maximum": 358400
},
"hasDefaultExport": {
"description": "worker 自检:bundle 是否含默认导出(GameHostFactory 默认导出,game-host.d.ts:42-59)。可选自检位。",
"type": "boolean"
},
"esbuildOk": {
"description": "worker 自检:esbuild 打包是否成功(§6.1 selfCheck.esbuildOk,须为 true)。可选自检位。",
"type": "boolean"
}
}
}