mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-06 16:16:44 +08:00
- 修复 Runtime、Source Generator 与 Tooling 对 oneOf/anyOf 的静默接受,统一改为显式报错 - 补充 JS 与 Release 测试回归,覆盖生成器诊断和运行时拒绝路径 - 更新 ai-plan 跟踪与中文文档,明确后续默认跳过会改变生成类型形状的组合关键字
8.4 KiB
8.4 KiB
AI-First Config System 跟踪
目标
基于当前 GFramework 设计结论,继续推进 AI-First 游戏配置系统,并把主线保持在
C# Runtime + Source Generator + Consumer DX。
当前恢复点
- 恢复点编号:
AI-FIRST-CONFIG-RP-003 - 当前阶段:
C# Runtime + Source Generator + Consumer DX - 当前焦点:
- 已完成 object-focused
if/then/else,继续评估下一批仍不改变生成类型形状的共享关键字 - 已明确将
oneOf/anyOf归类为当前不支持的组合关键字,并在 Runtime / Generator / Tooling 三端显式拒绝,避免静默接受导致形状漂移 - 已完成 PR #262 的 CodeRabbit follow-up,补齐 latest review body 中 folded
Nitpick comments的 skill 解析并按建议收口 Tooling / Tests - 先以 Runtime / Generator / Tooling 三端一致语义为前提筛选下一项,而不是盲目扩全量 JSON Schema
- 继续把 VS Code 工具能力视为非阻塞项,不让复杂 UI 编辑器需求反过来拖慢 C# 主线
- 已完成 object-focused
已知风险
- 组合关键字扩展风险:下一批候选关键字可能像标准
oneOf/anyOf一样更容易引入生成类型形状漂移- 缓解措施:
oneOf/anyOf已改为三端显式拒绝;后续仅继续评估不会引入联合形状、属性合并或分支生成漂移的关键字子集
- 缓解措施:
- 工具链验证风险:VS Code 与 CI / 发布管道验证覆盖不足
- 缓解措施:继续为新增共享关键字补齐三端测试覆盖,优先保证 C# Runtime 与 Generator 回归通过,并记录 JS 测试与构建验证
- PR review 信号漂移风险:CodeRabbit 可能把建议折叠在 latest review body,而不是 issue comments
- 缓解措施:
gframework-pr-review现已同时解析 latest review body,并输出 declared / parsed 数量以便快速识别解析缺口
- 缓解措施:
- PR follow-up 残留风险:PR
#262最新 review thread 仍有少量 open comments,且 nitpick body 解析仍存在 declared / parsed 缺口- 缓解措施:先以 latest unresolved thread 为准逐条本地核验;已确认并补齐运行时诊断路径与
else without if回归测试,skill 现已补齐.pynitpick 与 outside-diff comment 解析,剩余项只需等待本地修复推送后再复抓确认
- 缓解措施:先以 latest unresolved thread 为准逐条本地核验;已确认并补齐运行时诊断路径与
- 非阻塞项回退风险:将 VS Code 功能标为非阻塞但导致主线回退的风险
- 缓解措施:C# 主线补齐新关键字时仍需在
configValidation.js与extension.js中同步落地,只是不让复杂表单控件阻塞发布
- 缓解措施:C# 主线补齐新关键字时仍需在
当前状态
- 已完成 Runtime、YAML Loader、Source Generator 与 VS Code Extension 的首轮可用版本
- 已落地项目级聚合注册入口、
GeneratedConfigCatalog、GameConfigBootstrap、GameConfigModule - 已补齐一批共享 JSON Schema 子集,包括:
enum、const、not、patternformat稳定子集:date、date-time、duration、email、time、uri、uuidminLength、maxLength、minItems、maxItems、contains、minContains、maxContains、exclusiveMinimum、exclusiveMaximum、multipleOf、uniqueItemsminProperties、maxProperties、dependentRequired、dependentSchemas、allOf、object-focusedif/then/else
- 已明确拒绝会改变生成类型形状的组合关键字:
oneOf、anyOf当前会在 Runtime / Generator / Tooling 三端直接报错,而不是静默忽略
if/then/else已按“不改变生成类型形状”的边界落地:- 只允许 object 节点上的 object-typed inline schema
if必填,且必须至少伴随then或else之一- 分支只能引用父对象已声明字段,不做属性合并
- 条件匹配沿用
dependentSchemas/allOf的 focused matcher 语义
- 相关实现与验证入口:
- Runtime:
GFramework.Game/Config/YamlConfigSchemaValidator.cs、GFramework.Game/Config/YamlConfigSchemaValidator.ObjectKeywords.cs - Generator:
GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs - Tooling:
tools/gframework-config-tool/src/configValidation.js、tools/gframework-config-tool/src/extension.js - Tests:
GFramework.Game.Tests/Config/YamlConfigLoaderIfThenElseTests.cs、GFramework.SourceGenerators.Tests/Config/SchemaConfigGeneratorTests.cs、tools/gframework-config-tool/test/configValidation.test.js
- Runtime:
- PR review follow-up 收口:
gframework-pr-review现已解析 latest CodeRabbit review body 中 foldedNitpick comments- text 输出会显示
CodeRabbit nitpick comments: X declared, Y parsed,避免再次静默遗漏 - 已按 5 条 nitpick 更新 VS Code tool hints、shared validation helper,以及对称分支测试覆盖
- PR
#262最新 follow-up:- 最新抓取结果显示 latest review body 里有 2 条 nitpick 与 1 条 outside-diff actionable comment
SchemaConfigGenerator的分支级诊断定位已在当前分支,无需重复修改YamlConfigSchemaValidator已补齐conditionalSchemaPath诊断路径,避免reward[then]/reward[else]坏形状误报到父路径YamlConfigLoaderIfThenElseTests已新增运行时else缺失if回归,避免 Runtime / Generator 覆盖漂移- active trace 已将重复的
### 验证标题改为专用 PR follow-up 标题,消除MD024 gframework-pr-review现已在 latest review body 中同时解析Outside diff range comments与Nitpick commentsparse_comment_cards已不再遗漏.codex/.../*.py这类 skill 文件评论卡片tools/gframework-config-tool/src/configValidation.js已按 outside-diff 建议收紧条件分支坏形状拒绝规则,并补齐 JS 回归测试
- 分支同步状态:
feat/ai-first-config已 rebase 到origin/feat/ai-first-config- 当前已解决“ahead / behind 同时存在”的分支差异,不再 behind 远端
- 当前最细粒度的下一阶段 backlog 保留在独立文件:
ai-plan/public/ai-first-config-system/todos/ai-first-config-system-csharp-experience-next.md
当前未完成项
- 继续扩展“不会改变生成类型形状”的共享关键字支持
- 继续降低复杂 schema 与多配置域项目的接入成本
- 让 VS Code 表单支持更深层对象数组嵌套,减少 raw YAML 回退
- 为复杂结构提供比“顶层标量 / 标量数组”更强的批量编辑能力
- 在真实 VS Code 宿主中完成对象数组编辑与复杂 schema 的交互式手工验证
活跃文档
- 当前 backlog:ai-first-config-system-csharp-experience-next.md
- 历史跟踪归档:ai-first-config-system-history-through-2026-04-17.md
- 历史 trace 归档:ai-first-config-system-history-through-2026-04-17.md
验证说明
2026-04-17之前的详细实现记录与定向验证命令已归档到历史 tracking / trace- active 跟踪文件只保留当前恢复点、当前状态和下一步,不再重复堆积已完成阶段的完整历史
2026-04-20当前恢复点验证:python3 .codex/skills/gframework-pr-review/scripts/fetch_current_pr_review.py --pr 262 --format json:通过(CodeRabbit outside-diff comments: 1 declared, 1 parsed,CodeRabbit nitpick comments: 2 declared, 2 parsed)bun run test(tools/gframework-config-tool):通过(122 tests;包含条件分支坏形状回归)dotnet test GFramework.SourceGenerators.Tests/GFramework.SourceGenerators.Tests.csproj -c Release --filter "FullyQualifiedName~SchemaConfigGeneratorTests":通过dotnet test GFramework.Game.Tests/GFramework.Game.Tests.csproj -c Release --filter "FullyQualifiedName~YamlConfigLoaderIfThenElseTests":通过(8 tests;新增else without if运行时回归)dotnet build GFramework.sln -c Release:通过(存在仓库既有 analyzer warning,无新增错误)
下一步
- 提交并推送当前 PR
#262follow-up 修复后,重新抓取一次 PR review,确认 outside-diff comment 与 open thread 是否都已收口 - 若 PR review 已收口,再回到
GFramework.Game/Config/YamlConfigSchemaValidator.cs、GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs、tools/gframework-config-tool/src/configValidation.js盘点下一批候选关键字 - 跳过
oneOf/anyOf,优先筛选下一个仍不改变生成类型形状、且不需要属性合并或联合分支生成的共享关键字