From e746fede7eab609ab6c9d2b58f5538df511ff6e0 Mon Sep 17 00:00:00 2001
From: gewuyou <95328647+GeWuYou@users.noreply.github.com>
Date: Tue, 12 May 2026 11:15:13 +0800
Subject: [PATCH] =?UTF-8?q?chore(cqrs-rewrite):=20=E4=BF=AE=E5=A4=8DPR349?=
=?UTF-8?q?=E8=AF=84=E5=AE=A1=E9=81=97=E7=95=99=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 更新 stream benchmark 的 XML 返回值契约
- 修复通知发布器缓存回归测试的误导性安全网
- 同步 ai-plan 中的当前 PR 锚点与验证结果
---
.../Messaging/StreamPipelineBenchmarks.cs | 3 +++
.../Messaging/StreamingBenchmarks.cs | 1 +
.../Cqrs/CqrsNotificationPublisherTests.cs | 10 +++----
.../todos/cqrs-rewrite-migration-tracking.md | 18 +++++++++----
.../traces/cqrs-rewrite-migration-trace.md | 27 ++++++++++++++++++-
5 files changed, 48 insertions(+), 11 deletions(-)
diff --git a/GFramework.Cqrs.Benchmarks/Messaging/StreamPipelineBenchmarks.cs b/GFramework.Cqrs.Benchmarks/Messaging/StreamPipelineBenchmarks.cs
index 16c4292d..b747e733 100644
--- a/GFramework.Cqrs.Benchmarks/Messaging/StreamPipelineBenchmarks.cs
+++ b/GFramework.Cqrs.Benchmarks/Messaging/StreamPipelineBenchmarks.cs
@@ -146,6 +146,7 @@ public class StreamPipelineBenchmarks
///
/// 直接调用 handler,并按当前观测模式消费响应序列,作为 stream pipeline 编排之外的基线。
///
+ /// 按当前观测模式完成 stream 消费后的等待句柄。
[Benchmark(Baseline = true)]
public ValueTask Stream_Baseline()
{
@@ -155,6 +156,7 @@ public class StreamPipelineBenchmarks
///
/// 通过 GFramework.CQRS runtime 创建 stream,并按当前矩阵配置执行 stream pipeline。
///
+ /// 按当前观测模式完成 stream 消费后的等待句柄。
[Benchmark]
public ValueTask Stream_GFrameworkCqrs()
{
@@ -169,6 +171,7 @@ public class StreamPipelineBenchmarks
///
/// 通过 MediatR 创建 stream,并按当前矩阵配置执行 stream pipeline,作为外部设计对照。
///
+ /// 按当前观测模式完成 stream 消费后的等待句柄。
[Benchmark]
public ValueTask Stream_MediatR()
{
diff --git a/GFramework.Cqrs.Benchmarks/Messaging/StreamingBenchmarks.cs b/GFramework.Cqrs.Benchmarks/Messaging/StreamingBenchmarks.cs
index b0e6ee5b..bb3f634a 100644
--- a/GFramework.Cqrs.Benchmarks/Messaging/StreamingBenchmarks.cs
+++ b/GFramework.Cqrs.Benchmarks/Messaging/StreamingBenchmarks.cs
@@ -167,6 +167,7 @@ public class StreamingBenchmarks
///
/// 通过 `ai-libs/Mediator` 的 source-generated concrete mediator 创建 stream,并按当前观测模式消费。
///
+ /// 按当前观测模式完成 stream 消费后的等待句柄。
[Benchmark]
public ValueTask Stream_Mediator()
{
diff --git a/GFramework.Cqrs.Tests/Cqrs/CqrsNotificationPublisherTests.cs b/GFramework.Cqrs.Tests/Cqrs/CqrsNotificationPublisherTests.cs
index 21a77a40..25064cd2 100644
--- a/GFramework.Cqrs.Tests/Cqrs/CqrsNotificationPublisherTests.cs
+++ b/GFramework.Cqrs.Tests/Cqrs/CqrsNotificationPublisherTests.cs
@@ -179,12 +179,12 @@ internal sealed class CqrsNotificationPublisherTests
.Returns(() =>
{
notificationPublisherLookupCount++;
- return notificationPublisherLookupCount switch
+ if (notificationPublisherLookupCount == 1)
{
- 1 => Array.Empty