From bc3d50f07e9201be30114681478e7a5cc9df4232 Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 07:29:01 +0000 Subject: [PATCH] fix: apply CodeRabbit auto-fixes Fixed 6 file(s) based on 6 unresolved review comments. Co-authored-by: CodeRabbit --- ...-config-system-history-through-2026-04-17.md | 12 ++++++------ ...irst-config-system-csharp-experience-next.md | 17 +++++++++++++++++ .../todos/ai-first-config-system-tracking.md | 11 ++++++++++- .../traces/ai-first-config-system-trace.md | 12 +++++++++++- .../todos/ai-plan-governance-tracking.md | 13 +++++++++++-- .../todos/cqrs-rewrite-history-through-rp043.md | 10 +++------- 6 files changed, 58 insertions(+), 17 deletions(-) diff --git a/ai-plan/public/ai-first-config-system/archive/todos/ai-first-config-system-history-through-2026-04-17.md b/ai-plan/public/ai-first-config-system/archive/todos/ai-first-config-system-history-through-2026-04-17.md index 31b330bc..7025f0b0 100644 --- a/ai-plan/public/ai-first-config-system/archive/todos/ai-first-config-system-history-through-2026-04-17.md +++ b/ai-plan/public/ai-first-config-system/archive/todos/ai-first-config-system-history-through-2026-04-17.md @@ -451,7 +451,7 @@ - `ArchitectureConfigIntegrationTests` 的临时目录清理改为同时兜底 `IOException` 与 `UnauthorizedAccessException`,降低测试在不同文件系统环境下的偶发失败 - `SchemaConfigGenerator` 新增项目级聚合输出 `GeneratedConfigCatalog` 与 `RegisterAllGeneratedConfigTables()`,让消费者项目可以一行注册当前编译中全部生成表 -### 2026-04-09 +### 2026-04-09(生命周期与同步桥接) - `GameConfigModule` 现在会在安装前显式拒绝已离开 `ArchitecturePhase.None` 的架构,避免错过 `BeforeUtilityInit` 首载窗口 - `GameConfigModule.Install(...)` 现在会先完成无副作用阶段校验,再先注册 `IConfigRegistry` / 生命周期 utility、最后注册生命周期钩子;一旦进入注册阶段即把模块实例视为已消耗,避免任何不可回滚的部分安装失败后重复暴露 utility 或重复挂钩子 @@ -460,7 +460,7 @@ - `ArchitectureConfigIntegrationTests` 统一为 PascalCase 命名,并新增“阻塞同步上下文下通过真实架构生命周期桥接完成初始化”和“迟到安装失败不消耗模块实例”的回归测试 - 已执行:`dotnet test GFramework.Game.Tests/GFramework.Game.Tests.csproj -c Release --filter "FullyQualifiedName~ArchitectureConfigIntegrationTests"` -### 2026-04-08 +### 2026-04-08(索引构建逻辑修复与聚合注册能力) - 修复 `SchemaConfigGenerator` 生成的索引构建逻辑:`BuildLookupIndex` 现在会跳过运行时空 key,并在生成代码 XML 注释中说明这是为了避免 `Lazy` 因格式错误配置而永久缓存异常 - 收紧生成器内部的索引查询空值守卫分类逻辑:不再依赖“只有 `string` 是引用类型”的静默假设,而是显式枚举当前支持的标量映射;未来新增标量若未同步分类,将在生成期直接失败 @@ -511,9 +511,9 @@ - 已执行:`dotnet test GFramework.SourceGenerators.Tests/GFramework.SourceGenerators.Tests.csproj -c Release --filter "FullyQualifiedName~SchemaConfigGenerator"` - 已执行:`node --test ./test/configValidation.test.js`(`tools/gframework-config-tool`) -### 2026-04-08 +### 2026-04-08(索引能力) -- `SchemaConfigGenerator` 新增 schema 元数据 `x-gframework-index`,允许对“顶层、必填、非主键、非引用标量字段”生成可选只读精确匹配索引 +- `SchemaConfigGenerator` 新增 schema 元数据 `x-gframework-index`,允许对"顶层、必填、非主键、非引用标量字段"生成可选只读精确匹配索引 - 生成的 `FindBy*` / `TryFindFirstBy*` 对显式声明索引的字段会改为惰性构建只读 bucket 字典;未声明字段继续保持 `All()` 线性扫描契约 - `ConfigSchemaDiagnostics` 新增 `GF_ConfigSchema_008`,在 `x-gframework-index` 类型错误或落到不支持字段时提供稳定诊断 - `GFramework.SourceGenerators.Tests/Config` 新增索引元数据诊断测试,并扩展查询辅助生成测试断言索引字段只为显式 opt-in 的属性生成 @@ -524,7 +524,7 @@ - 已执行:`dotnet test GFramework.Game.Tests/GFramework.Game.Tests.csproj -c Release --filter "FullyQualifiedName~GeneratedConfigConsumerIntegrationTests"` - 已执行:`bash scripts/validate-csharp-naming.sh` -### 2026-04-09 +### 2026-04-09(目录辅助与模块化接入) - `GeneratedConfigCatalog` 继续补齐启动与诊断辅助,新增 `GetTablesInConfigDomain(...)`、`GetTablesForRegistration(...)` 与 `MatchesRegistrationOptions(...)` - 聚合注册入口 `RegisterAllGeneratedConfigTables(...)` 改为复用 `GeneratedConfigCatalog.MatchesRegistrationOptions(...)`,让启动日志、诊断输出和真实注册路径共享同一套筛选逻辑 @@ -598,4 +598,4 @@ - `GFramework.SourceGenerators/Config/SchemaConfigGenerator.cs` - `tools/gframework-config-tool/src/configValidation.js` - `GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs` - - `docs/zh-CN/game/config-system.md` + - `docs/zh-CN/game/config-system.md` \ No newline at end of file diff --git a/ai-plan/public/ai-first-config-system/todos/ai-first-config-system-csharp-experience-next.md b/ai-plan/public/ai-first-config-system/todos/ai-first-config-system-csharp-experience-next.md index cc2e3e01..8fb93b44 100644 --- a/ai-plan/public/ai-first-config-system/todos/ai-first-config-system-csharp-experience-next.md +++ b/ai-plan/public/ai-first-config-system/todos/ai-first-config-system-csharp-experience-next.md @@ -93,3 +93,20 @@ - `tools/gframework-config-tool/src/configValidation.js` - `tools/gframework-config-tool/src/extension.js` - `docs/zh-CN/game/config-system.md` + +### 恢复块 + +- 恢复点编号:`AI-FIRST-CONFIG-RP-002` +- 当前阶段:`C# Runtime + Source Generator + Consumer DX` +- 已知风险: + - 语义一致性风险:`if` / `then` / `else` 在 Runtime / Generator / Tooling 三端语义不一致的风险,需要先验证是否能在不引入生成类型形状漂移的前提下落地 + - 工具链非阻塞风险:将 VS Code 功能标为非阻塞后,可能导致 C# 主线补齐新关键字时缺少工具侧同步验证 + - 复杂关键字回退风险:`allOf` 已收敛为 object-focused constraint block,未来新增组合关键字时需明确是否同样限制范围 +- 最近验证: + - 时间:2026-04-17 + - 内容:截至该日期的历史跟踪与执行 trace 已归档到主题内归档目录 + - 结果:通过 +- 下一步: + 1. 检查 `YamlConfigSchemaValidator.cs`、`SchemaConfigGenerator.cs`、`configValidation.js` 中当前已支持的关键字列表 + 2. 评估 `if` / `then` / `else` 是否能在三端保持一致语义且不改变生成类型形状 + 3. 若结论否定,选择下一批共享解释关键字而不是先回工具 UI \ No newline at end of file diff --git a/ai-plan/public/ai-first-config-system/todos/ai-first-config-system-tracking.md b/ai-plan/public/ai-first-config-system/todos/ai-first-config-system-tracking.md index 9385c4db..cc319107 100644 --- a/ai-plan/public/ai-first-config-system/todos/ai-first-config-system-tracking.md +++ b/ai-plan/public/ai-first-config-system/todos/ai-first-config-system-tracking.md @@ -14,6 +14,15 @@ - 优先考察 `if` / `then` / `else` 是否能在 Runtime / Generator / Tooling 三端保持一致语义 - 继续把 VS Code 工具能力视为非阻塞项,不让复杂 UI 编辑器需求反过来拖慢 C# 主线 +### 已知风险 + +- 语义一致性风险:`if` / `then` / `else` 在 Runtime / Generator / Tooling 三端语义不一致的风险 + - 缓解措施:先验证是否能在不引入生成类型形状漂移的前提下落地,若否则选择下一批共享解释关键字 +- 工具链验证风险:VS Code 与 CI / 发布管道验证覆盖不足 + - 缓解措施:继续为新增共享关键字补齐三端测试覆盖,优先保证 C# Runtime 与 Generator 回归通过 +- 非阻塞项回退风险:将 VS Code 功能标为非阻塞但导致主线回退的风险 + - 缓解措施:C# 主线补齐新关键字时仍需在 `configValidation.js` 与 `extension.js` 中同步落地,只是不让复杂表单控件阻塞发布 + ## 当前状态 - 已完成 Runtime、YAML Loader、Source Generator 与 VS Code Extension 的首轮可用版本 @@ -49,4 +58,4 @@ 1. 先检查 `GFramework.Game/Config/YamlConfigSchemaValidator.cs`、`GFramework.SourceGenerators/Config/SchemaConfigGenerator.cs`、`tools/gframework-config-tool/src/configValidation.js` 2. 评估 `if` / `then` / `else` 是否能在不引入生成类型形状漂移的前提下落地 -3. 若结论是否定,再选择下一批仍能共享解释的关键字,而不是先回到工具 UI 深挖 +3. 若结论是否定,再选择下一批仍能共享解释的关键字,而不是先回到工具 UI 深挖 \ No newline at end of file diff --git a/ai-plan/public/ai-first-config-system/traces/ai-first-config-system-trace.md b/ai-plan/public/ai-first-config-system/traces/ai-first-config-system-trace.md index 4a91a33d..167219db 100644 --- a/ai-plan/public/ai-first-config-system/traces/ai-first-config-system-trace.md +++ b/ai-plan/public/ai-first-config-system/traces/ai-first-config-system-trace.md @@ -18,8 +18,18 @@ - 历史 trace 归档: - `ai-plan/public/ai-first-config-system/archive/traces/ai-first-config-system-history-through-2026-04-17.md` +### 验证 + +- 2026-04-19:入口归档收口验证 + - 执行命令:`wc -l ai-plan/public/ai-first-config-system/todos/ai-first-config-system-tracking.md ai-plan/public/ai-first-config-system/traces/ai-first-config-system-trace.md` + - 结果:通过 + - 备注:active 入口文件行数显著减少,已完成阶段详细历史已移至归档 +- 2026-04-17 之前:详细实现与定向验证命令 + - 参考:`ai-plan/public/ai-first-config-system/archive/todos/ai-first-config-system-history-through-2026-04-17.md` + - 备注:包含 Runtime / Generator / Tooling 三端同步落地的每日验证记录与具体测试命令 + ### 下一步 1. 从 `ai-first-config-system-csharp-experience-next.md` 读取当前 backlog,而不是继续翻已完成历史 2. 先判断 `if` / `then` / `else` 是否满足“三端一致且不改变生成形状”的前提 -3. 若不满足,直接回退到下一批收益更明确的共享关键字评估 +3. 若不满足,直接回退到下一批收益更明确的共享关键字评估 \ No newline at end of file diff --git a/ai-plan/public/ai-plan-governance/todos/ai-plan-governance-tracking.md b/ai-plan/public/ai-plan-governance/todos/ai-plan-governance-tracking.md index 92298770..7e24954b 100644 --- a/ai-plan/public/ai-plan-governance/todos/ai-plan-governance-tracking.md +++ b/ai-plan/public/ai-plan-governance/todos/ai-plan-governance-tracking.md @@ -17,10 +17,19 @@ - 恢复点编号:`AI-PLAN-GOV-RP-005` - 当前阶段:`Phase 3` - 当前焦点: - - 将“主题内 `archive/` 已存在”升级为“active todo/trace 过长时必须归档已完成且已验证阶段”的显式规则 + - 将"主题内 `archive/` 已存在"升级为"active todo/trace 过长时必须归档已完成且已验证阶段"的显式规则 - 让 active `todos/` / `traces/` 只保留当前恢复点、活跃事实、活跃风险、下一步与 archive 指针 - 将 `ai-plan-governance`、`ai-first-config-system` 与 `cqrs-rewrite` 的历史阶段从默认启动入口移出 +### 已知风险 + +- 归档遗漏:已完成且已验证的阶段未及时归档,导致 active 入口文件持续膨胀 + - 缓解措施:只要某个 active 主题积累了多个已完成且已验证阶段,就在同一变更里将其细节迁入该主题自己的 `archive/` +- 入口回膨胀:后续新任务直接追加到 active 入口,而不是先归档历史 + - 缓解措施:每次变更前先检查当前 active 入口行数,超过合理范围时优先归档已完成内容 +- 跨文档语义漂移:tracking / trace / README 三个入口对同一主题的状态描述不一致 + - 缓解措施:修改任一文档时同步检查其他入口,确保恢复点编号、阶段名称和下一步描述保持一致 + ## 已完成 - 已为活跃主题建立并使用主题内归档目录: @@ -57,4 +66,4 @@ 1. 后续只要某个 active 主题积累了多个已完成且已验证阶段,就在同一变更里将其细节迁入该主题自己的 `archive/` 2. 若某个主题整体完成,再将整个主题目录移入 `ai-plan/public/archive//` -3. 后续新增 topic 时,默认直接创建 `todos/`、`traces/` 与 `archive/`,不要再把历史阶段长期堆在 active 入口 +3. 后续新增 topic 时,默认直接创建 `todos/`、`traces/` 与 `archive/`,不要再把历史阶段长期堆在 active 入口 \ No newline at end of file diff --git a/ai-plan/public/cqrs-rewrite/archive/todos/cqrs-rewrite-history-through-rp043.md b/ai-plan/public/cqrs-rewrite/archive/todos/cqrs-rewrite-history-through-rp043.md index db67b893..ef34b858 100644 --- a/ai-plan/public/cqrs-rewrite/archive/todos/cqrs-rewrite-history-through-rp043.md +++ b/ai-plan/public/cqrs-rewrite/archive/todos/cqrs-rewrite-history-through-rp043.md @@ -381,12 +381,8 @@ - `dotnet build GFramework/GFramework.sln` 通过 - `dotnet test GFramework/GFramework.Core.Tests/GFramework.Core.Tests.csproj --no-build` 通过,`1621` 个测试全部通过 - `dotnet build CoreGrid-Migration/CoreGrid.sln` 通过 - - - `dotnet test GFramework.Core.Tests/GFramework.Core.Tests.csproj -c Release --filter "FullyQualifiedName~GFramework.Core.Tests.Cqrs.CqrsHandlerRegistrarTests|FullyQualifiedName~GFramework.Core.Tests.Architectures.ArchitectureModulesBehaviorTests|FullyQualifiedName~GFramework.Core.Tests.Mediator.MediatorAdvancedFeaturesTests|FullyQualifiedName~GFramework.Core.Tests.Mediator.MediatorArchitectureIntegrationTests|FullyQualifiedName~GFramework.Core.Tests.Mediator.MediatorComprehensiveTests"` - 通过,`49` 个测试全部通过 - - - `dotnet test GFramework.Core.Tests/GFramework.Core.Tests.csproj -c Release --filter "FullyQualifiedName~GFramework.Core.Tests.Cqrs.CqrsHandlerRegistrarTests|FullyQualifiedName~GFramework.Core.Tests.Mediator.MediatorComprehensiveTests|FullyQualifiedName~GFramework.Core.Tests.Mediator.MediatorArchitectureIntegrationTests|FullyQualifiedName~GFramework.Core.Tests.Mediator.MediatorAdvancedFeaturesTests"` - 通过,`47` 个测试全部通过 + - `dotnet test GFramework.Core.Tests/GFramework.Core.Tests.csproj -c Release --filter "FullyQualifiedName~GFramework.Core.Tests.Cqrs.CqrsHandlerRegistrarTests|FullyQualifiedName~GFramework.Core.Tests.Architectures.ArchitectureModulesBehaviorTests|FullyQualifiedName~GFramework.Core.Tests.Mediator.MediatorAdvancedFeaturesTests|FullyQualifiedName~GFramework.Core.Tests.Mediator.MediatorArchitectureIntegrationTests|FullyQualifiedName~GFramework.Core.Tests.Mediator.MediatorComprehensiveTests"` 通过,`49` 个测试全部通过 + - `dotnet test GFramework.Core.Tests/GFramework.Core.Tests.csproj -c Release --filter "FullyQualifiedName~GFramework.Core.Tests.Cqrs.CqrsHandlerRegistrarTests|FullyQualifiedName~GFramework.Core.Tests.Mediator.MediatorComprehensiveTests|FullyQualifiedName~GFramework.Core.Tests.Mediator.MediatorArchitectureIntegrationTests|FullyQualifiedName~GFramework.Core.Tests.Mediator.MediatorAdvancedFeaturesTests"` 通过,`47` 个测试全部通过 - `dotnet build GFramework.Core.Tests/GFramework.Core.Tests.csproj -c Release` 通过 - `dotnet test GFramework.Core.Tests/GFramework.Core.Tests.csproj -c Release --no-build` 通过,`1624` 个测试全部通过 - `dotnet build CoreGrid-Migration/CoreGrid.sln` 通过,仅存在既有 analyzer warnings 与 Godot generator warning @@ -739,4 +735,4 @@ ### 下一步 1. 若要让 PR `#253` 上的 latest head review threads 反映本轮本地修正,需要先提交并推送当前分支,再重新执行 `$gframework-pr-review` -2. PR 当前公开 warning 仍包含 `Docstring Coverage`,若后续要继续消除此项,需要单独规划并提交文档注释覆盖率改进 +2. PR 当前公开 warning 仍包含 `Docstring Coverage`,若后续要继续消除此项,需要单独规划并提交文档注释覆盖率改进 \ No newline at end of file