mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-12 22:03:30 +08:00
chore(cqrs-rewrite): 更新批处理恢复点
- 更新 cqrs-rewrite 的 active tracking 与 trace,回填本轮多波 batch 的基线、验证与停点结论 - 修复 StreamPipelineBenchmarks 的 trailing whitespace,确保 git diff --check 通过
This commit is contained in:
parent
40efb4f763
commit
370ea20de8
@ -426,7 +426,7 @@ public class StreamPipelineBenchmarks
|
|||||||
public sealed class BenchmarkStreamPipelineBehavior4 : BenchmarkStreamPipelineBehaviorBase
|
public sealed class BenchmarkStreamPipelineBehavior4 : BenchmarkStreamPipelineBehaviorBase
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 为 stream pipeline benchmark 提供 handwritten generated registry,
|
/// 为 stream pipeline benchmark 提供 handwritten generated registry,
|
||||||
/// 让默认 pipeline 宿主也能走真实的 generated stream invoker provider 接线路径。
|
/// 让默认 pipeline 宿主也能走真实的 generated stream invoker provider 接线路径。
|
||||||
|
|||||||
@ -12,111 +12,72 @@ CQRS 迁移与收敛。
|
|||||||
|
|
||||||
## 当前恢复点
|
## 当前恢复点
|
||||||
|
|
||||||
- 恢复点编号:`CQRS-REWRITE-RP-134`
|
- 恢复点编号:`CQRS-REWRITE-RP-135`
|
||||||
- 当前阶段:`Phase 8`
|
- 当前阶段:`Phase 8`
|
||||||
- 当前 PR 锚点:`PR #348`
|
- 当前 PR 锚点:`PR #348`
|
||||||
- 当前结论:
|
- 当前结论:
|
||||||
- 本轮按 `$gframework-batch-boot` 协调多波 non-conflicting subagent,基线固定为
|
- 本轮按 `$gframework-batch-boot 50` 持续协调多波 non-conflicting subagent,基线固定为
|
||||||
`origin/main @ 3b2e6899d5ffdcfb634b28f3846f57528fbf9196 (2026-05-11T12:25:00+08:00)`。
|
`origin/main @ ef4d3d5d (2026-05-11 17:33:43 +0800)`。
|
||||||
- 本轮停止继续扩 batch 的主信号是 `reviewability / context-budget`,不是 `50` 文件阈值;
|
- 当前 branch 相对基线的累计 diff 约为 `7 files / 961 lines`;本轮停点由
|
||||||
自然停点时累计 branch diff 约为 `12 files`,仍明显低于阈值。
|
`context-budget / reviewability` 决定,而不是 `50 files` 阈值。
|
||||||
- CQRS runtime / tests 侧已补齐并提交:
|
- tests 侧已补齐并提交:
|
||||||
- `CqrsNotificationPublisherTests` 锁定“多 publisher 报错”与“单 dispatcher 内 publisher 缓存复用”
|
- `CqrsRegistrationServiceTests`:补空输入、空项过滤、稳定键排序与跨调用跳过边界
|
||||||
- `CqrsGeneratedRequestInvokerProviderTests` 与 `CqrsHandlerRegistrar` 收口 generated descriptor 的异常枚举、
|
- `CqrsHandlerRegistrarTests` 与 `CqrsHandlerRegistrarFallbackFailureTests`:
|
||||||
坏元数据与重复 pair 回退契约
|
补 abstract registry 与缺少无参构造器 registry 的回退 / 抛错覆盖
|
||||||
- `CqrsDispatcherCacheTests` 锁定 request / stream pipeline presence、executor cache 与上下文重新注入组合分支
|
- `CqrsNotificationPublisherTests`:补“零 publisher 回退到默认顺序发布器并缓存”回归
|
||||||
- benchmark 侧已补齐并提交:
|
- benchmark 侧已补齐并提交:
|
||||||
- `RequestStartupBenchmarks` 的 `Mediator` startup 对照
|
- `StreamPipelineBenchmarks`
|
||||||
- `StreamStartupBenchmarks`
|
- `StreamingBenchmarks` 的 steady-state `Mediator` 对照
|
||||||
- `NotificationStartupBenchmarks`
|
- `GFramework.Cqrs.Benchmarks/README.md` 的 stream coverage / gap 同步
|
||||||
- `GFramework.Cqrs.Benchmarks/README.md` 的 current coverage / gap 收口
|
- 本轮未修改 `GFramework.Cqrs` 运行时代码;notification fallback 与 generated registry 激活守卫均由新回归证明现有实现已满足预期。
|
||||||
- 文档与恢复入口侧已补齐并提交:
|
|
||||||
- `GFramework.Cqrs/README.md`
|
|
||||||
- `docs/zh-CN/core/cqrs.md`
|
|
||||||
- `docs/zh-CN/source-generators/cqrs-handler-registry-generator.md`
|
|
||||||
- `ai-plan/public/cqrs-rewrite/archive/**` 顶部导航与跳转约定
|
|
||||||
- 当前 `PR #348` latest-head review 再次复核后:
|
|
||||||
- 跳过 `NotificationLifetimeBenchmarks.HandlerLifetime` 的 `[GenerateEnumExtensions]` 建议,原因是仓库没有“所有枚举统一生成扩展”的约定,且 benchmark 局部枚举不在该能力的强制范围内
|
|
||||||
- 接受并修复 `NotificationLifetimeBenchmarks` 的 scoped 容器释放与公开 XML 文档缺口
|
|
||||||
- 接受并修复 `CqrsHandlerRegistrar` 对 generated descriptor 的“先去重后校验”缺陷,并补回归测试锁定“首条无效、后条有效”的同键场景
|
|
||||||
- 接受并修复 generated descriptor 校验对 `MethodInfo` 使用 `ReferenceEquals` 的过严比较,改为按方法语义等价匹配
|
|
||||||
- 当前尚未提交的收尾切片仅剩:
|
|
||||||
- `GFramework.Cqrs.Benchmarks/Messaging/NotificationLifetimeBenchmarks.cs`
|
|
||||||
- `GFramework.Cqrs.Tests/Cqrs/CqrsRegistrationServiceTests.cs`
|
|
||||||
- `GFramework.Cqrs/README.md`
|
|
||||||
- `docs/zh-CN/core/command.md`
|
|
||||||
- `docs/zh-CN/core/query.md`
|
|
||||||
- 本 tracking / trace 文件本身
|
|
||||||
|
|
||||||
## 当前活跃事实
|
## 当前活跃事实
|
||||||
|
|
||||||
- 当前分支:`feat/cqrs-optimization`
|
- 当前分支:`feat/cqrs-optimization`
|
||||||
- 当前 PR:`PR #348`
|
- 当前 PR:`PR #348`
|
||||||
- 当前写面:
|
- 当前写面:
|
||||||
|
- `GFramework.Cqrs.Benchmarks/Messaging/StreamPipelineBenchmarks.cs`
|
||||||
|
- `GFramework.Cqrs.Benchmarks/Messaging/StreamingBenchmarks.cs`
|
||||||
- `GFramework.Cqrs.Benchmarks/README.md`
|
- `GFramework.Cqrs.Benchmarks/README.md`
|
||||||
- `GFramework.Cqrs.Benchmarks/Messaging/NotificationLifetimeBenchmarks.cs`
|
- `GFramework.Cqrs.Tests/Cqrs/CqrsHandlerRegistrarFallbackFailureTests.cs`
|
||||||
- `GFramework.Cqrs.Benchmarks/Messaging/NotificationStartupBenchmarks.cs`
|
- `GFramework.Cqrs.Tests/Cqrs/CqrsHandlerRegistrarTests.cs`
|
||||||
- `GFramework.Cqrs.Benchmarks/Messaging/RequestStartupBenchmarks.cs`
|
|
||||||
- `GFramework.Cqrs.Benchmarks/Messaging/StreamStartupBenchmarks.cs`
|
|
||||||
- `GFramework.Cqrs.Tests/Cqrs/CqrsDispatcherCacheTests.cs`
|
|
||||||
- `GFramework.Cqrs.Tests/Cqrs/CqrsGeneratedRequestInvokerProviderTests.cs`
|
|
||||||
- `GFramework.Cqrs.Tests/Cqrs/CqrsNotificationPublisherTests.cs`
|
- `GFramework.Cqrs.Tests/Cqrs/CqrsNotificationPublisherTests.cs`
|
||||||
- `GFramework.Cqrs.Tests/Cqrs/CqrsRegistrationServiceTests.cs`
|
- `GFramework.Cqrs.Tests/Cqrs/CqrsRegistrationServiceTests.cs`
|
||||||
- `GFramework.Cqrs/Internal/CqrsHandlerRegistrar.cs`
|
|
||||||
- `GFramework.Cqrs/README.md`
|
|
||||||
- `ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md`
|
- `ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md`
|
||||||
- `ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md`
|
- `ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md`
|
||||||
- `ai-plan/public/cqrs-rewrite/archive/todos/cqrs-rewrite-migration-tracking-history-through-rp131.md`
|
|
||||||
- `ai-plan/public/cqrs-rewrite/archive/traces/cqrs-rewrite-migration-trace-history-through-rp131.md`
|
|
||||||
- `docs/zh-CN/core/command.md`
|
|
||||||
- `docs/zh-CN/core/cqrs.md`
|
|
||||||
- `docs/zh-CN/core/query.md`
|
|
||||||
- `docs/zh-CN/source-generators/cqrs-handler-registry-generator.md`
|
|
||||||
- 当前基线:
|
- 当前基线:
|
||||||
|
- `origin/main @ ef4d3d5d (2026-05-11 17:33:43 +0800)`
|
||||||
- 本轮 batch 启动前,分支相对基线的累计 diff 为 `0 files / 0 lines`
|
- 本轮 batch 启动前,分支相对基线的累计 diff 为 `0 files / 0 lines`
|
||||||
- 当前自然停点时,累计 diff 约为 `12 files`
|
- 当前自然停点时,累计 diff 约为 `7 files / 961 lines`
|
||||||
- 本轮新增 benchmark smoke 结果:
|
- 本轮提交:
|
||||||
- `RequestStartupBenchmarks`
|
- `ef3cfdc4` `test(cqrs): 补充注册服务边界测试`
|
||||||
- `ColdStart_GFrameworkCqrs 61.648 us / 25336 B`
|
- `bcfecd3c` `test(cqrs): 补充 registrar 激活失败分支测试`
|
||||||
- `ColdStart_Mediator 110.867 us / 57872 B`
|
- `59cab567` `test(cqrs-benchmarks): 新增 stream pipeline benchmark 覆盖`
|
||||||
- `ColdStart_MediatR 679.103 us / 606256 B`
|
- `010b7028` `test(cqrs): 补充通知回退回归覆盖`
|
||||||
- `StreamStartupBenchmarks`
|
- `ae1c3b89` `test(cqrs-benchmarks): 补齐 stream steady-state Mediator 对照`
|
||||||
- `ColdStart_GFrameworkReflection 71.13 us / 25504 B`
|
|
||||||
- `ColdStart_GFrameworkGenerated 82.12 us / 28280 B`
|
|
||||||
- `ColdStart_MediatR 933.87 us / 678992 B`
|
|
||||||
- `NotificationStartupBenchmarks`
|
|
||||||
- `ColdStart_GFrameworkCqrs 85.09 us / 24752 B`
|
|
||||||
- `ColdStart_Mediator 136.08 us / 62512 B`
|
|
||||||
- `ColdStart_MediatR 1.379 ms / 719056 B`
|
|
||||||
|
|
||||||
## 当前风险
|
## 当前风险
|
||||||
|
|
||||||
- `NotificationLifetimeBenchmarks` 当前已跑完整默认作业,但还没并入提交;若继续新开 batch,未提交面会明显降低可审查性。
|
- 分支已累积 5 个窄切片提交;若继续在同一 turn 扩 benchmark + docs,reviewability 会明显下降。
|
||||||
- `RequestStartup` 的提交 `8990749d` 连带带入了 `CqrsDispatcherCacheTests.cs`;虽然两条切片均有效且已验证通过,但提交边界不再严格对应单个 ownership slice。
|
- 新增 benchmark 目前只做了编译验证,尚未执行 `StreamPipelineBenchmarks` 或更新后的 `StreamingBenchmarks` 实际作业。
|
||||||
- startup 与 lifetime benchmark 的默认作业结果已足以证明路径与相对量级,但 `Initialization_*` 与少量 short-run 结果仍不应直接当成稳定排序结论。
|
- `ef3cfdc4` 的 commit body 含字面 `\n`;若后续要整理历史,需要在显式允许的前提下单独处理提交格式。
|
||||||
|
|
||||||
## 最近权威验证
|
## 最近权威验证
|
||||||
|
|
||||||
- `dotnet build GFramework.Cqrs.Benchmarks/GFramework.Cqrs.Benchmarks.csproj -c Release`
|
- `dotnet build GFramework.Cqrs.Benchmarks/GFramework.Cqrs.Benchmarks.csproj -c Release`
|
||||||
- 结果:通过,`0 warning / 0 error`
|
- 结果:通过,`0 warning / 0 error`
|
||||||
- `dotnet build GFramework.Cqrs/GFramework.Cqrs.csproj -c Release`
|
- `dotnet test GFramework.Cqrs.Tests/GFramework.Cqrs.Tests.csproj -c Release --filter "FullyQualifiedName~CqrsRegistrationServiceTests|FullyQualifiedName~CqrsHandlerRegistrarTests|FullyQualifiedName~CqrsHandlerRegistrarFallbackFailureTests|FullyQualifiedName~CqrsNotificationPublisherTests"`
|
||||||
- 结果:通过,`0 warning / 0 error`
|
- 结果:通过,`Passed: 36, Failed: 0`
|
||||||
- `dotnet build GFramework.Core/GFramework.Core.csproj -c Release`
|
- `python3 scripts/license-header.py --check --paths GFramework.Cqrs.Benchmarks/Messaging/StreamPipelineBenchmarks.cs GFramework.Cqrs.Benchmarks/Messaging/StreamingBenchmarks.cs GFramework.Cqrs.Benchmarks/README.md GFramework.Cqrs.Tests/Cqrs/CqrsHandlerRegistrarFallbackFailureTests.cs GFramework.Cqrs.Tests/Cqrs/CqrsHandlerRegistrarTests.cs GFramework.Cqrs.Tests/Cqrs/CqrsNotificationPublisherTests.cs GFramework.Cqrs.Tests/Cqrs/CqrsRegistrationServiceTests.cs ai-plan/public/cqrs-rewrite/todos/cqrs-rewrite-migration-tracking.md ai-plan/public/cqrs-rewrite/traces/cqrs-rewrite-migration-trace.md`
|
||||||
- 结果:通过,`0 warning / 0 error`
|
- 结果:待本轮 `ai-plan` 更新后重新确认
|
||||||
- `dotnet test GFramework.Cqrs.Tests/GFramework.Cqrs.Tests.csproj -c Release --filter "FullyQualifiedName~CqrsRegistrationServiceTests"`
|
- `git diff --check origin/main...HEAD`
|
||||||
- 结果:通过,`Passed: 4, Failed: 0`
|
- 结果:发现并修复 `StreamPipelineBenchmarks.cs` 1 处 trailing whitespace;待本轮 `ai-plan` 更新后重新确认
|
||||||
- `dotnet run --project GFramework.Cqrs.Benchmarks/GFramework.Cqrs.Benchmarks.csproj -c Release --no-build -- --artifacts-suffix pr347-req-scoped --filter "*RequestLifetimeBenchmarks.SendRequest_GFrameworkCqrs*" --job short --warmupCount 1 --iterationCount 1 --launchCount 1`
|
|
||||||
- 结果:通过
|
|
||||||
- 备注:`Singleton 52.69 ns / 32 B`、`Transient 57.88 ns / 56 B`、`Scoped 144.72 ns / 368 B`
|
|
||||||
- `dotnet run --project GFramework.Cqrs.Benchmarks/GFramework.Cqrs.Benchmarks.csproj -c Release --no-build -- --artifacts-suffix pr347-stream-scoped --filter "*StreamLifetimeBenchmarks.Stream_GFramework*" --job short --warmupCount 1 --iterationCount 1 --launchCount 1`
|
|
||||||
- 结果:通过
|
|
||||||
- 备注:`Scoped + FirstItem` 约为 `266.7~267.0 ns / 792 B`,`Scoped + DrainAll` 约为 `331.6~332.2 ns / 856 B`
|
|
||||||
|
|
||||||
## 下一推荐步骤
|
## 下一推荐步骤
|
||||||
|
|
||||||
1. 先提交当前未提交的 `NotificationLifetime + registration fallback tests + CQRS/legacy docs` 收尾切片,回收工作树到干净状态。
|
1. 再次运行 `$gframework-pr-review`,复核 `PR #348` latest-head open thread 是否已随着本轮 5 个新提交收敛。
|
||||||
2. 再次运行 `$gframework-pr-review`,复核 `PR #348` latest-head open thread 是否已随着本轮多波 head 收敛。
|
2. 若继续扩 benchmark,优先在 `StreamLifetimeBenchmarks` 或 `StreamStartupBenchmarks` 中补单文件 `Mediator` parity,而不是并行扩多个矩阵。
|
||||||
3. 若继续扩 benchmark,优先从 `GFramework.Cqrs.Benchmarks/README.md` 已明确列出的 gap 中选下一个单文件切片,而不是继续扩大 shared infra 改动面。
|
3. 若切回文档收尾,把 `GFramework.Cqrs/README.md`、`docs/zh-CN/core/command.md`、`docs/zh-CN/core/query.md` 作为单独一波 docs-only 切片处理。
|
||||||
|
|
||||||
## 活跃文档
|
## 活跃文档
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,44 @@ SPDX-License-Identifier: Apache-2.0
|
|||||||
|
|
||||||
# CQRS 重写迁移追踪
|
# CQRS 重写迁移追踪
|
||||||
|
|
||||||
|
## 2026-05-12
|
||||||
|
|
||||||
|
### 阶段:多波 batch 继续收口(CQRS-REWRITE-RP-135)
|
||||||
|
|
||||||
|
- 按 `$gframework-batch-boot 50` 恢复当前 topic,并把基线固定为
|
||||||
|
`origin/main @ ef4d3d5d (2026-05-11 17:33:43 +0800)`。
|
||||||
|
- 启动时确认当前工作树干净,branch diff 为 `0 files / 0 lines`;旧 tracking 中“未提交收尾切片”已不再反映真实仓库状态。
|
||||||
|
- 第 1 波 accepted delegated scope:
|
||||||
|
- `CqrsRegistrationServiceTests`
|
||||||
|
- 补空输入不触发 registrar、忽略空项后按稳定程序集键排序并去重、跨调用跳过已注册键时继续处理剩余新程序集
|
||||||
|
- `CqrsHandlerRegistrarTests` + `CqrsHandlerRegistrarFallbackFailureTests`
|
||||||
|
- 补 abstract registry 与缺少无参构造器 registry 在程序集级回退路径和 direct activation 入口的告警 / 抛错覆盖
|
||||||
|
- `StreamPipelineBenchmarks` + `GFramework.Cqrs.Benchmarks/README.md`
|
||||||
|
- 新增 `0 / 1 / 4` 个 stream pipeline 行为与 `FirstItem / DrainAll` 观测矩阵
|
||||||
|
- README 补齐 stream pipeline coverage、运行示例与 gap 说明
|
||||||
|
- 第 2 波 accepted delegated scope:
|
||||||
|
- `CqrsNotificationPublisherTests`
|
||||||
|
- 补“容器未注册 publisher 时回退到 `SequentialNotificationPublisher`,且首次解析后缓存结果”回归
|
||||||
|
- `StreamingBenchmarks` + `GFramework.Cqrs.Benchmarks/README.md`
|
||||||
|
- 补 steady-state stream 的 `Mediator` 对照
|
||||||
|
- README 将 stream steady-state gap 收口为“lifetime / startup 仍缺 `Mediator` parity”
|
||||||
|
- 主线程验收与修正:
|
||||||
|
- 审核 5 个 worker 提交均未越出 ownership 边界
|
||||||
|
- 在 `StreamPipelineBenchmarks.cs` 修掉 `git diff --check` 报出的 1 处 trailing whitespace
|
||||||
|
- 更新 active tracking / trace 到当前 branch 事实,避免下次 `boot` 继续落到过期恢复点
|
||||||
|
- 本轮权威验证:
|
||||||
|
- `dotnet build GFramework.Cqrs.Benchmarks/GFramework.Cqrs.Benchmarks.csproj -c Release`
|
||||||
|
- `dotnet test GFramework.Cqrs.Tests/GFramework.Cqrs.Tests.csproj -c Release --filter "FullyQualifiedName~CqrsRegistrationServiceTests|FullyQualifiedName~CqrsHandlerRegistrarTests|FullyQualifiedName~CqrsHandlerRegistrarFallbackFailureTests|FullyQualifiedName~CqrsNotificationPublisherTests"`
|
||||||
|
- `python3 scripts/license-header.py --check --paths ...`
|
||||||
|
- `git diff --check origin/main...HEAD`
|
||||||
|
- 当前停点判断:
|
||||||
|
- 当前 branch diff 约为 `7 files / 961 lines`
|
||||||
|
- 明显低于 `50 files` 阈值
|
||||||
|
- 本轮停止信号来自 `context-budget / reviewability`,不是文件预算耗尽
|
||||||
|
- 当前下一步:
|
||||||
|
- 先把本轮主线程修正与 `ai-plan` 更新提交到干净工作树
|
||||||
|
- 再按需要运行 `$gframework-pr-review` 或继续单文件 benchmark parity / docs-only 下一波
|
||||||
|
|
||||||
## 2026-05-11
|
## 2026-05-11
|
||||||
|
|
||||||
### 阶段:PR #348 latest-head review 再收口(CQRS-REWRITE-RP-134)
|
### 阶段:PR #348 latest-head review 再收口(CQRS-REWRITE-RP-134)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user