Skip to content

Feat/cqrs optimization#323

Merged
GeWuYou merged 7 commits intomainfrom
feat/cqrs-optimization
May 4, 2026
Merged

Feat/cqrs optimization#323
GeWuYou merged 7 commits intomainfrom
feat/cqrs-optimization

Conversation

@GeWuYou
Copy link
Copy Markdown
Owner

@GeWuYou GeWuYou commented May 4, 2026

Summary by CodeRabbit

发布说明

  • Tests

    • 扩展 CQRS 处理器生成器的回归测试覆盖,新增多项场景验证(运行时缺失生成契约、fallback 行为回退、缺失 request invoker/provider 类型时不发射元数据 等)。
  • Documentation

    • 精化生成器相关的 XML 文档注释表述并更新迁移/追踪文档与验证记录,补充阶段性验证与测试结果摘要。

GeWuYou added 6 commits May 4, 2026 18:49
- 新增 request invoker descriptor 缺失时的 generator 回归覆盖

- 新增 request invoker descriptor entry 缺失时的 generator 回归覆盖

- 更新 CQRS 恢复文档与本轮验证记录
- 新增 mixed fallback 禁用多实例 attribute 时的字符串回退覆盖

- 补充 runtime AttributeUsage 变体测试辅助方法

- 更新 CQRS 恢复文档与本轮验证记录
- 新增缺少 ICqrsHandlerRegistry 时的 generator 静默跳过覆盖

- 更新 CQRS 恢复文档与本轮验证记录
- 新增缺少 notification handler 合同时的 generator 静默跳过覆盖

- 新增缺少 stream handler 合同时的 generator 静默跳过覆盖

- 新增缺少 registry attribute 合同时的 generator 静默跳过覆盖

- 更新 CQRS 恢复文档与本轮验证记录
- 新增缺少 ILogger 合同时的 generator 静默跳过覆盖

- 新增缺少 IServiceCollection 合同时的 generator 静默跳过覆盖

- 更新 CQRS 恢复文档与本轮验证记录
- 新增缺少 IRequestHandler 合同时的 generator 静默跳过覆盖

- 更新 CQRS 恢复文档与本轮验证记录
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2274    ↑27 2274    ↑27 0 0 0 0 39.9s    ↑2.1s

Test Results

passed 2274 passed ↑27

Details

tests 2274 tests ↑27
clock 39.9s ↑2.1s
tool nunit
build CI - Build & Test arrow-right build-and-test link #1054
pull-request Feat/cqrs optimization link #323

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2174 0 0 4.8s

build-and-test: Run #1054

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

🎉 All tests passed!

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
CreateStream_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 7 4.6s 4.8s
SendRequestAsync_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 22 2.8s 4.7s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 22 2.1s 2.2s
Generates_Scene_Behavior_Boilerplate 22 1.8s 2.0s
CleanupDuringAcquire_Should_NotCauseRaceCondition 22 1.1s 1.1s
Append_ShouldNotBlock 22 1.0s 1.0s
Context_Caching_Should_Improve_Performance 22 784ms 795ms
PendingCount_ShouldReflectQueuedEntries 22 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 22 404ms 405ms
Cleanup_Should_RemoveUnusedLocks 22 401ms 402ms

± Comparison with run #1026 at 7856e31 | 🎉 No failed tests detected across all runs. | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 22 runs.

Github Test Reporter by CTRF 💚

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 4, 2026

Greptile Summary

This PR expands regression test coverage for the CQRS handler registry source generator across three dimensions: (1) a parameterized test verifying the generator silently skips output when any of seven foundational runtime contracts are missing, (2) a new test locking down the mixed-fallback single-string-attribute path when AllowMultiple = false, and (3) two tests covering request invoker provider gate suppression when CqrsRequestInvokerDescriptor or CqrsRequestInvokerDescriptorEntry is absent. The XML doc comments on supportsRequestInvokerProvider and supportsStreamInvokerProvider are updated to reflect the now-broader descriptor+entry contract check.

Confidence Score: 5/5

Safe to merge — changes are test additions and doc comment updates with no production logic changes.

No production code logic is modified. All new code is test-only. The only previously flagged concern (first-] scan fragility in ReplaceAttributeUsageForType) is a P2 style issue already noted in a prior review and unchanged here. No new P0 or P1 findings.

No files require special attention.

Important Files Changed

Filename Overview
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs Documentation-only change: XML doc comments for supportsRequestInvokerProvider and supportsStreamInvokerProvider parameters generalized to describe the full set of required contracts instead of naming only two interfaces.
GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs Adds four new tests and one helper method: parameterized Does_Not_Generate_Registry_When_Runtime_Lacks_Required_Generation_Contract (7 cases), Emits_String_Fallback_Metadata_For_Mixed_Fallback_When_Runtime_Disallows_Multiple_Fallback_Attributes, and two request descriptor gate tests. The ReplaceAttributeUsageForType helper uses a first-] scan that is fragile for bracket-containing AttributeUsage arguments (previously flagged).
ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md Internal planning document updated to reflect RP-077 through RP-082 recovery points and advance the active PR anchor from #307 to #323.
ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md Trace document appended with detailed verification records for RP-077 through RP-082, documenting each test addition, build result, and next-step guidance.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Generator invoked] --> B{All foundational<br/>runtime contracts present?}
    B -- No --> C[Skip emission entirely<br/>GeneratedSources = empty]
    B -- Yes --> D{supportsRequestInvokerProvider?<br/>descriptor + descriptorEntry present?}
    D -- No --> E[Emit registry only<br/>no ICqrsRequestInvokerProvider]
    D -- Yes --> F[Emit registry + request invoker provider metadata]
    F --> G{Mixed fallback?<br/>AllowMultiple = true?}
    G -- AllowMultiple false --> H[Single string CqrsReflectionFallbackAttribute]
    G -- AllowMultiple true --> I[Type + string split attributes]
Loading

Reviews (2): Last reviewed commit: "docs(cqrs): 同步 PR 恢复锚点" | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Warnings Elapsed time
⚠️ CSHARP dotnet-format yes 1 no 5.13s
✅ REPOSITORY gitleaks yes no no 8.24s
✅ REPOSITORY trufflehog yes no no 6.97s

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

📝 Walkthrough

Walkthrough

该 PR 精化了 CQRS 源生成器的 XML 文档说明并扩展回归测试:新增四个测试和一个测试辅助方法,覆盖运行时缺失生成契约、request invoker provider descriptor 缺失、以及在不允许多重 fallback attribute 下的字符串回退场景;并更新迁移追踪文档记录。

Changes

CQRS Handler Registry 生成器文档与测试完善

Layer / File(s) Summary
文档精化
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs
更新 CreateRequestInvokerEmissionsCreateStreamInvokerEmissions 参数的 XML 注释,改为描述“完整暴露 provider、descriptor 与 descriptor entry 契约”;实现未变。
核心测试扩展
GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs
新增参数化测试 Does_Not_Generate_Registry_When_Runtime_Lacks_Required_Generation_Contract,验证在缺失多种运行时生成契约(如 registry/interface/logger/DI)时生成器不发射注册器源码且无错误诊断。
Request invoker provider 回归测试
GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs
新增 Does_Not_Emit_Request_Invoker_Provider_Metadata_When_Runtime_Lacks_Request_Descriptor_TypeDoes_Not_Emit_Request_Invoker_Provider_Metadata_When_Runtime_Lacks_Request_Descriptor_Entry_Type,验证缺少 CqrsRequestInvokerDescriptorCqrsRequestInvokerDescriptorEntry 时不发射 request provider 相关元数据或 Invoke 方法。
Fallback metadata 测试
GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs
新增 Emits_String_Fallback_Metadata_For_Mixed_Fallback_When_Runtime_Disallows_Multiple_Fallback_Attributes,通过替换 AttributeUsage 限制多实例,验证生成器回退为字符串形式的程序集级 fallback 元数据且不包含 typeof(...) 形式。
测试辅助方法
GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs
新增私有方法 ReplaceAttributeUsageForType(string source, string typeName, string replacementAttributeUsage),用于在测试源码中定位并替换指定类型附近的 AttributeUsage 块。
迁移追踪 / 计划文档
ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md, ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md
将恢复点从 CQRS-REWRITE-RP-076 更新为 CQRS-REWRITE-RP-082,记录新增的回归阶段(RP-077 至 RP-082)、相应的 build/test 校验与通过计数,并调整活跃 PR/锚点为 PR #323``。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive PR标题"Feat/cqrs optimization"过于宽泛且缺乏具体性,未能准确反映本次改动的主要内容。 建议将标题改为更具体的描述,如"Add regression tests for CQRS handler registry generation contracts"或"Refine CQRS handler registry generator documentation and add contract validation tests",以更清晰地传达本PR的核心改动。
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% 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 feat/cqrs-optimization

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

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

🤖 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/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md`:
- Line 21: 更新文档中“ai-plan active 入口”处将当前的 PR 标识从 `PR `#307`` 改为本次变更所在的 `PR
`#323``(替换出现的 `PR `#307`` 字样),并把早期的 `PR `#307`` 和其他历史 PR
及阶段细节移到归档段落或附注中以避免混淆;确保保留原有“RP-082”引用不变并在同段落说明哪个 PR 为当前唯一权威恢复锚点。
🪄 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: d195999b-32d8-4f24-bcae-7f196a24dccd

📥 Commits

Reviewing files that changed from the base of the PR and between ac95202 and b1f406a.

📒 Files selected for processing (4)
  • GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs
  • GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs
  • ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md
  • ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md
📜 Review details
🧰 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.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs
  • GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.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
XML documentation comments must explain intent, contract, and usage constraints instead of restating syntax
If a member participates in lifecycle, threading, registration, or disposal behavior, document that behavior explicitly in XML documentation
Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds/compatibility constraints/edge cases, and registration order/lifecycle sequencing/generated code assumptions
Avoid obvious comments such as // increment i that restate syntax
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interaction with other components, why abstraction exists, and when to use instead of alternatives
Generated logic and generator pipelines MUST explain what is generated, why it is generated, semantic assumptions generator relies on, and any diagnostics or fallback behavior
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling if any
Comments MUST NOT be trivial, redundant, or misleading; prefer explaining why and when, not just what
Code should remain understandable without requiring external context; prefer slightly more explanation over too little for framework code
Missing required documentation is a coding standards violation; code that doe...

Files:

  • GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs
  • GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs
**/*.{cs,csproj,xml,yml,yaml,py,sh,json,js,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use 4 spaces for indentation; do not use tabs

Files:

  • GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs
  • GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs
**/*.{cs,py,sh,js,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Separate logical blocks with blank lines when it improves readability

Files:

  • GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs
  • GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs
**/*.{cs,py,sh,js,ts,json,yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

Keep line length readable; around 120 characters is preferred upper bound

Files:

  • GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs
  • GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs
🧠 Learnings (2)
📚 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.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs
  • GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs
📚 Learning: 2026-04-16T13:25:59.124Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:25:59.124Z
Learning: In the GeWuYou/GFramework repo, treat `global using NUnit.Framework;` as provided project-wide by `GFramework.SourceGenerators.Tests/GlobalUsings.cs` (via GlobalUsings.cs). Do not require or flag missing per-file `using NUnit.Framework;` directives in test `.cs` files under `GFramework.SourceGenerators.Tests/`, since the project-wide global usings already include NUnit (along with other common namespaces).

Applied to files:

  • GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs
🪛 LanguageTool
ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md

[grammar] ~88-~88: Ensure spelling is correct
Context: ... 后运行 - git diff --check - 结果:通过 ## 下一推荐步骤 1. 继续处理 PR #307`` 的剩余 review 收尾,优先保持 `ai-pl...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (7)
GFramework.Cqrs.SourceGenerators/Cqrs/CqrsHandlerRegistryGenerator.SourceEmission.cs (2)

78-96: 文档精化提升了契约要求的表达精度

参数 supportsRequestInvokerProvider 的 XML 文档从"同时暴露 provider 接口与枚举描述符契约"更新为"完整暴露 request invoker provider、descriptor 与 descriptor entry 契约",准确反映了生成逻辑对运行时契约的完整性要求:

  • 明确列举了三种必需的契约类型(provider、descriptor、descriptor entry)
  • 使用"完整暴露"强调所有部分必须同时存在才能继续发射
  • 与实际代码行为一致(第 100-101 行在不支持时返回空集合,第 421-445 行生成代码引用所有三种类型)

该文档改进符合编码规范中"解释意图、契约和使用约束"的要求。


135-149: 文档精化与 request invoker 保持一致

参数 supportsStreamInvokerProvider 的 XML 文档更新与 CreateRequestInvokerEmissions 方法(第 82-83 行)保持了相同的精化模式,准确描述了 stream invoker 相关契约的完整性要求:

  • 明确要求 provider、descriptor 与 descriptor entry 三类契约必须完整存在
  • 与生成逻辑一致(第 153-154 行不支持时返回空集合,第 545-569 行引用全部契约类型)
  • 术语统一性良好,便于维护者理解对称的 request/stream invoker 发射路径
GFramework.SourceGenerators.Tests/Cqrs/CqrsHandlerRegistryGeneratorTests.cs (3)

2335-2393: 基础 generation contract 的参数化回归覆盖很到位。

这组用例同时锁定了“输入可编译、生成器无错误、且应静默不发射”的行为边界,能有效防止 contract gate 回归。


2933-2975: mixed fallback 在单实例 AttributeUsage 下的回退断言实现准确。

通过动态替换 AttributeUsage 并校验仅发射单个字符串 fallback,覆盖了一个容易被忽略的 runtime 兼容分支。


3105-3155: request descriptor / descriptor entry 缺失分支补齐得很好。

新增两个测试与已有 provider gate 规则保持对称,能防止 request provider 元数据“半发射”。

ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md (1)

34-188: 阶段化追踪记录清晰,验证链路完整。

RP-077 到 RP-082 的“补齐点—验证命令—下一步”闭环表达一致,便于后续回放与审计。

ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md (1)

45-92: 新增验证清单与 RP-082 结论衔接良好。

请求/回退/generation gate 三条主线的验证记录已经对齐当前阶段目标,信息组织可读性不错。

Comment thread ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md Outdated
- 更新 CQRS active tracking 的当前 PR 锚点为 PR #323
- 补充 PR review 收敛 trace 与最新验证结果
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2274 2274 0 0 0 0 37.8s    ↓2.0s

Test Results

passed 2274 passed

Details

tests 2274 tests
clock 37.8s ↓2.0s
tool nunit
build CI - Build & Test arrow-right build-and-test link #1055
pull-request Feat/cqrs optimization link #323

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2179 0 0 4.8s

build-and-test: Run #1055

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

🎉 All tests passed!

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
CreateStream_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 8 4.4s 4.8s
SendRequestAsync_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 23 2.7s 4.7s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 23 2.1s 2.2s
Generates_Scene_Behavior_Boilerplate 23 1.9s 2.0s
CleanupDuringAcquire_Should_NotCauseRaceCondition 23 1.1s 1.1s
Append_ShouldNotBlock 23 1.0s 1.0s
Context_Caching_Should_Improve_Performance 23 784ms 795ms
PendingCount_ShouldReflectQueuedEntries 23 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 23 404ms 405ms
Cleanup_Should_RemoveUnusedLocks 23 401ms 402ms

± Comparison with run #1054 at 5899f65 | 🎉 No failed tests detected across all runs. | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 23 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.

🧹 Nitpick comments (1)
ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md (1)

38-91: ⚡ Quick win

可考虑简化重复的验证历史记录。

当前验证历史中 license-header.py --checkgit diff --check 各出现 6 次,且每次结果和备注完全相同。可将重复的基础验证合并为总结性说明(如"RP-077 至 RP-082 各阶段 license header 与 git diff 检查均通过"),仅保留各阶段特有的测试命令和结果,以降低文档维护成本并提升可读性。

由于详细的逐阶段验证已记录在 cqrs-rewrite-migration-trace.md 中,tracking 文档可聚焦于关键验证点和当前状态总览。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md` around
lines 38 - 91, The validation history repeats `python3 scripts/license-header.py
--check` and `git diff --check` multiple times; refactor the section in
cqrs-rewrite-migration-tracking.md to collapse identical, consecutive checks
into a single summarized entry (e.g., "license header and git diff checks passed
across RP-077..RP-082") while preserving unique test results such as the various
`dotnet test` and `dotnet build` lines; ensure you update or add a brief note
pointing to `cqrs-rewrite-migration-trace.md` for the full step-by-step logs and
keep each retained line's command text (e.g., `python3 scripts/license-header.py
--check`, `git diff --check`, `dotnet test ...`) unchanged so they remain
discoverable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md`:
- Around line 38-91: The validation history repeats `python3
scripts/license-header.py --check` and `git diff --check` multiple times;
refactor the section in cqrs-rewrite-migration-tracking.md to collapse
identical, consecutive checks into a single summarized entry (e.g., "license
header and git diff checks passed across RP-077..RP-082") while preserving
unique test results such as the various `dotnet test` and `dotnet build` lines;
ensure you update or add a brief note pointing to
`cqrs-rewrite-migration-trace.md` for the full step-by-step logs and keep each
retained line's command text (e.g., `python3 scripts/license-header.py --check`,
`git diff --check`, `dotnet test ...`) unchanged so they remain discoverable.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9425e0b3-c3b7-4103-a6ee-c34881535b82

📥 Commits

Reviewing files that changed from the base of the PR and between b1f406a and 212d5b1.

📒 Files selected for processing (2)
  • ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md
  • ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Code Quality & Security
  • GitHub Check: Analyze (C#)
  • GitHub Check: Build and Test
  • GitHub Check: submit-nuget
🧰 Additional context used
🪛 LanguageTool
ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md

[grammar] ~192-~192: Ensure spelling is correct
Context: ... active tracking 中仍保留 PR #307`` 作为当前 PR 锚点;本地复核后确认该反馈仍成立 - 已将 active tracking 的当前 PR 锚点、活跃事实、最近 ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md

[grammar] ~26-~26: Ensure spelling is correct
Context: ...OPEN- latest-head review 仍以ai-plan恢复文档收敛为主要待闭环项;代码与测试侧的本地有效问题已收敛 - 远端CTRF最新汇总为2274/2274` passed - ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~93-~93: Ensure spelling is correct
Context: ... 后运行 - git diff --check - 结果:通过 ## 下一推荐步骤 1. 继续处理 PR #323`` 的剩余 review 收尾,优先保持 `ai-pl...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (6)
ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md (3)

12-12: PR 锚点已统一更新至 #323,past review 反馈已完整闭环。

文档中所有 active 恢复入口、当前活跃事实和下一步行动均已从 PR #307 更新为 `PR `#323。Line 21 和 Line 111 明确将 PR #307`` 归档为历史参考,符合 past review comment 的改进建议。

Also applies to: 21-21, 25-25, 95-95


13-21: 当前结论层次清晰地总结了 RP-077 至 RP-082 的递进覆盖。

从 request/stream invoker provider gate 对称回归(RP-077),到 mixed fallback 单字符串回退(RP-078),再到基础 generation gate 的分阶段扩展(RP-079~082),各结论条目精准对应相关 runtime contract 和测试覆盖范围。Line 21 明确锚定 PR #323 和 RP-082 为唯一权威恢复点,与 trace 文档保持一致。


27-27: CTRF 结果更新准确反映了回归测试的增量覆盖。

2247/2247 提升到 2274/2274 通过,净增 27 个测试用例,与 RP-077 至 RP-082 各阶段新增的 CQRS generator 回归测试及其他测试补充相符。

ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md (3)

20-20: 临时输出路径占位符使用得当。

使用 <temporary-json-output> 占位符替代固定路径避免了硬编码临时文件位置,便于不同环境下复现验证步骤。

Also applies to: 198-198


34-214: 分阶段回归测试文档结构清晰。

RP-077 至 RP-082 各阶段文档遵循统一的"阶段描述→验证步骤→下一步"结构,每个验证环节都包含具体命令、通过状态和测试用例数量,便于后续复现和审计。阶段间逻辑递进合理,从 request invoker provider 对称回归逐步扩展到基础 generation gate 的完整覆盖。


189-214: PR 锚点收敛文档完整闭环了先前的 review 反馈。

该段落明确记录了从 PR #307 切换到 `PR `#323 的决策和验证过程,与 past review comment 中指出的锚点漂移问题形成呼应。将 PR #307`` 降级为历史参考而非 active 恢复入口的处理方式合理,避免了后续按错入口恢复的风险。

@GeWuYou GeWuYou merged commit c69942d into main May 4, 2026
7 checks passed
@GeWuYou GeWuYou deleted the feat/cqrs-optimization branch May 4, 2026 13:03
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