Conversation
- 拆分 CqrsDispatcherCacheTests 末尾的 request、handler 与 behavior 辅助类型到同目录独立文件 - 修复 dispatcher cache 测试中的 ConfigureAwait warning,保持现有断言与分发语义不变
- 拆分 TestArchitecture 与 TestArchitectureContext 到独立测试文件以消除 MA0048 - 修复 TestArchitectureContext 的可空签名以匹配 IArchitectureContext 契约 - 补充测试桩公开成员的 XML 文档并保持 GameContextTests 行为不变
- 拆分 RegistryInitializationHookBaseTests 末尾的测试辅助类型到同目录独立文件以消除 MA0048 - 更新 TestRegistry 的公开集合暴露方式为只读接口以规避 MA0016 - 补充新测试辅助类型的 XML 文档并保持原有测试行为不变
- 拆分 CqrsHandlerRegistrarTests 尾部的测试辅助类型到同目录同名文件 - 保持 CQRS handler registrar 测试行为与 XML 文档不变并消除该切片的 MA0048 warning
- 拆分 GameContextTests、ArchitectureServicesTests、RegistryInitializationHookBaseTests 与 Cqrs 测试辅助类型,消除批次内 MA0048 热点 - 修复 Core.Tests 零散可空性、集合抽象和测试辅助 warning,使受影响 Release 构建清零 - 更新 analyzer-warning-reduction 跟踪与 trace,记录 236 条仓库根 warning 基线和 45/50 停止点
|
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:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent 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)
🧰 Additional context used📓 Path-based instructions (2)ai-plan/public/*/traces/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
ai-plan/public/*/todos/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (17)📓 Common learnings📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
📚 Learning: 2026-04-26T03:16:48.230ZApplied to files:
🪛 LanguageToolai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md[grammar] ~30-~30: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md[grammar] ~25-~25: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) [grammar] ~25-~25: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) 🔇 Additional comments (5)
📝 WalkthroughWalkthrough将多个测试基础设施从内联移至独立文件,新增并重构若干测试桩(架构上下文/上下文基类、注册表与初始化钩子、CQRS 测试类型、日志与资源测试工具),并在 RegistryInitializationHookBase.OnPhase 中改为捕获并忽略 GetUtility 抛出的 InvalidOperationException。 Changes
Sequence Diagram(s)(无) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 分钟 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 |
|
| Filename | Overview |
|---|---|
| GFramework.Core/Architectures/RegistryInitializationHookBase.cs | Adds ArgumentNullException.ThrowIfNull guard and replaces nullable check with catch (InvalidOperationException) to handle missing registries; see comment on overly broad exception catch. |
| GFramework.Core.Tests/Architectures/TestArchitectureContextBase.cs | New shared base context that centralises container, event bus, and CQRS entry-point stubs, eliminating duplicated implementations across test files. |
| GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs | Inline test doubles extracted to dedicated files; test cases preserved; missing null-architecture assertion for the new guard. |
| GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs | Extracted from inline declaration; now a dedicated file wrapping TestArchitectureContextWithRegistry with proper XML docs. |
| GFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs | Extracted from inline declaration; now uses TestArchitectureContext (throws on GetUtility) which is consistent with the new catch (InvalidOperationException) production logic. |
| GFramework.Core.Tests/Architectures/TestArchitectureContextWithRegistry.cs | Extracted from inline declaration; overrides GetUtility to return TestRegistry without querying the container, correctly bypassing the throw path. |
| GFramework.Cqrs.Tests/Cqrs/CqrsHandlerRegistrarTests.cs | Inline CQRS test doubles extracted to dedicated files; one new test added for CapturingLoggerFactoryProvider.MinLevel mutation; safe refactor. |
| GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs | New shared logger factory test double; clean extraction from inline code. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["OnPhase(phase, architecture)"] --> B{architecture == null?}
B -- yes --> C[throw ArgumentNullException]
B -- no --> D{phase == _targetPhase?}
D -- no --> E[return no-op]
D -- yes --> F["architecture.Context.GetUtility<TRegistry>()"]
F -- success --> G["foreach config → RegisterConfig(registry, config)"]
F -- "throws InvalidOperationException\n(registry not found)" --> H[return no-op]
G --> I[Done]
Prompt To Fix All With AI
This is a comment left during a code review.
Path: GFramework.Core/Architectures/RegistryInitializationHookBase.cs
Line: 53-59
Comment:
**`InvalidOperationException` catch is broader than the missing-registry case**
`GetRequired` (used by `TestArchitectureContextBase`) throws `InvalidOperationException` for both "zero registrations" and "more than one registration". The production `ArchitectureContext.GetOrCache` can also throw for other reasons (e.g., a factory delegate that itself throws `InvalidOperationException`). Catching all `InvalidOperationException` here silently suppresses those errors as a no-op, which can make duplicate-registration bugs invisible.
Consider narrowing the catch, or checking `GetUtility` via a try-get pattern, or at minimum adding an XML `<remarks>` note clarifying which `InvalidOperationException` subtypes are intentionally swallowed.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs
Line: 16-112
Comment:
**Missing test for new `ArgumentNullException` guard**
The PR adds `ArgumentNullException.ThrowIfNull(architecture)` to `OnPhase`, but the test class has no coverage for this path. A test like `OnPhase_Should_Throw_ArgumentNullException_When_Architecture_Is_Null` would pin the documented contract and catch regressions:
```csharp
[Test]
public void OnPhase_Should_Throw_ArgumentNullException_When_Architecture_Is_Null()
{
var hook = new TestRegistryInitializationHook(new[] { "config1" });
Assert.Throws<ArgumentNullException>(() =>
hook.OnPhase(ArchitecturePhase.AfterSystemInit, null!));
}
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (6): Last reviewed commit: "docs(analyzer-warning-reduction): 同步PR审查..." | Re-trigger Greptile
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #998
❌ Some tests failed!
Slowest Tests
± Comparison with run #996 at b83e3b0 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 48 runs. Github Test Reporter by CTRF 💚 |
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| dotnet-format | yes | 1 | no | 5.54s | ||
| ✅ REPOSITORY | gitleaks | yes | no | no | 8.2s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 6.96s |
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
There was a problem hiding this comment.
Actionable comments posted: 8
🧹 Nitpick comments (4)
GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs (1)
17-47: 建议为捕获集合增加并发安全边界,并返回快照。Line 31 返回了底层
_loggers,Line 46 持续写入该集合;如果测试期间存在并发创建 logger,读取与写入可能互相干扰。建议使用同步保护并让Loggers返回快照,同时补充线程模型注释。💡 建议修改
internal sealed class CapturingLoggerFactoryProvider : ILoggerFactoryProvider { private readonly List<TestLogger> _loggers = []; + private readonly object _sync = new(); @@ - public IReadOnlyList<TestLogger> Loggers => _loggers; + public IReadOnlyList<TestLogger> Loggers + { + get + { + lock (_sync) + { + return _loggers.ToArray(); + } + } + } @@ public ILogger CreateLogger(string name) { var logger = new TestLogger(name, MinLevel); - _loggers.Add(logger); + lock (_sync) + { + _loggers.Add(logger); + } return logger; } }As per coding guidelines "When adding caching, pooling, or shared mutable state, document thread-safety assumptions and failure modes in C#" and "Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, edge cases, registration order, lifecycle sequencing, and generated code assumptions".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs` around lines 17 - 47, The Loggers property exposes the mutable backing field _loggers while CreateLogger mutates it, causing race conditions under concurrent test use; make access thread-safe by introducing a private readonly sync object (e.g., _sync) and lock around mutations in CreateLogger and reads in Loggers, and have Loggers return an immutable snapshot (e.g., new array/List copy) instead of the live list; also add a brief XML/comment on the class indicating its thread-safety guarantees and that callers receive snapshots.GFramework.Core.Tests/Logging/TestLogger.cs (1)
11-36: 建议避免直接暴露可变集合,并补充线程安全语义。Line 25 直接返回底层
_logs,Line 35 在无同步保护下写入。若测试路径出现并发日志写入,可能导致断言不稳定。建议返回快照并在写入/读取处统一同步,同时加一条并发语义注释。💡 建议修改
public sealed class TestLogger : AbstractLogger { private readonly List<LogEntry> _logs = new(); + private readonly object _sync = new(); @@ - public IReadOnlyList<LogEntry> Logs => _logs; + public IReadOnlyList<LogEntry> Logs + { + get + { + lock (_sync) + { + return _logs.ToArray(); + } + } + } @@ protected override void Write(LogLevel level, string message, Exception? exception) { - _logs.Add(new LogEntry(level, message, exception)); + lock (_sync) + { + _logs.Add(new LogEntry(level, message, exception)); + } }As per coding guidelines "When adding caching, pooling, or shared mutable state, document thread-safety assumptions and failure modes in C#" and "Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, edge cases, registration order, lifecycle sequencing, and generated code assumptions".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Core.Tests/Logging/TestLogger.cs` around lines 11 - 36, The Tests' TestLogger exposes the mutable backing field _logs via Logs and mutates it in Write without synchronization; fix by adding a private readonly sync object (e.g. _sync), wrap the body of Write(LogLevel, string, Exception?) in lock(_sync) when adding to _logs, change the Logs getter to return a snapshot (e.g. lock(_sync) return _logs.ToList().AsReadOnly() or similar) instead of exposing the list, and add an inline XML/summary comment on the TestLogger/Logs explaining the thread-safety semantics (that the logger is safe for concurrent writes and Logs returns a snapshot view for assertions).GFramework.Core.Tests/Resource/TestResourceLoader.cs (1)
25-29: 移除 TestResourceLoader 中不必要的固定延迟。该 10 毫秒延迟不必要地减慢了测试套件执行;改用
Task.FromResult(Load(path))可保持异步方法签名同时消除无谓的等待时间。建议的修改
public async Task<TestResource> LoadAsync(string path) { - await Task.Delay(10).ConfigureAwait(false); // 模拟异步加载 - return Load(path); + return await Task.FromResult(Load(path)).ConfigureAwait(false); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Core.Tests/Resource/TestResourceLoader.cs` around lines 25 - 29, The LoadAsync method in TestResourceLoader currently awaits an unnecessary Task.Delay(10) which slows tests; replace the artificial delay by returning the result asynchronously (use Task.FromResult of Load(path) or remove async/await and return Task.FromResult(Load(path))) so LoadAsync keeps its signature but no longer introduces a fixed wait; update the LoadAsync implementation and remove the await/ConfigureAwait call accordingly.GFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.cs (1)
13-20: 为共享可变状态补充并发文档或改用受控访问。
InvocationOrder直接暴露为可变集合,虽然当前测试环境不启用并行执行,但根据编码指南要求,应为共享可变状态明确记录线程安全假设与失败模式。当前 XML 文档中未说明:
- 该状态是否线程安全(当前:否)
- 失败模式(并发访问时的表现)
- 仅用于顺序测试的上下文
最小修复:在
InvocationOrder和Reset()的 XML 文档中补充<remarks>部分,明确说明这是测试专用、非线程安全的状态。推荐改进:改为私有集合 + 受控写入接口,并加锁保护,使代码防御式更强:
♻️ 推荐重构示例
internal static class DeterministicNotificationHandlerState { + private static readonly object SyncRoot = new(); + private static readonly List<string> _invocationOrder = []; + /// <summary> /// 获取当前测试中的通知处理器执行顺序。 /// </summary> - public static List<string> InvocationOrder { get; } = []; + public static IReadOnlyList<string> InvocationOrder + { + get + { + lock (SyncRoot) + { + return _invocationOrder.ToArray(); + } + } + } + + /// <summary> + /// 记录处理器执行名称。该方法对共享状态的写入是串行化的。 + /// </summary> + public static void Record(string handlerName) + { + lock (SyncRoot) + { + _invocationOrder.Add(handlerName); + } + } /// <summary> /// 重置共享的执行顺序状态。 /// </summary> public static void Reset() { - InvocationOrder.Clear(); + lock (SyncRoot) + { + _invocationOrder.Clear(); + } } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.cs` around lines 13 - 20, 在 Cqrs/DeterministicNotificationHandlerState 中,InvocationOrder 目前以可变公有集合暴露且文档未说明线程安全性;请在 InvocationOrder 的 XML 注释中添加 <remarks>,明确标注“仅用于测试、非线程安全、并发访问将导致未定义/竞争行为”;同时在 Reset() 的 XML 注释中添加相同的 <remarks> 以说明其仅在单线程/顺序测试上下文使用且并发调用不是受支持的情形。保留成员可见性不变以保持最小修复(可选改进:将 InvocationOrder 设为私有并通过受控方法/锁写入—不在本次变更中实施)。
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@GFramework.Core.Tests/Architectures/TestArchitectureContext.cs`:
- Around line 357-416: The current legacy entry methods (SendCommand,
SendCommand<TResult>, SendCommandAsync, SendCommandAsync<TResult>,
SendQuery<TResult>, SendQueryAsync<TResult>) return defaults/CompletedTask which
masks misuse; change each implementation to throw NotSupportedException (or call
the real executor if one is available) so callers get an explicit failure
instead of a silent default result—update SendCommand to throw,
SendCommand<TResult> to throw, SendCommandAsync to return a faulted Task via
throwing, SendCommandAsync<TResult> to throw, SendQuery<TResult> to throw, and
SendQueryAsync<TResult> to throw (or delegate to the executor) so behavior
matches the class contract.
- Around line 39-40: The EventBus property on TestArchitectureContext currently
returns a new EventBus each access causing RegisterEvent, SendEvent and
UnRegisterEvent to operate on different instances (silently dropping
subscriptions); change TestArchitectureContext to hold a single cached EventBus
instance (e.g., a private readonly field) and have the EventBus property return
that instance, then delegate RegisterEvent, SendEvent and UnRegisterEvent to
that same cached instance; alternatively, if this architecture slice should not
support events, make those APIs throw NotSupportedException instead of operating
against ephemeral EventBus objects.
In `@GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs`:
- Around line 356-402: Replace the placeholder returns in the CQRS shim methods
so they consistently signal unsupported operations instead of returning default
values or performing invalid casts: change
SendCommand<TResult>(ICommand<TResult>) and SendQuery<TResult>(IQuery<TResult>)
to throw new NotSupportedException(), change SendCommandAsync(IAsyncCommand) to
return Task.FromException(new NotSupportedException()), change
SendCommandAsync<TResult>(IAsyncCommand<TResult>) to return
Task.FromException<TResult>(new NotSupportedException()), and change
SendQueryAsync<TResult>(IAsyncQuery<TResult>) to return
Task.FromException<TResult>(new NotSupportedException()); this removes the
default! usages and the invalid (Task<TResult>)Task.CompletedTask casts and
follows the class convention to explicitly surface NotSupportedException.
In `@GFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs`:
- Around line 94-97: The explicit interface implementation
IArchitecture.RegisterLifecycleHook currently throws NotSupportedException while
the class-level method on TestArchitectureWithoutRegistry silently ignores the
hook; make the behaviors consistent by changing the explicit implementation on
IArchitecture.RegisterLifecycleHook in TestArchitectureWithoutRegistry to
perform the same no-op semantics and return the passed-in
IArchitectureLifecycleHook (i.e., return hook) instead of throwing; apply the
same change for the other explicit implementation instance noted (the second
occurrence covering lines ~179-186) so both explicit-interface methods mirror
the class behaviour.
In `@GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs`:
- Around line 96-99: 当前通过接口调用的显式实现 IArchitecture.RegisterLifecycleHook 抛出
NotSupportedException,而类的公开实现是 no-op,导致语义不一致;把显式接口实现改为与公开方法一致:在
TestArchitectureWithRegistry 的显式实现 IArchitecture.RegisterLifecycleHook 调用该类的公开
RegisterLifecycleHook 方法(或相同的忽略逻辑)并返回传入的 hook(即返回 hook 而非抛出),并对另一个重复的问题(行
176-183)做同样处理以统一行为。
In `@GFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.cs`:
- Line 23: The field declaration private IEventBus eventBus = null!; suppresses
nullable warnings; instead make the backing field nullable (private IEventBus?
eventBus) and replace direct field usage with a protected non-null accessor
(e.g., a property/getter named EventBus) that throws an
InvalidOperationException if eventBus is null, or ensure explicit initialization
in the test lifecycle (e.g., SetUp/constructor) so eventBus is non-null before
use; update all references in WaitForMultipleEventsTests to use the accessor or
ensure SetUp assigns eventBus to satisfy nullable analysis.
In `@GFramework.Core.Tests/Resource/TestResourceLoader.cs`:
- Around line 14-51: Add explicit null checks and XML exception docs for the
public APIs: in Load(string path) validate path and throw ArgumentNullException
if null or empty (keep FileNotFoundException when missing); in LoadAsync(string
path) validate path up-front (throw ArgumentNullException) before the await
and/or delegate to Load after validation; in Unload(TestResource resource)
validate resource and throw ArgumentNullException if null; in CanLoad(string
path) validate path and throw ArgumentNullException if null (or return false if
you prefer a non-throwing contract—choose one consistently) ; in
AddTestData(string path, string content) validate both path and content and
throw ArgumentNullException for null values. Also update the XML documentation
on each method (Load, LoadAsync, Unload, CanLoad, AddTestData) to declare the
thrown exceptions (ArgumentNullException, FileNotFoundException where
applicable).
In `@GFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.cs`:
- Around line 14-23: Add XML <exception> documentation to the Register method to
declare that it throws ArgumentNullException when a null parameter is passed;
specifically document ArgumentNullException for the services parameter
(IServiceCollection services) and for the logger parameter (ILogger logger),
referencing the existing null checks (ArgumentNullException.ThrowIfNull) in the
Register method so the XML comments match the runtime behavior.
---
Nitpick comments:
In `@GFramework.Core.Tests/Logging/TestLogger.cs`:
- Around line 11-36: The Tests' TestLogger exposes the mutable backing field
_logs via Logs and mutates it in Write without synchronization; fix by adding a
private readonly sync object (e.g. _sync), wrap the body of Write(LogLevel,
string, Exception?) in lock(_sync) when adding to _logs, change the Logs getter
to return a snapshot (e.g. lock(_sync) return _logs.ToList().AsReadOnly() or
similar) instead of exposing the list, and add an inline XML/summary comment on
the TestLogger/Logs explaining the thread-safety semantics (that the logger is
safe for concurrent writes and Logs returns a snapshot view for assertions).
In `@GFramework.Core.Tests/Resource/TestResourceLoader.cs`:
- Around line 25-29: The LoadAsync method in TestResourceLoader currently awaits
an unnecessary Task.Delay(10) which slows tests; replace the artificial delay by
returning the result asynchronously (use Task.FromResult of Load(path) or remove
async/await and return Task.FromResult(Load(path))) so LoadAsync keeps its
signature but no longer introduces a fixed wait; update the LoadAsync
implementation and remove the await/ConfigureAwait call accordingly.
In `@GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs`:
- Around line 17-47: The Loggers property exposes the mutable backing field
_loggers while CreateLogger mutates it, causing race conditions under concurrent
test use; make access thread-safe by introducing a private readonly sync object
(e.g., _sync) and lock around mutations in CreateLogger and reads in Loggers,
and have Loggers return an immutable snapshot (e.g., new array/List copy)
instead of the live list; also add a brief XML/comment on the class indicating
its thread-safety guarantees and that callers receive snapshots.
In `@GFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.cs`:
- Around line 13-20: 在 Cqrs/DeterministicNotificationHandlerState
中,InvocationOrder 目前以可变公有集合暴露且文档未说明线程安全性;请在 InvocationOrder 的 XML 注释中添加
<remarks>,明确标注“仅用于测试、非线程安全、并发访问将导致未定义/竞争行为”;同时在 Reset() 的 XML 注释中添加相同的 <remarks>
以说明其仅在单线程/顺序测试上下文使用且并发调用不是受支持的情形。保留成员可见性不变以保持最小修复(可选改进:将 InvocationOrder
设为私有并通过受控方法/锁写入—不在本次变更中实施)。
🪄 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: b4e28cc1-ccd9-488b-9336-230e64c312cf
📒 Files selected for processing (51)
GFramework.Core.Tests/Architectures/AnotherTestArchitectureContext.csGFramework.Core.Tests/Architectures/ArchitectureServicesTests.csGFramework.Core.Tests/Architectures/ContextProviderTests.csGFramework.Core.Tests/Architectures/GameContextTests.csGFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.csGFramework.Core.Tests/Architectures/TestArchitecture.csGFramework.Core.Tests/Architectures/TestArchitectureBase.csGFramework.Core.Tests/Architectures/TestArchitectureContext.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.csGFramework.Core.Tests/Architectures/TestArchitectureContextWithRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.csGFramework.Core.Tests/Architectures/TestRegistry.csGFramework.Core.Tests/Architectures/TestRegistryInitializationHook.csGFramework.Core.Tests/Coroutine/CommandCoroutineExtensionsTests.csGFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.csGFramework.Core.Tests/Events/EmptyEvent.csGFramework.Core.Tests/Events/EventListenerScopeTests.csGFramework.Core.Tests/Events/TestEvent.csGFramework.Core.Tests/Logging/LoggerTests.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.Core.Tests/Logging/TestLogger.csGFramework.Core.Tests/Resource/ResourceManagerTests.csGFramework.Core.Tests/Resource/TestResource.csGFramework.Core.Tests/Resource/TestResourceLoader.csGFramework.Cqrs.Tests/Cqrs/AlphaDeterministicNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.csGFramework.Cqrs.Tests/Cqrs/CqrsDispatcherCacheTests.csGFramework.Cqrs.Tests/Cqrs/CqrsHandlerRegistrarTests.csGFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.csGFramework.Cqrs.Tests/Cqrs/DeterministicOrderNotification.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotification.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequest.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequestHandler.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamHandler.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamRequest.csGFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheBehavior.csGFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequest.csGFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequestHandler.csGFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequest.csGFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequestHandler.csGFramework.Cqrs.Tests/Cqrs/GeneratedNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotification.csGFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/PrivateConstructorNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/ReflectionFallbackNotificationContainer.csGFramework.Cqrs.Tests/Cqrs/ZetaDeterministicNotificationHandler.csai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.mdai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
💤 Files with no reviewable changes (6)
- GFramework.Core.Tests/Architectures/ContextProviderTests.cs
- GFramework.Core.Tests/Logging/LoggerTests.cs
- GFramework.Core.Tests/Resource/ResourceManagerTests.cs
- GFramework.Cqrs.Tests/Cqrs/CqrsHandlerRegistrarTests.cs
- GFramework.Core.Tests/Architectures/ArchitectureServicesTests.cs
- GFramework.Core.Tests/Architectures/GameContextTests.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)
**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.cs: Apply [Log] attribute for automatic logging field and logging helper method generation
Apply [Priority] attribute for automatic priority comparison implementation generation
Apply [GenerateEnumExtensions] attribute to generate enumeration extension capabilities
Apply [ContextAware] attribute to automatically implement IContextAware boilerplate logic
**/*.cs: All public, protected, and internal types and members MUST include XML documentation comments (///) with<summary>,<param>,<returns>,<exception>, and<remarks>where applicable
Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, edge cases, registration order, lifecycle sequencing, and generated code assumptions
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Generated logic and generator pipelines MUST explain what is generated, why it is generated, semantic assumptions, and diagnostics or fallback behavior
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling
Do not rely on implicit imports; declare every requiredusingexplicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace patternGFramework.{Module}.{Feature}with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces withIprefix, parameters and locals in camelCase, private fields in_camelCase
Use 4 spaces for indentation in C# files; do not use tabs
Use Allman braces in C# files
Keepusingdirectives at the top of C# files and sort them consistently
Prefer one primary type per C# file unless the surrounding project already uses a different local pattern
Keep...
Files:
GFramework.Core.Tests/Events/EmptyEvent.csGFramework.Core.Tests/Architectures/AnotherTestArchitectureContext.csGFramework.Core.Tests/Architectures/TestArchitecture.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequest.csGFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.csGFramework.Cqrs.Tests/Cqrs/DeterministicOrderNotification.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotification.csGFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequest.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamHandler.csGFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequestHandler.csGFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.csGFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequestHandler.csGFramework.Core.Tests/Events/EventListenerScopeTests.csGFramework.Core.Tests/Events/TestEvent.csGFramework.Cqrs.Tests/Cqrs/ReflectionFallbackNotificationContainer.csGFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequest.csGFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotification.csGFramework.Core.Tests/Architectures/TestRegistryInitializationHook.csGFramework.Cqrs.Tests/Cqrs/GeneratedNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/AlphaDeterministicNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/ZetaDeterministicNotificationHandler.csGFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.csGFramework.Cqrs.Tests/Cqrs/PrivateConstructorNotificationHandlerRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureContextWithRegistry.csGFramework.Core.Tests/Logging/TestLogger.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequestHandler.csGFramework.Core.Tests/Architectures/TestRegistry.csGFramework.Core.Tests/Resource/TestResourceLoader.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamRequest.csGFramework.Core.Tests/Architectures/TestArchitectureBase.csGFramework.Cqrs.Tests/Cqrs/CqrsDispatcherCacheTests.csGFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.csGFramework.Core.Tests/Resource/TestResource.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.Core.Tests/Coroutine/CommandCoroutineExtensionsTests.csGFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheBehavior.csGFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.csGFramework.Core.Tests/Architectures/TestArchitectureContext.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.Tests/Cqrs/DispatcherCacheRequest.csGFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.csGFramework.Cqrs.Tests/Cqrs/DeterministicOrderNotification.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotification.csGFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequest.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamHandler.csGFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequestHandler.csGFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequestHandler.csGFramework.Cqrs.Tests/Cqrs/ReflectionFallbackNotificationContainer.csGFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequest.csGFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotification.csGFramework.Cqrs.Tests/Cqrs/GeneratedNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/AlphaDeterministicNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/ZetaDeterministicNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/PrivateConstructorNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequestHandler.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamRequest.csGFramework.Cqrs.Tests/Cqrs/CqrsDispatcherCacheTests.csGFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.csGFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheBehavior.cs
**/*{Startup,Init,Register,Setup,Configure}*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
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(...)
Files:
GFramework.Core.Tests/Architectures/TestRegistryInitializationHook.csGFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs
ai-plan/public/*/traces/**
📄 CodeRabbit inference engine (AGENTS.md)
Contributors MUST maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work, recording the current date, key decisions, validation milestones, and the immediate next step
Files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
ai-plan/public/*/todos/**
📄 CodeRabbit inference engine (AGENTS.md)
ai-plan/public/*/todos/**: When working from a tracked implementation plan, contributors MUST update the corresponding tracking document underai-plan/public/<topic>/todos/in the same change
Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point
Active tracking and trace files are recovery entrypoints, not append-only changelogs; they MUST stay concise enough forbootto locate the current recovery point quickly
Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step so another contributor or subagent can continue the work safely
When completed and validated stages begin to accumulate, contributors MUST archive their detailed history out of the activetodos/andtraces/entry files in the same change, keeping only the current recovery point, active facts, active risks, immediate next step, and pointers to archive files
When a task spans multiple commits or is likely to exceed a single agent context window, update both the recovery document and the trace at each meaningful milestone before pausing or handing work off
If subagents are used on a complex task, the main agent MUST capture the delegated scope and any accepted findings in the active recovery document or trace before continuing implementation
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🧠 Learnings (18)
📚 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/Events/EmptyEvent.csGFramework.Core.Tests/Architectures/AnotherTestArchitectureContext.csGFramework.Core.Tests/Architectures/TestArchitecture.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequest.csGFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.csGFramework.Cqrs.Tests/Cqrs/DeterministicOrderNotification.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotification.csGFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequest.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamHandler.csGFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequestHandler.csGFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.csGFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequestHandler.csGFramework.Core.Tests/Events/EventListenerScopeTests.csGFramework.Core.Tests/Events/TestEvent.csGFramework.Cqrs.Tests/Cqrs/ReflectionFallbackNotificationContainer.csGFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequest.csGFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotification.csGFramework.Core.Tests/Architectures/TestRegistryInitializationHook.csGFramework.Cqrs.Tests/Cqrs/GeneratedNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/AlphaDeterministicNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/ZetaDeterministicNotificationHandler.csGFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.csGFramework.Cqrs.Tests/Cqrs/PrivateConstructorNotificationHandlerRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureContextWithRegistry.csGFramework.Core.Tests/Logging/TestLogger.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequestHandler.csGFramework.Core.Tests/Architectures/TestRegistry.csGFramework.Core.Tests/Resource/TestResourceLoader.csGFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamRequest.csGFramework.Core.Tests/Architectures/TestArchitectureBase.csGFramework.Cqrs.Tests/Cqrs/CqrsDispatcherCacheTests.csGFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.csGFramework.Core.Tests/Resource/TestResource.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.Core.Tests/Coroutine/CommandCoroutineExtensionsTests.csGFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheBehavior.csGFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.csGFramework.Core.Tests/Architectures/TestArchitectureContext.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`
Applied to files:
GFramework.Core.Tests/Architectures/AnotherTestArchitectureContext.csGFramework.Core.Tests/Architectures/TestArchitecture.csGFramework.Core.Tests/Architectures/TestRegistryInitializationHook.csGFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.csGFramework.Core.Tests/Architectures/TestArchitectureContextWithRegistry.csGFramework.Core.Tests/Architectures/TestRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureBase.csGFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.csGFramework.Core.Tests/Architectures/TestArchitectureContext.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Preserve snapshot-based verification patterns already used in the repository for source generator tests
Applied to files:
GFramework.Core.Tests/Architectures/AnotherTestArchitectureContext.csGFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.csGFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotification.csGFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.csGFramework.Core.Tests/Architectures/TestRegistry.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs
📚 Learning: 2026-04-16T13:26:01.780Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:26:01.780Z
Learning: In the GeWuYou/GFramework repository, the test project `GFramework.SourceGenerators.Tests` provides `global using NUnit.Framework;` via its `GlobalUsings.cs`. Do not flag missing `using NUnit.Framework;` directives in test files within this project, as the global using already covers it. The project-wide GlobalUsings.cs pattern is used broadly to supply common namespaces (including NUnit, System.IO, etc.) without per-file imports.
Applied to files:
GFramework.Core.Tests/Architectures/AnotherTestArchitectureContext.csGFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.csGFramework.Core.Tests/Events/EventListenerScopeTests.csGFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.csGFramework.Core.Tests/Architectures/TestRegistry.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Keep tests focused on observable behavior, not implementation trivia
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitecture.csGFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.csGFramework.Core.Tests/Events/EventListenerScopeTests.csGFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.csGFramework.Cqrs.Tests/Cqrs/CqrsDispatcherCacheTests.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.Core.Tests/Coroutine/CommandCoroutineExtensionsTests.csGFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : When a public C# API defines multiple contract branches, tests MUST cover the meaningful variants including null, empty, default, and filtered inputs when those branches change behavior
Applied to files:
GFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.Core.Tests/Coroutine/CommandCoroutineExtensionsTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Public API changes must be covered by unit or integration tests in C#
Applied to files:
GFramework.Core.Tests/Events/EventListenerScopeTests.csGFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.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.Tests/Cqrs/ReflectionFallbackNotificationContainer.csGFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotificationHandler.csGFramework.Cqrs.Tests/Cqrs/GeneratedNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/PrivateConstructorNotificationHandlerRegistry.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Regression fixes should include a test that fails before the fix and passes after it
Applied to files:
GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.csGFramework.Core.Tests/Architectures/TestRegistry.csGFramework.Core.Tests/Logging/LoggingConfigurationTests.csGFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.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: Architecture implementations should follow the four-layer structure: IArchitecture (lifecycle management), IContextAware (unified context access), IModel (data/state layer), ISystem (business logic layer), and IUtility (stateless utility layer)
Applied to files:
GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.csGFramework.Core.Tests/Architectures/TestArchitectureContext.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Applied to files:
GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.csGFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.csGFramework.Core.Tests/Architectures/TestArchitectureContext.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Mirror the source structure in test projects whenever practical
Applied to files:
GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Avoid hidden side effects in property getters, constructors, and registration helpers in C#
Applied to files:
GFramework.Cqrs.Tests/Cqrs/PrivateConstructorNotificationHandlerRegistry.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.Tests/Architectures/TestArchitectureContextWithRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.csGFramework.Core.Tests/Architectures/TestArchitectureContext.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: When the goal is to inspect or reduce warnings, establish the warning baseline by running `dotnet clean` and then `dotnet build`, not repeated incremental builds
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : When adding C# 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
📚 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: Component coordination should use separate components (ArchitectureLifecycle, ArchitectureComponentRegistry, ArchitectureModules) to distribute responsibilities rather than concentrating them in a single core class
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🪛 LanguageTool
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
[grammar] ~13-~13: Ensure spelling is correct
Context: ...Tests.cs、CqrsDispatcherCacheTests.cs与CqrsHandlerRegistrarTests.cs - 主线程已补齐ResourceManagerTests.cs、TestEvent.cs...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~15-~15: Ensure spelling is correct
Context: ...arning - 当前 GFramework.Core.Tests 与 GFramework.Cqrs.Tests 的受影响项目 Release 构建都已恢复到 `0 Warnin...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (43)
GFramework.Core.Tests/Events/EventListenerScopeTests.cs (2)
1-1:using增加合理且必要。这里显式引入
System.Runtime.InteropServices与后续StructLayout属性使用匹配,改动清晰。
307-307:StructLayout(LayoutKind.Auto)的测试场景使用可接受。该改动未改变测试断言语义,且未引入额外行为风险。
GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs (1)
310-312: 可空性处理方式合理,当前改动通过。这里先做非空断言再访问
Type,既保留了原有断言语义,也更清晰地处理了可空性警告。GFramework.Core.Tests/Coroutine/CommandCoroutineExtensionsTests.cs (2)
408-408: 此处调整是合适的。Line 408 改为 no-op 回调不改变“负超时应抛异常”的断言目标,同时降低可空性告警噪音。
424-424: 空总线分支的表达更清晰。Line 424 显式返回
null(带null!)能稳定触发“事件总线缺失”路径,测试意图明确且与被测实现一致。GFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.cs (1)
141-141: 该行仅为文件结尾换行/格式变化,无需额外审查意见。GFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequest.cs (1)
1-8: 实现简洁且契约正确。
DispatcherCacheRequest的定义与缓存测试目标匹配,当前实现可直接用于请求分发缓存验证。GFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotification.cs (1)
1-8: 通知测试模型定义清晰。该类型最小化且语义明确,适合作为 dispatcher notification 缓存测试输入。
GFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequestHandler.cs (1)
9-20: 处理器实现稳定,适合缓存测试。固定结果返回让测试可预测性更高,便于专注验证 dispatcher 缓存行为。
GFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotificationHandler.cs (1)
9-20: 通知处理器实现符合测试预期。无副作用完成路径清晰,可稳定支撑 notification 分发缓存验证。
GFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequest.cs (1)
1-8: 按响应类型分层的测试输入设计合理。该请求模型能有效补充 dispatcher 请求缓存在不同响应类型下的覆盖。
GFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamRequest.cs (1)
1-8: 流式请求类型定义正确且与测试上下文一致。该记录类型足够轻量,适合用于 stream dispatch 缓存路径验证。
GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequest.cs (1)
1-8: Pipeline 缓存测试请求建模到位。类型职责聚焦,便于在测试中隔离 pipeline invoker 缓存行为。
GFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamHandler.cs (1)
12-26: 流处理器实现符合缓存测试需求。最小异步流实现稳定、可预测,便于验证 stream 分发绑定缓存复用。
GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequestHandler.cs (1)
6-20: 实现清晰且符合测试意图这里使用固定返回值的
IRequestHandler测试替身很合适,ValueTask.FromResult(2)也与缓存路径验证场景一致。GFramework.Cqrs.Tests/Cqrs/CqrsDispatcherCacheTests.cs (1)
227-227:ConfigureAwait(false)的改动合理在
DrainAsync中这样处理可减少上下文捕获,且不改变该测试对可观察行为的验证目标。GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheBehavior.cs (1)
6-25: 管道行为实现正确且最小化直接转发到
next的实现非常适合作为缓存路径测试的最小行为体,没有引入额外副作用。GFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequestHandler.cs (1)
6-20: 测试处理器设计符合用途固定字符串返回值有助于稳定验证“按响应类型缓存”的路径,写法简洁且与同类测试替身保持一致。
GFramework.Cqrs.Tests/Cqrs/PrivateConstructorNotificationHandlerRegistry.cs (1)
21-30: 与上一处相同:Register的 XML 文档缺少<exception>。这里同样存在空参数抛异常但未在文档中声明的问题,建议按上一条评论统一补齐。
GFramework.Cqrs.Tests/Cqrs/GeneratedNotificationHandlerRegistry.cs (1)
14-23: 重复项:Register方法注释仍缺少<exception>。建议与前述注册器一起批量补齐,保持测试注册器文档风格一致。
GFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotification.cs (1)
5-8: 实现清晰,测试意图明确。该通知记录类型保持最小可用实现,适合作为生成注册路径验证的测试载体。
GFramework.Cqrs.Tests/Cqrs/ReflectionFallbackNotificationContainer.cs (1)
13-30: 反射回退测试建模合理。通过公开
Type+ 私有嵌套处理器的组合,能够稳定覆盖“生成注册器 + 反射补扫”路径。GFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotificationHandler.cs (1)
12-21: 处理器实现简洁且符合测试桩用途。
Handle保持无副作用并返回已完成任务,便于稳定验证注册行为。GFramework.Core.Tests/Logging/TestLogger.cs (1)
6-45: 文档与职责边界清晰,适合作为可复用测试日志器。这部分实现简洁,
AbstractLogger扩展点和LogEntry快照模型都很明确。GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs (1)
8-48: 接口契约实现完整,测试意图表达清楚。
MinLevel与CreateLogger(string name)的实现与ILoggerFactoryProvider契约一致,且注释覆盖充分。GFramework.Core.Tests/Events/EmptyEvent.cs (2)
3-5: XML 注释表达清晰,适合作为空事件语义说明。这一段注释与类型用途一致,可读性很好。
6-6: 此代码是有效的 C# 11+ 语法,无需修改。
public sealed class EmptyEvent;是 C# 11 引入的文件作用域类型声明语法,与文件作用域命名空间配合使用时完全有效。当前项目目标 net10.0(C# 14.0),完全支持此语法。此代码不会导致编译失败,无需修改为传统的空类型体形式。GFramework.Core.Tests/Events/TestEvent.cs (1)
3-5:TestEvent及ReceivedValue的文档注释与语义一致。注释粒度和措辞都很清楚,便于测试代码阅读与维护。
Also applies to: 8-10
GFramework.Core.Tests/Resource/TestResource.cs (1)
3-17: 实现清晰,可直接复用到资源管理相关测试中。类型职责单一,命名和注释可读性都很好。
GFramework.Cqrs.Tests/Cqrs/DeterministicOrderNotification.cs (1)
5-8: 实现清晰,通知契约定义合理。该通知类型保持最小化且语义明确,适合作为稳定顺序测试的输入模型。
GFramework.Cqrs.Tests/Cqrs/ZetaDeterministicNotificationHandler.cs (1)
18-22: 处理器实现直接且契约匹配。记录执行顺序并返回已完成任务的实现与当前测试目标一致。
GFramework.Cqrs.Tests/Cqrs/AlphaDeterministicNotificationHandler.cs (1)
18-22: 实现与测试断言目标一致。通过记录
Alpha处理器名称来支撑顺序断言,行为清晰且可读性良好。GFramework.Core.Tests/Architectures/TestArchitectureBase.cs (1)
12-47: 阶段历史封装调整合理,变更方向正确。
_phaseHistory私有化并通过IReadOnlyList暴露,配合事件记录阶段,整体可读性和封装性都更好。GFramework.Core.Tests/Architectures/TestRegistry.cs (1)
6-25: 测试注册表抽象清晰,接口边界合适。只读暴露
RegisteredConfigs,并通过Register控制写入,适合当前测试场景。GFramework.Core.Tests/Architectures/TestRegistryInitializationHook.cs (1)
17-32: 钩子实现与基类生命周期契约一致。构造参数透传与
RegisterConfig的注册行为都准确,测试替身可用性良好。ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md (1)
9-70: RP-087 跟踪信息完整,恢复入口可直接使用。本次更新同时覆盖了阶段推进、验证真值、风险收敛和下一步恢复点,结构清晰。
As per coding guidelines "Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point."
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md (1)
3-51: Trace 记录粒度合适,执行链路可追溯。RP-087 的背景、实施、验证与收口动作都已形成闭环,便于后续接力。
As per coding guidelines "Contributors MUST maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work, recording the current date, key decisions, validation milestones, and the immediate next step."GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs (1)
1-1:using System;的引入合理。与
Array.Empty<string>()的使用保持一致,变更安全。GFramework.Core.Tests/Architectures/AnotherTestArchitectureContext.cs (1)
3-8: 测试专用上下文类型拆分合理。独立文件化后更利于复用与维护,且类型职责清晰。
GFramework.Core.Tests/Architectures/TestArchitecture.cs (1)
5-15: 这个最小测试桩的边界把得很准。只保留
GameContext绑定测试需要的最小行为,空的OnInitialize()也避免把额外初始化副作用带进用例里。GFramework.Core.Tests/Architectures/TestArchitectureContextWithRegistry.cs (1)
12-33: 这个测试上下文扩展点收得很干净。只在
GetUtility<TUtility>()上拦截TestRegistry,其余解析仍然回退到基类实现,影响面很小。Based on learnings: "Use IArchitectureContext and Provider classes to propagate context capabilities between components rather than direct coupling to implementation details"
GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs (1)
1-10: 不需要添加显式的using Microsoft.Extensions.DependencyInjection;
GFramework.Core.Tests/GlobalUsings.cs已经通过global using Microsoft.Extensions.DependencyInjection;为整个测试项目提供了该命名空间。根据该仓库的模式,不应该在文件中标记已由 GlobalUsings.cs 覆盖的导入。> Likely an incorrect or invalid review comment.GFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs (1)
1-10: 此注释不适用。
Microsoft.Extensions.DependencyInjection已通过GFramework.Core.Tests/GlobalUsings.cs的global using指令在项目级别提供。GFramework仓库使用手动GlobalUsings.cs文件向测试项目全局导入常见命名空间,无需在个别文件中重复声明。> Likely an incorrect or invalid review comment.
- 修复测试架构上下文、生命周期钩子与注册表初始化钩子的评审问题,避免静默成功或错误共享状态 - 补充 TestResourceLoader、TestLogger、CapturingLoggerFactoryProvider 与 CQRS 测试辅助类型的契约文档和并发语义 - 新增测试覆盖并更新 analyzer-warning-reduction 活跃跟踪,记录 PR #300 跟进验证与现存 Cqrs warning blocker
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #1000
🎉 All tests passed!Slowest Tests
± Comparison with run #998 at d9c621b | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 49 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 (1)
GFramework.Core/Architectures/RegistryInitializationHookBase.cs (1)
32-43:⚠️ Potential issue | 🟡 Minor补上
OnPhase的<exception>文档。这里新增了
ArgumentNullException.ThrowIfNull(architecture),但公开生命周期入口的 XML 注释还没有说明这个异常契约。既然这次改动已经改变了空参行为,文档也要同步更新。As per coding guidelines, "All public, protected, and internal types and members MUST include XML documentation comments (
///) with<summary>,<param>,<returns>,<exception>, and<remarks>where applicable" and "Any change to public API, lifecycle semantics, module behavior, or extension points MUST update the related XML docs".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Core/Architectures/RegistryInitializationHookBase.cs` around lines 32 - 43, 为 OnPhase(ArchitecturePhase phase, IArchitecture architecture) 方法补充 XML 文档的 <exception> 节,明确指出当 architecture 为 null 时会抛出 ArgumentNullException(因为方法体新增了 ArgumentNullException.ThrowIfNull(architecture)),并在该节中简短描述触发条件(architecture 为 null)及异常类型;同时检查并保持现有 <summary>, <param> 和 <remarks> 与新添加的 <exception> 描述一致。
🧹 Nitpick comments (1)
GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs (1)
48-48: 建议让MinLevel读写与CreateLogger使用同一同步策略。当前
MinLevel可在并发下被修改,而CreateLogger读取时未同步;这会让同一批创建的 logger 级别不稳定。建议将MinLevel改为带锁的后备字段,或在创建时于锁内读取。As per coding guidelines: "When adding caching, pooling, or shared mutable state, document thread-safety assumptions and failure modes in C#."可选改法(保持接口不变)
internal sealed class CapturingLoggerFactoryProvider : ILoggerFactoryProvider { private readonly List<TestLogger> _loggers = []; private readonly Lock _sync = new(); + private LogLevel _minLevel; @@ public CapturingLoggerFactoryProvider(LogLevel minLevel = LogLevel.Info) { - MinLevel = minLevel; + _minLevel = minLevel; } @@ - public LogLevel MinLevel { get; set; } + public LogLevel MinLevel + { + get + { + lock (_sync) + { + return _minLevel; + } + } + set + { + lock (_sync) + { + _minLevel = value; + } + } + } @@ public ILogger CreateLogger(string name) { - var logger = new TestLogger(name, MinLevel); - lock (_sync) { + var logger = new TestLogger(name, _minLevel); _loggers.Add(logger); + return logger; } - - return logger; } }Also applies to: 55-65
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs` at line 48, MinLevel is a public mutable property that can be changed concurrently while CreateLogger reads it without synchronization, causing inconsistent logger levels; update CapturingLoggerFactoryProvider to use a single synchronization strategy by either making MinLevel backed by a private field with lock-protected getter/setter or by reading the MinLevel value inside the same lock used in CreateLogger (e.g., lock around the backing field access and logger creation) so that all loggers created in a batch observe a consistent level; document the thread-safety assumption on the class accordingly.
🤖 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/traces/analyzer-warning-reduction-trace.md`:
- Around line 3-84: The active trace file currently contains completed stage
histories (RP-083 through RP-087) that must be archived; remove the detailed
historical blocks under the RP-087 and RP-088 headings so the file only retains
the current recovery point, active facts/risks, immediate next step, and an
archive pointer, then create separate archive markdown(s) (e.g., an archive for
"RP-083–RP-087") containing the full histories you removed and add a concise
pointer line under the RP-088 heading referencing that archive; ensure the trace
entry for RP-088 itself follows the guideline (one-line recovery point, active
facts/risks, next steps, archive pointer) and that headings "RP-088" and
"RP-087" remain as identifiers to locate and prune the detailed content.
In `@GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs`:
- Around line 164-199: The test context's event API (SendEvent<TEvent>(),
SendEvent<TEvent>(TEvent), RegisterEvent<TEvent>(),
UnRegisterEvent<TEvent>(Action<TEvent>)) currently no-ops which hides failures;
either hook these methods into the shared event bus used by
TestArchitectureContext (forward calls to that bus so events get
published/subscribed) or make them explicitly fail by throwing
NotSupportedException (and return no successful DefaultUnRegister). Update
RegisterEvent<TEvent> to return a meaningful IUnRegister tied to the bus or
throw, and have SendEvent overloads and UnRegisterEvent forward to the same
event bus implementation or throw NotSupportedException to make unsupported
usage explicit.
---
Outside diff comments:
In `@GFramework.Core/Architectures/RegistryInitializationHookBase.cs`:
- Around line 32-43: 为 OnPhase(ArchitecturePhase phase, IArchitecture
architecture) 方法补充 XML 文档的 <exception> 节,明确指出当 architecture 为 null 时会抛出
ArgumentNullException(因为方法体新增了
ArgumentNullException.ThrowIfNull(architecture)),并在该节中简短描述触发条件(architecture 为
null)及异常类型;同时检查并保持现有 <summary>, <param> 和 <remarks> 与新添加的 <exception> 描述一致。
---
Nitpick comments:
In `@GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs`:
- Line 48: MinLevel is a public mutable property that can be changed
concurrently while CreateLogger reads it without synchronization, causing
inconsistent logger levels; update CapturingLoggerFactoryProvider to use a
single synchronization strategy by either making MinLevel backed by a private
field with lock-protected getter/setter or by reading the MinLevel value inside
the same lock used in CreateLogger (e.g., lock around the backing field access
and logger creation) so that all loggers created in a batch observe a consistent
level; document the thread-safety assumption on the class accordingly.
🪄 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: bdd9ae32-9c1c-4439-ae97-dae72f2fdb6a
📒 Files selected for processing (14)
GFramework.Core.Tests/Architectures/TestArchitectureContext.csGFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.csGFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.csGFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.csGFramework.Core.Tests/Logging/TestLogger.csGFramework.Core.Tests/Resource/TestResourceLoader.csGFramework.Core/Architectures/RegistryInitializationHookBase.csGFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.csGFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.csGFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.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 (2)
- GFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.cs
- GFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs
🚧 Files skipped from review as they are similar to previous changes (3)
- GFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.cs
- GFramework.Core.Tests/Resource/TestResourceLoader.cs
- GFramework.Core.Tests/Architectures/TestArchitectureContext.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)
**/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.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.csGFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.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>where applicable
Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, edge cases, registration order, lifecycle sequencing, and generated code assumptions
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Generated logic and generator pipelines MUST explain what is generated, why it is generated, semantic assumptions, and diagnostics or fallback behavior
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling
Do not rely on implicit imports; declare every requiredusingexplicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace patternGFramework.{Module}.{Feature}with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces withIprefix, parameters and locals in camelCase, private fields in_camelCase
Use 4 spaces for indentation in C# files; do not use tabs
Use Allman braces in C# files
Keepusingdirectives at the top of C# files and sort them consistently
Prefer one primary type per C# file unless the surrounding project already uses a different local pattern
Keep...
Files:
GFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csGFramework.Core.Tests/Logging/TestLogger.csGFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.csGFramework.Core/Architectures/RegistryInitializationHookBase.csGFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
**/*{Startup,Init,Register,Setup,Configure}*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
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(...)
Files:
GFramework.Core/Architectures/RegistryInitializationHookBase.cs
ai-plan/public/*/traces/**
📄 CodeRabbit inference engine (AGENTS.md)
Contributors MUST maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work, recording the current date, key decisions, validation milestones, and the immediate next step
Files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
ai-plan/public/*/todos/**
📄 CodeRabbit inference engine (AGENTS.md)
ai-plan/public/*/todos/**: When working from a tracked implementation plan, contributors MUST update the corresponding tracking document underai-plan/public/<topic>/todos/in the same change
Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point
Active tracking and trace files are recovery entrypoints, not append-only changelogs; they MUST stay concise enough forbootto locate the current recovery point quickly
Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step so another contributor or subagent can continue the work safely
When completed and validated stages begin to accumulate, contributors MUST archive their detailed history out of the activetodos/andtraces/entry files in the same change, keeping only the current recovery point, active facts, active risks, immediate next step, and pointers to archive files
When a task spans multiple commits or is likely to exceed a single agent context window, update both the recovery document and the trace at each meaningful milestone before pausing or handing work off
If subagents are used on a complex task, the main agent MUST capture the delegated scope and any accepted findings in the active recovery document or trace before continuing implementation
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🧠 Learnings (20)
📓 Common learnings
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`
📚 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.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Preserve snapshot-based verification patterns already used in the repository for source generator tests
Applied to files:
GFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.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.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csGFramework.Core.Tests/Logging/TestLogger.csGFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.csGFramework.Core/Architectures/RegistryInitializationHookBase.csGFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csGFramework.Core/Architectures/RegistryInitializationHookBase.csGFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Keep tests focused on observable behavior, not implementation trivia
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Regression fixes should include a test that fails before the fix and passes after it
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : When a public C# API defines multiple contract branches, tests MUST cover the meaningful variants including null, empty, default, and filtered inputs when those branches change behavior
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Public API changes must be covered by unit or integration tests in C#
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
📚 Learning: 2026-04-16T13:26:01.780Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:26:01.780Z
Learning: In the GeWuYou/GFramework repository, the test project `GFramework.SourceGenerators.Tests` provides `global using NUnit.Framework;` via its `GlobalUsings.cs`. Do not flag missing `using NUnit.Framework;` directives in test files within this project, as the global using already covers it. The project-wide GlobalUsings.cs pattern is used broadly to supply common namespaces (including NUnit, System.IO, etc.) without per-file imports.
Applied to files:
GFramework.Core/Architectures/RegistryInitializationHookBase.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: Architecture implementations should follow the four-layer structure: IArchitecture (lifecycle management), IContextAware (unified context access), IModel (data/state layer), ISystem (business logic layer), and IUtility (stateless utility layer)
Applied to files:
GFramework.Core/Architectures/RegistryInitializationHookBase.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Use the namespace pattern `GFramework.{Module}.{Feature}` with PascalCase segments in C# files
Applied to files:
GFramework.Core/Architectures/RegistryInitializationHookBase.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Applied to files:
GFramework.Core/Architectures/RegistryInitializationHookBase.csGFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/traces/** : Contributors MUST maintain a matching execution trace under `ai-plan/public/<topic>/traces/` for complex work, recording the current date, key decisions, validation milestones, and the immediate next step
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, edge cases, registration order, lifecycle sequencing, and generated code assumptions
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: Use IArchitectureContext and Provider classes to propagate context capabilities between components rather than direct coupling to implementation details
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: When the goal is to inspect or reduce warnings, establish the warning baseline by running `dotnet clean` and then `dotnet build`, not repeated incremental builds
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : When a C# method approaches analyzer complexity limits, extract named helper methods by semantic phase (parsing, normalization, validation, diagnostics) instead of silencing the warning
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : When adding C# 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/todos/analyzer-warning-reduction-tracking.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Any change to public API, lifecycle semantics, module behavior, or extension points MUST update the related XML docs
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🔇 Additional comments (4)
GFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.cs (2)
9-21: XML 文档契约完整,和运行时行为一致。该类型与
Register方法的文档清晰,<exception>也与空值检查保持一致。
22-32: 注册逻辑与防御式校验实现正确。
ThrowIfNull、防止空参数以及通知处理器的瞬态映射都实现到位,日志也便于定位测试路径。GFramework.Core.Tests/Logging/TestLogger.cs (1)
32-41: 线程安全与可观测性实现良好。Line 36-39 与 Line 51-54 对同一同步对象加锁,且
Logs返回快照副本,这样测试断言不会观察到被并发修改的集合,设计很稳妥。Also applies to: 49-55
GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs (1)
34-43: 日志器集合快照暴露方式合理。Line 38-41 在锁内复制并返回快照,避免调用方持有内部可变集合,适合跨测试断言读取。
- 修复 TestArchitectureContextV3 的共享事件总线语义并补充对应回归测试 - 优化 CapturingLoggerFactoryProvider 的最小级别同步策略并补充验证 - 更新 RegistryInitializationHookBase 异常文档与 analyzer warning reduction 的恢复文档归档
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #1001
🎉 All tests passed!Slowest Tests
± Comparison with run #1000 at c805e39 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 50 runs. Github Test Reporter by CTRF 💚 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs (1)
30-35: 建议把TestArchitectureContext和TestArchitectureContextV3的共同行为抽到共享测试基础设施里。这个测试桩现在把容器解析、
EventBus接线和整套 legacy CQRS 占位实现又复制了一遍,而GFramework.Core.Tests/Architectures/TestArchitectureContext.cs已经维护着几乎同一套契约。前面事件 API 静默no-op的回归,本质上就是两份测试桩漂移造成的;继续并行维护这两份IArchitectureContext实现,后面再改事件或 CQRS 语义时很容易再次只修一处。建议提取一个共享基类或组合 helper,只保留 V3 的差异点。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs` around lines 30 - 35, TestArchitectureContextV3 and TestArchitectureContext share duplicated setup (MicrosoftDiContainer, DefaultEnvironment, EventBus and legacy CQRS stubs); extract the common wiring into a shared test base or helper (e.g., TestArchitectureContextBase or ArchitectureTestHelpers) that implements the shared IArchitectureContext behavior (container creation, environment, EventBus wiring and placeholder CQRS setup) and have both TestArchitectureContext and TestArchitectureContextV3 delegate to or inherit from it, leaving only V3-specific differences in TestArchitectureContextV3; update references to MicrosoftDiContainer, DefaultEnvironment, EventBus and any CQRS placeholder methods so they live in the shared base/helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs`:
- Around line 19-43: Add regression tests to cover UnRegisterEvent and
null-argument branches: for both TestArchitectureContext and
TestArchitectureContextV3 add a test that RegisterEvent<TestEventV2>(...) then
UnRegisterEvent<TestEventV2>(...) then SendEvent<TestEventV2>() and assert the
handler is not called, and add tests that calling RegisterEvent(null),
UnRegisterEvent(null) and SendEvent(null) each throw ArgumentNullException;
reference the existing methods RegisterEvent, UnRegisterEvent, SendEvent and the
types TestArchitectureContext, TestArchitectureContextV3, TestEventV2 so the
tests fail before the bug fix and pass after.
---
Nitpick comments:
In `@GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs`:
- Around line 30-35: TestArchitectureContextV3 and TestArchitectureContext share
duplicated setup (MicrosoftDiContainer, DefaultEnvironment, EventBus and legacy
CQRS stubs); extract the common wiring into a shared test base or helper (e.g.,
TestArchitectureContextBase or ArchitectureTestHelpers) that implements the
shared IArchitectureContext behavior (container creation, environment, EventBus
wiring and placeholder CQRS setup) and have both TestArchitectureContext and
TestArchitectureContextV3 delegate to or inherit from it, leaving only
V3-specific differences in TestArchitectureContextV3; update references to
MicrosoftDiContainer, DefaultEnvironment, EventBus and any CQRS placeholder
methods so they live in the shared base/helper.
🪄 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: 932d0578-cd59-4fd5-8ae8-826b86ead076
📒 Files selected for processing (8)
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.csGFramework.Core/Architectures/RegistryInitializationHookBase.csGFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.csGFramework.Cqrs.Tests/Cqrs/CqrsHandlerRegistrarTests.csai-plan/public/analyzer-warning-reduction/archive/traces/analyzer-warning-reduction-history-rp083-rp088.mdai-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 (3)
- GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs
- GFramework.Cqrs.Tests/Cqrs/CqrsHandlerRegistrarTests.cs
- ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.cs: Apply [Log] attribute for automatic logging field and logging helper method generation
Apply [Priority] attribute for automatic priority comparison implementation generation
Apply [GenerateEnumExtensions] attribute to generate enumeration extension capabilities
Apply [ContextAware] attribute to automatically implement IContextAware boilerplate logic
**/*.cs: All public, protected, and internal types and members MUST include XML documentation comments (///) with<summary>,<param>,<returns>,<exception>, and<remarks>where applicable
Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, edge cases, registration order, lifecycle sequencing, and generated code assumptions
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Generated logic and generator pipelines MUST explain what is generated, why it is generated, semantic assumptions, and diagnostics or fallback behavior
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling
Do not rely on implicit imports; declare every requiredusingexplicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace patternGFramework.{Module}.{Feature}with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces withIprefix, parameters and locals in camelCase, private fields in_camelCase
Use 4 spaces for indentation in C# files; do not use tabs
Use Allman braces in C# files
Keepusingdirectives at the top of C# files and sort them consistently
Prefer one primary type per C# file unless the surrounding project already uses a different local pattern
Keep...
Files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csGFramework.Core/Architectures/RegistryInitializationHookBase.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
**/*{Startup,Init,Register,Setup,Configure}*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
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(...)
Files:
GFramework.Core/Architectures/RegistryInitializationHookBase.cs
ai-plan/public/*/traces/**
📄 CodeRabbit inference engine (AGENTS.md)
Contributors MUST maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work, recording the current date, key decisions, validation milestones, and the immediate next step
Files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
🧠 Learnings (25)
📓 Common learnings
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csGFramework.Core/Architectures/RegistryInitializationHookBase.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Keep tests focused on observable behavior, not implementation trivia
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Regression fixes should include a test that fails before the fix and passes after it
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : When a public C# API defines multiple contract branches, tests MUST cover the meaningful variants including null, empty, default, and filtered inputs when those branches change behavior
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Preserve snapshot-based verification patterns already used in the repository for source generator tests
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Public API changes must be covered by unit or integration tests in C#
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
📚 Learning: 2026-04-06T12:45:43.921Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 190
File: GFramework.Game/Config/GameConfigBootstrap.cs:1-3
Timestamp: 2026-04-06T12:45:43.921Z
Learning: In the GeWuYou/GFramework repository, C# files may omit explicit `using System*` imports because the project-wide `GlobalUsings.cs` (referenced via manual global `using` directives) supplies common namespaces (e.g., `System`, `System.Threading`, `System.Threading.Tasks`). During code review, do not flag missing `using System...` directives in `.cs` files as long as `GlobalUsings.cs` is present/used to provide those namespaces.
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csGFramework.Core/Architectures/RegistryInitializationHookBase.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
📚 Learning: 2026-04-16T13:26:01.780Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:26:01.780Z
Learning: In the GeWuYou/GFramework repository, the test project `GFramework.SourceGenerators.Tests` provides `global using NUnit.Framework;` via its `GlobalUsings.cs`. Do not flag missing `using NUnit.Framework;` directives in test files within this project, as the global using already covers it. The project-wide GlobalUsings.cs pattern is used broadly to supply common namespaces (including NUnit, System.IO, etc.) without per-file imports.
Applied to files:
GFramework.Core/Architectures/RegistryInitializationHookBase.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: Architecture implementations should follow the four-layer structure: IArchitecture (lifecycle management), IContextAware (unified context access), IModel (data/state layer), ISystem (business logic layer), and IUtility (stateless utility layer)
Applied to files:
GFramework.Core/Architectures/RegistryInitializationHookBase.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Use the namespace pattern `GFramework.{Module}.{Feature}` with PascalCase segments in C# files
Applied to files:
GFramework.Core/Architectures/RegistryInitializationHookBase.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Applied to files:
GFramework.Core/Architectures/RegistryInitializationHookBase.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/traces/** : Contributors MUST maintain a matching execution trace under `ai-plan/public/<topic>/traces/` for complex work, recording the current date, key decisions, validation milestones, and the immediate next step
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : When completed and validated stages begin to accumulate, contributors MUST archive their detailed history out of the active `todos/` and `traces/` entry files in the same change, keeping only the current recovery point, active facts, active risks, immediate next step, and pointers to archive files
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.mdai-plan/public/analyzer-warning-reduction/archive/traces/analyzer-warning-reduction-history-rp083-rp088.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : When a task spans multiple commits or is likely to exceed a single agent context window, update both the recovery document and the trace at each meaningful milestone before pausing or handing work off
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : Active tracking and trace files are recovery entrypoints, not append-only changelogs; they MUST stay concise enough for `boot` to locate the current recovery point quickly
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step so another contributor or subagent can continue the work safely
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.mdai-plan/public/analyzer-warning-reduction/archive/traces/analyzer-warning-reduction-history-rp083-rp088.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : If subagents are used on a complex task, the main agent MUST capture the delegated scope and any accepted findings in the active recovery document or trace before continuing implementation
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: For any multi-step refactor, migration, or cross-module task, contributors MUST create or adopt a dedicated recovery document under `ai-plan/public/<topic>/todos/` before making substantive code changes
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.mdai-plan/public/analyzer-warning-reduction/archive/traces/analyzer-warning-reduction-history-rp083-rp088.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: If a task depends on observations from `ai-libs/**`, record the referenced path and conclusion in the active plan or trace when the work is multi-step or complex, rather than editing the third-party reference copy
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : When working from a tracked implementation plan, contributors MUST update the corresponding tracking document under `ai-plan/public/<topic>/todos/` in the same change
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: Use IArchitectureContext and Provider classes to propagate context capabilities between components rather than direct coupling to implementation details
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Governance-only material such as XML audit snapshots, documentation remediation baselines, backlog status, and recovery metadata belongs in `ai-plan/**`, not in public docs
Applied to files:
ai-plan/public/analyzer-warning-reduction/archive/traces/analyzer-warning-reduction-history-rp083-rp088.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to {README.md,docs/**} : Public documentation MUST NOT include governance-only content such as inventory tables, coverage baselines, review queues, batch metrics, recovery points, trace summaries, or 'this still needs a later audit wave' notes
Applied to files:
ai-plan/public/analyzer-warning-reduction/archive/traces/analyzer-warning-reduction-history-rp083-rp088.md
🪛 LanguageTool
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
[grammar] ~30-~30: Ensure spelling is correct
Context: ...PR review follow-up 扩展到 Mediator/* 写集。 - GitHub PR 上的 open threads 在本地提交前仍可能显示为未关闭。 -...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
ai-plan/public/analyzer-warning-reduction/archive/traces/analyzer-warning-reduction-history-rp083-rp088.md
[grammar] ~15-~15: Ensure spelling is correct
Context: ...gisterLifecycleHook 接口行为 - 受影响项目验证通过,GFramework.Cqrs.Tests仍保留既有Mediator/*` warning 基线 #...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~21-~21: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...emental warning 基线后,并行消化 Core.Tests 与 Cqrs.Tests 的低风险 warning - 仓库根 warning 从 288 下...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
- 补齐 TestArchitectureContext 与 TestArchitectureContextV3 的事件注销与空参数契约回归测试 - 整理 TestResourceLoader 的命名空间缩进以收口局部格式噪音 - 更新 analyzer-warning-reduction 的恢复点与验证记录
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #1003
🎉 All tests passed!Slowest Tests
± Comparison with run #1001 at c23c574 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 51 runs. Github Test Reporter by CTRF 💚 |
- 重构 TestArchitectureContext 与 TestArchitectureContextV3 的共享 IArchitectureContext 测试实现到 TestArchitectureContextBase - 更新 gframework-pr-review 技能规则,要求对已验证成立的 nitpick 进行显式 triage - 补充 analyzer-warning-reduction 的恢复点与验证记录
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #1004
🎉 All tests passed!Slowest Tests
± Comparison with run #1003 at e4c5607 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 52 runs. Github Test Reporter by CTRF 💚 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (8)
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md (2)
3-21: (可选)建议把关键验证命令/结果用 fenced code block 包裹,提升后续检索与复用性。当前 RP-091 段落(Line 3-21)记录了
dotnet build、定向dotnet test和git diff --check结果,方向正确。为降低后续排障时“从纯文本里复制命令”的成本,建议将 Line 15-20 中的命令与结果分别用小的 fenced code block 包起来(或至少把命令行单独 code 格式化),这样后续继续跟踪/复盘更快。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md` around lines 3 - 21, In the RP-091 section of analyzer-warning-reduction-trace.md the verification commands and their results are inline plain text; update the block under "验证里程碑" (the dotnet build, dotnet test and git diff --check lines) to wrap each command and its result in small fenced code blocks (or at minimum mark the commands as inline code) so the commands (e.g., "dotnet build GFramework.Core.Tests/GFramework.Core.Tests.csproj -c Release", the targeted "dotnet test ... --filter ...", and "git diff --check") and their outcomes are easy to copy and parse for future reproductions.
22-27: 风险描述方向正确;建议补一条“如何判定仍需处理”的可操作标准(minor)。Line 24-26 说明 open threads 在本地提交前可能显示未关闭,并建议推送后再比对最新 head。建议再补一句“判定仍需处理”的标准,例如:重新
$gframework-pr-review后线程是否仍处于 unresolved 且指向仍在 diff 中的路径/符号。这样后续恢复/继续执行时判断更机械化。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md` around lines 22 - 27, Add a concise, actionable “how to determine still needs work” criterion to the 活跃风险 section: instruct reviewers to re-run the $gframework-pr-review check after pushing and treat a thread as still requiring action if the thread remains "unresolved" and its target (file path/symbol/function name) still appears in the current diff/patch; mention using the original PR "open threads" state as reference and that threads which resolve or no longer map to any symbol in the diff can be considered cleared..agents/skills/gframework-pr-review/SKILL.md (2)
80-80: Line 80 的规则与 Line 31 基本重复;建议用引用/简化降低未来维护风险。Line 31 已经定义了 verified nitpick 的 actionable 处理方式;Line 80 再次用几乎同样的条件描述“real drift/regression risk”。建议将 Line 80 改成更短的“参照上文 Line 31 的 nitpick actionable triage 规则”,以减少未来有人只改一处导致语义分叉。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.agents/skills/gframework-pr-review/SKILL.md at line 80, 第80行的规则重复了第31行关于“verified nitpick 的 actionable 处理方式”(即当 latest-head `Nitpick comment` 在本地验证后确认为真实漂移或回归风险时应作为可执行的 review input 处理)的描述;请将第80行的长句替换为简短引用/指示,例如“参照第31行的 verified nitpick actionable triage 规则”,以去重并避免未来维护出现语义分叉(保留对 latest-head `Nitpick comment` 和 verified nitpick actionable triage 的明确引用以便定位)。
31-32: 建议补充“可执行/不可执行 nitpick”判定边界,避免不同代理出现三分法不一致。当前规则要求:verified 的 nitpick 只要指向真实漂移/回归风险就必须 actionable,并要么修复要么解释延期(Line 31)。这很好,但为了让不同代理在“有风险但短期无落地方可落地”这种情况保持一致,建议在同一段落补一句明确定义,例如:
- 哪些情形算“drift/regression/maintainability risk”(给出 2-3 个可检查点:契约变更/行为语义改变/回归测试缺失/重复基础设施等)
- 若明确是 risk 但无法在本 PR 结束前给出工程修复路径时,允许使用“解释延期 + 给出下游修复条目/owner/时间窗”的模板化文本(而不是泛泛“deferred”)。
这样不会改变现有策略,只是减少解释成本和 triage 口径漂移。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.agents/skills/gframework-pr-review/SKILL.md around lines 31 - 32, Augment the existing rule about verified nitpicks (the bullet that begins "If a verified nitpick...") by inserting a concise clarifying sentence that (1) enumerates 2–3 concrete criteria that count as "drift/regression/maintainability risk" (e.g., contract/API change, behavioral/semantic change, missing regression tests or duplicated infra), and (2) provides a templated deferred-resolution option when an immediate engineering fix cannot be completed in the PR: require the reviewer/author to "explain deferment + create downstream issue with owner and target timeframe" (i.e., a one-line template like "Deferred: reason; issue=#; owner=@; ETA=YYYY-MM-DD"). Make the change adjacent to the existing verified-nitpick sentence so tools and agents can apply a consistent three-way decision (actionable / deferred-with-template / false-positive).ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md (1)
25-27: (可选)将“本轮没有触碰 …”改为更中性的措辞,减少歧义与语气风险。当前表述(Line 26)“本轮没有触碰
Mediator/*、YamlConfigSchemaValidator...…”属于语气化表达。建议改为更中性的“本轮未涉及/未修改/无交集于 …”,避免后续读者误解为“依赖存在但未修复”等语义差异。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md` around lines 25 - 27, 将文中的语气化表述 "本轮没有触碰 `Mediator/*`、`YamlConfigSchemaValidator*` 或 `GFramework.Core.Tests` 的整项目格式基线波次" 替换为更中性的措辞,例如 "本轮未修改 `Mediator/*`、`YamlConfigSchemaValidator*` 或 `GFramework.Core.Tests` 的整项目格式基线波次" 或 "本轮与 `Mediator/*`、`YamlConfigSchemaValidator*` 及 `GFramework.Core.Tests` 无交集/未涉及修改",以减少歧义并保持描述客观;在文件 ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md 中直接替换该短语即可。GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs (2)
97-139: 建议抽取 Legacy 入口断言助手,降低维护成本。当前两个用例的断言基本镜像,可提取一个私有断言方法并通过上下文工厂复用,避免后续改动时双处同步。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs` around lines 97 - 139, Extract the repeated assertions into a private helper (e.g., AssertLegacyEntriesThrow) that accepts a context factory or the base context type (like Func<TestArchitectureContextBase> or TestArchitectureContextBase) and performs the six assertions currently duplicated; then call this helper from both Legacy_Entries_Should_Throw_Or_Return_Faulted_Tasks and Legacy_Entries_On_TestArchitectureContextV3_Should_Throw_Or_Return_Faulted_Tasks passing new TestArchitectureContext() and new TestArchitectureContextV3() respectively. Ensure the helper references the same assertion calls (SendCommand, SendCommand with result, SendQuery, SendCommandAsync, SendCommandAsync with result, SendQueryAsync) so behavior is preserved and remove the duplicated assertion blocks from the two tests.
31-55: 建议将两个事件总线测试参数化,减少重复。两段断言逻辑一致,仅上下文构造不同。可复用
EventContextFactories合并为单个参数化测试,后续扩展上下文类型时更稳。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs` around lines 31 - 55, Combine the two duplicate tests into one parameterized test that iterates over context factories (e.g. use NUnit's TestCaseSource/EventContextFactories) so both TestArchitectureContext and TestArchitectureContextV3 are exercised by the same logic; replace the two methods RegisterEvent_And_SendEvent_Should_Use_Shared_EventBus and RegisterEvent_And_SendEvent_On_TestArchitectureContextV3_Should_Use_Shared_EventBus with a single test (e.g. RegisterEvent_And_SendEvent_Should_Use_Shared_EventBus) that takes a factory/delegate to create the context, invokes context.RegisterEvent<TestEventV2>(...) and context.SendEvent<TestEventV2>(), and asserts eventReceived is true, and add both factories (creating new TestArchitectureContext and new TestArchitectureContextV3) to EventContextFactories.GFramework.Core.Tests/Architectures/TestArchitectureContextBase.cs (1)
33-35: 建议缓存执行器实例,避免属性 getter 的隐式分配。
CommandExecutor与QueryExecutor每次访问都会创建新实例;对测试基类来说通常不需要这种波动语义,改为缓存字段更稳定。As per coding guidelines, "Avoid hidden side effects in property getters, constructors, and registration helpers in C#".♻️ 建议修改
public abstract class TestArchitectureContextBase : IArchitectureContext { private readonly MicrosoftDiContainer _container = new(); private readonly DefaultEnvironment _environment = new(); private readonly EventBus _eventBus = new(); + private readonly CommandExecutor _commandExecutor = new(); + private readonly QueryExecutor _queryExecutor = new(); @@ - public ICommandExecutor CommandExecutor => new CommandExecutor(); + public ICommandExecutor CommandExecutor => _commandExecutor; @@ - public IQueryExecutor QueryExecutor => new QueryExecutor(); + public IQueryExecutor QueryExecutor => _queryExecutor;Also applies to: 51-59
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@GFramework.Core.Tests/Architectures/TestArchitectureContextBase.cs` around lines 33 - 35, The CommandExecutor and QueryExecutor properties in TestArchitectureContextBase currently create new instances on each access (hidden allocation); change them to use private readonly or lazy-initialized backing fields so the same executor instance is returned on subsequent accesses. Locate the properties named CommandExecutor and QueryExecutor in class TestArchitectureContextBase and introduce cached backing fields (e.g., _commandExecutor, _queryExecutor) initialized once (either at declaration or first access) and have the property getters return those fields instead of constructing new instances each time.
🤖 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 53-57: Update the tracking doc so its validation steps match the
trace document: replace or edit the sentence "仓库级真值只以同轮 `dotnet clean` 后的
`dotnet build` 为准" to remove the `dotnet clean` requirement and state the same
validation sequence as in analyzer-warning-reduction-trace.md (i.e., `dotnet
build` / targeted `dotnet test` / `git diff --check`), ensuring the phrasing
exactly matches the trace milestone wording to avoid future confusion.
- Around line 18-27: In the tracking doc, replace the incorrect file-count
phrase "6 个已修改文件与 1 个新增文件" with the correct counts "18 个已修改文件与 38 个新增文件(合计 56
个变更文件)", and ensure the surrounding summary lines reflect the corrected totals;
locate the phrase in analyzer-warning-reduction-tracking.md and update it in the
same commit (verify with git diff 6cc87a9...HEAD).
---
Nitpick comments:
In @.agents/skills/gframework-pr-review/SKILL.md:
- Line 80: 第80行的规则重复了第31行关于“verified nitpick 的 actionable 处理方式”(即当 latest-head
`Nitpick comment` 在本地验证后确认为真实漂移或回归风险时应作为可执行的 review input
处理)的描述;请将第80行的长句替换为简短引用/指示,例如“参照第31行的 verified nitpick actionable triage
规则”,以去重并避免未来维护出现语义分叉(保留对 latest-head `Nitpick comment` 和 verified nitpick
actionable triage 的明确引用以便定位)。
- Around line 31-32: Augment the existing rule about verified nitpicks (the
bullet that begins "If a verified nitpick...") by inserting a concise clarifying
sentence that (1) enumerates 2–3 concrete criteria that count as
"drift/regression/maintainability risk" (e.g., contract/API change,
behavioral/semantic change, missing regression tests or duplicated infra), and
(2) provides a templated deferred-resolution option when an immediate
engineering fix cannot be completed in the PR: require the reviewer/author to
"explain deferment + create downstream issue with owner and target timeframe"
(i.e., a one-line template like "Deferred: reason; issue=#; owner=@;
ETA=YYYY-MM-DD"). Make the change adjacent to the existing verified-nitpick
sentence so tools and agents can apply a consistent three-way decision
(actionable / deferred-with-template / false-positive).
In
`@ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md`:
- Around line 25-27: 将文中的语气化表述 "本轮没有触碰 `Mediator/*`、`YamlConfigSchemaValidator*`
或 `GFramework.Core.Tests` 的整项目格式基线波次" 替换为更中性的措辞,例如 "本轮未修改
`Mediator/*`、`YamlConfigSchemaValidator*` 或 `GFramework.Core.Tests` 的整项目格式基线波次"
或 "本轮与 `Mediator/*`、`YamlConfigSchemaValidator*` 及 `GFramework.Core.Tests`
无交集/未涉及修改",以减少歧义并保持描述客观;在文件
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
中直接替换该短语即可。
In
`@ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md`:
- Around line 3-21: In the RP-091 section of analyzer-warning-reduction-trace.md
the verification commands and their results are inline plain text; update the
block under "验证里程碑" (the dotnet build, dotnet test and git diff --check lines)
to wrap each command and its result in small fenced code blocks (or at minimum
mark the commands as inline code) so the commands (e.g., "dotnet build
GFramework.Core.Tests/GFramework.Core.Tests.csproj -c Release", the targeted
"dotnet test ... --filter ...", and "git diff --check") and their outcomes are
easy to copy and parse for future reproductions.
- Around line 22-27: Add a concise, actionable “how to determine still needs
work” criterion to the 活跃风险 section: instruct reviewers to re-run the
$gframework-pr-review check after pushing and treat a thread as still requiring
action if the thread remains "unresolved" and its target (file
path/symbol/function name) still appears in the current diff/patch; mention
using the original PR "open threads" state as reference and that threads which
resolve or no longer map to any symbol in the diff can be considered cleared.
In `@GFramework.Core.Tests/Architectures/TestArchitectureContextBase.cs`:
- Around line 33-35: The CommandExecutor and QueryExecutor properties in
TestArchitectureContextBase currently create new instances on each access
(hidden allocation); change them to use private readonly or lazy-initialized
backing fields so the same executor instance is returned on subsequent accesses.
Locate the properties named CommandExecutor and QueryExecutor in class
TestArchitectureContextBase and introduce cached backing fields (e.g.,
_commandExecutor, _queryExecutor) initialized once (either at declaration or
first access) and have the property getters return those fields instead of
constructing new instances each time.
In `@GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs`:
- Around line 97-139: Extract the repeated assertions into a private helper
(e.g., AssertLegacyEntriesThrow) that accepts a context factory or the base
context type (like Func<TestArchitectureContextBase> or
TestArchitectureContextBase) and performs the six assertions currently
duplicated; then call this helper from both
Legacy_Entries_Should_Throw_Or_Return_Faulted_Tasks and
Legacy_Entries_On_TestArchitectureContextV3_Should_Throw_Or_Return_Faulted_Tasks
passing new TestArchitectureContext() and new TestArchitectureContextV3()
respectively. Ensure the helper references the same assertion calls
(SendCommand, SendCommand with result, SendQuery, SendCommandAsync,
SendCommandAsync with result, SendQueryAsync) so behavior is preserved and
remove the duplicated assertion blocks from the two tests.
- Around line 31-55: Combine the two duplicate tests into one parameterized test
that iterates over context factories (e.g. use NUnit's
TestCaseSource/EventContextFactories) so both TestArchitectureContext and
TestArchitectureContextV3 are exercised by the same logic; replace the two
methods RegisterEvent_And_SendEvent_Should_Use_Shared_EventBus and
RegisterEvent_And_SendEvent_On_TestArchitectureContextV3_Should_Use_Shared_EventBus
with a single test (e.g. RegisterEvent_And_SendEvent_Should_Use_Shared_EventBus)
that takes a factory/delegate to create the context, invokes
context.RegisterEvent<TestEventV2>(...) and context.SendEvent<TestEventV2>(),
and asserts eventReceived is true, and add both factories (creating new
TestArchitectureContext and new TestArchitectureContextV3) to
EventContextFactories.
🪄 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: 689c37d6-18ff-4326-83ba-26610762a3e8
📒 Files selected for processing (8)
.agents/skills/gframework-pr-review/SKILL.mdGFramework.Core.Tests/Architectures/TestArchitectureContext.csGFramework.Core.Tests/Architectures/TestArchitectureContextBase.csGFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csGFramework.Core.Tests/Architectures/TestArchitectureContextV3.csGFramework.Core.Tests/Resource/TestResourceLoader.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 (2)
- GFramework.Core.Tests/Architectures/TestArchitectureContext.cs
- GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.cs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.cs: Apply [Log] attribute for automatic logging field and logging helper method generation
Apply [Priority] attribute for automatic priority comparison implementation generation
Apply [GenerateEnumExtensions] attribute to generate enumeration extension capabilities
Apply [ContextAware] attribute to automatically implement IContextAware boilerplate logic
**/*.cs: All public, protected, and internal types and members MUST include XML documentation comments (///) with<summary>,<param>,<returns>,<exception>, and<remarks>where applicable
Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, edge cases, registration order, lifecycle sequencing, and generated code assumptions
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Generated logic and generator pipelines MUST explain what is generated, why it is generated, semantic assumptions, and diagnostics or fallback behavior
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling
Do not rely on implicit imports; declare every requiredusingexplicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace patternGFramework.{Module}.{Feature}with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces withIprefix, parameters and locals in camelCase, private fields in_camelCase
Use 4 spaces for indentation in C# files; do not use tabs
Use Allman braces in C# files
Keepusingdirectives at the top of C# files and sort them consistently
Prefer one primary type per C# file unless the surrounding project already uses a different local pattern
Keep...
Files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csGFramework.Core.Tests/Resource/TestResourceLoader.csGFramework.Core.Tests/Architectures/TestArchitectureContextBase.cs
ai-plan/public/*/traces/**
📄 CodeRabbit inference engine (AGENTS.md)
Contributors MUST maintain a matching execution trace under
ai-plan/public/<topic>/traces/for complex work, recording the current date, key decisions, validation milestones, and the immediate next step
Files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
ai-plan/public/*/todos/**
📄 CodeRabbit inference engine (AGENTS.md)
ai-plan/public/*/todos/**: When working from a tracked implementation plan, contributors MUST update the corresponding tracking document underai-plan/public/<topic>/todos/in the same change
Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point
Active tracking and trace files are recovery entrypoints, not append-only changelogs; they MUST stay concise enough forbootto locate the current recovery point quickly
Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step so another contributor or subagent can continue the work safely
When completed and validated stages begin to accumulate, contributors MUST archive their detailed history out of the activetodos/andtraces/entry files in the same change, keeping only the current recovery point, active facts, active risks, immediate next step, and pointers to archive files
When a task spans multiple commits or is likely to exceed a single agent context window, update both the recovery document and the trace at each meaningful milestone before pausing or handing work off
If subagents are used on a complex task, the main agent MUST capture the delegated scope and any accepted findings in the active recovery document or trace before continuing implementation
Files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🧠 Learnings (23)
📓 Common learnings
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`
📚 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: All coding rules must be followed strictly as defined in AGENTS.md
Applied to files:
.agents/skills/gframework-pr-review/SKILL.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csGFramework.Core.Tests/Architectures/TestArchitectureContextBase.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Keep tests focused on observable behavior, not implementation trivia
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : When a public C# API defines multiple contract branches, tests MUST cover the meaningful variants including null, empty, default, and filtered inputs when those branches change behavior
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Regression fixes should include a test that fails before the fix and passes after it
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Preserve snapshot-based verification patterns already used in the repository for source generator tests
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Public API changes must be covered by unit or integration tests in C#
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.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.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.csGFramework.Core.Tests/Resource/TestResourceLoader.csGFramework.Core.Tests/Architectures/TestArchitectureContextBase.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.Tests/Architectures/TestArchitectureContextBase.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBase.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: Architecture implementations should follow the four-layer structure: IArchitecture (lifecycle management), IContextAware (unified context access), IModel (data/state layer), ISystem (business logic layer), and IUtility (stateless utility layer)
Applied to files:
GFramework.Core.Tests/Architectures/TestArchitectureContextBase.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/traces/** : Contributors MUST maintain a matching execution trace under `ai-plan/public/<topic>/traces/` for complex work, recording the current date, key decisions, validation milestones, and the immediate next step
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : When completed and validated stages begin to accumulate, contributors MUST archive their detailed history out of the active `todos/` and `traces/` entry files in the same change, keeping only the current recovery point, active facts, active risks, immediate next step, and pointers to archive files
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : When a task spans multiple commits or is likely to exceed a single agent context window, update both the recovery document and the trace at each meaningful milestone before pausing or handing work off
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : Active tracking and trace files are recovery entrypoints, not append-only changelogs; they MUST stay concise enough for `boot` to locate the current recovery point quickly
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step so another contributor or subagent can continue the work safely
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : If subagents are used on a complex task, the main agent MUST capture the delegated scope and any accepted findings in the active recovery document or trace before continuing implementation
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: For any multi-step refactor, migration, or cross-module task, contributors MUST create or adopt a dedicated recovery document under `ai-plan/public/<topic>/todos/` before making substantive code changes
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: If a task depends on observations from `ai-libs/**`, record the referenced path and conclusion in the active plan or trace when the work is multi-step or complex, rather than editing the third-party reference copy
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : When working from a tracked implementation plan, contributors MUST update the corresponding tracking document under `ai-plan/public/<topic>/todos/` in the same change
Applied to files:
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : When a C# method approaches analyzer complexity limits, extract named helper methods by semantic phase (parsing, normalization, validation, diagnostics) instead of silencing the warning
Applied to files:
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🪛 LanguageTool
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
[grammar] ~25-~25: Ensure spelling is correct
Context: ...、.agents/skills/gframework-pr-review/ 与 ai-plan/public/analyzer-warning-reduction - 本轮没有触碰 Mediator/*、`YamlConfigSchemaValidator...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (9)
GFramework.Core.Tests/Resource/TestResourceLoader.cs (4)
9-14: 类型职责与状态容器设计合理。
TestResourceLoader的职责单一明确,Dictionary<string, string>(StringComparer.Ordinal)的选择也有助于保证测试行为稳定可预测。
16-34: 同步加载路径的契约完整且实现一致。参数校验、命中返回、未命中抛出
FileNotFoundException三段逻辑清晰,且 XML 异常说明与实现行为一致。
36-47: 异步入口复用同步逻辑是合适的。
LoadAsync复用Load保证了异常语义和数据路径一致,作为测试加载器实现简洁且可维护。
49-87: 卸载、可加载判断与测试数据注入的防御性校验到位。公开 API 对输入参数均做了必要校验,文档化异常契约完整,整体可读性与可测试性都不错。
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md (1)
60-63: LGTM:下一步建议与本轮风险隔离策略一致。Line 60-63 的后续动作(提交 nitpick follow-up + 重新跑
$gframework-pr-review+ dotnet format 单独切片)与前文风险控制相符,可直接执行。ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md (1)
36-49: archive 路径验证通过,recovery entrypoint 链完整。Line 36-49 列出的所有 archive pointer(10 个文件)在仓库中存在且路径正确。recovery 入口点链条保持完整,可安全用于后续恢复工作。
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs (2)
57-91: 回归覆盖已到位,关键分支验证完整。这一段同时覆盖了空参数契约与
UnRegisterEvent后不再分发事件的回归场景,测试目标清晰且以行为为中心。Based on learnings, "Regression fixes should include a test that fails before the fix and passes after it" and "When a public C# API defines multiple contract branches, tests MUST cover the meaningful variants including null, empty, default, and filtered inputs when those branches change behavior".
141-153: 接口视角契约验证准确。
RegisterLifecycleHook返回原始 hook 实例这一接口契约被明确验证,且覆盖了带/不带 registry 的两种替身实现。GFramework.Core.Tests/Architectures/TestArchitectureContextBase.cs (1)
42-49: 事件总线共享语义与空参数契约实现良好。同一
_eventBus上完成注册/发送/反注册,并对入口参数执行空值校验,行为一致且可预测。Also applies to: 190-234
- 更新 tracking 文档中的变更文件计数与验证口径,使其与当前 PR head 和 trace 记录一致。 - 补充 RP-092 trace,记录当前 open threads 复核结论、定向测试结果与后续恢复步骤。
Summary
Test ResultsDetails
Insights
Fail Rate
build-and-test: Run #1005
🎉 All tests passed!Slowest Tests
± Comparison with run #1004 at f53a829 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 53 runs. Github Test Reporter by CTRF 💚 |
Summary by CodeRabbit