Skip to content

Fix/analyzer warning reduction batch#300

Merged
GeWuYou merged 10 commits intomainfrom
fix/analyzer-warning-reduction-batch
Apr 28, 2026
Merged

Fix/analyzer warning reduction batch#300
GeWuYou merged 10 commits intomainfrom
fix/analyzer-warning-reduction-batch

Conversation

@GeWuYou
Copy link
Copy Markdown
Owner

@GeWuYou GeWuYou commented Apr 28, 2026

Summary by CodeRabbit

  • Tests
    • 重组并统一大量测试替身与辅助类型;新增并集中多项架构/事件/资源/日志/CQRS 测试替身与验证用例(共享 TestArchitectureContextBase、若干 TestArchitecture/Context/Registry/Logger/Resource/Dispatcher/Notification 测试类型);移除若干内联实现以复用共享实现并调整测试初始化与清理逻辑
  • Bug Fixes
    • 初始化钩子:架构为 null 时抛出 ArgumentNullException;目标注册器缺失时改为安全 no-op
  • Chores
    • 更新分析器跟踪、归档与审查技能文档,改进警告减少与验证痕迹记录

GeWuYou added 5 commits April 28, 2026 07:47
- 拆分 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 停止点
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e4d96062-bdda-4bb1-896f-2a432362eaec

📥 Commits

Reviewing files that changed from the base of the PR and between f33a176 and 5c4f2df.

📒 Files selected for processing (2)
  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
  • ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📜 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)
  • GitHub Check: Analyze (C#)
  • GitHub Check: Code Quality & Security
  • GitHub Check: Build and Test
🧰 Additional context used
📓 Path-based instructions (2)
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 under ai-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 for boot to 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 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
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 (17)
📓 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 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
  • 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 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
  • 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 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
  • 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 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
  • 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: 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
  • 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 docs/zh-CN/** : When a feature is added, removed, renamed, or substantially refactored, contributors MUST update or create the corresponding user-facing integration documentation in `docs/zh-CN/` in the same change

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: Commit messages MUST use Conventional Commits format: `<type>(<scope>): <summary>` with simplified Chinese summary and unordered list body items starting with verbs like `新增`、`修复`、`优化`

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 docs/zh-CN/** : For integration-oriented features such as the AI-First config system, documentation MUST cover: project directory layout and file conventions, required project or package wiring, minimal working usage example, and migration or compatibility notes

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 ai-plan/public/README.md : When a worktree-to-topic mapping changes, or when a topic becomes active/inactive, contributors MUST update `ai-plan/public/README.md` in the same change

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 {README.md,docs/**} : If an existing documentation page no longer reflects the current implementation, fixing the code without fixing the documentation is considered incomplete work

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: 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
🪛 LanguageTool
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md

[grammar] ~30-~30: Ensure spelling is correct
Context: ...tectureContextBase,把容器解析、共享 EventBus行为,以及 legacy / CQRS 失败契约统一收敛到一处 - 将TestAr...

(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
Context: ...56个变更文件),分别位于GFramework.Core.TestsGFramework.Cqrs.TestsGFramework.Core.agents/skill...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[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 (5)
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md (2)

3-21: RP-092 记录完整且可恢复性良好。

当前段落已清晰覆盖日期、决策依据、验证里程碑与结果,适合作为后续接手的恢复入口。


41-57: 活跃风险、下一步与归档指针结构清晰。

风险与缓解措施成对出现,且归档链接补齐后有助于保持 active trace 可读性。

ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md (3)

9-15: 恢复点信息更新到位。

RP 编号、阶段与当前焦点表达一致,便于按阶段继续推进。


25-26: 文件变更规模描述已对齐基线差异。

18/38/56 的统计口径明确,解决了先前恢复文档中的计数漂移问题。


55-58: 验证口径与 trace 已统一。

dotnet build、定向 dotnet testgit diff --check 三项口径一致,降低后续接手歧义。


📝 Walkthrough

Walkthrough

将多个测试基础设施从内联移至独立文件,新增并重构若干测试桩(架构上下文/上下文基类、注册表与初始化钩子、CQRS 测试类型、日志与资源测试工具),并在 RegistryInitializationHookBase.OnPhase 中改为捕获并忽略 GetUtility 抛出的 InvalidOperationException。

Changes

Cohort / File(s) Summary
架构测试桩(新增)
GFramework.Core.Tests/Architectures/TestArchitecture.cs, GFramework.Core.Tests/Architectures/TestArchitectureContext.cs, GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs, GFramework.Core.Tests/Architectures/TestArchitectureContextWithRegistry.cs, GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs, GFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs
新增多种 IArchitecture / IArchitectureContext 测试桩与变体(含带/不带 TestRegistry),多数 CQRS 路径返回 NotSupported 或失败任务。
架构测试基类(新增/调整)
GFramework.Core.Tests/Architectures/TestArchitectureContextBase.cs, GFramework.Core.Tests/Architectures/TestArchitectureBase.cs
新增 TestArchitectureContextBase(实现共享 IArchitectureContext 行为);TestArchitectureBase 将 PhaseHistory 改为 IReadOnlyList 并维护内部历史。
架构测试实现(移除/重定位)
GFramework.Core.Tests/Architectures/GameContextTests.cs, GFramework.Core.Tests/Architectures/ArchitectureServicesTests.cs, GFramework.Core.Tests/Architectures/ContextProviderTests.cs, GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs
从这些测试文件中移除内联的 TestArchitecture/Context 定义,改为依赖新增的独立实现。
注册表与钩子(新增)
GFramework.Core.Tests/Architectures/TestRegistry.cs, GFramework.Core.Tests/Architectures/TestRegistryInitializationHook.cs, GFramework.Core/Architectures/RegistryInitializationHookBase.cs
新增 TestRegistry 与 TestRegistryInitializationHook;RegistryInitializationHookBase.OnPhase 现在对 null architecture 抛 ArgumentNullException,并在找不到 registry 时捕获 InvalidOperationException 并视为 no‑op(更新 XML 注释)。
架构行为测试(新增)
GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
新增测试套件,覆盖事件注册/分发、空参校验、注销后行为、旧式 CQRS 入口的失败语义以及 RegisterLifecycleHook 行为。
CQRS 测试装置(新增大量内部类型)
GFramework.Cqrs.Tests/Cqrs/* (例如 DispatcherCache*, DispatcherPipelineCache*, DispatcherStringCache*, Generated*, ReflectionFallback*, Deterministic*, CapturingLoggerFactoryProvider.cs 等)
新增多个内部请求/通知/流类型、处理器、pipeline 行为、生成式注册表模拟、反射回退容器、确定性通知顺序追踪与日志捕获 provider;并在若干原文件中移除对应内联测试类型。
日志测试工具(提取/替换)
GFramework.Core.Tests/Logging/TestLogger.cs, GFramework.Core.Tests/Logging/LoggerTests.cs, GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs
将 TestLogger 提取为独立线程安全实现(提供 IReadOnlyList 快照),删除原文件内联实现并调整相关测试中的空性/断言用法。
资源测试(提取)
GFramework.Core.Tests/Resource/TestResource.cs, GFramework.Core.Tests/Resource/TestResourceLoader.cs, GFramework.Core.Tests/Resource/ResourceManagerTests.cs
新增 TestResource 与 TestResourceLoader(内存 path→content 映射、同步/异步加载与卸载);从 ResourceManagerTests 中移除内联类型。
小范围测试改动
GFramework.Core.Tests/Coroutine/*, GFramework.Core.Tests/Events/*
若干测试中改进可空性处理、SetUp/TearDown 清理、StructLayout 注释、XML 注释与 EOF 换行等细节更改。
文档与计划跟踪
ai-plan/public/analyzer-warning-reduction/*, .agents/skills/gframework-pr-review/SKILL.md
更新 analyzer-warning-reduction 跟踪/trace/归档文档并调整 PR 评审技能规则(使部分 nitpick 评论成为可执行项)。

Sequence Diagram(s)

(无)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 分钟

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题「Fix/analyzer warning reduction batch」与大量代码变更高度相关,准确反映了该PR的核心目标:批量修复分析器警告并重构测试基础设施。
Docstring Coverage ✅ Passed Docstring coverage is 84.97% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/analyzer-warning-reduction-batch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 28, 2026

Greptile Summary

This PR reduces analyzer warnings by extracting inline test doubles into dedicated shared files (consolidating around a new TestArchitectureContextBase) and fixes RegistryInitializationHookBase.OnPhase to guard against a null architecture argument and to handle a missing registry via catch (InvalidOperationException) rather than a null check — aligning with the actual GetUtility contract that throws instead of returning null.

Confidence Score: 5/5

Safe to merge; the one production logic change is correct and well-tested, and all remaining comments are minor P2 suggestions.

No P0 or P1 findings. The catch (InvalidOperationException) broadness is a theoretical edge case that does not affect current callers, and the missing null-architecture test is a style gap only.

GFramework.Core/Architectures/RegistryInitializationHookBase.cs — review the breadth of the InvalidOperationException catch.

Important Files Changed

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&lt;TRegistry&gt;()"]
    F -- success --> G["foreach config → RegisterConfig(registry, config)"]
    F -- "throws InvalidOperationException\n(registry not found)" --> H[return no-op]
    G --> I[Done]
Loading
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

@github-actions
Copy link
Copy Markdown

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2159 2158    ↓1 1    ↑1 0 0 0 36.1s    ↑2.2s

Test Results

failed 1 failed ↑1
passed 2158 passed ↓1

Details

tests 2159 tests
clock 36.1s ↑2.2s
tool nunit
build CI - Build & Test arrow-right build-and-test link #998
pull-request Fix/analyzer warning reduction batch link #300

Failed Tests

RegistryInitializationHookBaseTests arrow-right OnPhase_Should_Not_Throw_When_Registry_Not_Found

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2151 0 4 4.7s

Fail Rate

Fail Rate 0.00%
Test 📝 Results 📊 Passed ✅ Failed ❌ Fail Rate (%) 📈
ILogAppender_Flush_Should_Raise_OnFlushCompleted_Only_Once 40 39 1 2.50    ↓0.06
RegisterMigration_During_Cache_Rebuild_Should_Not_Leave_Stale_Type_Cache 47 46 1 2.13    ↓0.04
Run_Should_Assign_Globally_Unique_Reference_Metadata_Member_Names 48 47 1 2.08    ↓0.05
OnPhase_Should_Not_Throw_When_Registry_Not_Found 48 47 1 2.08    ↑2.08

build-and-test: Run #998

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
2159 2158 1 0 0 0 0 36.1s

Some tests failed!

Name Failure Message
❌ OnPhase_Should_Not_Throw_When_Registry_Not_Found Assert.That(code, new ThrowsNothingConstraint()) Expected: No Exception to be thrown But was: <System.InvalidOperationException: No instance registered for TestRegistry at GFramework.Core.Ioc.MicrosoftDiContainer.GetRequired[T]() in /home/runner/work/GFramework/GFramework/GFramework.Core/Ioc/MicrosoftDiContainer.cs:line 544 at GFramework.Core.Tests.Architectures.TestArchitectureContext.GetUtility[TUtility]() in /home/runner/work/GFramework/GFramework/GFramework.Core.Tests/Architectures/TestArchitectureContext.cs:line 127 at GFramework.Core.Architectures.RegistryInitializationHookBase`2.OnPhase(ArchitecturePhase phase, IArchitecture architecture) in /home/runner/work/GFramework/GFramework/GFramework.Core/Architectures/RegistryInitializationHookBase.cs:line 40 at GFramework.Core.Tests.Architectures.RegistryInitializationHookBaseTests.<>c__DisplayClass3_0.<OnPhase_Should_Not_Throw_When_Registry_Not_Found>b__0() in /home/runner/work/GFramework/GFramework/GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs:line 77 at InvokeStub_TestDelegate.Invoke(Object, Object, IntPtr*) at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) --- End of stack trace from previous location --- at NUnit.Framework.Internal.ExceptionHelper.Rethrow(Exception exception) at NUnit.Framework.Internal.Reflect.DynamicInvokeWithTransparentExceptions(Delegate delegate) at NUnit.Framework.Internal.ExceptionHelper.RecordException(Delegate parameterlessDelegate, String parameterName)>

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
SendRequestAsync_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 48 4.1s 4.7s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 48 2.1s 2.4s
Generates_Scene_Behavior_Boilerplate 48 1.9s 2.0s
CleanupDuringAcquire_Should_NotCauseRaceCondition 48 1.1s 1.1s
Append_ShouldNotBlock 48 1.0s 1.0s
Context_Caching_Should_Improve_Performance 48 781ms 791ms
PendingCount_ShouldReflectQueuedEntries 48 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 48 404ms 406ms
Cleanup_Should_RemoveUnusedLocks 48 401ms 402ms
Generates_Precise_Assembly_Type_Lookups_For_Inaccessible_External_Protected_Types 48 323ms 354ms

± Comparison with run #996 at b83e3b0 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 48 runs.

Github Test Reporter by CTRF 💚

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Warnings Elapsed time
⚠️ CSHARP 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

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 文档中未说明:

  • 该状态是否线程安全(当前:否)
  • 失败模式(并发访问时的表现)
  • 仅用于顺序测试的上下文

最小修复:在 InvocationOrderReset() 的 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6cc87a9 and ba4ace8.

📒 Files selected for processing (51)
  • GFramework.Core.Tests/Architectures/AnotherTestArchitectureContext.cs
  • GFramework.Core.Tests/Architectures/ArchitectureServicesTests.cs
  • GFramework.Core.Tests/Architectures/ContextProviderTests.cs
  • GFramework.Core.Tests/Architectures/GameContextTests.cs
  • GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs
  • GFramework.Core.Tests/Architectures/TestArchitecture.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureBase.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContext.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextWithRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs
  • GFramework.Core.Tests/Architectures/TestRegistry.cs
  • GFramework.Core.Tests/Architectures/TestRegistryInitializationHook.cs
  • GFramework.Core.Tests/Coroutine/CommandCoroutineExtensionsTests.cs
  • GFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.cs
  • GFramework.Core.Tests/Events/EmptyEvent.cs
  • GFramework.Core.Tests/Events/EventListenerScopeTests.cs
  • GFramework.Core.Tests/Events/TestEvent.cs
  • GFramework.Core.Tests/Logging/LoggerTests.cs
  • GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs
  • GFramework.Core.Tests/Logging/TestLogger.cs
  • GFramework.Core.Tests/Resource/ResourceManagerTests.cs
  • GFramework.Core.Tests/Resource/TestResource.cs
  • GFramework.Core.Tests/Resource/TestResourceLoader.cs
  • GFramework.Cqrs.Tests/Cqrs/AlphaDeterministicNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs
  • GFramework.Cqrs.Tests/Cqrs/CqrsDispatcherCacheTests.cs
  • GFramework.Cqrs.Tests/Cqrs/CqrsHandlerRegistrarTests.cs
  • GFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.cs
  • GFramework.Cqrs.Tests/Cqrs/DeterministicOrderNotification.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotification.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequest.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequestHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamRequest.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheBehavior.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequest.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequestHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequest.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequestHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedNotificationHandlerRegistry.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotification.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.cs
  • GFramework.Cqrs.Tests/Cqrs/PrivateConstructorNotificationHandlerRegistry.cs
  • GFramework.Cqrs.Tests/Cqrs/ReflectionFallbackNotificationContainer.cs
  • GFramework.Cqrs.Tests/Cqrs/ZetaDeterministicNotificationHandler.cs
  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
  • ai-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 required using explicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace pattern GFramework.{Module}.{Feature} with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces with I prefix, 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
Keep using directives 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.cs
  • GFramework.Core.Tests/Architectures/AnotherTestArchitectureContext.cs
  • GFramework.Core.Tests/Architectures/TestArchitecture.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequest.cs
  • GFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.cs
  • GFramework.Cqrs.Tests/Cqrs/DeterministicOrderNotification.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotification.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequest.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequestHandler.cs
  • GFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequestHandler.cs
  • GFramework.Core.Tests/Events/EventListenerScopeTests.cs
  • GFramework.Core.Tests/Events/TestEvent.cs
  • GFramework.Cqrs.Tests/Cqrs/ReflectionFallbackNotificationContainer.cs
  • GFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequest.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotification.cs
  • GFramework.Core.Tests/Architectures/TestRegistryInitializationHook.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedNotificationHandlerRegistry.cs
  • GFramework.Cqrs.Tests/Cqrs/AlphaDeterministicNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/ZetaDeterministicNotificationHandler.cs
  • GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs
  • GFramework.Cqrs.Tests/Cqrs/PrivateConstructorNotificationHandlerRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextWithRegistry.cs
  • GFramework.Core.Tests/Logging/TestLogger.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequestHandler.cs
  • GFramework.Core.Tests/Architectures/TestRegistry.cs
  • GFramework.Core.Tests/Resource/TestResourceLoader.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamRequest.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureBase.cs
  • GFramework.Cqrs.Tests/Cqrs/CqrsDispatcherCacheTests.cs
  • GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs
  • GFramework.Core.Tests/Resource/TestResource.cs
  • GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs
  • GFramework.Core.Tests/Coroutine/CommandCoroutineExtensionsTests.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheBehavior.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
  • GFramework.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.cs
  • GFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.cs
  • GFramework.Cqrs.Tests/Cqrs/DeterministicOrderNotification.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotification.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequest.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequestHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequestHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/ReflectionFallbackNotificationContainer.cs
  • GFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequest.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotification.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedNotificationHandlerRegistry.cs
  • GFramework.Cqrs.Tests/Cqrs/AlphaDeterministicNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/ZetaDeterministicNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/PrivateConstructorNotificationHandlerRegistry.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequestHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamRequest.cs
  • GFramework.Cqrs.Tests/Cqrs/CqrsDispatcherCacheTests.cs
  • GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs
  • GFramework.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.cs
  • GFramework.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 under ai-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 for boot to 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 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
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.cs
  • GFramework.Core.Tests/Architectures/AnotherTestArchitectureContext.cs
  • GFramework.Core.Tests/Architectures/TestArchitecture.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequest.cs
  • GFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.cs
  • GFramework.Cqrs.Tests/Cqrs/DeterministicOrderNotification.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotification.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequest.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherStringCacheRequestHandler.cs
  • GFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequestHandler.cs
  • GFramework.Core.Tests/Events/EventListenerScopeTests.cs
  • GFramework.Core.Tests/Events/TestEvent.cs
  • GFramework.Cqrs.Tests/Cqrs/ReflectionFallbackNotificationContainer.cs
  • GFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheRequest.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotification.cs
  • GFramework.Core.Tests/Architectures/TestRegistryInitializationHook.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedNotificationHandlerRegistry.cs
  • GFramework.Cqrs.Tests/Cqrs/AlphaDeterministicNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/ZetaDeterministicNotificationHandler.cs
  • GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs
  • GFramework.Cqrs.Tests/Cqrs/PrivateConstructorNotificationHandlerRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextWithRegistry.cs
  • GFramework.Core.Tests/Logging/TestLogger.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheRequestHandler.cs
  • GFramework.Core.Tests/Architectures/TestRegistry.cs
  • GFramework.Core.Tests/Resource/TestResourceLoader.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherCacheStreamRequest.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureBase.cs
  • GFramework.Cqrs.Tests/Cqrs/CqrsDispatcherCacheTests.cs
  • GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs
  • GFramework.Core.Tests/Resource/TestResource.cs
  • GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs
  • GFramework.Core.Tests/Coroutine/CommandCoroutineExtensionsTests.cs
  • GFramework.Cqrs.Tests/Cqrs/DispatcherPipelineCacheBehavior.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
  • GFramework.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.cs
  • GFramework.Core.Tests/Architectures/TestArchitecture.cs
  • GFramework.Core.Tests/Architectures/TestRegistryInitializationHook.cs
  • GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextWithRegistry.cs
  • GFramework.Core.Tests/Architectures/TestRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureBase.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
  • GFramework.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.cs
  • GFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.cs
  • GFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotification.cs
  • GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs
  • GFramework.Core.Tests/Architectures/TestRegistry.cs
  • GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs
  • GFramework.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.cs
  • GFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.cs
  • GFramework.Core.Tests/Events/EventListenerScopeTests.cs
  • GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs
  • GFramework.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.cs
  • GFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.cs
  • GFramework.Core.Tests/Events/EventListenerScopeTests.cs
  • GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs
  • GFramework.Cqrs.Tests/Cqrs/CqrsDispatcherCacheTests.cs
  • GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs
  • GFramework.Core.Tests/Coroutine/CommandCoroutineExtensionsTests.cs
  • 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 **/*.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.cs
  • GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs
  • GFramework.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.cs
  • GFramework.Core.Tests/Architectures/RegistryInitializationHookBaseTests.cs
  • GFramework.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.cs
  • GFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedRegistryNotificationHandler.cs
  • GFramework.Cqrs.Tests/Cqrs/GeneratedNotificationHandlerRegistry.cs
  • GFramework.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.cs
  • GFramework.Core.Tests/Architectures/TestRegistry.cs
  • GFramework.Core.Tests/Logging/LoggingConfigurationTests.cs
  • GFramework.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.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
  • GFramework.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.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
  • GFramework.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.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
  • GFramework.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.csCqrsDispatcherCacheTests.csCqrsHandlerRegistrarTests.cs - 主线程已补齐ResourceManagerTests.csTestEvent.cs...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~15-~15: Ensure spelling is correct
Context: ...arning - 当前 GFramework.Core.TestsGFramework.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: 接口契约实现完整,测试意图表达清楚。

MinLevelCreateLogger(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: TestEventReceivedValue 的文档注释与语义一致。

注释粒度和措辞都很清楚,便于测试代码阅读与维护。

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.csglobal using 指令在项目级别提供。GFramework 仓库使用手动 GlobalUsings.cs 文件向测试项目全局导入常见命名空间,无需在个别文件中重复声明。

			> Likely an incorrect or invalid review comment.

Comment thread GFramework.Core.Tests/Architectures/TestArchitectureContext.cs Outdated
Comment thread GFramework.Core.Tests/Architectures/TestArchitectureContext.cs Outdated
Comment thread GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs Outdated
Comment thread GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs
Comment thread GFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.cs Outdated
Comment thread GFramework.Core.Tests/Resource/TestResourceLoader.cs
- 修复测试架构上下文、生命周期钩子与注册表初始化钩子的评审问题,避免静默成功或错误共享状态

- 补充 TestResourceLoader、TestLogger、CapturingLoggerFactoryProvider 与 CQRS 测试辅助类型的契约文档和并发语义

- 新增测试覆盖并更新 analyzer-warning-reduction 活跃跟踪,记录 PR #300 跟进验证与现存 Cqrs warning blocker
@github-actions
Copy link
Copy Markdown

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2163    ↑4 2163    ↑5 0    ↓1 0 0 0 35.5s    ↓565ms

Test Results

passed 2163 passed ↑5

Details

tests 2163 tests ↑4
clock 35.5s ↓565ms
tool nunit
build CI - Build & Test arrow-right build-and-test link #1000
pull-request Fix/analyzer warning reduction batch link #300

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2151 0 4 4.7s

Fail Rate

Fail Rate 0.00%
Test 📝 Results 📊 Passed ✅ Failed ❌ Fail Rate (%) 📈
ILogAppender_Flush_Should_Raise_OnFlushCompleted_Only_Once 41 40 1 2.44    ↓0.06
RegisterMigration_During_Cache_Rebuild_Should_Not_Leave_Stale_Type_Cache 48 47 1 2.08    ↓0.05
Run_Should_Assign_Globally_Unique_Reference_Metadata_Member_Names 49 48 1 2.04    ↓0.04
OnPhase_Should_Not_Throw_When_Registry_Not_Found 49 48 1 2.04    ↓0.04

build-and-test: Run #1000

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
2163 2163 0 0 0 0 0 35.5s

🎉 All tests passed!

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
SendRequestAsync_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 49 4.1s 4.7s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 49 2.2s 2.4s
Generates_Scene_Behavior_Boilerplate 49 1.9s 2.0s
CleanupDuringAcquire_Should_NotCauseRaceCondition 49 1.1s 1.1s
Append_ShouldNotBlock 49 1.0s 1.0s
Context_Caching_Should_Improve_Performance 49 781ms 791ms
PendingCount_ShouldReflectQueuedEntries 49 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 49 404ms 406ms
Cleanup_Should_RemoveUnusedLocks 49 401ms 402ms
Generates_Precise_Assembly_Type_Lookups_For_Inaccessible_External_Protected_Types 49 323ms 354ms

± Comparison with run #998 at d9c621b | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 49 runs.

Github Test Reporter by CTRF 💚

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 改为带锁的后备字段,或在创建时于锁内读取。

可选改法(保持接口不变)
 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;
     }
 }
As per coding guidelines: "When adding caching, pooling, or shared mutable state, document thread-safety assumptions and failure modes in C#."

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

📥 Commits

Reviewing files that changed from the base of the PR and between ba4ace8 and 5693ab7.

📒 Files selected for processing (14)
  • GFramework.Core.Tests/Architectures/TestArchitectureContext.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithoutRegistry.cs
  • GFramework.Core.Tests/Coroutine/WaitForMultipleEventsTests.cs
  • GFramework.Core.Tests/Logging/TestLogger.cs
  • GFramework.Core.Tests/Resource/TestResourceLoader.cs
  • GFramework.Core/Architectures/RegistryInitializationHookBase.cs
  • GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs
  • GFramework.Cqrs.Tests/Cqrs/DeterministicNotificationHandlerState.cs
  • GFramework.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.cs
  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
  • ai-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.cs
  • GFramework.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 required using explicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace pattern GFramework.{Module}.{Feature} with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces with I prefix, 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
Keep using directives 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.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
  • GFramework.Core.Tests/Logging/TestLogger.cs
  • GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs
  • GFramework.Core/Architectures/RegistryInitializationHookBase.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs
  • GFramework.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 under ai-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 for boot to 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 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
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.cs
  • 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.Cqrs.Tests/Cqrs/PartialGeneratedNotificationHandlerRegistry.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
  • GFramework.Core.Tests/Logging/TestLogger.cs
  • GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs
  • GFramework.Core/Architectures/RegistryInitializationHookBase.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs
  • 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: Applies to **/*.Tests.cs : Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`

Applied to files:

  • GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
  • GFramework.Core/Architectures/RegistryInitializationHookBase.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureWithRegistry.cs
  • 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: 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.cs
  • ai-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.cs
  • 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: 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
  • GFramework.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 在锁内复制并返回快照,避免调用方持有内部可变集合,适合跨测试断言读取。

Comment thread GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs Outdated
- 修复 TestArchitectureContextV3 的共享事件总线语义并补充对应回归测试

- 优化 CapturingLoggerFactoryProvider 的最小级别同步策略并补充验证

- 更新 RegistryInitializationHookBase 异常文档与 analyzer warning reduction 的恢复文档归档
@GeWuYou GeWuYou enabled auto-merge April 28, 2026 02:15
@github-actions
Copy link
Copy Markdown

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2165    ↑2 2165    ↑2 0 0 0 0 38.1s    ↑2.6s

Test Results

passed 2165 passed ↑2

Details

tests 2165 tests ↑2
clock 38.1s ↑2.6s
tool nunit
build CI - Build & Test arrow-right build-and-test link #1001
pull-request Fix/analyzer warning reduction batch link #300

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2151 0 4 4.7s

Fail Rate

Fail Rate 0.00%
Test 📝 Results 📊 Passed ✅ Failed ❌ Fail Rate (%) 📈
ILogAppender_Flush_Should_Raise_OnFlushCompleted_Only_Once 42 41 1 2.38    ↓0.06
RegisterMigration_During_Cache_Rebuild_Should_Not_Leave_Stale_Type_Cache 49 48 1 2.04    ↓0.04
Run_Should_Assign_Globally_Unique_Reference_Metadata_Member_Names 50 49 1 2.00    ↓0.04
OnPhase_Should_Not_Throw_When_Registry_Not_Found 50 49 1 2.00    ↓0.04

build-and-test: Run #1001

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
2165 2165 0 0 0 0 0 38.1s

🎉 All tests passed!

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
SendRequestAsync_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 50 4.1s 4.7s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 50 2.2s 2.4s
Generates_Scene_Behavior_Boilerplate 50 1.9s 2.0s
CleanupDuringAcquire_Should_NotCauseRaceCondition 50 1.1s 1.1s
Append_ShouldNotBlock 50 1.0s 1.0s
Context_Caching_Should_Improve_Performance 50 781ms 791ms
PendingCount_ShouldReflectQueuedEntries 50 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 50 404ms 406ms
Cleanup_Should_RemoveUnusedLocks 50 401ms 402ms
Generates_Precise_Assembly_Type_Lookups_For_Inaccessible_External_Protected_Types 50 323ms 354ms

± Comparison with run #1000 at c805e39 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 50 runs.

Github Test Reporter by CTRF 💚

@GeWuYou
Copy link
Copy Markdown
Owner Author

GeWuYou commented Apr 28, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Repository owner deleted a comment from coderabbitai Bot Apr 28, 2026
Repository owner deleted a comment from coderabbitai Bot Apr 28, 2026
@GeWuYou
Copy link
Copy Markdown
Owner Author

GeWuYou commented Apr 28, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@GeWuYou
Copy link
Copy Markdown
Owner Author

GeWuYou commented Apr 28, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@GeWuYou
Copy link
Copy Markdown
Owner Author

GeWuYou commented Apr 28, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@GeWuYou
Copy link
Copy Markdown
Owner Author

GeWuYou commented Apr 28, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs (1)

30-35: 建议把 TestArchitectureContextTestArchitectureContextV3 的共同行为抽到共享测试基础设施里。

这个测试桩现在把容器解析、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

📥 Commits

Reviewing files that changed from the base of the PR and between 5693ab7 and 1635a03.

📒 Files selected for processing (8)
  • GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
  • GFramework.Core/Architectures/RegistryInitializationHookBase.cs
  • GFramework.Cqrs.Tests/Cqrs/CapturingLoggerFactoryProvider.cs
  • GFramework.Cqrs.Tests/Cqrs/CqrsHandlerRegistrarTests.cs
  • ai-plan/public/analyzer-warning-reduction/archive/traces/analyzer-warning-reduction-history-rp083-rp088.md
  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
  • ai-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 required using explicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace pattern GFramework.{Module}.{Feature} with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces with I prefix, 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
Keep using directives 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.cs
  • GFramework.Core/Architectures/RegistryInitializationHookBase.cs
  • GFramework.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.cs
  • GFramework.Core/Architectures/RegistryInitializationHookBase.cs
  • 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: Applies to **/*.Tests.cs : Keep tests focused on observable behavior, not implementation trivia

Applied to files:

  • GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
  • 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: 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.cs
  • GFramework.Core/Architectures/RegistryInitializationHookBase.cs
  • GFramework.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.cs
  • 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: 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.md
  • 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 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.md
  • 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 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
  • 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: 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.TestsCqrs.Tests 的低风险 warning - 仓库根 warning 从 288 下...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

- 补齐 TestArchitectureContext 与 TestArchitectureContextV3 的事件注销与空参数契约回归测试
- 整理 TestResourceLoader 的命名空间缩进以收口局部格式噪音
- 更新 analyzer-warning-reduction 的恢复点与验证记录
@github-actions
Copy link
Copy Markdown

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2169    ↑4 2169    ↑4 0 0 0 0 37.4s    ↓709ms

Test Results

passed 2169 passed ↑4

Details

tests 2169 tests ↑4
clock 37.4s ↓709ms
tool nunit
build CI - Build & Test arrow-right build-and-test link #1003
pull-request Fix/analyzer warning reduction batch link #300

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2152 0 4 4.7s

Fail Rate

Fail Rate 0.00%
Test 📝 Results 📊 Passed ✅ Failed ❌ Fail Rate (%) 📈
ILogAppender_Flush_Should_Raise_OnFlushCompleted_Only_Once 43 42 1 2.33    ↓0.05
RegisterMigration_During_Cache_Rebuild_Should_Not_Leave_Stale_Type_Cache 50 49 1 2.00    ↓0.04
Run_Should_Assign_Globally_Unique_Reference_Metadata_Member_Names 51 50 1 1.96    ↓0.04
OnPhase_Should_Not_Throw_When_Registry_Not_Found 51 50 1 1.96    ↓0.04

build-and-test: Run #1003

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
2169 2169 0 0 0 0 0 37.4s

🎉 All tests passed!

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
SendRequestAsync_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 51 4.1s 4.7s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 51 2.2s 2.4s
Generates_Scene_Behavior_Boilerplate 51 1.9s 2.0s
CleanupDuringAcquire_Should_NotCauseRaceCondition 51 1.1s 1.1s
Append_ShouldNotBlock 51 1.0s 1.0s
Context_Caching_Should_Improve_Performance 51 781ms 791ms
PendingCount_ShouldReflectQueuedEntries 51 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 51 404ms 406ms
Cleanup_Should_RemoveUnusedLocks 51 401ms 402ms
Generates_Precise_Assembly_Type_Lookups_For_Inaccessible_External_Protected_Types 51 323ms 354ms

± 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 的恢复点与验证记录
@github-actions
Copy link
Copy Markdown

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2169 2169 0 0 0 0 38.6s    ↑1.2s

Test Results

passed 2169 passed

Details

tests 2169 tests
clock 38.6s ↑1.2s
tool nunit
build CI - Build & Test arrow-right build-and-test link #1004
pull-request Fix/analyzer warning reduction batch link #300

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2152 0 4 4.7s

Fail Rate

Fail Rate 0.00%
Test 📝 Results 📊 Passed ✅ Failed ❌ Fail Rate (%) 📈
ILogAppender_Flush_Should_Raise_OnFlushCompleted_Only_Once 44 43 1 2.27    ↓0.06
RegisterMigration_During_Cache_Rebuild_Should_Not_Leave_Stale_Type_Cache 51 50 1 1.96    ↓0.04
Run_Should_Assign_Globally_Unique_Reference_Metadata_Member_Names 52 51 1 1.92    ↓0.04
OnPhase_Should_Not_Throw_When_Registry_Not_Found 52 51 1 1.92    ↓0.04

build-and-test: Run #1004

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
2169 2169 0 0 0 0 0 38.6s

🎉 All tests passed!

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
SendRequestAsync_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 52 4.1s 4.7s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 52 2.2s 2.4s
Generates_Scene_Behavior_Boilerplate 52 1.9s 2.0s
CleanupDuringAcquire_Should_NotCauseRaceCondition 52 1.1s 1.1s
Append_ShouldNotBlock 52 1.0s 1.0s
Context_Caching_Should_Improve_Performance 52 781ms 791ms
PendingCount_ShouldReflectQueuedEntries 52 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 52 404ms 406ms
Cleanup_Should_RemoveUnusedLocks 52 401ms 402ms
Generates_Precise_Assembly_Type_Lookups_For_Inaccessible_External_Protected_Types 52 324ms 354ms

± Comparison with run #1003 at e4c5607 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 52 runs.

Github Test Reporter by CTRF 💚

@GeWuYou
Copy link
Copy Markdown
Owner Author

GeWuYou commented Apr 28, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@GeWuYou
Copy link
Copy Markdown
Owner Author

GeWuYou commented Apr 28, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 testgit 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 的隐式分配。

CommandExecutorQueryExecutor 每次访问都会创建新实例;对测试基类来说通常不需要这种波动语义,改为缓存字段更稳定。

♻️ 建议修改
 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;
As per coding guidelines, "Avoid hidden side effects in property getters, constructors, and registration helpers in C#".

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1635a03 and f33a176.

📒 Files selected for processing (8)
  • .agents/skills/gframework-pr-review/SKILL.md
  • GFramework.Core.Tests/Architectures/TestArchitectureContext.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextBase.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextBehaviorTests.cs
  • GFramework.Core.Tests/Architectures/TestArchitectureContextV3.cs
  • GFramework.Core.Tests/Resource/TestResourceLoader.cs
  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
  • ai-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 required using explicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace pattern GFramework.{Module}.{Feature} with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces with I prefix, 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
Keep using directives 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.cs
  • GFramework.Core.Tests/Resource/TestResourceLoader.cs
  • GFramework.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 under ai-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 for boot to 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 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
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.cs
  • 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 **/*.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.cs
  • ai-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.cs
  • GFramework.Core.Tests/Resource/TestResourceLoader.cs
  • 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: 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 复核结论、定向测试结果与后续恢复步骤。
@github-actions
Copy link
Copy Markdown

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2169 2169 0 0 0 0 38.5s    ↓146ms

Test Results

passed 2169 passed

Details

tests 2169 tests
clock 38.5s ↓146ms
tool nunit
build CI - Build & Test arrow-right build-and-test link #1005
pull-request Fix/analyzer warning reduction batch link #300

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2152 0 4 4.7s

Fail Rate

Fail Rate 0.00%
Test 📝 Results 📊 Passed ✅ Failed ❌ Fail Rate (%) 📈
ILogAppender_Flush_Should_Raise_OnFlushCompleted_Only_Once 45 44 1 2.22    ↓0.05
RegisterMigration_During_Cache_Rebuild_Should_Not_Leave_Stale_Type_Cache 52 51 1 1.92    ↓0.04
Run_Should_Assign_Globally_Unique_Reference_Metadata_Member_Names 53 52 1 1.89    ↓0.03
OnPhase_Should_Not_Throw_When_Registry_Not_Found 53 52 1 1.89    ↓0.03

build-and-test: Run #1005

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
2169 2169 0 0 0 0 0 38.5s

🎉 All tests passed!

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
SendRequestAsync_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 53 4.1s 4.7s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 53 2.2s 2.4s
Generates_Scene_Behavior_Boilerplate 53 1.9s 2.0s
CleanupDuringAcquire_Should_NotCauseRaceCondition 53 1.1s 1.1s
Append_ShouldNotBlock 53 1.0s 1.0s
Context_Caching_Should_Improve_Performance 53 781ms 791ms
PendingCount_ShouldReflectQueuedEntries 53 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 53 404ms 406ms
Cleanup_Should_RemoveUnusedLocks 53 401ms 402ms
Generates_Precise_Assembly_Type_Lookups_For_Inaccessible_External_Protected_Types 53 324ms 354ms

± Comparison with run #1004 at f53a829 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 53 runs.

Github Test Reporter by CTRF 💚

@GeWuYou GeWuYou merged commit 18115f8 into main Apr 28, 2026
5 checks passed
@GeWuYou GeWuYou deleted the fix/analyzer-warning-reduction-batch branch April 28, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant