Fix/analyzer warning reduction batch#297
Conversation
- 拆分 PriorityServiceTests 末尾的测试接口与辅助类型到独立文件 - 保留原有命名空间、可见性与优先级测试语义 - 补充新文件的 XML 注释并清理原测试文件的无关 using
- 修复 YamlConfigLoader 的超长方法、依赖比较与热重载同步原语告警 - 拆分 MicrosoftDiContainerTests 与 AbstractAsyncQueryTests 的辅助类型文件以消除 MA0048 - 更新 analyzer warning reduction 跟踪文档并记录 non-incremental 构建基线变化
📝 WalkthroughWalkthrough将测试辅助类型从大型测试文件拆出为独立源文件(优先级、IoC、异步查询等);新增多组测试接口与实现;重构 GFramework.Game.Config.YamlConfigLoader 的加载/转换/热重载逻辑;添加保留取消语义的 YamlConfigLoader 回归测试并更新分析器追踪文档。 Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant YamlLoader as YamlConfigLoader
participant Registration as YamlTableRegistration
participant FileSystem
participant SchemaValidator
participant Deserializer
Caller->>YamlLoader: LoadAsync(registration, ct)
YamlLoader->>Registration: ValidateDirectory(path)
Registration->>FileSystem: EnumerateYamlFiles(dir)
FileSystem-->>Registration: ordered file list
loop for each file
Registration->>FileSystem: ReadYamlAsync(file, ct)
FileSystem-->>Registration: content or throw (cancelled)
Registration->>SchemaValidator: CollectReferences(content, schema?)
SchemaValidator-->>Registration: referenced names
Registration->>Deserializer: Deserialize<TValue>(content)
Deserializer-->>Registration: TValue or throw (wrapped)
end
Registration->>YamlLoader: BuildLoadResult(items, schemaRefs)
YamlLoader-->>Caller: return YamlTableLoadResult or throw (OperationCanceledException preserved)
Estimated code review effort🎯 3 (中等) | ⏱️ ~20 分钟 可能相关的 PR
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Filename | Overview |
|---|---|
| GFramework.Game/Config/YamlConfigLoader.cs | Refactored YamlTableRegistration.LoadAsync into focused helper methods; added OperationCanceledException re-throw guards before the general catch in ReadYamlAsync, DeserializeValue, and BuildLoadResult to prevent cancellation exceptions from being wrapped in ConfigLoadException. |
| GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs | Added three regression tests for cancellation propagation via private-method reflection; tests for ReadYamlAsync, DeserializeValue, and BuildLoadResult correctly verify OperationCanceledException is not swallowed. |
| GFramework.Core.Tests/Architectures/PriorityServiceTests.cs | Test fixtures previously defined inline (systems, models, utilities, interfaces) extracted into dedicated files; logic unchanged. |
| GFramework.Core.Tests/Query/AbstractAsyncQueryTests.cs | Inline query fixture types extracted into dedicated files; logic unchanged. |
| GFramework.Core.Tests/Ioc/MicrosoftDiContainerTests.cs | IoC test fixtures extracted into dedicated files; no logic changes. |
Sequence Diagram
sequenceDiagram
participant Caller
participant YamlConfigLoader
participant YamlTableRegistration
participant FileSystem
participant SchemaValidator
Caller->>YamlConfigLoader: LoadAsync(registry, ct)
loop per registration
YamlConfigLoader->>YamlTableRegistration: LoadAsync(rootPath, deserializer, ct)
YamlTableRegistration->>YamlTableRegistration: GetValidatedDirectoryPath(rootPath)
YamlTableRegistration->>SchemaValidator: LoadSchemaAsync(rootPath, ct)
SchemaValidator-->>YamlTableRegistration: YamlConfigSchema?
loop per YAML file
YamlTableRegistration->>FileSystem: ReadYamlAsync(dir, file, schema, ct)
note over YamlTableRegistration: re-throws OperationCanceledException before wrapping in ConfigLoadException
FileSystem-->>YamlTableRegistration: yaml string
YamlTableRegistration->>YamlTableRegistration: CollectReferenceUsages
YamlTableRegistration->>YamlTableRegistration: DeserializeValue(ct)
end
YamlTableRegistration->>YamlTableRegistration: BuildLoadResult(ct)
YamlTableRegistration-->>YamlConfigLoader: YamlTableLoadResult
end
YamlConfigLoader->>YamlConfigLoader: CrossTableReferenceValidator.Validate
YamlConfigLoader->>YamlConfigLoader: RegistrationDispatcher.Register (all tables)
YamlConfigLoader->>Caller: done
Prompt To Fix All With AI
This is a comment left during a code review.
Path: GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
Line: 2808-2829
Comment:
**Reflection-based test couples to private implementation details**
The test accesses `ReadYamlAsync` by name via `BindingFlags.NonPublic`. If the method is ever renamed, inlined, or its signature changes, this test will silently fail with a null-method assertion rather than a compilation error, making the regression invisible until the null check fires. The same applies to `DeserializeValue` and `BuildLoadResult` in the tests below.
A more resilient approach is to drive the same scenario through the public `LoadAsync` API with a pre-cancelled token — this exercises the full call path without binding to private names, and a compile error would catch any relevant signature change.
How can I resolve this? If you propose a fix, please make it concise.Reviews (4): Last reviewed commit: "fix(game): 修复同步加载阶段的取消透传" | Re-trigger Greptile
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #991
🎉 All tests passed!Slowest Tests
± Comparison with run #988 at 1656a06 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 42 runs. Github Test Reporter by CTRF 💚 |
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| dotnet-format | yes | 1 | no | 5.3s | ||
| ✅ REPOSITORY | gitleaks | yes | no | no | 7.49s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 5.8s |
Detailed Issues
⚠️ CSHARP / dotnet-format - 1 error
Welcome to .NET 9.0!
---------------------
SDK Version: 9.0.114
----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate, run 'dotnet dev-certs https --trust'
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Unhandled exception: System.Exception: Restore operation failed.
at Microsoft.CodeAnalysis.Tools.CodeFormatter.OpenMSBuildWorkspaceAsync(String solutionOrProjectPath, WorkspaceType workspaceType, Boolean noRestore, Boolean requiresSemantics, String binaryLogPath, Boolean logWorkspaceWarnings, ILogger logger, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.CodeFormatter.FormatWorkspaceAsync(FormatOptions formatOptions, ILogger logger, CancellationToken cancellationToken, String binaryLogPath)
at Microsoft.CodeAnalysis.Tools.FormatCommandCommon.FormatAsync(FormatOptions formatOptions, ILogger`1 logger, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.Commands.RootFormatCommand.FormatCommandDefaultHandler.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

Show us your support by starring ⭐ the repository
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (3)
GFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.cs (1)
18-26: 可选:补充<returns>文档以保持注释完整性。
OnDoAsync的重写虽然始终抛出异常,但其声明返回类型仍为Task<int>。当前注释只有<exception>而缺少<returns>,与项目内其他*V4测试类(均含<returns>)的风格不一致。可考虑补充一行说明该方法不会正常返回,或在抛出前显式标注返回语义,以满足 "All public, protected, and internal types and members MUST include XML documentation comments with ...<returns>... where applicable" 的规范要求。♻️ 建议的小幅完善
/// <summary> /// 执行异步查询操作并抛出异常 /// </summary> /// <param name="input">查询输入参数</param> + /// <returns>该方法不会正常返回,始终抛出异常。</returns> /// <exception cref="InvalidOperationException">总是抛出异常</exception> protected override Task<int> OnDoAsync(TestAsyncQueryInputV2 input)As per coding guidelines: "All public, protected, and internal types and members MUST include XML documentation comments (
///) with<summary>,<param>,<returns>,<exception>, and<remarks>where applicable".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.cs` around lines 18 - 26, Add a <returns> XML doc for the protected override Task<int> OnDoAsync(TestAsyncQueryInputV2 input) in TestAsyncQueryWithExceptionV4 to match project doc style; update the method's XML comments to include a <returns> element that states the method returns a Task<int> but will not complete normally (it always throws an InvalidOperationException), keeping the existing <exception> entry intact so the XML docs include <summary>, <param>, <returns>, and <exception> for OnDoAsync.GFramework.Core.Tests/Ioc/IPrioritizedService.cs (1)
8-11:Name属性与IMixedService重复定义,建议复用。
IPrioritizedService与IMixedService都独立声明了string? Name { get; set; }。PrioritizedService同时实现两个接口时,依赖隐式实现一并满足。这种重复声明属于 DRY 违反,未来若要修改Name语义(如改为不可空、加注释约束)需要改两处。如果两个接口在测试中确实代表不同语义(例如 “带优先级的命名服务” vs “混合服务”),建议让
IPrioritizedService继承IMixedService,从而集中维护Name契约:♻️ 建议的重构
-public interface IPrioritizedService : IPrioritized -{ - string? Name { get; set; } -} +public interface IPrioritizedService : IPrioritized, IMixedService +{ +}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Core.Tests/Ioc/IPrioritizedService.cs` around lines 8 - 11, IPrioritizedService currently re-declares string? Name { get; set; } already present on IMixedService; remove the duplicate by having IPrioritizedService extend IMixedService instead: change the interface signature to include IMixedService (e.g., public interface IPrioritizedService : IPrioritized, IMixedService) and delete the Name property from IPrioritizedService so PrioritizedService and other implementers get Name via IMixedService; rebuild and fix any impacted usages or tests that referenced the removed declaration.GFramework.Game/Config/YamlConfigLoader.cs (1)
701-705:IntegerTryParseDelegate<T>第一个参数的可空性与 BCL 方法签名不匹配,会触发 CS8622 告警。delegate 在第 702 行声明第一个参数为非空
string value,但 BCL 的int.TryParse、long.TryParse等方法签名均为bool TryParse(string? s, ...)(参数可空)。在第 831-838 行将这些方法组赋给 delegate 时会产生 CS8622 兼容性错误。建议: 将第 702 行的参数改为
string? value以匹配 BCL 方法签名。由于rawValue在调用点已是非空字符串,不需额外的空检查。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Game/Config/YamlConfigLoader.cs` around lines 701 - 705, IntegerTryParseDelegate<T> currently declares its first parameter as non-nullable string which mismatches BCL TryParse signatures and triggers CS8622; change the first parameter of the delegate IntegerTryParseDelegate<T> from string value to string? value so it matches int.TryParse/long.TryParse signatures and allows assigning those methods to the delegate; no extra null checks are needed at call sites because rawValue passed into the delegate is already non-null.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@GFramework.Core.Tests/Ioc/IMixedService.cs`:
- Line 8: The public interface property IMixedService.Name is missing XML
documentation; add a /// <summary> comment above the Name property in the
IMixedService interface describing its purpose (and include <remarks> or other
XML tags if applicable) so it complies with the project documentation guideline
requiring XML comments for public members.
In `@GFramework.Core.Tests/Ioc/IPrioritizedService.cs`:
- Line 10: Add an XML documentation comment for the public interface member Name
on IPrioritizedService: add a /// <summary> describing what the Name property
represents (e.g., the service identifier or display name) and include any
relevant <remarks> if needed; ensure the comment sits immediately above the
string? Name { get; set; } declaration in the IPrioritizedService interface so
the public API complies with the XML doc guideline.
In `@GFramework.Game/Config/YamlConfigLoader.cs`:
- Around line 552-567: ReadYamlAsync currently catches all Exception and wraps
them as ConfigLoadException, which hides OperationCanceledException and breaks
cancellation flow; update ReadYamlAsync so that in the catch you detect
OperationCanceledException (or Exception when it's an OCE) and rethrow it
immediately (preserving cancellation) before creating/wrapping other exceptions;
apply the same pattern to the other risky catch blocks in DeserializeValue and
BuildLoadResult so any OperationCanceledException is not swallowed, while other
exceptions continue to be wrapped with ConfigLoadExceptionFactory as before;
reference the methods ReadYamlAsync, DeserializeValue, BuildLoadResult and
ensure ReloadTableAsync's catch filters can observe genuine OCEs.
---
Nitpick comments:
In `@GFramework.Core.Tests/Ioc/IPrioritizedService.cs`:
- Around line 8-11: IPrioritizedService currently re-declares string? Name {
get; set; } already present on IMixedService; remove the duplicate by having
IPrioritizedService extend IMixedService instead: change the interface signature
to include IMixedService (e.g., public interface IPrioritizedService :
IPrioritized, IMixedService) and delete the Name property from
IPrioritizedService so PrioritizedService and other implementers get Name via
IMixedService; rebuild and fix any impacted usages or tests that referenced the
removed declaration.
In `@GFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.cs`:
- Around line 18-26: Add a <returns> XML doc for the protected override
Task<int> OnDoAsync(TestAsyncQueryInputV2 input) in
TestAsyncQueryWithExceptionV4 to match project doc style; update the method's
XML comments to include a <returns> element that states the method returns a
Task<int> but will not complete normally (it always throws an
InvalidOperationException), keeping the existing <exception> entry intact so the
XML docs include <summary>, <param>, <returns>, and <exception> for OnDoAsync.
In `@GFramework.Game/Config/YamlConfigLoader.cs`:
- Around line 701-705: IntegerTryParseDelegate<T> currently declares its first
parameter as non-nullable string which mismatches BCL TryParse signatures and
triggers CS8622; change the first parameter of the delegate
IntegerTryParseDelegate<T> from string value to string? value so it matches
int.TryParse/long.TryParse signatures and allows assigning those methods to the
delegate; no extra null checks are needed at call sites because rawValue passed
into the delegate is already non-null.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a0721b57-d2f3-4b6e-8b2c-9788a4e30958
📒 Files selected for processing (39)
GFramework.Core.Tests/Architectures/IMixedTestSystem.csGFramework.Core.Tests/Architectures/IPriorityTestModel.csGFramework.Core.Tests/Architectures/IPriorityTestSystem.csGFramework.Core.Tests/Architectures/IPriorityTestUtility.csGFramework.Core.Tests/Architectures/MixedTestSystemNegativePriority.csGFramework.Core.Tests/Architectures/MixedTestSystemWithPriority.csGFramework.Core.Tests/Architectures/MixedTestSystemWithoutPriority.csGFramework.Core.Tests/Architectures/PriorityServiceTests.csGFramework.Core.Tests/Architectures/PriorityTestModelA.csGFramework.Core.Tests/Architectures/PriorityTestModelB.csGFramework.Core.Tests/Architectures/PriorityTestModelC.csGFramework.Core.Tests/Architectures/PriorityTestSystemA.csGFramework.Core.Tests/Architectures/PriorityTestSystemB.csGFramework.Core.Tests/Architectures/PriorityTestSystemC.csGFramework.Core.Tests/Architectures/PriorityTestUtilityA.csGFramework.Core.Tests/Architectures/PriorityTestUtilityB.csGFramework.Core.Tests/Architectures/PriorityTestUtilityC.csGFramework.Core.Tests/Ioc/AliasAwareService.csGFramework.Core.Tests/Ioc/IMixedService.csGFramework.Core.Tests/Ioc/IPrimaryAliasService.csGFramework.Core.Tests/Ioc/IPrioritizedService.csGFramework.Core.Tests/Ioc/ISecondaryAliasService.csGFramework.Core.Tests/Ioc/IService.csGFramework.Core.Tests/Ioc/ISharedAliasService.csGFramework.Core.Tests/Ioc/MicrosoftDiContainerTests.csGFramework.Core.Tests/Ioc/NonPrioritizedService.csGFramework.Core.Tests/Ioc/PrioritizedService.csGFramework.Core.Tests/Ioc/TestService.csGFramework.Core.Tests/Query/AbstractAsyncQueryTests.csGFramework.Core.Tests/Query/TestAsyncComplexQueryV4.csGFramework.Core.Tests/Query/TestAsyncQueryChildV4.csGFramework.Core.Tests/Query/TestAsyncQueryInputV2.csGFramework.Core.Tests/Query/TestAsyncQueryResultV2.csGFramework.Core.Tests/Query/TestAsyncQueryV4.csGFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.csGFramework.Core.Tests/Query/TestAsyncStringQueryV4.csGFramework.Game/Config/YamlConfigLoader.csai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
💤 Files with no reviewable changes (3)
- GFramework.Core.Tests/Query/AbstractAsyncQueryTests.cs
- GFramework.Core.Tests/Ioc/MicrosoftDiContainerTests.cs
- GFramework.Core.Tests/Architectures/PriorityServiceTests.cs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.cs: Apply [Log] attribute for automatic logging field and logging helper method generation
Apply [Priority] attribute for automatic priority comparison implementation generation
Apply [GenerateEnumExtensions] attribute to generate enumeration extension capabilities
Apply [ContextAware] attribute to automatically implement IContextAware boilerplate logic
**/*.cs: All public, protected, and internal types and members MUST include XML documentation comments (///) with<summary>,<param>,<returns>,<exception>, and<remarks>where applicable
Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, edge cases, registration order, lifecycle sequencing, and generated code assumptions
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Generated logic and generator pipelines MUST explain what is generated, why it is generated, semantic assumptions, and diagnostics or fallback behavior
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling
Do not rely on implicit imports; declare every requiredusingexplicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace patternGFramework.{Module}.{Feature}with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces withIprefix, parameters and locals in camelCase, private fields in_camelCase
Use 4 spaces for indentation in C# files; do not use tabs
Use Allman braces in C# files
Keepusingdirectives at the top of C# files and sort them consistently
Prefer one primary type per C# file unless the surrounding project already uses a different local pattern
Keep...
Files:
GFramework.Core.Tests/Architectures/IPriorityTestSystem.csGFramework.Core.Tests/Ioc/IPrioritizedService.csGFramework.Core.Tests/Architectures/IPriorityTestUtility.csGFramework.Core.Tests/Architectures/IPriorityTestModel.csGFramework.Core.Tests/Ioc/AliasAwareService.csGFramework.Core.Tests/Ioc/IMixedService.csGFramework.Core.Tests/Ioc/TestService.csGFramework.Core.Tests/Architectures/IMixedTestSystem.csGFramework.Core.Tests/Architectures/PriorityTestUtilityA.csGFramework.Core.Tests/Query/TestAsyncQueryInputV2.csGFramework.Core.Tests/Ioc/ISharedAliasService.csGFramework.Core.Tests/Ioc/IPrimaryAliasService.csGFramework.Core.Tests/Architectures/PriorityTestUtilityC.csGFramework.Core.Tests/Ioc/IService.csGFramework.Core.Tests/Architectures/PriorityTestModelB.csGFramework.Core.Tests/Architectures/MixedTestSystemWithPriority.csGFramework.Core.Tests/Architectures/PriorityTestModelA.csGFramework.Core.Tests/Architectures/MixedTestSystemNegativePriority.csGFramework.Core.Tests/Architectures/PriorityTestSystemB.csGFramework.Core.Tests/Ioc/NonPrioritizedService.csGFramework.Core.Tests/Architectures/PriorityTestModelC.csGFramework.Core.Tests/Query/TestAsyncQueryResultV2.csGFramework.Core.Tests/Architectures/PriorityTestSystemA.csGFramework.Core.Tests/Architectures/MixedTestSystemWithoutPriority.csGFramework.Core.Tests/Ioc/PrioritizedService.csGFramework.Core.Tests/Query/TestAsyncComplexQueryV4.csGFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.csGFramework.Core.Tests/Ioc/ISecondaryAliasService.csGFramework.Core.Tests/Query/TestAsyncQueryV4.csGFramework.Core.Tests/Query/TestAsyncQueryChildV4.csGFramework.Core.Tests/Architectures/PriorityTestSystemC.csGFramework.Core.Tests/Query/TestAsyncStringQueryV4.csGFramework.Game/Config/YamlConfigLoader.csGFramework.Core.Tests/Architectures/PriorityTestUtilityB.cs
ai-plan/public/*/traces/**
📄 CodeRabbit inference engine (AGENTS.md)
Contributors MUST maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work, recording the current date, key decisions, validation milestones, and the immediate next step
Files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
ai-plan/public/*/todos/**
📄 CodeRabbit inference engine (AGENTS.md)
ai-plan/public/*/todos/**: When working from a tracked implementation plan, contributors MUST update the corresponding tracking document underai-plan/public/<topic>/todos/in the same change
Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point
Active tracking and trace files are recovery entrypoints, not append-only changelogs; they MUST stay concise enough forbootto locate the current recovery point quickly
Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step so another contributor or subagent can continue the work safely
When completed and validated stages begin to accumulate, contributors MUST archive their detailed history out of the activetodos/andtraces/entry files in the same change, keeping only the current recovery point, active facts, active risks, immediate next step, and pointers to archive files
When a task spans multiple commits or is likely to exceed a single agent context window, update both the recovery document and the trace at each meaningful milestone before pausing or handing work off
If subagents are used on a complex task, the main agent MUST capture the delegated scope and any accepted findings in the active recovery document or trace before continuing implementation
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🧠 Learnings (10)
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`
Applied to files:
GFramework.Core.Tests/Architectures/IPriorityTestSystem.csGFramework.Core.Tests/Architectures/IPriorityTestUtility.csGFramework.Core.Tests/Architectures/IPriorityTestModel.csGFramework.Core.Tests/Architectures/IMixedTestSystem.csGFramework.Core.Tests/Architectures/PriorityTestUtilityC.csGFramework.Core.Tests/Architectures/PriorityTestModelB.csGFramework.Core.Tests/Architectures/MixedTestSystemWithPriority.csGFramework.Core.Tests/Architectures/PriorityTestModelA.csGFramework.Core.Tests/Architectures/PriorityTestSystemB.csGFramework.Core.Tests/Architectures/PriorityTestModelC.csGFramework.Core.Tests/Architectures/PriorityTestSystemA.csGFramework.Core.Tests/Architectures/MixedTestSystemWithoutPriority.csGFramework.Core.Tests/Architectures/PriorityTestSystemC.cs
📚 Learning: 2026-04-17T11:35:08.762Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-17T11:35:08.762Z
Learning: Applies to **/*.cs : Apply [Priority] attribute for automatic priority comparison implementation generation
Applied to files:
GFramework.Core.Tests/Architectures/IPriorityTestSystem.csGFramework.Core.Tests/Architectures/IPriorityTestUtility.csGFramework.Core.Tests/Architectures/IPriorityTestModel.csGFramework.Core.Tests/Ioc/TestService.csGFramework.Core.Tests/Architectures/PriorityTestUtilityA.csGFramework.Core.Tests/Architectures/PriorityTestUtilityC.csGFramework.Core.Tests/Architectures/PriorityTestModelB.csGFramework.Core.Tests/Architectures/MixedTestSystemWithPriority.csGFramework.Core.Tests/Architectures/PriorityTestModelA.csGFramework.Core.Tests/Architectures/MixedTestSystemNegativePriority.csGFramework.Core.Tests/Architectures/PriorityTestSystemB.csGFramework.Core.Tests/Architectures/PriorityTestModelC.csGFramework.Core.Tests/Architectures/PriorityTestSystemA.csGFramework.Core.Tests/Ioc/PrioritizedService.csGFramework.Core.Tests/Architectures/PriorityTestSystemC.csGFramework.Core.Tests/Architectures/PriorityTestUtilityB.cs
📚 Learning: 2026-04-06T12:45:43.921Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 190
File: GFramework.Game/Config/GameConfigBootstrap.cs:1-3
Timestamp: 2026-04-06T12:45:43.921Z
Learning: In the GeWuYou/GFramework repository, C# files may omit explicit `using System*` imports because the project-wide `GlobalUsings.cs` (referenced via manual global `using` directives) supplies common namespaces (e.g., `System`, `System.Threading`, `System.Threading.Tasks`). During code review, do not flag missing `using System...` directives in `.cs` files as long as `GlobalUsings.cs` is present/used to provide those namespaces.
Applied to files:
GFramework.Core.Tests/Architectures/IPriorityTestSystem.csGFramework.Core.Tests/Ioc/IPrioritizedService.csGFramework.Core.Tests/Architectures/IPriorityTestUtility.csGFramework.Core.Tests/Architectures/IPriorityTestModel.csGFramework.Core.Tests/Ioc/AliasAwareService.csGFramework.Core.Tests/Ioc/IMixedService.csGFramework.Core.Tests/Ioc/TestService.csGFramework.Core.Tests/Architectures/IMixedTestSystem.csGFramework.Core.Tests/Architectures/PriorityTestUtilityA.csGFramework.Core.Tests/Query/TestAsyncQueryInputV2.csGFramework.Core.Tests/Ioc/ISharedAliasService.csGFramework.Core.Tests/Ioc/IPrimaryAliasService.csGFramework.Core.Tests/Architectures/PriorityTestUtilityC.csGFramework.Core.Tests/Ioc/IService.csGFramework.Core.Tests/Architectures/PriorityTestModelB.csGFramework.Core.Tests/Architectures/MixedTestSystemWithPriority.csGFramework.Core.Tests/Architectures/PriorityTestModelA.csGFramework.Core.Tests/Architectures/MixedTestSystemNegativePriority.csGFramework.Core.Tests/Architectures/PriorityTestSystemB.csGFramework.Core.Tests/Ioc/NonPrioritizedService.csGFramework.Core.Tests/Architectures/PriorityTestModelC.csGFramework.Core.Tests/Query/TestAsyncQueryResultV2.csGFramework.Core.Tests/Architectures/PriorityTestSystemA.csGFramework.Core.Tests/Architectures/MixedTestSystemWithoutPriority.csGFramework.Core.Tests/Ioc/PrioritizedService.csGFramework.Core.Tests/Query/TestAsyncComplexQueryV4.csGFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.csGFramework.Core.Tests/Ioc/ISecondaryAliasService.csGFramework.Core.Tests/Query/TestAsyncQueryV4.csGFramework.Core.Tests/Query/TestAsyncQueryChildV4.csGFramework.Core.Tests/Architectures/PriorityTestSystemC.csGFramework.Core.Tests/Query/TestAsyncStringQueryV4.csGFramework.Game/Config/YamlConfigLoader.csGFramework.Core.Tests/Architectures/PriorityTestUtilityB.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Public API changes must be covered by unit or integration tests in C#
Applied to files:
GFramework.Core.Tests/Architectures/PriorityTestUtilityC.csGFramework.Core.Tests/Architectures/PriorityTestModelC.csGFramework.Core.Tests/Architectures/PriorityTestSystemC.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Keep tests focused on observable behavior, not implementation trivia
Applied to files:
GFramework.Core.Tests/Architectures/MixedTestSystemWithoutPriority.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: When the goal is to inspect or reduce warnings, establish the warning baseline by running `dotnet clean` and then `dotnet build`, not repeated incremental builds
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : When a C# method approaches analyzer complexity limits, extract named helper methods by semantic phase (parsing, normalization, validation, diagnostics) instead of silencing the warning
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.mdai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/traces/** : Contributors MUST maintain a matching execution trace under `ai-plan/public/<topic>/traces/` for complex work, recording the current date, key decisions, validation milestones, and the immediate next step
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-16T13:26:01.780Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:26:01.780Z
Learning: In the GeWuYou/GFramework repository, the test project `GFramework.SourceGenerators.Tests` provides `global using NUnit.Framework;` via its `GlobalUsings.cs`. Do not flag missing `using NUnit.Framework;` directives in test files within this project, as the global using already covers it. The project-wide GlobalUsings.cs pattern is used broadly to supply common namespaces (including NUnit, System.IO, etc.) without per-file imports.
Applied to files:
GFramework.Game/Config/YamlConfigLoader.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🪛 LanguageTool
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
[grammar] ~16-~16: Ensure spelling is correct
Context: ...g / 279 个唯一位点 - 当前剩余 warning 热点仍集中在 GFramework.Cqrs.Tests/Mediator/* 的大体量 MA0048、以及 `Yam...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~77-~77: Ensure spelling is correct
Context: ...。 3. 继续将 YamlConfigSchemaValidator* 与 GFramework.Cqrs.Tests/Mediator/* 作为独立高风险波次处理。
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (34)
GFramework.Core.Tests/Ioc/ISharedAliasService.cs (1)
1-6: LGTM!新接口拆分到独立文件以消除 MA0048,命名空间、XML 注释与命名规范均符合要求。
GFramework.Core.Tests/Ioc/ISecondaryAliasService.cs (1)
1-6: LGTM!
ISecondaryAliasService继承自ISharedAliasService,作为次级别名契约的空标记接口拆分清晰,符合命名空间与 XML 文档规范。GFramework.Core.Tests/Ioc/IPrimaryAliasService.cs (1)
1-6: LGTM!
IPrimaryAliasService与ISecondaryAliasService配对,统一继承ISharedAliasService,拆分粒度合理。GFramework.Core.Tests/Ioc/AliasAwareService.cs (1)
1-8: LGTM!
AliasAwareService使用sealed声明并实现两个别名接口,作为别名去重测试的具体类型,结构清晰且符合一文件一类型的约定。GFramework.Core.Tests/Architectures/IPriorityTestUtility.cs (1)
1-10: LGTM!将
IPriorityTestUtility从PriorityServiceTests.cs抽取为独立文件,符合 MA0048(一文件一类型)的整改目标。命名空间、XML 文档注释、命名规范均符合编码规范。GFramework.Core.Tests/Architectures/IPriorityTestSystem.cs (1)
1-10: LGTM!
IPriorityTestSystem作为优先级测试系统的标记契约,扩展自ISystem,无新增成员,符合用作类型契约的设计意图。文件结构与同批次其它测试契约接口一致。GFramework.Core.Tests/Architectures/PriorityTestUtilityC.cs (1)
1-14: LGTM!
PriorityTestUtilityC实现IPriorityTestUtility与IPrioritized,Priority => 30与PriorityServiceTests.Utilities_Should_Be_Sorted_By_Priority的预期断言(C 在索引 2)一致。XML 文档完整。GFramework.Core.Tests/Architectures/IPriorityTestModel.cs (1)
1-10: LGTM!
IPriorityTestModel抽取为独立文件,扩展IModel,作为优先级模型测试的标记契约,与同批次的IPriorityTestSystem、IPriorityTestUtility设计模式保持一致。GFramework.Core.Tests/Architectures/PriorityTestUtilityB.cs (1)
1-14: LGTM!
PriorityTestUtilityB优先级 20 与测试期望(B 位于索引 1)相符,类型抽取干净,XML 注释齐全。GFramework.Core.Tests/Architectures/IMixedTestSystem.cs (1)
1-10: LGTM!
IMixedTestSystem作为混合优先级测试场景的系统契约从PriorityServiceTests.cs抽离,命名、命名空间与文档均符合规范。后续MixedTestSystemWithPriority/MixedTestSystemWithoutPriority/MixedTestSystemNegativePriority共同实现该契约的设计清晰。GFramework.Core.Tests/Architectures/PriorityTestUtilityA.cs (1)
1-14: LGTM!
PriorityTestUtilityA优先级 10(最高),与排序断言utilities[0]期望一致。类型职责单一、文档完整。GFramework.Core.Tests/Architectures/PriorityTestSystemA.cs (1)
1-21: LGTM!
PriorityTestSystemA继承AbstractSystem并实现IPriorityTestSystem与IPrioritized,Priority => 10与Systems_Should_Be_Sorted_By_Priority中 A 位于索引 0 的断言匹配。OnInit显式留空并附注释说明只覆盖优先级排序行为,意图清晰。GFramework.Core.Tests/Architectures/PriorityTestModelB.cs (1)
1-22: LGTM!类型拆分清晰,XML 注释完整,命名空间与命名规范均符合要求,空
OnInit()仅用于满足AbstractModel抽象契约,Priority => 20与同套件中 A(10)/C(30) 的梯度一致,可满足优先级排序测试需要。GFramework.Core.Tests/Architectures/MixedTestSystemWithPriority.cs (1)
1-21: LGTM!
MixedTestSystemWithPriority实现IMixedTestSystem+IPrioritized并固定Priority => 10,与同组MixedTestSystemNegativePriority(-10) 及MixedTestSystemWithoutPriority(默认 0) 形成正/负/缺省三种情形,能够覆盖MicrosoftDiContainer.SortByPriority的稳定排序行为;XML 注释与空OnInit()实现均符合规范。GFramework.Core.Tests/Architectures/PriorityTestModelA.cs (1)
1-22: LGTM!类型抽离为独立文件,符合 MA0048 的修复目标;
Priority => 10与 B(20)/C(30) 梯度一致,XML 注释完整,空OnInit()满足AbstractModel抽象方法契约。GFramework.Core.Tests/Architectures/PriorityTestSystemC.cs (1)
1-21: LGTM!
PriorityTestSystemC与PriorityTestSystemB(20) 形成 20/30 的优先级梯度,XML 注释完整,空OnInit()仅用于满足AbstractSystem.OnInit抽象契约,文件拆分符合每文件单类型的指南。GFramework.Core.Tests/Architectures/MixedTestSystemNegativePriority.cs (1)
1-21: LGTM!负优先级用例
Priority => -10与IPrioritized契约(数值越小优先级越高)语义一致,可有效覆盖MicrosoftDiContainer.SortByPriority中负值早于默认 0 的排序分支;XML 注释与空OnInit()均符合规范。GFramework.Core.Tests/Architectures/PriorityTestModelC.cs (1)
1-22: LGTM!
PriorityTestModelC提供Priority => 30,补全模型侧 10/20/30 梯度,XML 注释完整,空OnInit()满足AbstractModel抽象契约。GFramework.Core.Tests/Architectures/MixedTestSystemWithoutPriority.cs (1)
1-16: LGTM!未实现
IPrioritized的混合系统类型,可触发SortByPriority中“非IPrioritized视为 0”的分支,与MixedTestSystemWithPriority(10) 及MixedTestSystemNegativePriority(-10) 一同提供完整排序覆盖;XML 注释与空OnInit()均符合规范。GFramework.Core.Tests/Architectures/PriorityTestSystemB.cs (1)
1-21: LGTM!类型已成功从
PriorityServiceTests.cs拆出为独立文件,有助于消除 MA0048;Priority => 20与同组 C(30) 形成稳定梯度,XML 注释与空OnInit()满足规范。GFramework.Core.Tests/Query/TestAsyncQueryInputV2.cs (1)
1-14: LGTM!新拆分的测试用查询输入类型实现了
IQueryInput,使用init只读属性、sealed修饰符及完整的 XML 注释,命名空间GFramework.Core.Tests.Query与目录结构一致,符合规范。GFramework.Core.Tests/Query/TestAsyncQueryV4.cs (1)
1-33: LGTM!
TestAsyncQueryV4正确继承AbstractAsyncQuery<TestAsyncQueryInputV2, int>,构造函数将input转发至基类,OnDoAsync中先设置Executed = true再返回input.Value * 2,符合基类约定(DoAsync调用OnDoAsync(input))。XML 注释与命名规范均符合要求。GFramework.Core.Tests/Query/TestAsyncQueryChildV4.cs (1)
1-33: LGTM!实现与
TestAsyncQueryV4一致,仅在结果上乘以 3 以体现子类语义差异,构造函数转发与Executed标记位的使用均符合基类骨架。GFramework.Core.Tests/Query/TestAsyncStringQueryV4.cs (1)
1-33: LGTM!字符串结果版异步查询测试类正确继承
AbstractAsyncQuery<TestAsyncQueryInputV2, string>,OnDoAsync设置Executed并返回Task.FromResult($"Value: {input.Value * 2}"),结构与其他*V4兄弟类一致。GFramework.Core.Tests/Query/TestAsyncQueryResultV2.cs (1)
1-17: LGTM!
TestAsyncQueryResultV2是不可变的复杂查询结果类型,使用init只读属性,并配有完整 XML 注释。提取到独立文件后符合每文件单一主类型的偏好。GFramework.Core.Tests/Query/TestAsyncComplexQueryV4.cs (1)
1-38: LGTM!
TestAsyncComplexQueryV4继承自AbstractAsyncQuery<TestAsyncQueryInputV2, TestAsyncQueryResultV2>,构造转发与OnDoAsync实现均符合基类约定,构造的TestAsyncQueryResultV2同时设置Value与DoubleValue两个 init-only 属性,整体清晰且与其它*V4类风格一致。GFramework.Core.Tests/Ioc/NonPrioritizedService.cs (1)
1-12: LGTM!类型与成员均有 XML 注释,
sealed修饰、命名空间和命名规范均符合规范,作为测试夹具实现简洁清晰。GFramework.Core.Tests/Ioc/PrioritizedService.cs (1)
1-17: LGTM!
PrioritizedService通过单一隐式实现同时满足IPrioritizedService和IMixedService的Name契约,并以可写的Priority拓展了IPrioritized的只读Priority契约(用于在测试中按需设置优先级),符合测试夹具的预期用法。注释、密封性、命名空间与命名均合规。备注:如果采纳了
IPrioritizedService改为继承IMixedService的建议,本文件无需任何改动。GFramework.Core.Tests/Ioc/IService.cs (1)
1-6: 看起来不错!标记接口定义正确,XML 文档完整且适当。命名遵循 C# 接口约定(
I前缀),命名空间符合GFramework.{Module}.{Feature}模式。GFramework.Core.Tests/Ioc/TestService.cs (1)
6-11: TestService は基本的なサービススタブであり、[Priority] 属性は不要です。TestService は IService インターフェイスのみを実装する最小限のテストダブルです。Priority プロパティを持つことは IService 要件ですが、[Priority] 属性は IPrioritized インターフェイスの自動生成用であり、TestService は IPrioritized を実装していません。
優先度ベースのテストが必要な場合は、PrioritizedService(IPrioritizedService を実装)が既に存在します。このクラスは設計通りで、変更は不要です。
> Likely an incorrect or invalid review comment.GFramework.Game/Config/YamlConfigLoader.cs (2)
472-488: LoadAsync 按语义阶段拆分得很干净,整体 LGTM。入口流程被拆为「目录校验 → schema 加载 → 文件枚举/读取 → 引用收集 → 反序列化 → 结果构建」六个清晰阶段,命名也一致地反映了职责,符合"按语义阶段提取命名 helper 而非压制告警"的项目准则。
DeserializeValue中对nullyield 的显式守卫也避免了下游收到默认实例。Also applies to: 490-544, 569-583, 585-614
890-896:Lock多目标条件编译与ContainsDependency的 ordinal 化处理 LGTM。
_gate使用#if NET9_0_OR_GREATER切换到System.Threading.Lock,并保留object兜底,与GameConfigBootstrap._stateGate保持一致的 config 子系统约定。注释也清楚地说明了"分析器建议使用专用同步原语"的动机。ContainsDependency改用string.Equals(..., StringComparison.Ordinal)替代隐式Contains,行为上与_lastSuccessfulDependencies/_dependenciesByTable中已经使用的StringComparer.Ordinal字典统一,避免了文化敏感比较导致的潜在 MA0002/MA0001 类告警。Also applies to: 1196-1202
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md (1)
3-43: Trace 内容齐全,符合 trace 文档准则。包含当前日期
2026-04-27、活跃恢复点RP-083、关键决策(主线程修复 + 两波 worker 拆分 + 主动停掉ArchitectureContextTests候选)、验证里程碑(项目级 + 仓库根dotnet clean/dotnet build的明确 warning/error 数)、活跃风险及下一步建议,均符合ai-plan/public/*/traces/**的记录要求。As per coding guidelines, "Contributors MUST maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work, recording the current date, key decisions, validation milestones, and the immediate next step".ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md (1)
9-50: 跟踪文档更新完整,恢复点信息齐备。恢复点编号
RP-083、阶段Phase 83、当前焦点(YamlConfigLoader单文件清理 + 两个测试拆分 slice)、活跃事实(origin/main@b6a9fef基线 + 仓库根397/316 → 353/279)、活跃风险(Cqrs.Tests/Mediator/*、YamlConfigSchemaValidator*高耦合热点)、以及下一步建议(提交本轮 + 优先 7-warningMA0048切片)均已就位,足以支撑下一位 contributor / subagent 在不丢失上下文的前提下接力。As per coding guidelines, "Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point".
Also applies to: 75-77
- 修复 ReadYamlAsync 在取消时错误包装异常的问题,并对齐 IntegerTryParseDelegate 的可空性签名 - 更新 Ioc 与 Query 测试辅助类型的 XML 文档,并让 IPrioritizedService 复用 IMixedService 的 Name 契约 - 补充 YamlConfigLoader 取消语义回归测试并同步 analyzer warning reduction 跟踪
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #992
🎉 All tests passed!Slowest Tests
± Comparison with run #991 at 88f0c60 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 43 runs. Github Test Reporter by CTRF 💚 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs (1)
2794-2829: 测试方法标记为async Task但没有任何await,会触发 CS1998 警告。外层方法体内只有同步调用与一次反射
Invoke;唯一的await位于传给Assert.That的内部 lambda 中,对外层async修饰符并不构成await。考虑到本 PR 的主线目标就是 analyzer warning reduction,这里反而引入一条新的 CS1998。建议改用更地道的
Assert.ThrowsAsync<OperationCanceledException>直接断言异步异常,并把方法签名改回同步void,既消除 CS1998 又比Throws.InstanceOf<>+ 异步 lambda 的写法更直接。♻️ 建议的写法
- [Test] - public async Task ReadYamlAsync_Should_Preserve_OperationCanceledException_When_Cancellation_Is_Requested() + [Test] + public void ReadYamlAsync_Should_Preserve_OperationCanceledException_When_Cancellation_Is_Requested() { CreateConfigFile( "monster/slime.yaml", """ id: 1 name: Slime hp: 10 """); var loader = new YamlConfigLoader(_rootPath) .RegisterTable<int, MonsterConfigStub>("monster", "monster", static config => config.Id); var registration = GetSingleYamlTableRegistration(loader); var readYamlAsyncMethod = registration.GetType() .GetMethod("ReadYamlAsync", BindingFlags.Instance | BindingFlags.NonPublic); Assert.That(readYamlAsyncMethod, Is.Not.Null); using var cancellationTokenSource = new CancellationTokenSource(); cancellationTokenSource.Cancel(); // 通过反射直接命中注册项的文件读取路径,稳定回归本次取消语义修复。 var readTask = (Task<string>)readYamlAsyncMethod!.Invoke( registration, new object?[] { Path.Combine(_rootPath, "monster"), Path.Combine(_rootPath, "monster", "slime.yaml"), null, cancellationTokenSource.Token })!; - Assert.That( - async () => await readTask.ConfigureAwait(false), - Throws.InstanceOf<OperationCanceledException>()); + Assert.ThrowsAsync<OperationCanceledException>(async () => await readTask.ConfigureAwait(false)); }As per coding guidelines: "Treat Meziantou.Analyzer feedback as part of the coding standard in C#" 以及"Match existing async patterns and naming conventions with
Asyncsuffix for asynchronous methods in C#"(此处由于无真正 await,方法应保持同步签名)。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs` around lines 2794 - 2829, The test method is async but contains no awaits (CS1998); make it synchronous by removing the async modifier and changing the signature back to void for ReadYamlAsync_Should_Preserve_OperationCanceledException_When_Cancellation_Is_Requested, and replace the Assert.That(async () => await readTask.ConfigureAwait(false), Throws.InstanceOf<OperationCanceledException>()) with a direct NUnit async assertion: Assert.ThrowsAsync<OperationCanceledException>(() => readTask) so the test asserts the canceled task correctly without an outer async method.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs`:
- Around line 2794-2829: The test method is async but contains no awaits
(CS1998); make it synchronous by removing the async modifier and changing the
signature back to void for
ReadYamlAsync_Should_Preserve_OperationCanceledException_When_Cancellation_Is_Requested,
and replace the Assert.That(async () => await readTask.ConfigureAwait(false),
Throws.InstanceOf<OperationCanceledException>()) with a direct NUnit async
assertion: Assert.ThrowsAsync<OperationCanceledException>(() => readTask) so the
test asserts the canceled task correctly without an outer async method.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 03278898-a875-43c9-b7d3-4e1705709e78
📒 Files selected for processing (8)
GFramework.Core.Tests/Ioc/IMixedService.csGFramework.Core.Tests/Ioc/IPrioritizedService.csGFramework.Core.Tests/Ioc/PrioritizedService.csGFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.csGFramework.Game.Tests/Config/YamlConfigLoaderTests.csGFramework.Game/Config/YamlConfigLoader.csai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
✅ Files skipped from review due to trivial changes (1)
- GFramework.Core.Tests/Ioc/PrioritizedService.cs
🚧 Files skipped from review as they are similar to previous changes (3)
- GFramework.Core.Tests/Ioc/IMixedService.cs
- GFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.cs
- GFramework.Game/Config/YamlConfigLoader.cs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.cs: Apply [Log] attribute for automatic logging field and logging helper method generation
Apply [Priority] attribute for automatic priority comparison implementation generation
Apply [GenerateEnumExtensions] attribute to generate enumeration extension capabilities
Apply [ContextAware] attribute to automatically implement IContextAware boilerplate logic
**/*.cs: All public, protected, and internal types and members MUST include XML documentation comments (///) with<summary>,<param>,<returns>,<exception>, and<remarks>where applicable
Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, edge cases, registration order, lifecycle sequencing, and generated code assumptions
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Generated logic and generator pipelines MUST explain what is generated, why it is generated, semantic assumptions, and diagnostics or fallback behavior
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling
Do not rely on implicit imports; declare every requiredusingexplicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace patternGFramework.{Module}.{Feature}with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces withIprefix, parameters and locals in camelCase, private fields in_camelCase
Use 4 spaces for indentation in C# files; do not use tabs
Use Allman braces in C# files
Keepusingdirectives at the top of C# files and sort them consistently
Prefer one primary type per C# file unless the surrounding project already uses a different local pattern
Keep...
Files:
GFramework.Core.Tests/Ioc/IPrioritizedService.csGFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
ai-plan/public/*/traces/**
📄 CodeRabbit inference engine (AGENTS.md)
Contributors MUST maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work, recording the current date, key decisions, validation milestones, and the immediate next step
Files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
ai-plan/public/*/todos/**
📄 CodeRabbit inference engine (AGENTS.md)
ai-plan/public/*/todos/**: When working from a tracked implementation plan, contributors MUST update the corresponding tracking document underai-plan/public/<topic>/todos/in the same change
Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point
Active tracking and trace files are recovery entrypoints, not append-only changelogs; they MUST stay concise enough forbootto locate the current recovery point quickly
Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step so another contributor or subagent can continue the work safely
When completed and validated stages begin to accumulate, contributors MUST archive their detailed history out of the activetodos/andtraces/entry files in the same change, keeping only the current recovery point, active facts, active risks, immediate next step, and pointers to archive files
When a task spans multiple commits or is likely to exceed a single agent context window, update both the recovery document and the trace at each meaningful milestone before pausing or handing work off
If subagents are used on a complex task, the main agent MUST capture the delegated scope and any accepted findings in the active recovery document or trace before continuing implementation
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🧠 Learnings (7)
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Public API changes must be covered by unit or integration tests in C#
Applied to files:
GFramework.Core.Tests/Ioc/IPrioritizedService.cs
📚 Learning: 2026-04-06T12:45:43.921Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 190
File: GFramework.Game/Config/GameConfigBootstrap.cs:1-3
Timestamp: 2026-04-06T12:45:43.921Z
Learning: In the GeWuYou/GFramework repository, C# files may omit explicit `using System*` imports because the project-wide `GlobalUsings.cs` (referenced via manual global `using` directives) supplies common namespaces (e.g., `System`, `System.Threading`, `System.Threading.Tasks`). During code review, do not flag missing `using System...` directives in `.cs` files as long as `GlobalUsings.cs` is present/used to provide those namespaces.
Applied to files:
GFramework.Core.Tests/Ioc/IPrioritizedService.csGFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Regression fixes should include a test that fails before the fix and passes after it
Applied to files:
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-16T13:26:01.780Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:26:01.780Z
Learning: In the GeWuYou/GFramework repository, the test project `GFramework.SourceGenerators.Tests` provides `global using NUnit.Framework;` via its `GlobalUsings.cs`. Do not flag missing `using NUnit.Framework;` directives in test files within this project, as the global using already covers it. The project-wide GlobalUsings.cs pattern is used broadly to supply common namespaces (including NUnit, System.IO, etc.) without per-file imports.
Applied to files:
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: For any multi-step refactor, migration, or cross-module task, contributors MUST create or adopt a dedicated recovery document under `ai-plan/public/<topic>/todos/` before making substantive code changes
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Any change to public API, lifecycle semantics, module behavior, or extension points MUST update the related XML docs
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🪛 LanguageTool
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
[grammar] ~11-~11: Ensure spelling is correct
Context: ...的原始取消语义,并把 IntegerTryParseDelegate<T> 第一个参数改为 string? - 校验 GFramework.Core.Tests/Ioc/* 与 `Query/...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
[grammar] ~70-~70: Ensure spelling is correct
Context: ... #297 review follow-up 与 ai-plan 同步。 2. 下一波优先挑选 ArchitectureContextTests.cs 或 `AsyncQ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~72-~72: Ensure spelling is correct
Context: ...。 3. 继续将 YamlConfigSchemaValidator* 与 GFramework.Cqrs.Tests/Mediator/* 作为独立高风险波次处理。
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (2)
GFramework.Core.Tests/Ioc/IPrioritizedService.cs (1)
1-10: LGTM!接口组合设计清晰。通过同时继承
IPrioritized与IMixedService,IPrioritizedService复用了已具备 XML 文档注释的Priority与Name契约,避免了成员重复声明,也修复了此前对Name缺少 XML 注释的告警。命名空间、命名规范、XML 注释、using声明均符合规范。GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs (1)
3419-3433: LGTM。通过反射定位单一
_registrations项并校验数量,便于从私有注册管道直击ReadYamlAsync路径。System.Collections.IList用作非泛型解包也合理;如果想避免内联完全限定名,可在文件顶部补一行using System.Collections;,但这是可选项。
- 修复取消读取回归测试的外层 async Task 签名,消除没有 await 的编译警告 - 优化异步异常断言,继续验证取消流程会保留 OperationCanceledException 语义
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #993
🎉 All tests passed!Slowest Tests
± Comparison with run #992 at f63c5c7 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 44 runs. Github Test Reporter by CTRF 💚 |
- 修复 YAML 同步反序列化与构表阶段的取消处理,避免已取消会话被包装为配置加载失败 - 补充私有同步路径的回归测试,覆盖反序列化与构表阶段的 OperationCanceledException 透传语义
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #994
🎉 All tests passed!Slowest Tests
± Comparison with run #993 at 37ae05e | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 45 runs. Github Test Reporter by CTRF 💚 |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs (2)
3510-3510: 可改用using导入System.Collections.IList,避免在方法体中内联完整命名空间。文件其余位置未出现
System.Collections.*的内联限定名,仅本处使用了完整命名空间前缀。可在文件顶部添加using System.Collections;以保持风格一致。♻️ 建议替换为短名引用
- var registrations = registrationsField!.GetValue(loader) as System.Collections.IList; + var registrations = registrationsField!.GetValue(loader) as IList;并在文件顶部添加
using System.Collections;。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs` at line 3510, Replace the inline fully-qualified type usage with the short name by adding "using System.Collections;" to the file header and updating the expression that obtains the registrations to use IList (i.e. change "System.Collections.IList" to "IList"); specifically update the line that assigns registrations from registrationsField.GetValue(loader) to cast to IList and ensure the new using is present so the short type name resolves.
3502-3516: 建议为GetSingleYamlTableRegistration补充 XML 文档注释,与同文件其他私有辅助方法保持一致。文件中其他私有辅助方法(如
CreateConfigFile、CreateSchemaFile、WaitForTaskWithinAsync、AssertMonsterHotReloadUpdated)均有<summary>与<param>注释,唯独本助手缺失。虽然private成员不在强制 XML 文档要求范围内,但保持文件内一致性更利于后续维护。♻️ 建议补充文档注释
+ /// <summary> + /// 反射读取加载器内部 <c>_registrations</c> 字段并断言只有一项注册,便于取消语义测试稳定命中目标注册项。 + /// </summary> + /// <param name="loader">已注册唯一配置表的加载器。</param> + /// <returns>唯一的 YAML 表注册项实例。</returns> private static object GetSingleYamlTableRegistration(YamlConfigLoader loader)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs` around lines 3502 - 3516, GetSingleYamlTableRegistration is missing the XML documentation that other private helpers in the file have; add a <summary> describing that it reflects into YamlConfigLoader to retrieve the single registration, and a <returns> describing the returned registration object, and include a <param name="loader"> describing the loader argument so the method matches the file's documentation style (follow the format used by CreateConfigFile/CreateSchemaFile/WaitForTaskWithinAsync).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs`:
- Line 3510: Replace the inline fully-qualified type usage with the short name
by adding "using System.Collections;" to the file header and updating the
expression that obtains the registrations to use IList (i.e. change
"System.Collections.IList" to "IList"); specifically update the line that
assigns registrations from registrationsField.GetValue(loader) to cast to IList
and ensure the new using is present so the short type name resolves.
- Around line 3502-3516: GetSingleYamlTableRegistration is missing the XML
documentation that other private helpers in the file have; add a <summary>
describing that it reflects into YamlConfigLoader to retrieve the single
registration, and a <returns> describing the returned registration object, and
include a <param name="loader"> describing the loader argument so the method
matches the file's documentation style (follow the format used by
CreateConfigFile/CreateSchemaFile/WaitForTaskWithinAsync).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d1cc3f67-ecde-4869-8ce6-8635ca734e1f
📒 Files selected for processing (2)
GFramework.Game.Tests/Config/YamlConfigLoaderTests.csGFramework.Game/Config/YamlConfigLoader.cs
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Analyze (C#)
- GitHub Check: Code Quality & Security
- GitHub Check: Build and Test
🧰 Additional context used
📓 Path-based instructions (1)
**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.cs: Apply [Log] attribute for automatic logging field and logging helper method generation
Apply [Priority] attribute for automatic priority comparison implementation generation
Apply [GenerateEnumExtensions] attribute to generate enumeration extension capabilities
Apply [ContextAware] attribute to automatically implement IContextAware boilerplate logic
**/*.cs: All public, protected, and internal types and members MUST include XML documentation comments (///) with<summary>,<param>,<returns>,<exception>, and<remarks>where applicable
Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, edge cases, registration order, lifecycle sequencing, and generated code assumptions
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Generated logic and generator pipelines MUST explain what is generated, why it is generated, semantic assumptions, and diagnostics or fallback behavior
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling
Do not rely on implicit imports; declare every requiredusingexplicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace patternGFramework.{Module}.{Feature}with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces withIprefix, parameters and locals in camelCase, private fields in_camelCase
Use 4 spaces for indentation in C# files; do not use tabs
Use Allman braces in C# files
Keepusingdirectives at the top of C# files and sort them consistently
Prefer one primary type per C# file unless the surrounding project already uses a different local pattern
Keep...
Files:
GFramework.Game.Tests/Config/YamlConfigLoaderTests.csGFramework.Game/Config/YamlConfigLoader.cs
🧠 Learnings (6)
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Regression fixes should include a test that fails before the fix and passes after it
Applied to files:
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-16T13:26:01.780Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:26:01.780Z
Learning: In the GeWuYou/GFramework repository, the test project `GFramework.SourceGenerators.Tests` provides `global using NUnit.Framework;` via its `GlobalUsings.cs`. Do not flag missing `using NUnit.Framework;` directives in test files within this project, as the global using already covers it. The project-wide GlobalUsings.cs pattern is used broadly to supply common namespaces (including NUnit, System.IO, etc.) without per-file imports.
Applied to files:
GFramework.Game.Tests/Config/YamlConfigLoaderTests.csGFramework.Game/Config/YamlConfigLoader.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Preserve snapshot-based verification patterns already used in the repository for source generator tests
Applied to files:
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Mirror the source structure in test projects whenever practical
Applied to files:
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`
Applied to files:
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-06T12:45:43.921Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 190
File: GFramework.Game/Config/GameConfigBootstrap.cs:1-3
Timestamp: 2026-04-06T12:45:43.921Z
Learning: In the GeWuYou/GFramework repository, C# files may omit explicit `using System*` imports because the project-wide `GlobalUsings.cs` (referenced via manual global `using` directives) supplies common namespaces (e.g., `System`, `System.Threading`, `System.Threading.Tasks`). During code review, do not flag missing `using System...` directives in `.cs` files as long as `GlobalUsings.cs` is present/used to provide those namespaces.
Applied to files:
GFramework.Game.Tests/Config/YamlConfigLoaderTests.csGFramework.Game/Config/YamlConfigLoader.cs
🔇 Additional comments (8)
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs (1)
2790-2912: 新增取消语义回归测试覆盖到位。三个新增测试通过反射分别覆盖
ReadYamlAsync(异步路径,原始 OCE 直接透传)、DeserializeValue与BuildLoadResult(同步路径,OCE 包装为TargetInvocationException.InnerException)。参数顺序与YamlConfigLoader中的实际私有方法签名匹配,对失败前修复后通过的回归场景保护良好,符合**/*.Tests.cs学习中"回归修复需要先失败后通过的测试"的要求。GFramework.Game/Config/YamlConfigLoader.cs (7)
472-488:LoadAsync拆分为语义阶段助手的重构干净到位。按
GetValidatedDirectoryPath/LoadSchemaAsync/LoadValuesAsync/BuildLoadResult划分流水线,与编码规范中"按语义阶段(解析、规范化、校验、诊断)抽取命名助手以替代抑制复杂度警告"的指导一致;每个阶段都贯通同一个cancellationToken,与新的取消语义测试形成稳定耦合。As per coding guidelines: "When a C# method approaches analyzer complexity limits, extract named helper methods by semantic phase (parsing, normalization, validation, diagnostics) instead of silencing the warning"
546-572:ReadYamlAsync新增 OCE 透传守卫已修复历史问题。
catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested)出现在通用catch (Exception)之前,能保留请求 token 的取消语义;附带的中文注释清晰说明了"避免热重载把会话级取消误报为配置读取失败"的意图,与ReloadTableAsync(第 1169 行)的catch (OperationCanceledException)过滤器配合形成正确控制流。
590-626:DeserializeValue取消透传修复完整。第 600 行的
ThrowIfCancellationRequested()与第 609 行的 OCE 过滤器配合,使同步反序列化阶段在已取消时直接抛出原始 OCE,反射调用时则被包装为TargetInvocationException.InnerException——新增的DeserializeValue_Should_Preserve_OperationCanceledException_When_Cancellation_Is_Requested测试正好覆盖此路径。
628-660:BuildLoadResult取消透传修复完整。构表阶段的 OCE 守卫与对应回归测试
BuildLoadResult_Should_Preserve_OperationCanceledException_When_Cancellation_Is_Requested形成稳定保护,避免提交前取消被错误归类为TableBuildFailed。
Summary by CodeRabbit
发行说明
代码质量改进
测试
性能优化
Chores