Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough重构并拆分多个源生成器(ContextAware、Cqrs、SchemaConfig),引入冲突免疫的生成字段名、运行时类型引用/反射查找与更小的解析/发射辅助方法,同时在若干核心库添加 MA0016/MA0015 pragma、类型契约调整和对应测试。 Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant GeneratedRegistry as GeneratedRegistry
participant Services as IServiceCollection
participant Logger as ILogger
participant AssemblyLoader as AppDomain/AssemblyLoader
participant TypeResolver as TypeResolver
GeneratedRegistry->>Services: Register(services, logger)
Note right of GeneratedRegistry: 验证参数并(若需)缓存 registry assembly
GeneratedRegistry->>AssemblyLoader: 查找/加载外部程序集(若需要)
AssemblyLoader-->>GeneratedRegistry: Assembly[] / Assembly?
GeneratedRegistry->>TypeResolver: Resolve implementation Type (typeof 或 GetType(..., throwOnError:false))
TypeResolver-->>GeneratedRegistry: Type? (null guarded)
GeneratedRegistry->>Services: AddTransient(handlerInterface, implementationType 或 constructedGeneric)
GeneratedRegistry->>Logger: Debug 日志(解析成功或失败)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #923
🎉 All tests passed!Slowest Tests
± Comparison with run #921 at 876c28c | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 11 runs. Github Test Reporter by CTRF 💚 |
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| dotnet-format | yes | 1 | no | 5.91s | ||
| ✅ REPOSITORY | gitleaks | yes | no | no | 7.29s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 6.3s |
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
|
| Filename | Overview |
|---|---|
| GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.cs | Inherited member collision detection fixed via full base-type traversal in CollectReservedContextMemberNames; field names now allocated with numeric suffixes when conflicts exist; Context getter simplified to always-lock path; SetContextProvider gains null guard. |
| GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs | Class made partial and large method bodies extracted to new sibling files; no logic changes in the main pipeline orchestration. |
| GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs | New file containing runtime type-reference resolution logic; handles pointer types, dynamic, arrays, constructed generics, and assembly-internal types with graceful fallback. |
| GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs | New file containing all source-emission helpers; extracted from the monolithic generator file with no semantic changes. |
| GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.Models.cs | New file containing record structs and enums used as data models for the CQRS generator; clean separation of concerns. |
| GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs | Refactored to extract TryReadSchemaText/ParseSchemaRoot; OperationCanceledException is now explicitly re-thrown when the generator's own token is cancelled. |
| GFramework.Core/Functional/Option.cs | Added IEquatable<Option<T>> implementation with Equals, GetHashCode, and ==/!= operators; correctly uses EqualityComparer<T>.Default. |
| GFramework.Core/Events/EasyEvents.cs | ArgumentException preserved with #pragma disable MA0015 and justification comment; public API contract unchanged. |
| GFramework.Core/Coroutine/CoroutineScheduler.cs | _grouped and _tagged dictionaries now use StringComparer.Ordinal for consistent, culture-invariant key lookups. |
| GFramework.Core/Logging/LoggingConfiguration.cs | CA1002/MA0016 suppression pragmas added to preserve concrete List<T>/Dictionary<K,V> API surface; StringComparer.Ordinal initialiser kept on LoggerLevels. |
| GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs | Two new snapshot tests added for field-name collision scenarios (direct user fields and inherited base-class fields); test helper refactored to avoid duplicating the large infrastructure source block. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ContextAwareGenerator\ndetects ContextAware type] --> B[CollectReservedContextMemberNames]
B --> C{Walk full\ninheritance chain}
C --> D[Collect all non-implicit\nmember names into HashSet]
D --> E[AllocateGeneratedMemberName\n_gFrameworkContextAwareContext]
E --> F{base name\navailable?}
F -- yes --> G[Use base name\nadd to reserved set]
F -- no --> H[Try suffix 1, 2, 3...\nuntil unique]
H --> I[Add suffixed name\nto reserved set]
G --> J[AllocateGeneratedMemberName\n_gFrameworkContextAwareProvider]
I --> J
J --> K[AllocateGeneratedMemberName\n_gFrameworkContextAwareSync]
K --> L[GeneratedContextMemberNames record\nContextFieldName / ProviderFieldName / SyncFieldName]
L --> M[GenerateContextBackingFields]
L --> N[GenerateContextGetter\nalways-lock path]
L --> O[GenerateContextProviderConfiguration\nSetContextProvider + null guard\nResetContextProvider]
L --> P[GenerateInterfaceImplementations\nSetContext / GetContext]
Reviews (13): Last reviewed commit: "fix(cqrs-source-generators): 化解注册生成器文件级冲..." | Re-trigger Greptile
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #925
🎉 All tests passed!Slowest Tests
± Comparison with run #923 at 91a8273 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 12 runs. Github Test Reporter by CTRF 💚 |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs (1)
1-1792:⚠️ Potential issue | 🟠 Major文件大小超出编码规范限制,需进行职责拆分
当前文件共 1792 行,显著超出编码规范规定的 800-1000 行上限(超出 79%)。根据编码规范:"如果文件超出该范围,贡献者必须停下来检查是否应该拆分职责后再继续。" 这是一个 MUST 级别的要求。
建议考虑以下拆分点:
- 运行时类型引用解析逻辑(lines 455-606, 1315-1485 的运行时类型引用处理)提取到专门的类型引用处理器
- 源码发射逻辑(lines 720-1534 的源码构建和输出)提取到专门的源码构建器
- 数据结构定义(lines 1576-1792 的各类 record 和 struct)提取到单独的结构定义文件
这样的拆分将提升可维护性,并符合单一职责原则和框架内的文件管理规范。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs` around lines 1 - 1792, The file is too large (1792 lines) and must be split to satisfy the repository's 800–1000 line limit; refactor by extracting responsibilities into smaller files. Split out the runtime type reference logic (e.g. TryCreateRuntimeTypeReference, TryCreateConstructedGenericRuntimeTypeReference, CreateNamedRuntimeTypeReference, TryCreateGenericTypeDefinitionReference, RuntimeTypeReferenceSpec and related helpers like AppendRuntimeTypeReferenceResolution, AppendArrayRuntimeTypeReferenceResolution, AppendConstructedGenericRuntimeTypeReferenceResolution, ContainsExternalAssemblyTypeLookup) into a new TypeReferenceResolver class/file; extract the source-emission logic (e.g. GenerateSource, CreateGeneratedRegistrySourceShape, AppendGeneratedSourcePreamble, AppendGeneratedRegistryType, AppendRegisterMethod, AppendGeneratedRegistryType helper methods and AppendReflectionHelpers) into a RegistrySourceBuilder class/file; and move the data records/structs (HandlerRegistrationSpec, ReflectedImplementationRegistrationSpec, OrderedRegistrationSpec, GeneratedRegistrySourceShape, RuntimeTypeReferenceSpec if not moved, PreciseReflectedRegistrationSpec, ImplementationRegistrationSpec, HandlerCandidateAnalysis, GenerationEnvironment) into a separate Models/Specs file; ensure public/internal accessibility and update references in CqrsHandlerRegistryGenerator to use the new types and methods while keeping API surface and behavior unchanged.GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.cs (2)
225-231:⚠️ Potential issue | 🟡 Minor为生成的 public provider API 加运行时 null 校验。
provider是非空契约,但 nullable-disabled 调用方或null!仍可传入null,当前实现会静默清空 provider 并回退默认上下文,和“配置 provider”的语义不一致。建议补充参数校验和异常文档
sb.AppendLine(" /// <param name=\"provider\">后续懒加载上下文时要使用的提供者实例。</param>"); + sb.AppendLine(" /// <exception cref=\"global::System.ArgumentNullException\">当 <paramref name=\"provider\" /> 为 null 时抛出。</exception>"); sb.AppendLine(" /// <remarks>"); @@ sb.AppendLine(" public static void SetContextProvider(global::GFramework.Core.Abstractions.Architectures.IArchitectureContextProvider provider)"); sb.AppendLine(" {"); + sb.AppendLine(" global::System.ArgumentNullException.ThrowIfNull(provider);"); sb.AppendLine(" lock (_contextSync)");🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.cs` around lines 225 - 231, 在生成的 SetContextProvider(global::GFramework.Core.Abstractions.Architectures.IArchitectureContextProvider provider) 方法中增加运行时的非空校验:在进入 lock(_contextSync) 之前或内部对 provider 做 null 检查并在为 null 时抛出 ArgumentNullException(以避免静默回退 _contextProvider),同时更新方法的文档注释以说明当 provider 为 null 会抛出 ArgumentNullException,确保使用的符号包括 SetContextProvider、_contextProvider、_contextSync 和 IArchitectureContextProvider 以便定位和修改生成器模板。
188-203:⚠️ Potential issue | 🟠 Major使用
Volatile.Read/Write确保_context字段的内存可见性。当前实现在第 188 行进行无锁读取,但在锁内进行写入(第 201、321 行),导致数据竞争:线程 A 读取
_context为 null,线程 B 随后调用SetContext写入新值,线程 A 进入锁后又通过??=用 provider 获取的值覆盖了线程 B 的更改。需要使用global::System.Threading.Volatile.Read(ref _context)和global::System.Threading.Volatile.Write(ref _context, context)统一发布与读取语义。具体修改:
- 第 188 行:替换为
var context = global::System.Threading.Volatile.Read(ref _context);- 第 201 行:替换为带 null 检查的显式赋值,最后用
global::System.Threading.Volatile.Write(ref _context, context);- 第 321 行(SetContext):替换为
global::System.Threading.Volatile.Write(ref _context, context);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.cs` around lines 188 - 203, Replace the current non-volatile unsynchronized read/write of the _context field with Volatile semantics to prevent lost updates: in the GetContext generation use global::System.Threading.Volatile.Read(ref _context) instead of a plain read for the initial local variable; inside the lock where you set _context via provider (the block that references _contextProvider and does the _context ??= ...), perform an explicit null-check and assign the resolved context then publish it with global::System.Threading.Volatile.Write(ref _context, context) rather than using ??=; likewise update the SetContext implementation to publish the new value using global::System.Threading.Volatile.Write(ref _context, context). Ensure you still synchronize provider creation with lock(_contextSync) and keep provider.GetContext() usage unchanged except for storing and publishing via Volatile.Write.
🧹 Nitpick comments (1)
GFramework.Core/Functional/Option.cs (1)
16-20: 建议为Option<T>类型补充<remarks>,明确契约与边界语义。类型已写了
<summary>,但这里建议再补充<remarks>,说明Some/None、null约束及使用注意点,便于 API 使用者理解行为契约。As per coding guidelines
**/*.cs: All public, protected, and internal types and members MUST include XML documentation comments (///) with<summary>,<param>,<returns>,<exception>, and<remarks>tags where applicable.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Core/Functional/Option.cs` around lines 16 - 20, Add an XML <remarks> section to the Option<T> type documentation (the public readonly struct Option<T>) that clearly states the contract and boundary semantics: describe the Some/None semantics, whether Option<T> can wrap null for reference types (and any behavior for T being a nullable/reference type), expectations when calling methods or accessing Value, thread-safety or immutability guarantees, and typical usage/interop guidance (e.g., prefer pattern matching, avoid treating None as null). Ensure the new doc follows the project's XML doc rules alongside the existing <summary> and include any applicable <exception> or <remarks> nuance for Option<T> consumers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md`:
- Around line 224-225: The comment notes the real entry point in
SchemaConfigGenerator.cs is GenerateCatalogClass but the next-step notes
reference GenerateConfigCatalogSource; update the reference and any new code to
use the actual method name GenerateCatalogClass (or restore
GenerateConfigCatalogSource by adding a forwarding wrapper that calls
GenerateCatalogClass) and adjust all callers/usages accordingly (including any
TODOs or recovery scripts that expect GenerateCatalogClass); also verify
high-yield methods TryBuildConstraintDocumentation and GenerateCatalogClass are
the ones targeted for MA0051 fixes so tooling and tests point to the correct
symbol.
In `@GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.cs`:
- Around line 152-157: The generated backing fields in
GenerateContextBackingFields use generic names (_context, _contextProvider,
_contextSync) that can collide with user code; rename them to unique, stable
prefixed names (e.g. _gFrameworkContextAwareContext,
_gFrameworkContextAwareProvider, _gFrameworkContextAwareSync) and update every
generated reference accordingly: adjust the GetContext accessor, the
SetContextProvider and ResetContextProvider methods, and the explicit SetContext
implementation so they all use the new prefixed symbols (ensure you update
references in the methods named GetContext, SetContextProvider,
ResetContextProvider, and SetContext).
---
Outside diff comments:
In `@GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.cs`:
- Around line 225-231: 在生成的
SetContextProvider(global::GFramework.Core.Abstractions.Architectures.IArchitectureContextProvider
provider) 方法中增加运行时的非空校验:在进入 lock(_contextSync) 之前或内部对 provider 做 null 检查并在为 null
时抛出 ArgumentNullException(以避免静默回退 _contextProvider),同时更新方法的文档注释以说明当 provider 为
null 会抛出 ArgumentNullException,确保使用的符号包括
SetContextProvider、_contextProvider、_contextSync 和 IArchitectureContextProvider
以便定位和修改生成器模板。
- Around line 188-203: Replace the current non-volatile unsynchronized
read/write of the _context field with Volatile semantics to prevent lost
updates: in the GetContext generation use
global::System.Threading.Volatile.Read(ref _context) instead of a plain read for
the initial local variable; inside the lock where you set _context via provider
(the block that references _contextProvider and does the _context ??= ...),
perform an explicit null-check and assign the resolved context then publish it
with global::System.Threading.Volatile.Write(ref _context, context) rather than
using ??=; likewise update the SetContext implementation to publish the new
value using global::System.Threading.Volatile.Write(ref _context, context).
Ensure you still synchronize provider creation with lock(_contextSync) and keep
provider.GetContext() usage unchanged except for storing and publishing via
Volatile.Write.
In `@GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs`:
- Around line 1-1792: The file is too large (1792 lines) and must be split to
satisfy the repository's 800–1000 line limit; refactor by extracting
responsibilities into smaller files. Split out the runtime type reference logic
(e.g. TryCreateRuntimeTypeReference,
TryCreateConstructedGenericRuntimeTypeReference,
CreateNamedRuntimeTypeReference, TryCreateGenericTypeDefinitionReference,
RuntimeTypeReferenceSpec and related helpers like
AppendRuntimeTypeReferenceResolution, AppendArrayRuntimeTypeReferenceResolution,
AppendConstructedGenericRuntimeTypeReferenceResolution,
ContainsExternalAssemblyTypeLookup) into a new TypeReferenceResolver class/file;
extract the source-emission logic (e.g. GenerateSource,
CreateGeneratedRegistrySourceShape, AppendGeneratedSourcePreamble,
AppendGeneratedRegistryType, AppendRegisterMethod, AppendGeneratedRegistryType
helper methods and AppendReflectionHelpers) into a RegistrySourceBuilder
class/file; and move the data records/structs (HandlerRegistrationSpec,
ReflectedImplementationRegistrationSpec, OrderedRegistrationSpec,
GeneratedRegistrySourceShape, RuntimeTypeReferenceSpec if not moved,
PreciseReflectedRegistrationSpec, ImplementationRegistrationSpec,
HandlerCandidateAnalysis, GenerationEnvironment) into a separate Models/Specs
file; ensure public/internal accessibility and update references in
CqrsHandlerRegistryGenerator to use the new types and methods while keeping API
surface and behavior unchanged.
---
Nitpick comments:
In `@GFramework.Core/Functional/Option.cs`:
- Around line 16-20: Add an XML <remarks> section to the Option<T> type
documentation (the public readonly struct Option<T>) that clearly states the
contract and boundary semantics: describe the Some/None semantics, whether
Option<T> can wrap null for reference types (and any behavior for T being a
nullable/reference type), expectations when calling methods or accessing Value,
thread-safety or immutability guarantees, and typical usage/interop guidance
(e.g., prefer pattern matching, avoid treating None as null). Ensure the new doc
follows the project's XML doc rules alongside the existing <summary> and include
any applicable <exception> or <remarks> nuance for Option<T> consumers.
🪄 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: e9e368ce-389c-42eb-8b72-618542b8185b
📒 Files selected for processing (12)
GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.csGFramework.Core.Tests/Events/EasyEventsTests.csGFramework.Core/Coroutine/CoroutineScheduler.csGFramework.Core/Events/EasyEvents.csGFramework.Core/Extensions/CollectionExtensions.csGFramework.Core/Functional/Option.csGFramework.Core/Logging/FilterConfiguration.csGFramework.Core/Logging/LoggingConfiguration.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.csai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📜 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). (4)
- GitHub Check: submit-nuget
- GitHub Check: Code Quality & Security
- GitHub Check: Build and Test
- GitHub Check: Analyze (C#)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.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>tags where applicable. Comments must explain intent, contract, and usage constraints instead of restating syntax.
Add inline comments for non-trivial logic, concurrency or threading behavior, performance-sensitive paths, workarounds/compatibility constraints/edge cases, and registration order/lifecycle sequencing/generated code assumptions. Avoid obvious comments such as// increment i.
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interaction with other components, why the abstraction exists, and when to use it instead of alternatives.
Generated logic and generator pipelines MUST explain what is generated, why it is generated, the semantic assumptions the generator relies on, and any diagnostics or fallback behavior.
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling if any.
Follow C# naming conventions: use PascalCase for types, methods, properties, events, and constants; useIprefix for interfaces; use camelCase for parameters and locals; use_camelCasefor private fields.
Use the namespace patternGFramework.{Module}.{Feature}with PascalCase segments.
Do not rely on implicit imports. Declare every requiredusingexplicitly. Keepusingdirectives at the top of the file and sort them consistently.
Write null-safe code that re...
Files:
GFramework.Core/Events/EasyEvents.csGFramework.Core.Tests/Events/EasyEventsTests.csGFramework.Core/Coroutine/CoroutineScheduler.csGFramework.Core/Logging/FilterConfiguration.csGFramework.Core/Logging/LoggingConfiguration.csGFramework.Core/Extensions/CollectionExtensions.csGFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.csGFramework.Core/Functional/Option.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs
ai-plan/public/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep committed
ai-plan/public/**content safe to publish in Git history. Never write secrets, tokens, credentials, private keys, machine usernames, home-directory paths, hostnames, IP addresses, proprietary URLs, or other sensitive environment details into anyai-plan/**file. Never record absolute file-system paths; use repository-relative paths, branch names, PR numbers, or stable document identifiers instead.
Files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.mdai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
ai-plan/public/*/traces/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work. The trace should record the current date, key decisions, validation milestones, and the immediate next step. Update both the recovery document and the trace at each meaningful milestone before pausing or handing work off.
Files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
ai-plan/public/*/todos/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Contributors MUST keep
ai-plan/public/<topic>/todos/recovery documents up-to-date with completed work, newly discovered issues, validation results, and the next recommended recovery point. For any multi-step refactor, migration, or cross-module task, create or adopt a dedicated recovery document before making substantive code changes. Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step.
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
**/Cqrs/**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
Use CQRS (Command Query Responsibility Segregation) pattern with the Cqrs naming entry point instead of the historical Mediator alias
Files:
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs
🧠 Learnings (11)
📚 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/Events/EasyEvents.csGFramework.Core.Tests/Events/EasyEventsTests.csGFramework.Core/Coroutine/CoroutineScheduler.csGFramework.Core/Logging/FilterConfiguration.csGFramework.Core/Logging/LoggingConfiguration.csGFramework.Core/Extensions/CollectionExtensions.csGFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.csGFramework.Core/Functional/Option.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to ai-plan/public/*/traces/*.md : Maintain a matching execution trace under `ai-plan/public/<topic>/traces/` for complex work. The trace should record the current date, key decisions, validation milestones, and the immediate next step. Update both the recovery document and the trace at each meaningful milestone before pausing or handing work off.
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-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.cs : Preserve deterministic behavior in registries, lifecycle orchestration, and generated outputs. When adding analyzers or suppressions, keep them minimal and justify them in code comments if the reason is not obvious.
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-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to ai-plan/public/*/todos/*.md : Contributors MUST keep `ai-plan/public/<topic>/todos/` recovery documents up-to-date with completed work, newly discovered issues, validation results, and the next recommended recovery point. For any multi-step refactor, migration, or cross-module task, create or adopt a dedicated recovery document before making substantive code changes. Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step.
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-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Treat source code, `*.csproj`, tests, generated snapshots, and packaging metadata as the primary evidence for documentation updates. Treat verified reference implementations under `ai-libs/` as a secondary evidence source for real project adoption patterns, directory layouts, and end-to-end usage examples.
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 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 [ContextAware] attribute to automatically implement IContextAware boilerplate logic
Applied to files:
GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/SourceGenerators/**/*.cs : Source generator changes MUST be covered by generator tests. Preserve snapshot-based verification patterns already used in the repository. When generator behavior changes intentionally, update snapshots together with the implementation.
Applied to files:
GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.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: Use IArchitectureContext and Provider classes to propagate context capabilities between components rather than direct coupling to implementation details
Applied to files:
GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.cs : Generated logic and generator pipelines MUST explain what is generated, why it is generated, the semantic assumptions the generator relies on, and any diagnostics or fallback behavior.
Applied to files:
GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.cs : Prefer explicit, readable code over clever shorthand in framework internals. Match existing async patterns and naming conventions with `Async` suffix for asynchronous methods. Avoid hidden side effects in property getters, constructors, and registration helpers.
Applied to files:
GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.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 **/*{Startup,Init,Register,Setup,Configure}*.cs : CQRS handler registration should use generated products from CqrsHandlerRegistryGenerator at runtime, falling back to reflection scanning when generation cannot cover cases; explicitly register handlers from non-default assemblies using RegisterCqrsHandlersFromAssembly(...) or RegisterCqrsHandlersFromAssemblies(...)
Applied to files:
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs
🪛 LanguageTool
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
[grammar] ~42-~42: Ensure spelling is correct
Context: ... 决策: - 本轮暂缓 MA0158,转入单文件、可由生成器测试覆盖的 GFramework.Cqrs.SourceGenerators 结构拆分 - 未使用 subagent...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~109-~109: Ensure spelling is correct
Context: ...路径表示状态冲突, 不是某个方法参数无效,因此不能为 MA0015 人造参数名 - 为 Option<T> 声明 `IEquatable<Option...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
[grammar] ~17-~17: Ensure spelling is correct
Context: ....cs的剩余MA0051结构拆分,生成输出保持不变 - 已完成GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegist...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~20-~20: Ensure spelling is correct
Context: ...Configuration与CollectionExtensions已改用集合抽象接口,并保留内部具体集合默认值 -CoroutineScheduler的 tag/group 字典已显式使用StringComparer.Ordin...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~26-~26: Ensure spelling is correct
Context: ...atorswarnings-only 基线已降到0条 - 当前GFramework.Cqrs.SourceGeneratorswarnings-only 基线已降到...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~51-~51: Ensure spelling is correct
Context: ...051收口;warnings-only 基线已降到0条 - 已完成GFramework.Cqrs.SourceGenerators中CqrsHandlerRegistr...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (36)
GFramework.Core/Events/EasyEvents.cs (1)
56-62: 异常类型调整合理将重复注册抛出的异常由
ArgumentException改为InvalidOperationException,语义上更贴切(属于状态冲突而非参数校验),与 .NET 约定一致,XML 文档注释也同步更新。注意这是对外 API 的破坏性变更,若存在外部调用方捕获旧的ArgumentException,需在发布说明中提醒。GFramework.Core.Tests/Events/EasyEventsTests.cs (1)
101-110: 测试与生产代码变更保持同步断言类型和 XML 文档措辞均已同步更新为
InvalidOperationException/ “状态冲突”,与EasyEvents.AddEvent<T>()的新契约一致。GFramework.Core/Functional/Option.cs (2)
316-316: 该处仅为结构性收尾,无需评论。
20-20: 实现IEquatable<Option<T>>的变更是正确且一致的。当前声明与现有
Equals/GetHashCode/运算符实现保持一致,方向正确、无明显回归风险。GFramework.Core/Extensions/CollectionExtensions.cs (1)
84-84: Return type 改为IDictionary在仓库内部无兼容性问题。验证显示仓库内所有
ToDictionarySafe调用均使用var声明,无任何代码显式依赖Dictionary<TKey, TValue>具体返回类型。返回接口而非具体实现类是符合 C# 最佳实践的 API 设计,提供更好的抽象和扩展性。若此改动系有意为之的 API 改进,可按需在发布说明中注明。GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs (1)
206-207: 类型比较收敛为 ordinal 语义,改动看起来合理。主键类型校验、约束文档、inline schema 摘要和路径拼接都保持了 JSON schema keyword 的大小写敏感语义;
schemaType的 nullable flow 也更清晰。Also applies to: 1857-1876, 3967-4111, 4374-4397, 4516-4518
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md (1)
3-31: RP-019 trace 记录完整。本段包含恢复点日期、决策、实现范围、验证命令和下一步建议,也未记录不可公开的环境细节。
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs (25)
92-98: 重构改进了可读性将接口收集和候选分析拆分为独立辅助方法提升了代码的语义清晰度,保持了早期返回的逻辑流程。
100-111: LGTM!接口过滤和排序逻辑正确,使用稳定的字符串比较器确保生成输出的确定性,这对于可重现构建至关重要。
113-165: 重构改进了性能和可维护性提取候选分析逻辑为独立方法,并优化了
canReferenceImplementation的计算(只计算一次而非在循环中重复计算),提升了代码清晰度。
167-215: 优秀的逻辑整合将接口分类逻辑整合到单一方法中,清晰地处理了三种注册路径(直接注册、实现类型反射注册、精确反射注册),提升了代码的可测试性和可维护性。
485-501: LGTM!将已构造泛型和命名类型的处理逻辑委托给专门的辅助方法,保持了核心方法的简洁性。未绑定泛型的检查条件正确。
503-543: 正确处理已构造泛型类型该方法通过递归验证泛型定义和全部泛型实参的可表达性,保持了快速失败行为。逻辑清晰且正确。
545-561: LGTM!正确根据类型所属程序集选择当前程序集反射查找或外部程序集反射查找,确保跨程序集类型引用的正确性。
724-730: 重构简化了源码生成流程将源码形状计算和发射逻辑提取到独立辅助方法,使主生成流程更加线性和易于理解。
732-755: 优化生成流程的预计算策略预先计算生成输出需要的辅助分支,避免在发射阶段重复扫描注册集合,这是一个有效的性能优化。
757-784: LGTM!正确发射生成文件头和程序集级元数据特性,条件性发射 reflection fallback 特性的逻辑正确。
786-809: LGTM!正确发射程序集级 reflection fallback 元数据特性,字符串转义和参数分隔符处理正确。
811-842: LGTM!正确发射生成注册器类型本体,基于
HasExternalAssemblyTypeLookups标志条件性发射反射辅助方法的逻辑正确。
844-892: 优化的条件性变量发射使用预计算的
RequiresRegistryAssemblyVariable标志条件性发射程序集变量,避免了在发射阶段重复检查每个注册项,提升了效率。
913-938: 良好的代码复用提取服务注册发射逻辑为可复用辅助方法,减少代码重复。方法正确格式化
AddTransient调用并支持可配置的缩进。
940-959: LGTM!提取日志发射逻辑确保所有生成注册路径的日志文本格式一致,字符串转义正确应用。
988-1030: 正确合并和排序多种注册类型该方法将直接注册、实现类型反射注册和精确反射注册合并为统一的有序列表,并按 handler 接口日志名排序以确保输出稳定性。逻辑清晰且正确。
1032-1059: LGTM!正确根据类型可访问性选择直接
typeof引用或反射查找,字符串转义应用正确。
1061-1105: 良好的分派逻辑使用 switch 语句根据注册类型分派到专门的发射方法,并在 default 分支抛出异常以防御未来新增的注册类型,这是良好的防御性编程实践。
1107-1184: 优秀的关注点分离三个专门的有序注册发射方法通过复用通用的
AppendServiceRegistration和AppendRegistrationLog辅助方法保持一致性,同时为每种注册类型提供了专门处理。
1224-1252: LGTM!正确递归处理每个 handler 泛型实参,并收集需要空值检查的反射解析变量。逻辑清晰且正确。
1254-1281: 正确的空值保护实现为运行时反射解析的泛型实参生成空值保护块,使用 "is not null" 模式检查所有反射变量,避免注册无法完整构造的服务类型。
1283-1313: LGTM!正确发射
MakeGenericType构造语句以在运行时创建关闭的 handler 服务类型,参数连接逻辑正确。
1357-1447: 正确的递归类型引用处理四个专门的运行时类型引用发射方法正确处理数组、指针和已构造泛型类型,通过递归处理组成类型确保完整的类型重建。数组处理正确区分一维和多维数组。
1449-1485: LGTM!正确发射命名类型的运行时反射查找语句,并将变量名添加到需要空值检查的集合中。条件逻辑根据是否为外部程序集正确选择查找方式。
1586-1601: 设计良好的数据结构新的数据结构设计合理:
OrderedRegistrationSpec用于跟踪有序注册项及其来源,GeneratedRegistrySourceShape预计算代码分支需求。RequiresRegistryAssemblyVariable属性正确组合了三个条件。GFramework.Core/Coroutine/CoroutineScheduler.cs (1)
44-44: 显式指定分组和标签键的比较器没问题。这里让
_grouped/_tagged的字符串键比较语义更明确,且添加、删除、查询都走同一组字典实例,没有看到一致性问题。Also applies to: 53-53
GFramework.Core/Logging/LoggingConfiguration.cs (1)
18-24: 此更改是意图清晰的析构器警告减少方案,不是破坏性变更。将
Appenders和LoggerLevels的公开属性类型从具体类型改为接口类型(IList<T>/IDictionary<K,V>)是在 commit 2348957 "fix(analyzers): 降低 Core、Cqrs、Godot 与生成器的构建警告" 中有意进行的。该更改:
- 已在代码库中广泛测试(112 个测试通过,包含 LoggingConfigurationTests 和 ConfigurableLoggerFactoryTests)
- 与现有使用模式兼容——属性通过索引、迭代、Count 等接口方法访问,均对
IList<T>和IDictionary<K,V>无缝工作- 遵循 C# 设计最佳实践(依赖抽象而非具体实现)
- 默认初始化器仍使用具体类型(
new List<T>()/new Dictionary<K,V>(StringComparer.Ordinal))无需回退或迁移计划。
GFramework.Core/Logging/FilterConfiguration.cs (1)
23-28: 这是一个经过规划的 API 设计改进,不应该回退。根据
analyzer-warning-reduction跟踪记录(RP-016),将FilterConfiguration.Namespaces和Filters从List<T>改为IList<T>是为了解决 Meziantou 分析器警告(MA0016)而进行的有意改变。设计目标是"兼顾 analyzer 与现有配置消费路径",同时保留List<T>的默认实例行为。
IList<T>对于配置 POCO 来说是更合适的公开接口,所有已确认的使用点(.ToArray()、.Select())都与此兼容。若要修改此更改,需要在项目的语义版本控制中反映破坏性变化(如主版本号递增),而不是回退到List<T>。> Likely an incorrect or invalid review comment.GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.cs (1)
141-146: 生成器快照测试已覆盖,无需进一步措施。快照测试
ContextAwareGeneratorSnapshotTests.Snapshot_ContextAwareGenerator()已验证并通过,快照文件捕获了包括SetContextProvider()、ResetContextProvider()、_contextProvider、_contextSync在内的全部新增生成逻辑。生成输出的同步协议、lazy 初始化语义和 provider 回退行为均已在快照中固定,避免了无意回退风险。
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #926
🎉 All tests passed!Slowest Tests
± Comparison with run #925 at e3aedac | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 13 runs. Github Test Reporter by CTRF 💚 |
- 重构 CqrsHandlerRegistryGenerator 为按职责拆分的 partial 生成器文件,保留现有注册输出与 fallback 契约 - 修复 ContextAwareGenerator 生成字段命名冲突并为 SetContextProvider 补充运行时 null 校验与异常文档 - 补充 Option<T> 的 XML remarks 契约说明与 ContextAwareGenerator 字段冲突快照测试 - 更新 analyzer-warning-reduction 跟踪与 trace,记录 PR #269 review follow-up 与验证结果
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #927
🎉 All tests passed!Slowest Tests
± Comparison with run #926 at cc1c3ca | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 14 runs. Github Test Reporter by CTRF 💚 |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs (1)
143-147: 可省略冗余参数传递。外层已判断
sourceShape.HasExternalAssemblyTypeLookups为true才会进入该分支,AppendReflectionHelpers再次接收bool includeExternalAssemblyTypeLookupHelpers并在方法内重复判断同一条件属于可简化项。可以去掉参数并内联当前为true的分支,或把参数留给日后可能的“反射辅助但非外部程序集查找”分支,并在注释中说明保留原因。♻️ 建议的简化
- if (sourceShape.HasExternalAssemblyTypeLookups) - { - builder.AppendLine(); - AppendReflectionHelpers(builder, sourceShape.HasExternalAssemblyTypeLookups); - } + if (sourceShape.HasExternalAssemblyTypeLookups) + { + builder.AppendLine(); + AppendReflectionHelpers(builder); + }并相应去掉
AppendReflectionHelpers的includeExternalAssemblyTypeLookupHelpers参数与内部if。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs` around lines 143 - 147, The call site checks sourceShape.HasExternalAssemblyTypeLookups before calling AppendReflectionHelpers, so remove the redundant bool parameter: change the invocation to AppendReflectionHelpers(builder) and update the AppendReflectionHelpers method signature to drop includeExternalAssemblyTypeLookupHelpers; remove the internal if that re-checks the same condition and inline the branch body (or keep conditional logic only where needed inside the method), and update any other callers to the new signature; leave a short comment on AppendReflectionHelpers if you chose to preserve the parameter for future behaviors instead of removing it.
🤖 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.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs`:
- Around line 166-221: The external-reflection branches in
CreateNamedRuntimeTypeReference and TryCreateGenericTypeDefinitionReference
assume namedType.ContainingAssembly / genericTypeDefinition.ContainingAssembly
is non-null and call .Identity.ToString(), which can NRE for error/synthetic
symbols; update both methods to first check if ContainingAssembly is null and if
so avoid using .Identity: for CreateNamedRuntimeTypeReference return a failure
path (propagate by having the caller TryCreateRuntimeTypeReference treat it as
false) or emit a generator diagnostic instead of dereferencing, and for
TryCreateGenericTypeDefinitionReference detect null ContainingAssembly and set
genericTypeDefinitionReference = null and return false (or report a diagnostic)
so the caller falls back to the conservative registration path; ensure all
references to ContainingAssembly.Identity.ToString() are guarded by the null
check.
In `@GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs`:
- Around line 133-146: The current catch-all around
file.GetText(cancellationToken) swallows OperationCanceledException and emits an
InvalidSchemaJson diagnostic; add a specific catch for
OperationCanceledException and rethrow (or simply let it propagate) before the
general catch so Roslyn cancellation is honored. Concretely, update the
try/catch in SchemaConfigGenerator.cs to catch OperationCanceledException (from
file.GetText with cancellationToken) and throw it, leaving the existing catch
(Exception) block to handle only real errors that should create
ConfigSchemaDiagnostics.InvalidSchemaJson via Diagnostic.Create and return
false.
In
`@GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs`:
- Around line 151-157: Add a test case in CollisionProneRule that declares both
the old field names (_context, _contextProvider, _contextSync) and the new
generated names (_gFrameworkContextAwareContext,
_gFrameworkContextAwareProvider, _gFrameworkContextAwareSync) on the same
partial type so the snapshot test exercises the generator's name-conflict
handling; update the test input in ContextAwareGeneratorSnapshotTests.cs to
include a partial class CollisionProneRule with both sets of fields and keep the
existing snapshot assertion pattern so the generator output vs. snapshot will
reveal whether duplicate-member conflicts are handled.
In
`@GFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/MyRule.ContextAware.g.cs`:
- Around line 37-49: The fast-path read of _gFrameworkContextAwareContext in the
Context property lacks acquire semantics so concurrent SetContext (which writes
under _gFrameworkContextAwareSync) can be invisible to readers; fix by replacing
the plain read with Volatile.Read on _gFrameworkContextAwareContext, keep the
existing lock(_gFrameworkContextAwareSync) block and inside it use a
double-check (Volatile.Read) and assign with Volatile.Write when initializing
_gFrameworkContextAwareProvider and _gFrameworkContextAwareContext (calls to
GameContextProvider.GetContext remain inside the lock); alternatively, if you
prefer the conservative approach, remove the fast-path entirely and always
acquire lock(_gFrameworkContextAwareSync) before reading/initializing to
guarantee visibility.
---
Nitpick comments:
In
`@GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs`:
- Around line 143-147: The call site checks
sourceShape.HasExternalAssemblyTypeLookups before calling
AppendReflectionHelpers, so remove the redundant bool parameter: change the
invocation to AppendReflectionHelpers(builder) and update the
AppendReflectionHelpers method signature to drop
includeExternalAssemblyTypeLookupHelpers; remove the internal if that re-checks
the same condition and inline the branch body (or keep conditional logic only
where needed inside the method), and update any other callers to the new
signature; leave a short comment on AppendReflectionHelpers if you chose to
preserve the parameter for future behaviors instead of removing it.
🪄 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: 6ce7e4e7-4d81-4669-a7d9-722c68f42fb9
📒 Files selected for processing (12)
GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.csGFramework.Core/Functional/Option.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.Models.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.csGFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/CollisionProneRule.ContextAware.g.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/MyRule.ContextAware.g.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/Functional/Option.cs
🚧 Files skipped from review as they are similar to previous changes (1)
- GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.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: Code Quality & Security
- GitHub Check: Build and Test
- GitHub Check: Analyze (C#)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.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>tags where applicable. Comments must explain intent, contract, and usage constraints instead of restating syntax.
Add inline comments for non-trivial logic, concurrency or threading behavior, performance-sensitive paths, workarounds/compatibility constraints/edge cases, and registration order/lifecycle sequencing/generated code assumptions. Avoid obvious comments such as// increment i.
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interaction with other components, why the abstraction exists, and when to use it instead of alternatives.
Generated logic and generator pipelines MUST explain what is generated, why it is generated, the semantic assumptions the generator relies on, and any diagnostics or fallback behavior.
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling if any.
Follow C# naming conventions: use PascalCase for types, methods, properties, events, and constants; useIprefix for interfaces; use camelCase for parameters and locals; use_camelCasefor private fields.
Use the namespace patternGFramework.{Module}.{Feature}with PascalCase segments.
Do not rely on implicit imports. Declare every requiredusingexplicitly. Keepusingdirectives at the top of the file and sort them consistently.
Write null-safe code that re...
Files:
GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/MyRule.ContextAware.g.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.Models.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/CollisionProneRule.ContextAware.g.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs
ai-plan/public/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep committed
ai-plan/public/**content safe to publish in Git history. Never write secrets, tokens, credentials, private keys, machine usernames, home-directory paths, hostnames, IP addresses, proprietary URLs, or other sensitive environment details into anyai-plan/**file. Never record absolute file-system paths; use repository-relative paths, branch names, PR numbers, or stable document identifiers instead.
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
ai-plan/public/*/todos/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Contributors MUST keep
ai-plan/public/<topic>/todos/recovery documents up-to-date with completed work, newly discovered issues, validation results, and the next recommended recovery point. For any multi-step refactor, migration, or cross-module task, create or adopt a dedicated recovery document before making substantive code changes. Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step.
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
**/Cqrs/**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
Use CQRS (Command Query Responsibility Segregation) pattern with the Cqrs naming entry point instead of the historical Mediator alias
Files:
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.Models.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs
ai-plan/public/*/traces/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work. The trace should record the current date, key decisions, validation milestones, and the immediate next step. Update both the recovery document and the trace at each meaningful milestone before pausing or handing work off.
Files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
🧠 Learnings (11)
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/SourceGenerators/**/*.cs : Source generator changes MUST be covered by generator tests. Preserve snapshot-based verification patterns already used in the repository. When generator behavior changes intentionally, update snapshots together with the implementation.
Applied to files:
GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/MyRule.ContextAware.g.csai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.Models.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/CollisionProneRule.ContextAware.g.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs
📚 Learning: 2026-04-16T13:25:59.124Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:25:59.124Z
Learning: In the GeWuYou/GFramework repo, treat `global using NUnit.Framework;` as provided project-wide by `GFramework.SourceGenerators.Tests/GlobalUsings.cs` (via GlobalUsings.cs). Do not require or flag missing per-file `using NUnit.Framework;` directives in test `.cs` files under `GFramework.SourceGenerators.Tests/`, since the project-wide global usings already include NUnit (along with other common namespaces).
Applied to files:
GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/MyRule.ContextAware.g.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/CollisionProneRule.ContextAware.g.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.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/MyRule.ContextAware.g.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.Models.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/CollisionProneRule.ContextAware.g.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.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 [ContextAware] attribute to automatically implement IContextAware boilerplate logic
Applied to files:
GFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/MyRule.ContextAware.g.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/CollisionProneRule.ContextAware.g.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: Use IArchitectureContext and Provider classes to propagate context capabilities between components rather than direct coupling to implementation details
Applied to files:
GFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/MyRule.ContextAware.g.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to ai-plan/public/*/todos/*.md : Contributors MUST keep `ai-plan/public/<topic>/todos/` recovery documents up-to-date with completed work, newly discovered issues, validation results, and the next recommended recovery point. For any multi-step refactor, migration, or cross-module task, create or adopt a dedicated recovery document before making substantive code changes. Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.cs : Generated logic and generator pipelines MUST explain what is generated, why it is generated, the semantic assumptions the generator relies on, and any diagnostics or fallback behavior.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to ai-plan/public/*/traces/*.md : Maintain a matching execution trace under `ai-plan/public/<topic>/traces/` for complex work. The trace should record the current date, key decisions, validation milestones, and the immediate next step. Update both the recovery document and the trace at each meaningful milestone before pausing or handing work off.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 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 **/*{Startup,Init,Register,Setup,Configure}*.cs : CQRS handler registration should use generated products from CqrsHandlerRegistryGenerator at runtime, falling back to reflection scanning when generation cannot cover cases; explicitly register handlers from non-default assemblies using RegisterCqrsHandlersFromAssembly(...) or RegisterCqrsHandlersFromAssemblies(...)
Applied to files:
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.Models.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.cs : Preserve deterministic behavior in registries, lifecycle orchestration, and generated outputs. When adding analyzers or suppressions, keep them minimal and justify them in code comments if the reason is not obvious.
Applied to files:
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.Models.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.csai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Treat source code, `*.csproj`, tests, generated snapshots, and packaging metadata as the primary evidence for documentation updates. Treat verified reference implementations under `ai-libs/` as a secondary evidence source for real project adoption patterns, directory layouts, and end-to-end usage examples.
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
🪛 LanguageTool
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
[grammar] ~17-~17: Ensure spelling is correct
Context: ....cs的剩余MA0051结构拆分,生成输出保持不变 - 已完成GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegist...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~24-~24: Ensure spelling is correct
Context: ...Configuration与CollectionExtensions已改用集合抽象接口,并保留内部具体集合默认值 -CoroutineScheduler的 tag/group 字典已显式使用StringComparer.Ordin...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~30-~30: Ensure spelling is correct
Context: ...atorswarnings-only 基线已降到0条 - 当前GFramework.Cqrs.SourceGeneratorswarnings-only 基线已降到...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~55-~55: Ensure spelling is correct
Context: ...051收口;warnings-only 基线已降到0条 - 已完成GFramework.Cqrs.SourceGenerators中CqrsHandlerRegistr...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~55-~55: Ensure spelling is correct
Context: ...剩余 MA0051 收口;warnings-only 基线已降到 0 条 - 已完成当前 PR #269 的 review follow-up:收口 `ContextA...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
[grammar] ~18-~18: Ensure spelling is correct
Context: ...rovider/_contextSync- 实施调整: - 将GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegist...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~104-~104: Ensure spelling is correct
Context: ... 决策: - 本轮暂缓 MA0158,转入单文件、可由生成器测试覆盖的 GFramework.Cqrs.SourceGenerators 结构拆分 - 未使用 subagent...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~171-~171: Ensure spelling is correct
Context: ...路径表示状态冲突, 不是某个方法参数无效,因此不能为 MA0015 人造参数名 - 为 Option<T> 声明 `IEquatable<Option...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (3)
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.cs (1)
81-215: 拆分后的 handler 接口分类流程清晰且保持确定性。
GetSupportedHandlerInterfaces显式使用StringComparer.Ordinal对接口排序,TryAddStaticHandlerRegistration将三类静态注册分支拆分干净,CreateHandlerCandidateAnalysis只负责聚合结果;整体保持了原有语义且与拆分出来的 Models/RuntimeTypeReferences/SourceEmission 三个 partial 职责边界一致。GFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/CollisionProneRule.ContextAware.g.cs (1)
1-103: 生成快照与生成器改动一致。
_gFrameworkContextAware*前缀字段规避了用户类型字段重名冲突;SetContextProvider的ArgumentNullException.ThrowIfNull及各路径统一在_gFrameworkContextAwareSync下写入/重置,行为与<remarks>中声明的契约(provider 切换不会清除已缓存实例上下文)自洽。ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md (1)
250-251: todo 中引用的方法名均已验证存在,可用作切入点。
GenerateBindingsClass、AppendGeneratedConfigCatalogType和GenerateCatalogClass在当前SchemaConfigGenerator.cs中都已正确定义,不存在之前GenerateConfigCatalogSource的问题。恢复点中的建议入口是有效的。
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #929
🎉 All tests passed!Slowest Tests
± Comparison with run #927 at 3411e9e | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 15 runs. Github Test Reporter by CTRF 💚 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs (1)
3113-3118:⚠️ Potential issue | 🟠 Major转义 XML 文档中的泛型类型。
第 3115 行在
///注释中包含未转义的IEqualityComparer<{schema.KeyClrType}>?。当schema.KeyClrType被替换(例如为int)时,XML 文档解析器会将<int>解析为 XML 标签,导致生成代码出现文档警告。使用
EscapeXmlDocumentation()方法转义泛型类型,并用<c>标签包裹以实现代码格式化,与文件中现有的文档处理模式保持一致。建议修复
for (var index = 0; index < schemas.Count; index++) { var schema = schemas[index]; + var comparerTypeDocumentation = EscapeXmlDocumentation( + $"global::System.Collections.Generic.IEqualityComparer<{schema.KeyClrType}>?"); builder.AppendLine(" /// <summary>"); builder.AppendLine( - $" /// Gets or sets the optional key comparer forwarded to {schema.EntityName}ConfigBindings.Register{schema.EntityName}Table(global::GFramework.Game.Config.YamlConfigLoader, global::System.Collections.Generic.IEqualityComparer<{schema.KeyClrType}>?) when aggregate registration runs."); + $" /// Gets or sets the optional key comparer forwarded to {schema.EntityName}ConfigBindings.Register{schema.EntityName}Table using <c>{comparerTypeDocumentation}</c> when aggregate registration runs."); builder.AppendLine(" /// </summary>"); builder.AppendLine( $" public global::System.Collections.Generic.IEqualityComparer<{schema.KeyClrType}>? {schema.EntityName}Comparer {{ get; init; }}");🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs` around lines 3113 - 3118, The XML doc in SchemaConfigGenerator is inserting raw generic text ("IEqualityComparer<{schema.KeyClrType}>?") into a /// summary which can be parsed as XML tags; call the existing EscapeXmlDocumentation() on the full generic type and wrap it in a <c> tag when building the summary string. Concretely, update the builder.AppendLine that writes the summary (the line constructing "IEqualityComparer<{schema.KeyClrType}>?") to use something like "<c>" + EscapeXmlDocumentation($"global::System.Collections.Generic.IEqualityComparer<{schema.KeyClrType}>?") + "</c>" so the generic angle brackets are escaped in the XML docs for the {schema.EntityName}Comparer property.
🧹 Nitpick comments (2)
GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs (1)
62-69: 建议补充正向断言以增强回归价值。当前仅断言小写键不存在,若
LoggerLevels初始化失败导致字典为空,测试依然会通过。建议同时断言原始大小写键存在,这样才能真正锁定StringComparer.Ordinal的契约。♻️ 建议修改
var config = new LoggingConfiguration(); config.LoggerLevels["GFramework.Core"] = LogLevel.Info; - Assert.That(config.LoggerLevels.ContainsKey("gframework.core"), Is.False); + Assert.Multiple(() => + { + Assert.That(config.LoggerLevels.ContainsKey("GFramework.Core"), Is.True); + Assert.That(config.LoggerLevels.ContainsKey("gframework.core"), Is.False); + });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs` around lines 62 - 69, The test LoggerLevels_Should_Remain_Case_Sensitive_By_Default currently only asserts that the lowercase key "gframework.core" is absent, which would still pass if LoggerLevels were empty; update the test to also assert that the original-cased key exists and maps to LogLevel.Info to confirm LoggingConfiguration initializes LoggerLevels with case-sensitive comparer. Locate the test method LoggerLevels_Should_Remain_Case_Sensitive_By_Default and add a positive assertion that config.LoggerLevels.ContainsKey("GFramework.Core") is true (and optionally assert config.LoggerLevels["GFramework.Core"] == LogLevel.Info) to validate the StringComparer.Ordinal contract used by LoggingConfiguration.GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs (1)
171-243: 建议抽取重复的“按所属程序集选择反射查找形式”分支。
TryCreateNamedRuntimeTypeReference(171-192)与TryCreateGenericTypeDefinitionReference的后半段(226-242)在判定流程上完全一致:先比较ContainingAssembly是否为当前编译程序集,再在ContainingAssembly is null时返回失败,最后落到FromExternalReflectionLookup。两处重复维护很容易出现一侧改了、一侧忘改的漂移(例如将来需要区分netstandard.dll之类的转发程序集或加 diagnostic 报告时)。可以抽一个小 helper,比如
TryCreateReflectionLookupReference(compilation, symbol, metadataName, out spec),让两个方法共享同一份逻辑;TryCreateGenericTypeDefinitionReference只需在CanReferenceFromGeneratedRegistry命中时负责ConstructUnboundGenericType()的特殊化。这样可以把“反射查找形式的选择”收敛到单一实现,并方便未来为这两条路径加统一的 generator diagnostic。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs` around lines 171 - 243, Both TryCreateNamedRuntimeTypeReference and TryCreateGenericTypeDefinitionReference duplicate the "choose reflection lookup form by containing assembly" logic; extract that branch into a single helper (e.g., TryCreateReflectionLookupReference) that takes Compilation, INamedTypeSymbol (or ISymbol), metadata name and out RuntimeTypeReferenceSpec? and performs the ContainingAssembly == compilation.Assembly check, null check, and FromExternalReflectionLookup fallback. Update TryCreateNamedRuntimeTypeReference to call the new helper directly, and change TryCreateGenericTypeDefinitionReference to first handle the CanReferenceFromGeneratedRegistry + ConstructUnboundGenericType() path and otherwise call the same helper for the reflection lookup decision so both methods share the same logic and diagnostic hook point.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md`:
- Around line 251-259: Replace the escaped quotes \"\" used for the MSBuild
property RestoreFallbackFolders in the dotnet command lines with plain double
quotes "" so the shell copies a valid MSBuild argument; specifically update the
occurrences in the dotnet build and dotnet test command strings (the lines
containing -p:RestoreFallbackFolders=\"\") to use -p:RestoreFallbackFolders=""
(affecting the build commands for GFramework.Core.csproj,
GFramework.Cqrs.SourceGenerators.csproj, GFramework.Game.SourceGenerators.csproj
and the dotnet test invocations).
In `@GFramework.Core.Tests/Extensions/CollectionExtensionsTests.cs`:
- Around line 174-179: The test currently only asserts the return type is
Dictionary<,>; update the assertion for the method found via
typeof(GFramework.Core.Extensions.CollectionExtensions).GetMethods().Single(m =>
m.Name ==
nameof(GFramework.Core.Extensions.CollectionExtensions.ToDictionarySafe)) (the
method variable) to also verify the generic parameter identities so the API
remains Dictionary<TKey, TValue>: assert method.IsGenericMethodDefinition is
true, then assert method.GetGenericArguments() contains two generic parameters
named "TKey" and "TValue" (or assert the return type's generic argument names
match those method type parameter names) to ensure the return type is
specifically Dictionary<TKey, TValue>.
In `@GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs`:
- Around line 179-180: The root entity name derived by
ToPascalCase(GetSchemaBaseName(filePath)) can produce invalid C# identifiers
(e.g. starting with digits) and is used to build root type names in
ParseObjectSpec and CreateSchemaFileSpec; validate the computed entityName with
the same mechanism used for properties (TryBuildPropertyIdentifier /
SyntaxFacts.IsValidIdentifier) and if invalid normalize it (for example prefix
with an underscore or a fixed letter and re-run ToPascalCase) so that
$"{entityName}Config" and $"{entityName}Table" always produce legal C#
identifiers; update the code path around the entityName assignment and any
callers (ParseObjectSpec, CreateSchemaFileSpec) to use the validated/normalized
identifier.
---
Outside diff comments:
In `@GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs`:
- Around line 3113-3118: The XML doc in SchemaConfigGenerator is inserting raw
generic text ("IEqualityComparer<{schema.KeyClrType}>?") into a /// summary
which can be parsed as XML tags; call the existing EscapeXmlDocumentation() on
the full generic type and wrap it in a <c> tag when building the summary string.
Concretely, update the builder.AppendLine that writes the summary (the line
constructing "IEqualityComparer<{schema.KeyClrType}>?") to use something like
"<c>" +
EscapeXmlDocumentation($"global::System.Collections.Generic.IEqualityComparer<{schema.KeyClrType}>?")
+ "</c>" so the generic angle brackets are escaped in the XML docs for the
{schema.EntityName}Comparer property.
---
Nitpick comments:
In `@GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs`:
- Around line 62-69: The test
LoggerLevels_Should_Remain_Case_Sensitive_By_Default currently only asserts that
the lowercase key "gframework.core" is absent, which would still pass if
LoggerLevels were empty; update the test to also assert that the original-cased
key exists and maps to LogLevel.Info to confirm LoggingConfiguration initializes
LoggerLevels with case-sensitive comparer. Locate the test method
LoggerLevels_Should_Remain_Case_Sensitive_By_Default and add a positive
assertion that config.LoggerLevels.ContainsKey("GFramework.Core") is true (and
optionally assert config.LoggerLevels["GFramework.Core"] == LogLevel.Info) to
validate the StringComparer.Ordinal contract used by LoggingConfiguration.
In
`@GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs`:
- Around line 171-243: Both TryCreateNamedRuntimeTypeReference and
TryCreateGenericTypeDefinitionReference duplicate the "choose reflection lookup
form by containing assembly" logic; extract that branch into a single helper
(e.g., TryCreateReflectionLookupReference) that takes Compilation,
INamedTypeSymbol (or ISymbol), metadata name and out RuntimeTypeReferenceSpec?
and performs the ContainingAssembly == compilation.Assembly check, null check,
and FromExternalReflectionLookup fallback. Update
TryCreateNamedRuntimeTypeReference to call the new helper directly, and change
TryCreateGenericTypeDefinitionReference to first handle the
CanReferenceFromGeneratedRegistry + ConstructUnboundGenericType() path and
otherwise call the same helper for the reflection lookup decision so both
methods share the same logic and diagnostic hook point.
🪄 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: 553de8f2-858e-4756-b8a5-28e26ec9fe76
📒 Files selected for processing (18)
GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.csGFramework.Core.Tests/Events/EasyEventsTests.csGFramework.Core.Tests/Extensions/CollectionExtensionsTests.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.Core/Events/EasyEvents.csGFramework.Core/Extensions/CollectionExtensions.csGFramework.Core/Logging/FilterConfiguration.csGFramework.Core/Logging/LoggingConfiguration.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.csGFramework.SourceGenerators.Tests/Config/SchemaConfigGeneratorTests.csGFramework.SourceGenerators.Tests/Config/SchemaGeneratorTestDriver.csGFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/CollisionProneRule.ContextAware.g.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/MyRule.ContextAware.g.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 (3)
- GFramework.Core/Logging/FilterConfiguration.cs
- GFramework.Core/Extensions/CollectionExtensions.cs
- GFramework.SourceGenerators.Tests/Config/SchemaConfigGeneratorTests.cs
🚧 Files skipped from review as they are similar to previous changes (6)
- GFramework.Core.Tests/Events/EasyEventsTests.cs
- GFramework.Core/Logging/LoggingConfiguration.cs
- GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs
- GFramework.Core/Events/EasyEvents.cs
- GFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/MyRule.ContextAware.g.cs
- GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (5)
**/*.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>tags where applicable. Comments must explain intent, contract, and usage constraints instead of restating syntax.
Add inline comments for non-trivial logic, concurrency or threading behavior, performance-sensitive paths, workarounds/compatibility constraints/edge cases, and registration order/lifecycle sequencing/generated code assumptions. Avoid obvious comments such as// increment i.
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interaction with other components, why the abstraction exists, and when to use it instead of alternatives.
Generated logic and generator pipelines MUST explain what is generated, why it is generated, the semantic assumptions the generator relies on, and any diagnostics or fallback behavior.
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling if any.
Follow C# naming conventions: use PascalCase for types, methods, properties, events, and constants; useIprefix for interfaces; use camelCase for parameters and locals; use_camelCasefor private fields.
Use the namespace patternGFramework.{Module}.{Feature}with PascalCase segments.
Do not rely on implicit imports. Declare every requiredusingexplicitly. Keepusingdirectives at the top of the file and sort them consistently.
Write null-safe code that re...
Files:
GFramework.Core.Tests/Extensions/CollectionExtensionsTests.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.SourceGenerators.Tests/Config/SchemaGeneratorTestDriver.csGFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/CollisionProneRule.ContextAware.g.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs
**/Cqrs/**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
Use CQRS (Command Query Responsibility Segregation) pattern with the Cqrs naming entry point instead of the historical Mediator alias
Files:
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs
ai-plan/public/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep committed
ai-plan/public/**content safe to publish in Git history. Never write secrets, tokens, credentials, private keys, machine usernames, home-directory paths, hostnames, IP addresses, proprietary URLs, or other sensitive environment details into anyai-plan/**file. Never record absolute file-system paths; use repository-relative paths, branch names, PR numbers, or stable document identifiers instead.
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
ai-plan/public/*/todos/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Contributors MUST keep
ai-plan/public/<topic>/todos/recovery documents up-to-date with completed work, newly discovered issues, validation results, and the next recommended recovery point. For any multi-step refactor, migration, or cross-module task, create or adopt a dedicated recovery document before making substantive code changes. Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step.
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
ai-plan/public/*/traces/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work. The trace should record the current date, key decisions, validation milestones, and the immediate next step. Update both the recovery document and the trace at each meaningful milestone before pausing or handing work off.
Files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
🧠 Learnings (13)
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/SourceGenerators/**/*.cs : Source generator changes MUST be covered by generator tests. Preserve snapshot-based verification patterns already used in the repository. When generator behavior changes intentionally, update snapshots together with the implementation.
Applied to files:
GFramework.Core.Tests/Extensions/CollectionExtensionsTests.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.SourceGenerators.Tests/Config/SchemaGeneratorTestDriver.csGFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/CollisionProneRule.ContextAware.g.csai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.csai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.Tests.cs : Every non-trivial feature, bug fix, or behavior change MUST include tests or an explicit justification for why a test is not practical. Public API changes must be covered by unit or integration tests. When a public API defines multiple contract branches, tests MUST cover the meaningful variants, including null, empty, default, and filtered inputs when those branches change behavior. Regression fixes should include a test that fails before the fix and passes after it.
Applied to files:
GFramework.Core.Tests/Extensions/CollectionExtensionsTests.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.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/Extensions/CollectionExtensionsTests.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.SourceGenerators.Tests/Config/SchemaGeneratorTestDriver.csGFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/CollisionProneRule.ContextAware.g.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs
📚 Learning: 2026-04-16T13:25:59.124Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:25:59.124Z
Learning: In the GeWuYou/GFramework repo, treat `global using NUnit.Framework;` as provided project-wide by `GFramework.SourceGenerators.Tests/GlobalUsings.cs` (via GlobalUsings.cs). Do not require or flag missing per-file `using NUnit.Framework;` directives in test `.cs` files under `GFramework.SourceGenerators.Tests/`, since the project-wide global usings already include NUnit (along with other common namespaces).
Applied to files:
GFramework.SourceGenerators.Tests/Config/SchemaGeneratorTestDriver.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/CollisionProneRule.ContextAware.g.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 [ContextAware] attribute to automatically implement IContextAware boilerplate logic
Applied to files:
GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.csGFramework.SourceGenerators.Tests/Rule/snapshots/ContextAwareGenerator/CollisionProneRule.ContextAware.g.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.cs : Prefer explicit, readable code over clever shorthand in framework internals. Match existing async patterns and naming conventions with `Async` suffix for asynchronous methods. Avoid hidden side effects in property getters, constructors, and registration helpers.
Applied to files:
GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.cs : Preserve deterministic behavior in registries, lifecycle orchestration, and generated outputs. When adding analyzers or suppressions, keep them minimal and justify them in code comments if the reason is not obvious.
Applied to files:
GFramework.Core.SourceGenerators/Rule/ContextAwareGenerator.csai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 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 **/*{Startup,Init,Register,Setup,Configure}*.cs : CQRS handler registration should use generated products from CqrsHandlerRegistryGenerator at runtime, falling back to reflection scanning when generation cannot cover cases; explicitly register handlers from non-default assemblies using RegisterCqrsHandlersFromAssembly(...) or RegisterCqrsHandlersFromAssemblies(...)
Applied to files:
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to ai-plan/public/*/todos/*.md : Contributors MUST keep `ai-plan/public/<topic>/todos/` recovery documents up-to-date with completed work, newly discovered issues, validation results, and the next recommended recovery point. For any multi-step refactor, migration, or cross-module task, create or adopt a dedicated recovery document before making substantive code changes. Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.cs : Generated logic and generator pipelines MUST explain what is generated, why it is generated, the semantic assumptions the generator relies on, and any diagnostics or fallback behavior.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to ai-plan/public/*/traces/*.md : Maintain a matching execution trace under `ai-plan/public/<topic>/traces/` for complex work. The trace should record the current date, key decisions, validation milestones, and the immediate next step. Update both the recovery document and the trace at each meaningful milestone before pausing or handing work off.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.cs : Write null-safe code that respects nullable annotations instead of suppressing warnings by default. Follow the repository defaults: `ImplicitUsings` disabled, `Nullable` enabled, `GenerateDocumentationFile` enabled for shipped libraries, and `LangVersion` is generally `preview`.
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Treat source code, `*.csproj`, tests, generated snapshots, and packaging metadata as the primary evidence for documentation updates. Treat verified reference implementations under `ai-libs/` as a secondary evidence source for real project adoption patterns, directory layouts, and end-to-end usage examples.
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
🪛 LanguageTool
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
[grammar] ~17-~17: Ensure spelling is correct
Context: ....cs的剩余MA0051结构拆分,生成输出保持不变 - 已完成GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegist...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~31-~31: Ensure spelling is correct
Context: ...atorswarnings-only 基线已降到0条 - 当前GFramework.Cqrs.SourceGeneratorswarnings-only 基线已降到...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~56-~56: Ensure spelling is correct
Context: ...051收口;warnings-only 基线已降到0条 - 已完成GFramework.Cqrs.SourceGenerators中CqrsHandlerRegistr...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
[grammar] ~54-~54: Ensure spelling is correct
Context: ...rovider/_contextSync- 实施调整: - 将GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegist...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~140-~140: Ensure spelling is correct
Context: ... 决策: - 本轮暂缓 MA0158,转入单文件、可由生成器测试覆盖的 GFramework.Cqrs.SourceGenerators 结构拆分 - 未使用 subagent...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~207-~207: Ensure spelling is correct
Context: ...路径表示状态冲突, 不是某个方法参数无效,因此不能为 MA0015 人造参数名 - 为 Option<T> 声明 `IEquatable<Option...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (4)
GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs (1)
42-60: 反射类型断言 LGTM。通过反射锁定
Appenders、LoggerLevels、Namespaces、Filters的具体集合类型,能够有效防止未来无意将公共属性改为接口类型(如IList<>/IDictionary<>)而破坏已建立的 API 契约,与LoggingConfiguration.cs/FilterConfiguration.cs中的 MA0016 pragma 保持一致。GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs (2)
70-117: 整体实现 LGTM。类型转换入口对指针 / 函数指针提前拒绝、
CanReferenceFromGeneratedRegistry先行用于最优的直接引用路径,再按数组、构造泛型、命名类型的顺序回退,语义清晰;TypeArguments的foreach保持 Roslyn 给出的顺序,满足生成器确定性输出的要求。之前评审提出的ContainingAssemblyNRE 隐患已在 182-186 / 233-237 显式is null分支中兜底,回退到调用方的宽松反射扫描路径也与 XML 文档承诺一致。
1-305: 快照测试已完整覆盖所有 runtime type reference 辅助方法的分支路径,无需采取行动。已验证的测试覆盖:
- 外部程序集泛型实参:
Generates_Precise_Assembly_Type_Lookups_For_Inaccessible_External_Protected_Types()→ExternalAssemblyPreciseLookupExpected快照验证了ResolveReferencedAssemblyType()的外部程序集查找路径- 内嵌数组:
Generates_Precise_Service_Type_For_Hidden_Array_Type_Arguments()和上述外部程序集测试中的.MakeArrayType()递归分支- 不可访问命名类型:protected internal 嵌套类型在外部程序集测试中明确验证
- 无法表示导致回退:
Reports_Compilation_Error_And_Skips_Precise_Registration_For_Hidden_Pointer_Response()测试了指针类型拒绝路径- 直接引用、当前程序集反射查找、混合注册场景:分别由
MixedDirectAndPreciseRegistrationsExpected、HiddenNestedHandlerSelfRegistrationExpected等 7 个快照常量完整覆盖测试框架使用自定义的
GeneratorTest<T>.RunAsync()与预期输出常量进行快照式验证,符合仓库现有的生成器测试模式。GFramework.SourceGenerators.Tests/Config/SchemaGeneratorTestDriver.cs (1)
20-39: API 设计可更清晰,但当前无编译问题。虽然两个
params重载在理论上共享相同的必填参数列表,但实际代码库中所有调用都显式传递 AdditionalFiles,不存在调用Run(source)的情况。代码已成功编译并合并,说明不存在 CS0121 二义性。如需提高 API 清晰度,可选择添加显式单参数重载或重命名其中一个入口。但这是可选的设计改进,而非当前必需的修复。
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #930
🎉 All tests passed!Slowest Tests
± Comparison with run #929 at f5481c9 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 16 runs. Github Test Reporter by CTRF 💚 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs`:
- Around line 254-279: The default branch in CanReferenceFromGeneratedRegistry
currently treats unresolved/error Roslyn types as referenceable which lets
TypeDisplayName from type.ToDisplayString(...) flow into FromDirectReference and
produce invalid typeof(...) in generated code; update
CanReferenceFromGeneratedRegistry to explicitly reject symbols where type.Kind
== TypeKind.Error (and similarly treat dynamic/unresolved/error appropriately)
so error-type symbols return false and force the generator to use the
conservative reflection path instead of emitting FromDirectReference for error
types; reference the CanReferenceFromGeneratedRegistry method, the
Type.Kind/TypeKind.Error check, and the downstream
FromDirectReference/ToDisplayString/TypeDisplayName flow when making the change.
In `@GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs`:
- Around line 223-225: The code calls rootTypeElement.GetString() without first
ensuring rootTypeElement.ValueKind is JsonValueKind.String; update the
conditional in SchemaConfigGenerator (the block using
root.TryGetProperty("type", out var rootTypeElement) and IsSchemaType) to first
check rootTypeElement.ValueKind == JsonValueKind.String (or !=
JsonValueKind.String and treat as non-string) before calling GetString(),
mirroring the other schema checks (e.g., dependency/allOf/conditional checks) so
the InvalidOperationException is avoided and the RootObjectSchemaRequired
diagnostic is produced as intended.
🪄 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: 24353096-baa4-4d72-8a25-4ab5feb964f3
📒 Files selected for processing (8)
GFramework.Core.Tests/Extensions/CollectionExtensionsTests.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.csGFramework.SourceGenerators.Tests/Config/SchemaConfigGeneratorTests.csGFramework.SourceGenerators.Tests/Config/snapshots/SchemaConfigGenerator/GeneratedConfigCatalog.g.txtai-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.SourceGenerators.Tests/Config/snapshots/SchemaConfigGenerator/GeneratedConfigCatalog.g.txt
🚧 Files skipped from review as they are similar to previous changes (1)
- GFramework.Core.Tests/Extensions/CollectionExtensionsTests.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: Build and Test
- GitHub Check: Code Quality & Security
- GitHub Check: Analyze (C#)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.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>tags where applicable. Comments must explain intent, contract, and usage constraints instead of restating syntax.
Add inline comments for non-trivial logic, concurrency or threading behavior, performance-sensitive paths, workarounds/compatibility constraints/edge cases, and registration order/lifecycle sequencing/generated code assumptions. Avoid obvious comments such as// increment i.
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interaction with other components, why the abstraction exists, and when to use it instead of alternatives.
Generated logic and generator pipelines MUST explain what is generated, why it is generated, the semantic assumptions the generator relies on, and any diagnostics or fallback behavior.
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling if any.
Follow C# naming conventions: use PascalCase for types, methods, properties, events, and constants; useIprefix for interfaces; use camelCase for parameters and locals; use_camelCasefor private fields.
Use the namespace patternGFramework.{Module}.{Feature}with PascalCase segments.
Do not rely on implicit imports. Declare every requiredusingexplicitly. Keepusingdirectives at the top of the file and sort them consistently.
Write null-safe code that re...
Files:
GFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.SourceGenerators.Tests/Config/SchemaConfigGeneratorTests.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs
ai-plan/public/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep committed
ai-plan/public/**content safe to publish in Git history. Never write secrets, tokens, credentials, private keys, machine usernames, home-directory paths, hostnames, IP addresses, proprietary URLs, or other sensitive environment details into anyai-plan/**file. Never record absolute file-system paths; use repository-relative paths, branch names, PR numbers, or stable document identifiers instead.
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
ai-plan/public/*/todos/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Contributors MUST keep
ai-plan/public/<topic>/todos/recovery documents up-to-date with completed work, newly discovered issues, validation results, and the next recommended recovery point. For any multi-step refactor, migration, or cross-module task, create or adopt a dedicated recovery document before making substantive code changes. Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step.
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
**/Cqrs/**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
Use CQRS (Command Query Responsibility Segregation) pattern with the Cqrs naming entry point instead of the historical Mediator alias
Files:
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs
ai-plan/public/*/traces/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work. The trace should record the current date, key decisions, validation milestones, and the immediate next step. Update both the recovery document and the trace at each meaningful milestone before pausing or handing work off.
Files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
🧠 Learnings (12)
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.Tests.cs : Every non-trivial feature, bug fix, or behavior change MUST include tests or an explicit justification for why a test is not practical. Public API changes must be covered by unit or integration tests. When a public API defines multiple contract branches, tests MUST cover the meaningful variants, including null, empty, default, and filtered inputs when those branches change behavior. Regression fixes should include a test that fails before the fix and passes after it.
Applied to files:
GFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.SourceGenerators.Tests/Config/SchemaConfigGeneratorTests.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/Logging/LoggingConfigurationTests.csGFramework.SourceGenerators.Tests/Config/SchemaConfigGeneratorTests.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/SourceGenerators/**/*.cs : Source generator changes MUST be covered by generator tests. Preserve snapshot-based verification patterns already used in the repository. When generator behavior changes intentionally, update snapshots together with the implementation.
Applied to files:
GFramework.SourceGenerators.Tests/Config/SchemaConfigGeneratorTests.csai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.Tests.cs : Mirror the source structure in test projects whenever practical. Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`. Keep tests focused on observable behavior, not implementation trivia.
Applied to files:
GFramework.SourceGenerators.Tests/Config/SchemaConfigGeneratorTests.cs
📚 Learning: 2026-04-16T13:25:59.124Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:25:59.124Z
Learning: In the GeWuYou/GFramework repo, treat `global using NUnit.Framework;` as provided project-wide by `GFramework.SourceGenerators.Tests/GlobalUsings.cs` (via GlobalUsings.cs). Do not require or flag missing per-file `using NUnit.Framework;` directives in test `.cs` files under `GFramework.SourceGenerators.Tests/`, since the project-wide global usings already include NUnit (along with other common namespaces).
Applied to files:
GFramework.SourceGenerators.Tests/Config/SchemaConfigGeneratorTests.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to ai-plan/public/*/todos/*.md : Contributors MUST keep `ai-plan/public/<topic>/todos/` recovery documents up-to-date with completed work, newly discovered issues, validation results, and the next recommended recovery point. For any multi-step refactor, migration, or cross-module task, create or adopt a dedicated recovery document before making substantive code changes. Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.cs : Generated logic and generator pipelines MUST explain what is generated, why it is generated, the semantic assumptions the generator relies on, and any diagnostics or fallback behavior.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Treat source code, `*.csproj`, tests, generated snapshots, and packaging metadata as the primary evidence for documentation updates. Treat verified reference implementations under `ai-libs/` as a secondary evidence source for real project adoption patterns, directory layouts, and end-to-end usage examples.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/.csproj : Naming must remain compatible with `scripts/validate-csharp-naming.sh`. Project files and package metadata should reflect current implementation status and adopted naming conventions.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to ai-plan/public/*/traces/*.md : Maintain a matching execution trace under `ai-plan/public/<topic>/traces/` for complex work. The trace should record the current date, key decisions, validation milestones, and the immediate next step. Update both the recovery document and the trace at each meaningful milestone before pausing or handing work off.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 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 **/*{Startup,Init,Register,Setup,Configure}*.cs : CQRS handler registration should use generated products from CqrsHandlerRegistryGenerator at runtime, falling back to reflection scanning when generation cannot cover cases; explicitly register handlers from non-default assemblies using RegisterCqrsHandlersFromAssembly(...) or RegisterCqrsHandlersFromAssemblies(...)
Applied to files:
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.cs : Preserve deterministic behavior in registries, lifecycle orchestration, and generated outputs. When adding analyzers or suppressions, keep them minimal and justify them in code comments if the reason is not obvious.
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
🪛 LanguageTool
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
[grammar] ~17-~17: Ensure spelling is correct
Context: ....cs的剩余MA0051结构拆分,生成输出保持不变 - 已完成GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegist...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~33-~33: Ensure spelling is correct
Context: ...atorswarnings-only 基线已降到0条 - 当前GFramework.Cqrs.SourceGeneratorswarnings-only 基线已降到...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~58-~58: Ensure spelling is correct
Context: ...051收口;warnings-only 基线已降到0条 - 已完成GFramework.Cqrs.SourceGenerators中CqrsHandlerRegistr...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
[grammar] ~87-~87: Ensure spelling is correct
Context: ...rovider/_contextSync- 实施调整: - 将GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegist...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~173-~173: Ensure spelling is correct
Context: ... 决策: - 本轮暂缓 MA0158,转入单文件、可由生成器测试覆盖的 GFramework.Cqrs.SourceGenerators 结构拆分 - 未使用 subagent...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~240-~240: Ensure spelling is correct
Context: ...路径表示状态冲突, 不是某个方法参数无效,因此不能为 MA0015 人造参数名 - 为 Option<T> 声明 `IEquatable<Option...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (8)
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md (1)
3-34: RP-023 trace 记录完整,LGTM。该段包含当前日期、关键决策、实施项、验证结果和下一步,且未写入敏感环境信息。
As per coding guidelines,
ai-plan/public/*/traces/*.md: Maintain a matching execution trace underai-plan/public/<topic>/traces/for complex work. The trace should record 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)
10-39: 恢复点、风险和下一步已同步,LGTM。RP-023 的状态、活跃事实、风险缓解和验证记录都已更新,下一步也指向了可恢复的具体切入点。
As per coding guidelines,
ai-plan/public/*/todos/*.md: Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step.Also applies to: 94-127, 266-285
GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs (1)
42-74: 公共 API 形状和默认 comparer 回归覆盖到位。新增测试能锁定
List<>/Dictionary<,>公开契约,并验证LoggerLevels默认大小写敏感语义。Based on learnings, Public API changes must be covered by unit or integration tests.
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs (1)
25-252: 运行时类型引用拆分清晰,LGTM。精确注册、构造泛型、当前/外部程序集反射查找和
ContainingAssembly空值回退都收敛到了独立 helper,职责边界更清楚。Also applies to: 283-313
GFramework.SourceGenerators.Tests/Config/SchemaConfigGeneratorTests.cs (3)
75-115: 根类型标识符诊断覆盖到位。该回归测试验证了非法 schema 文件名会复用
GF_ConfigSchema_006,并检查<root>、原始片段和生成标识符,测试桩也足够小。Based on learnings, Regression fixes should include a test that fails before the fix and passes after it.
Also applies to: 117-139
2732-2737: comparer XML 转义断言有效,LGTM。新增断言锁定了
<c>内泛型尖括号的 XML 转义,能防止生成文档再次写入未转义类型文本。Based on learnings, Source generator changes MUST be covered by generator tests.
15-30: 改用SchemaGeneratorTestDriver并配合自定义AdditionalText实现来测试取消传播,避免反射绑定私有 helper 方法。当前测试通过反射调用
TryReadSchemaText,对私有 helper 方法名称或签名的任何改动都会导致测试失败。更稳健的方式是让ThrowingAdditionalText(该类已存在)与SchemaGeneratorTestDriver.Run()一起工作,通过测试驱动的公开 API 来验证取消传播行为,而无须依赖私有方法的反射调用。前提条件: 需确认
GeneratorDriver.RunGenerators()会允许由生成器Execute方法抛出的OperationCanceledException向外传播(而非被驱动程序捕获或转换为诊断)。如果驱动程序会捕获该异常,当前的反射方案可能是必要的。GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs (1)
4071-4074: 当前的验证逻辑已充分防止了转义标识符问题。
GetSchemaBaseName提取的@Foo经由ToPascalCase处理后,@前缀会被保留(因为@不在分割符列表-,_,.,中),导致rootClassName = "@FooConfig"。根据 Roslyn 文档,SyntaxFacts.IsValidIdentifier("@FooConfig")返回false,因为@不是有效的标识符起始字符。既然
rootClassName的验证会拒绝任何包含@前缀的情形,就不会进入下游的方法名拼接逻辑。因此,不存在生成Register@FooTable这类非法方法名的风险。无需添加额外的
IsComposableGeneratedIdentifierhelper;当前的单一验证已足够保护。> Likely an incorrect or invalid review comment.
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #931
🎉 All tests passed!Slowest Tests
± Comparison with run #930 at 74d7203 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 17 runs. Github Test Reporter by CTRF 💚 |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs (1)
358-373:⚠️ Potential issue | 🟠 Major补上归一化后属性名的冲突检测。
Line 480 只校验单个生成标识符是否合法,但没有校验同一对象内的唯一性;例如 schema 同时声明
foo-bar和foo_bar时,ToPascalCase都会生成FooBar,Line 372 随后会把两个属性都加入模型,最终生成重复属性/查询方法并导致消费项目编译失败。建议在ParseObjectSpec的属性循环中维护HashSet<string>,在加入properties前对parsedProperty.Property!.PropertyName做冲突诊断,并为该场景补 generator regression/snapshot 测试。Based on learnings: Source generator changes MUST be covered by generator tests. Preserve snapshot-based verification patterns already used in the repository.
Also applies to: 480-505
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs` around lines 358 - 373, The loop in ParseObjectSpec that enumerates properties doesn't detect collisions after name normalization (e.g., "foo-bar" and "foo_bar" both becoming "FooBar"), so add a HashSet<string> (e.g., normalizedPropertyNames) in the method that contains the foreach and before adding parsedProperty.Property!.PropertyName to properties check if normalizedPropertyNames.Contains(parsedProperty.Property!.PropertyName); if it does, return a diagnostic via ParsedObjectResult.FromDiagnostic describing the duplicate normalized name (use the same diagnostic pattern used elsewhere); otherwise add the normalized name to the HashSet and then add the Property to properties; also add a generator regression/snapshot test that defines a schema with colliding names to ensure the source generator emits the diagnostic (apply same fix for the similar block handling properties around the 480-505 region).
🧹 Nitpick comments (1)
GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs (1)
1460-1471: 建议把该生成输出断言收紧为快照式校验。当前只检查包含
GetType("MissingResponse"...和 registry 类名;如果后续同时误发射 fallback marker、额外 helper,或又混入typeof(MissingResponse),这个测试不一定能精准定位回归。这里最好像同文件其他用例一样比较完整 expected 生成源码;至少补负向断言。最小增强示例
Assert.Multiple(() => { Assert.That(inputCompilationErrors.Select(static diagnostic => diagnostic.Id), Does.Contain("CS0246")); Assert.That(generatedCompilationErrors, Is.Empty); Assert.That(generatorErrors, Is.Empty); Assert.That(execution.GeneratedSources, Has.Length.EqualTo(1)); + var generatedSource = execution.GeneratedSources[0].content; Assert.That( - execution.GeneratedSources[0].content, + generatedSource, Does.Contain("registryAssembly.GetType(\"MissingResponse\", throwOnError: false, ignoreCase: false);")); Assert.That( - execution.GeneratedSources[0].content, + generatedSource, Does.Contain("internal sealed class __GFrameworkGeneratedCqrsHandlerRegistry")); + Assert.That(generatedSource, Does.Not.Contain("typeof(MissingResponse")); + Assert.That(generatedSource, Does.Not.Contain("CqrsReflectionFallbackAttribute(")); });Based on learnings, “Source generator changes MUST be covered by generator tests. Preserve snapshot-based verification patterns already used in the repository.”
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs` around lines 1460 - 1471, Tighten the generated-source assertions in the Assert.Multiple block by replacing the loose contains checks on execution.GeneratedSources[0].content with a snapshot (exact string) comparison used elsewhere in this test file (or add explicit negative assertions); specifically, assert that execution.GeneratedSources has length 1 and compare execution.GeneratedSources[0].content to the expected snapshot text (or to a literal expected string) and additionally assert it does NOT contain "typeof(MissingResponse)" and any known fallback marker; keep checks for generatedCompilationErrors and generatorErrors as-is and reuse the same snapshot helper/pattern used by other tests in this file for consistency.
🤖 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.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs`:
- Around line 70-88: The generated registry currently treats TypeKind.Dynamic as
a direct reference which yields "dynamic" and later emits typeof(dynamic)
(invalid); update TryCreateRuntimeTypeReference (or
CanReferenceFromGeneratedRegistry) to detect TypeKind.Dynamic and instead either
return false (forcing the reflection/backup path) or map the runtime reference
to "object" before calling RuntimeTypeReferenceSpec.FromDirectReference (use
type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) but replace
dynamic with "global::System.Object" or similar); also add a regression test
exercising IRequestHandler<..., dynamic> to ensure the generator does not emit
typeof(dynamic).
---
Outside diff comments:
In `@GFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs`:
- Around line 358-373: The loop in ParseObjectSpec that enumerates properties
doesn't detect collisions after name normalization (e.g., "foo-bar" and
"foo_bar" both becoming "FooBar"), so add a HashSet<string> (e.g.,
normalizedPropertyNames) in the method that contains the foreach and before
adding parsedProperty.Property!.PropertyName to properties check if
normalizedPropertyNames.Contains(parsedProperty.Property!.PropertyName); if it
does, return a diagnostic via ParsedObjectResult.FromDiagnostic describing the
duplicate normalized name (use the same diagnostic pattern used elsewhere);
otherwise add the normalized name to the HashSet and then add the Property to
properties; also add a generator regression/snapshot test that defines a schema
with colliding names to ensure the source generator emits the diagnostic (apply
same fix for the similar block handling properties around the 480-505 region).
---
Nitpick comments:
In `@GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs`:
- Around line 1460-1471: Tighten the generated-source assertions in the
Assert.Multiple block by replacing the loose contains checks on
execution.GeneratedSources[0].content with a snapshot (exact string) comparison
used elsewhere in this test file (or add explicit negative assertions);
specifically, assert that execution.GeneratedSources has length 1 and compare
execution.GeneratedSources[0].content to the expected snapshot text (or to a
literal expected string) and additionally assert it does NOT contain
"typeof(MissingResponse)" and any known fallback marker; keep checks for
generatedCompilationErrors and generatorErrors as-is and reuse the same snapshot
helper/pattern used by other tests in this file for consistency.
🪄 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: a6f84dc6-afb6-413b-805c-c215b2f5594e
📒 Files selected for processing (6)
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.csGFramework.SourceGenerators.Tests/Config/SchemaConfigGeneratorTests.csGFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.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 as they are similar to previous changes (1)
- GFramework.SourceGenerators.Tests/Config/SchemaConfigGeneratorTests.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 (5)
**/Cqrs/**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
Use CQRS (Command Query Responsibility Segregation) pattern with the Cqrs naming entry point instead of the historical Mediator alias
Files:
GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs
**/*.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>tags where applicable. Comments must explain intent, contract, and usage constraints instead of restating syntax.
Add inline comments for non-trivial logic, concurrency or threading behavior, performance-sensitive paths, workarounds/compatibility constraints/edge cases, and registration order/lifecycle sequencing/generated code assumptions. Avoid obvious comments such as// increment i.
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interaction with other components, why the abstraction exists, and when to use it instead of alternatives.
Generated logic and generator pipelines MUST explain what is generated, why it is generated, the semantic assumptions the generator relies on, and any diagnostics or fallback behavior.
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling if any.
Follow C# naming conventions: use PascalCase for types, methods, properties, events, and constants; useIprefix for interfaces; use camelCase for parameters and locals; use_camelCasefor private fields.
Use the namespace patternGFramework.{Module}.{Feature}with PascalCase segments.
Do not rely on implicit imports. Declare every requiredusingexplicitly. Keepusingdirectives at the top of the file and sort them consistently.
Write null-safe code that re...
Files:
GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs
ai-plan/public/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep committed
ai-plan/public/**content safe to publish in Git history. Never write secrets, tokens, credentials, private keys, machine usernames, home-directory paths, hostnames, IP addresses, proprietary URLs, or other sensitive environment details into anyai-plan/**file. Never record absolute file-system paths; use repository-relative paths, branch names, PR numbers, or stable document identifiers instead.
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
ai-plan/public/*/todos/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Contributors MUST keep
ai-plan/public/<topic>/todos/recovery documents up-to-date with completed work, newly discovered issues, validation results, and the next recommended recovery point. For any multi-step refactor, migration, or cross-module task, create or adopt a dedicated recovery document before making substantive code changes. Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step.
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
ai-plan/public/*/traces/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work. The trace should record the current date, key decisions, validation milestones, and the immediate next step. Update both the recovery document and the trace at each meaningful milestone before pausing or handing work off.
Files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/SourceGenerators/**/*.cs : Source generator changes MUST be covered by generator tests. Preserve snapshot-based verification patterns already used in the repository. When generator behavior changes intentionally, update snapshots together with the implementation.
📚 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 **/*{Startup,Init,Register,Setup,Configure}*.cs : CQRS handler registration should use generated products from CqrsHandlerRegistryGenerator at runtime, falling back to reflection scanning when generation cannot cover cases; explicitly register handlers from non-default assemblies using RegisterCqrsHandlersFromAssembly(...) or RegisterCqrsHandlersFromAssemblies(...)
Applied to files:
GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/SourceGenerators/**/*.cs : Source generator changes MUST be covered by generator tests. Preserve snapshot-based verification patterns already used in the repository. When generator behavior changes intentionally, update snapshots together with the implementation.
Applied to files:
GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.csai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.csai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 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.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.csGFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.RuntimeTypeReferences.csGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs
📚 Learning: 2026-04-16T13:25:59.124Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:25:59.124Z
Learning: In the GeWuYou/GFramework repo, treat `global using NUnit.Framework;` as provided project-wide by `GFramework.SourceGenerators.Tests/GlobalUsings.cs` (via GlobalUsings.cs). Do not require or flag missing per-file `using NUnit.Framework;` directives in test `.cs` files under `GFramework.SourceGenerators.Tests/`, since the project-wide global usings already include NUnit (along with other common namespaces).
Applied to files:
GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to ai-plan/public/*/todos/*.md : Contributors MUST keep `ai-plan/public/<topic>/todos/` recovery documents up-to-date with completed work, newly discovered issues, validation results, and the next recommended recovery point. For any multi-step refactor, migration, or cross-module task, create or adopt a dedicated recovery document before making substantive code changes. Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.cs : Generated logic and generator pipelines MUST explain what is generated, why it is generated, the semantic assumptions the generator relies on, and any diagnostics or fallback behavior.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Treat source code, `*.csproj`, tests, generated snapshots, and packaging metadata as the primary evidence for documentation updates. Treat verified reference implementations under `ai-libs/` as a secondary evidence source for real project adoption patterns, directory layouts, and end-to-end usage examples.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/.csproj : Naming must remain compatible with `scripts/validate-csharp-naming.sh`. Project files and package metadata should reflect current implementation status and adopted naming conventions.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdGFramework.Game.SourceGenerators/Config/SchemaConfigGenerator.cs
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to ai-plan/public/*/traces/*.md : Maintain a matching execution trace under `ai-plan/public/<topic>/traces/` for complex work. The trace should record the current date, key decisions, validation milestones, and the immediate next step. Update both the recovery document and the trace at each meaningful milestone before pausing or handing work off.
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-22T03:16:51.907Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-22T03:16:51.907Z
Learning: Applies to **/*.cs : Preserve deterministic behavior in registries, lifecycle orchestration, and generated outputs. When adding analyzers or suppressions, keep them minimal and justify them in code comments if the reason is not obvious.
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
🪛 LanguageTool
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
[grammar] ~17-~17: Ensure spelling is correct
Context: ....cs的剩余MA0051结构拆分,生成输出保持不变 - 已完成GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegist...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~35-~35: Ensure spelling is correct
Context: ...atorswarnings-only 基线已降到0条 - 当前GFramework.Cqrs.SourceGeneratorswarnings-only 基线已降到...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~60-~60: Ensure spelling is correct
Context: ...051收口;warnings-only 基线已降到0条 - 已完成GFramework.Cqrs.SourceGenerators中CqrsHandlerRegistr...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
[grammar] ~119-~119: Ensure spelling is correct
Context: ...rovider/_contextSync- 实施调整: - 将GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegist...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~205-~205: Ensure spelling is correct
Context: ... 决策: - 本轮暂缓 MA0158,转入单文件、可由生成器测试覆盖的 GFramework.Cqrs.SourceGenerators 结构拆分 - 未使用 subagent...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~272-~272: Ensure spelling is correct
Context: ...路径表示状态冲突, 不是某个方法参数无效,因此不能为 MA0015 人造参数名 - 为 Option<T> 声明 `IEquatable<Option...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (2)
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md (1)
288-290: 恢复文档中建议的拆分切入点方法名均有效。GenerateBindingsClass(第 2461 行)与AppendGeneratedConfigCatalogType(第 2791 行)在SchemaConfigGenerator.cs中均已验证存在,可按计划继续推进恢复工作。ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md (1)
3-287: 追踪记录更新看起来没问题。新增内容使用仓库相对路径,记录了日期、决策、实施调整、验证结果和下一步建议,且未发现不适合进入公开 Git 历史的环境敏感信息。
As per coding guidelines,
ai-plan/public/**: “Keep committedai-plan/public/**content safe to publish in Git history.” /ai-plan/public/*/traces/*.md: “The trace should record the current date, key decisions, validation milestones, and the immediate next step.”
Summary
Test ResultsDetails
Failed TestsSchemaConfigGeneratorTests Insights
Fail Rate
build-and-test: Run #932
❌ Some tests failed!
Slowest Tests
± Comparison with run #931 at 4d7c1d6 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 18 runs. Github Test Reporter by CTRF 💚 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@greptile-apps review |
- 修正 SchemaConfigGeneratorTests 的 reference metadata 唯一性用例,改用合法 schema 路径碰撞覆盖后缀分配逻辑 - 更新 analyzer-warning-reduction 跟踪与 trace,记录 PR #269 failed-test follow-up 和定向验证结果
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #934
🎉 All tests passed!Slowest Tests
± Comparison with run #932 at f5eb99a | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 19 runs. Github Test Reporter by CTRF 💚 |
- 更新 Core 配置与集合扩展的集合抽象契约 - 修复 CoroutineScheduler 字符串字典 comparer 与 EasyEvents 重复注册异常类型 - 补充 Option<T> 相等性接口并更新 analyzer recovery 记录
- 重构 ContextAwareGenerator 的上下文属性生成流程,降低 MA0051 复杂度 - 补充 analyzer warning reduction 的 RP-017 恢复记录与验证结果 - 更新 下一步 MA0158 多目标兼容性评估方向
- 重构 CQRS handler registry 生成器的候选分析、运行时类型引用和源码发射阶段 - 补充 analyzer warning reduction 的 RP-018 跟踪和验证记录
- 修复 SchemaConfigGenerator 中 schema 关键字比较缺少 StringComparison 的 analyzer warning - 新增 schema 类型比较 helper 以统一 ordinal 比较语义 - 更新 analyzer warning reduction 的 RP-019 恢复记录与验证结果
- 重构 SchemaConfigGenerator 的 schema 解析、属性解析与遍历阶段 - 拆分数组属性、约束文档和生成代码发射 helper 以降低 MA0051 基线 - 更新 analyzer warning reduction 恢复文档和验证记录
- 重构 CqrsHandlerRegistryGenerator 为按职责拆分的 partial 生成器文件,保留现有注册输出与 fallback 契约 - 修复 ContextAwareGenerator 生成字段命名冲突并为 SetContextProvider 补充运行时 null 校验与异常文档 - 补充 Option<T> 的 XML remarks 契约说明与 ContextAwareGenerator 字段冲突快照测试 - 更新 analyzer-warning-reduction 跟踪与 trace,记录 PR #269 review follow-up 与验证结果
- 恢复 EasyEvents、CollectionExtensions 与 logging 配置模型的公共 API 兼容形状 - 修复 ContextAwareGenerator 字段命名冲突、锁内读取路径与相关快照回归测试 - 更新 Cqrs 与 schema generator 的 null/cancellation 契约,并同步 ai-plan 跟踪与验证记录
- 修复 SchemaConfigGenerator 的根类型标识符校验与 comparer XML 文档转义\n- 补强 LoggingConfiguration 与 CollectionExtensions 的公共 API 兼容断言\n- 重构 Cqrs 运行时类型反射查找 helper,并更新 analyzer-warning-reduction 跟踪与验证记录
- 修复 Cqrs handler registry 对 Roslyn error type 的直接引用,改走安全的运行时类型查找 - 补充 SchemaConfigGenerator 根 type 非字符串诊断回归与 Cqrs 未解析类型回归测试 - 更新 analyzer-warning-reduction 的 RP-024 跟踪与验证记录
- 修复 SchemaConfigGenerator 的归一化字段名冲突诊断,并补充对应 generator 回归测试 - 修复 CqrsHandlerRegistryGenerator 对 dynamic 的运行时类型引用,避免生成非法 typeof(dynamic) - 更新 AGENTS 与 analyzer-warning-reduction 跟踪,明确受影响模块必须独立 build 并处理或显式报告 warning
- 修正 SchemaConfigGeneratorTests 的 reference metadata 唯一性用例,改用合法 schema 路径碰撞覆盖后缀分配逻辑 - 更新 analyzer-warning-reduction 跟踪与 trace,记录 PR #269 failed-test follow-up 和定向验证结果
- 修复 ContextAwareGenerator 的保留名收集逻辑,使 _gFrameworkContextAware* 字段分配覆盖完整基类链 - 新增 inherited collision 快照回归测试与快照文件,锁定基类占用字段名时的后缀回退行为 - 更新 analyzer-warning-reduction 跟踪与 trace,记录本轮 Greptile follow-up 与验证结果
- 合并 main 在线上单文件版本新增的模型 XML 文档,并迁移到当前 partial 拆分后的 Models 文件 - 保留 CqrsHandlerRegistryGenerator 主文件的现有生成管线拆分,不回退已完成的结构调整 - 更新 analyzer-warning-reduction 跟踪与 trace,记录本轮冲突确认、合并策略与构建验证结果
71472a8 to
b8c2ad4
Compare
Summary
Test ResultsDetails
Insights
build-and-test: Run #936
🎉 All tests passed!Slowest Tests
🎉 No failed tests in this run. | 🍂 No flaky tests in this run. Github Test Reporter by CTRF 💚 |
Summary by CodeRabbit
Bug 修复
增强功能
重构
测试
文档