Skip to content

refactor: cluster-006 committed-state publication hook for projection scope activation#744

Closed
loning wants to merge 0 commit into
auto-refact-devfrom
refactor/iter18-cluster-006-committed-state-publication
Closed

refactor: cluster-006 committed-state publication hook for projection scope activation#744
loning wants to merge 0 commit into
auto-refact-devfrom
refactor/iter18-cluster-006-committed-state-publication

Conversation

@loning
Copy link
Copy Markdown
Contributor

@loning loning commented May 20, 2026

Phase 9 r3 consensus:structural(#732)

committed-state publication hook 激活现有 projection scope,删除 command-path activation facade。

关联 #732

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

📊 状态卡片 — reviewer 派出

维度
阶段 派出 codex(role=reviewer)
codex log review-pr744-architect-r1.log
工作目录 /Users/auric/aevatar
timeout 3600s(~60 min 上限)
上下文 r1 architect
下一步自动会做 1. 三 reviewer 完成 verdict marker 2. controller 计算 consensus 3. unanimous → auto-merge / reject → fix r<N+1>
是否需要人介入 ❌ 否(自动推进)

🤖 controller status banner

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

📊 状态卡片 — reviewer 派出

维度
阶段 派出 codex(role=reviewer)
codex log review-pr744-tests-r1.log
工作目录 /Users/auric/aevatar
timeout 3600s(~60 min 上限)
上下文 r1 tests
下一步自动会做 1. 三 reviewer 完成 verdict marker 2. controller 计算 consensus 3. unanimous → auto-merge / reject → fix r<N+1>
是否需要人介入 ❌ 否(自动推进)

🤖 controller status banner

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

📊 状态卡片 — reviewer 派出

维度
阶段 派出 codex(role=reviewer)
codex log review-pr744-quality-r1.log
工作目录 /Users/auric/aevatar
timeout 3600s(~60 min 上限)
上下文 r1 quality
下一步自动会做 1. 三 reviewer 完成 verdict marker 2. controller 计算 consensus 3. unanimous → auto-merge / reject → fix r<N+1>
是否需要人介入 ❌ 否(自动推进)

🤖 controller status banner

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

🤖 Quality review: comment on one oversized routing method

TL;DR

  • 这是什么: PR 744 的 readability / simplicity / dead code 角度复审。
  • 结论是什么: 整体聚焦、命名清楚、未看到死代码;但一个新方法超过质量清单建议的 80 行阈值。
  • 需要 maintainer 做什么: 建议把 service projection activation provider 的大分支拆成更小的 actor-specific helper 后再合并,或接受为小型 follow-up。

详细说明

我给出的 verdict 是 comment,不是 reject。新增的 ICommittedStatePublicationHookIProjectionActivationPlanProviderProjectionActivationPlan 都有明确业务意图,也有多个具体 provider / hook 调用点支撑,不是单实现空抽象;命令路径删除 projection priming 后没有看到残留的无用构造参数或字段。

唯一质量问题在 src/platform/Aevatar.GAgentService.Projection/Orchestration/ServiceCommittedStateProjectionActivationPlanProvider.cs:17:新加的 GetPlans 从 17 行到 108 行,单个 iterator 方法里串了 8 个 actor type 分支和多组 event descriptor 判断。它已经超过本轮 reviewer checklist 的“新/改方法优先 ≤ 80 行”阈值;这里不是功能错误,但会让后续加 projection mapping 时更容易插错位置。建议拆成 actor-specific private helper,或者用精确 mapping table 加少量 helper 表达 deployment / serving set 这类多 plan case。


📎 完整 codex 原始输出(存档备查)

pr: 744
role: quality
verdict: comment

Verdict

Comment: the PR is focused and the new abstraction names are clear, but one new event-to-projection routing method is large enough to deserve a readability follow-up before this pattern spreads.

Evidence

  • src/platform/Aevatar.GAgentService.Projection/Orchestration/ServiceCommittedStateProjectionActivationPlanProvider.cs:17: newly added GetPlans runs from line 17 through line 108 and mixes eight actor-type branches with several event-descriptor checks in one iterator method. That exceeds the review checklist's preferred 80-line method threshold and makes later projection mapping edits easy to misplace; the workflow and governance providers stay much smaller, so this is the only quality nit I found.

What would change your verdict (only if comment or reject)

Split ServiceCommittedStateProjectionActivationPlanProvider.GetPlans into small actor-specific private methods, or replace the top-level actor branch chain with a compact exact mapping table plus narrowly named helpers for multi-plan cases such as deployments and serving sets. Keep the current exact descriptor checks and DurablePlan<TContext> helper.

REVIEW_DONE:744:quality:comment

⟦AI:AUTO-LOOP⟧

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

🤖 Architect review:拒绝,committed event 可能被持久化但不进入投影观察链

TL;DR

  • 这是什么: PR 744 的架构合规复审,只看 CLAUDE/AGENTS 约束。
  • 结论是什么: reject,当前 hook 可能在 event-store commit 之后、observer publish 之前抛错。
  • 需要 maintainer 做什么: 调整为 committed fact 必定先进入观察/投影主链,projection activation 失败不能阻断已提交事实发布。

详细说明

阻塞点在 committed-state publication 的顺序。ConfirmEventsAsync 已经把 domain event 提交到 event store,随后新的 ICommittedStatePublicationHookCommittedStateEventPublisher.PublishAsync 前执行;而 CommittedStateProjectionActivationHook 会把 provider/dispatch 失败转换成异常。结果是:projection activation 服务缺失或失败时,事件已经是 durable committed fact,但不会进入 observer/projection stream。

这直接撞上 CLAUDE.md 条款:committed domain event 必须可观察:write-side 完成 committed event 后必须送入 projection 主链;禁止只落 event store 而不进入可观察流。 建议把 activation 失败移出 pre-publication blocking path:已提交事实必须先进入统一观察/投影链;activation 可以改成 publish 后的 continuation、durable retry,或其他不会阻断 committed fact 可观察性的机制。

另外有一个非阻塞 checklist 问题:几个新增/refactored type 只有方法级 Old/New comment,缺少 type 级 // Refactor (iter18/cluster-006): Old pattern ... New principle ...,详见 artifact。


📎 完整 codex 原始输出(存档备查)

pr: 744
role: architect
verdict: reject

Verdict

reject: the new committed-state activation hook can throw after event-store commit but before observer publication, creating a durable committed event that never reaches the observable projection chain.

Evidence

  • src/Aevatar.Foundation.Core/GAgentBase.TState.cs:179 commits pending domain events through ConfirmEventsAsync, and src/Aevatar.Foundation.Core/GAgentBase.TState.cs:257 then runs ICommittedStatePublicationHook.BeforePublishAsync before CommittedStateEventPublisher.PublishAsync at src/Aevatar.Foundation.Core/GAgentBase.TState.cs:260. src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:37-58 converts provider or dispatch failures into thrown InvalidOperationExceptions, so a projection activation failure can abort publication after the event has already been durably committed. This violates CLAUDE.md: "committed domain event 必须可观察:write-side 完成 committed event 后必须送入 projection 主链;禁止只落 event store 而不进入可观察流。"
  • src/Aevatar.CQRS.Projection.Core/Orchestration/ProjectionActivationPlanDispatcher.cs:41-49 makes publication depend on synchronous projection scope activation (IProjectionScopeActivationService<TLease>.EnsureAsync) before the committed event is published. This regresses the same committed-event observability clause because missing/failed activation blocks the observer stream instead of allowing the committed fact to enter the projection chain and be handled by normal projection durability/retry semantics.
  • Old/New pattern comments are incomplete on refactored types: src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:9, src/Aevatar.CQRS.Projection.Core/Orchestration/ProjectionActivationPlanDispatcher.cs:9, src/platform/Aevatar.GAgentService.Projection/Orchestration/ServiceCommittedStateProjectionActivationPlanProvider.cs:12, src/platform/Aevatar.GAgentService.Governance.Projection/Orchestration/ServiceGovernanceCommittedStateProjectionActivationPlanProvider.cs:11, and src/workflow/Aevatar.Workflow.Projection/Orchestration/WorkflowCommittedStateProjectionActivationPlanProvider.cs:10 have method-level comments but no type-level // Refactor (iter18/cluster-006): Old pattern ... New principle ... block. This is a checklist compliance comment, not the blocking reason.

What would change your verdict

Move projection activation failure out of the pre-publication blocking path. A committed event that has reached event-store commit must still be published to the committed observer/projection stream; activation planning/dispatch can be best-effort with durable retry, or be modeled as a separate observable continuation after CommittedStateEventPublisher.PublishAsync, but it must not be able to strand committed facts in the event store only. Also add the required Old/New refactor comment to each refactored type listed above.

REVIEW_DONE:744:architect:reject
⟦AI:AUTO-LOOP⟧

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

🤖 Tests reviewer: 拒绝,PR 744 测试覆盖不足

TL;DR

  • 这是什么: PR 744 的测试质量视角独立 review。
  • 结论: reject,新增 committed-state activation hook 路径还有真实分支未测,且多处旧行为测试被折叠掉。
  • 需要 maintainer 做什么: 补齐下面列出的行为测试和 source-regression guard 后再重新请求 review。

详细说明

主要问题不是测试命名或小瑕疵,而是覆盖缺口。CommittedStateProjectionActivationHook 新增了 dispatcher/activation 失败包装分支,但现有测试只覆盖 provider 失败;ProjectionActivationPlanDispatcher 新增了 activation service 未注册的错误分支,也没有测试。

另外,ServiceCommandApplicationService 仍保留多条不同 command 分支,但测试把原来覆盖 update/default/revision/deployment/rollout lifecycle 的用例折叠成少数 broad dispatch 测试,多个 public 方法不再被执行。ResponsesAgentToolStateCommandAdapter 也在删除 projection ensure 的同时丢掉了 todo/task/web trace 解析边界测试。cluster-006 是“去掉 command-path projection activation”的 no-regression refactor,建议增加读取源码的 guard,例如断言相关类源码不再包含 EnsureProjectionAsync / projection activation 端口调用。


📎 完整 codex 原始输出(存档备查)

pr: 744
role: tests
verdict: reject

Verdict

Reject: the PR adds the committed-state activation hook path, but leaves net-new failure branches and several changed command/adapter behaviors without behavior-level regression coverage.

Evidence

  • src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:50-58 adds the activation-service failure branch that wraps dispatcher failures as Projection activation failed ...; test/Aevatar.CQRS.Projection.Core.Tests/CommittedStateProjectionActivationHookTests.cs:41 only covers provider failure, not dispatcher/activation failure.
  • src/Aevatar.CQRS.Projection.Core/Orchestration/ProjectionActivationPlanDispatcher.cs:41-47 adds the missing IProjectionScopeActivationService<TLease> branch, but CommittedStateProjectionActivationHookTests only registers a happy-path service and never asserts the clear missing-registration failure.
  • src/platform/Aevatar.GAgentService.Application/Services/ServiceCommandApplicationService.cs:32-147 still contains distinct command branches for update/default/revision/deployment/rollout lifecycle methods after removing projection priming, but test/Aevatar.GAgentService.Tests/Application/ServiceCommandApplicationServiceTests.cs:14-88 collapsed the old branch-specific tests and no longer executes UpdateServiceAsync, PrepareRevisionAsync, PublishRevisionAsync, RetireRevisionAsync, SetDefaultServingRevisionAsync, DeactivateServiceDeploymentAsync, AdvanceServiceRolloutAsync, PauseServiceRolloutAsync, or RollbackServiceRolloutAsync.
  • src/platform/Aevatar.GAgentService.Infrastructure/Adapters/ResponsesAgentToolStateCommandAdapter.cs:35-148 keeps parser and generated-id branches while removing projection ensure, but test/Aevatar.GAgentService.Tests/Infrastructure/ResponsesAgentToolStateCommandAdapterTests.cs:27-108 dropped prior behavior coverage for single-string todos, fallback todo keys, malformed/null todo JSON, objects without content, task description fallback keys/non-object/malformed JSON, and generated web trace IDs.
  • Cluster-006 is explicitly a no-regression refactor away from command-path projection activation, but the changed tests add no source-regression assertions such as source.Should().NotContain("EnsureProjectionAsync") / source.Should().NotContain("ActivateAsync(") for the changed application and adapter classes.
  • Clean checks: the test diff adds no Task.Delay, Thread.Sleep, WaitUntilAsync, [Skip], or [Trait("Category","Manual")]; tools/ci/test_polling_allowlist.txt is unchanged.

What would change your verdict (only if comment or reject)

Add focused tests for dispatcher failure/missing activation service; restore behavior-level coverage for every service command branch still present after projection priming removal; restore the parser/generated-ID edge coverage in ResponsesAgentToolStateCommandAdapterTests; and add source-regression guard tests that read the changed command/adapter sources and assert command-path projection activation calls are absent.

REVIEW_DONE:744:tests:reject

⟦AI:AUTO-LOOP⟧

⟦AI:AUTO-LOOP⟧

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 78.92857% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.48%. Comparing base (23620a3) to head (a7873ae).
⚠️ Report is 1 commits behind head on auto-refact-dev.

Files with missing lines Patch % Lines
...eCommittedStateProjectionActivationPlanProvider.cs 60.24% 27 Missing and 6 partials ⚠️
...stration/CommittedStateProjectionActivationHook.cs 72.34% 10 Missing and 3 partials ⚠️
...rchestration/ProjectionActivationPlanDispatcher.cs 75.00% 3 Missing and 3 partials ⚠️
src/Aevatar.Foundation.Core/GAgentBase.TState.cs 87.09% 3 Missing and 1 partial ⚠️
...wCommittedStateProjectionActivationPlanProvider.cs 93.93% 1 Missing and 1 partial ⚠️
...eCommittedStateProjectionActivationPlanProvider.cs 96.55% 0 Missing and 1 partial ⚠️
@@                 Coverage Diff                 @@
##           auto-refact-dev     #744      +/-   ##
===================================================
- Coverage            82.74%   82.48%   -0.27%     
===================================================
  Files                  954      961       +7     
  Lines                60374    60569     +195     
  Branches              7904     7922      +18     
===================================================
+ Hits                 49956    49959       +3     
- Misses                7024     7201     +177     
- Partials              3394     3409      +15     
Flag Coverage Δ
ci 82.48% <78.92%> (-0.27%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...bstractions/Activation/ProjectionActivationPlan.cs 100.00% <100.00%> (ø)
.../EventSourcing/CommittedStatePublicationContext.cs 100.00% <100.00%> (ø)
...ation/Services/ServiceCommandApplicationService.cs 50.00% <100.00%> (-45.69%) ⬇️
...ices/ServiceGovernanceCommandApplicationService.cs 95.74% <100.00%> (-0.75%) ⬇️
...DependencyInjection/ServiceCollectionExtensions.cs 81.81% <100.00%> (+4.89%) ⬆️
...tructure/Adapters/LlmSessionRegistrationAdapter.cs 99.22% <100.00%> (-0.02%) ⬇️
.../Adapters/ResponsesAgentToolStateCommandAdapter.cs 89.17% <100.00%> (-6.46%) ⬇️
...tructure/Adapters/ServiceRunRegistrationAdapter.cs 86.20% <100.00%> (+0.96%) ⬆️
...DependencyInjection/ServiceCollectionExtensions.cs 67.33% <100.00%> (+1.19%) ⬆️
...rkflow.Infrastructure/Runs/WorkflowRunActorPort.cs 80.76% <ø> (+0.10%) ⬆️
... and 7 more

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

📊 状态卡片 — fix 派出

维度
阶段 派出 codex(role=fix)
codex log fix-pr744-r2.log
工作目录 /Users/auric/aevatar-wt-iter18-cluster-006
timeout 5400s(~90 min 上限)
上下文 r2 修 tests reject
下一步自动会做 1. fix r 完成 marker FIX_DONE:... 2. controller commit + push 3. 派 reviewer r<N+1>
是否需要人介入 ❌ 否(自动推进)

🤖 controller status banner

⟦AI:AUTO-LOOP⟧

/// <summary>
/// Maps service committed state events to existing durable projection scopes.
/// </summary>
public sealed class ServiceCommittedStateProjectionActivationPlanProvider : IProjectionActivationPlanProvider
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

这是一个垃圾设计

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

🤖 PR 744 round 2 fix 已完成

TL;DR

  • 这是什么: fix-codex round 2 已处理 architect/tests/quality 的 reject/comment demand。
  • 结论: 已改为 projection activation 失败不阻断 committed observer publication,并补回缺失测试覆盖。
  • 下一步: controller 可提交当前 worktree 并重新派 Phase 8 review,预期 unanimous。

详细说明

本轮核心修复是把 CommittedStateProjectionActivationHook 从“发布前硬失败”改成“记录错误并继续发布”。也就是说,event store 已提交后的 CommittedStateEventPublished 不会因为 projection activation provider 或 activation service 出错而只留在 event store 里,符合 committed domain event 必须可观察 的约束。ProjectionActivationPlanDispatcher 仍保留清晰的 missing registration 错误;hook 侧捕获该错误,避免阻断 committed 事实进入观察链路。

测试侧补回了 reviewer 指出的覆盖缺口:dispatcher failure / missing activation service、service command 各生命周期分支、Responses agent tool parser/generated id 边界,以及 command/adapter source regression guard。quality comment 也已处理:ServiceCommittedStateProjectionActivationPlanProvider.GetPlans 拆成 actor-specific helper,保留精确 descriptor check 与 DurablePlan<TContext>

验证已通过:dotnet build aevatar.slnx --nologo、4 个相关 test project、test_stability_guards.shquery_projection_priming_guard.sharchitecture_guards.sh


📎 完整 codex 原始输出(存档备查)

Fix report for PR 744 round 2

Applied

  • (A) src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:45: changed provider failures from thrown InvalidOperationException into logged best-effort failures so committed observer publication can continue (addresses reviewer:architect's evidence Refactor/project namespace #1).
  • (A) src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:61: changed dispatcher/activation failures from thrown InvalidOperationException into logged best-effort failures so projection activation cannot strand a committed event after event-store commit (addresses reviewer:architect's evidence Refactor/project namespace #1 and Feature/cqrs projection suite #2).
  • (A) src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:11: added type-level Refactor (iter18/cluster-006) Old/New comment (addresses reviewer:architect's evidence MAF-Inspired Framework Improvements #3).
  • (A) src/Aevatar.CQRS.Projection.Core/Orchestration/ProjectionActivationPlanDispatcher.cs:9: added type-level Refactor (iter18/cluster-006) Old/New comment while keeping the dispatcher missing-registration error explicit (addresses reviewer:architect's evidence MAF-Inspired Framework Improvements #3 and reviewer:tests evidence Feature/cqrs projection suite #2).
  • (A) src/platform/Aevatar.GAgentService.Projection/Orchestration/ServiceCommittedStateProjectionActivationPlanProvider.cs:13: added type-level Refactor (iter18/cluster-006) Old/New comment (addresses reviewer:architect's evidence MAF-Inspired Framework Improvements #3).
  • (A) src/platform/Aevatar.GAgentService.Governance.Projection/Orchestration/ServiceGovernanceCommittedStateProjectionActivationPlanProvider.cs:11: added type-level Refactor (iter18/cluster-006) Old/New comment (addresses reviewer:architect's evidence MAF-Inspired Framework Improvements #3).
  • (A) src/workflow/Aevatar.Workflow.Projection/Orchestration/WorkflowCommittedStateProjectionActivationPlanProvider.cs:10: added type-level Refactor (iter18/cluster-006) Old/New comment (addresses reviewer:architect's evidence MAF-Inspired Framework Improvements #3).
  • (A) test/Aevatar.CQRS.Projection.Core.Tests/CommittedStateProjectionActivationHookTests.cs:42: added coverage proving provider failure no longer aborts later activation work or committed publication flow (addresses reviewer:tests evidence Refactor/project namespace #1).
  • (A) test/Aevatar.CQRS.Projection.Core.Tests/CommittedStateProjectionActivationHookTests.cs:58: added coverage proving missing activation service no longer escapes the hook and blocks publication; test/Aevatar.CQRS.Projection.Core.Tests/CommittedStateProjectionActivationHookTests.cs:70 keeps direct dispatcher coverage for the clear missing-registration error (addresses reviewer:tests evidence Feature/cqrs projection suite #2).
  • (A) test/Aevatar.CQRS.Projection.Core.Tests/CommittedStateProjectionActivationHookTests.cs:80: added coverage proving activation dispatch failure no longer aborts publication flow (addresses reviewer:tests evidence Refactor/project namespace #1).
  • (A) test/Aevatar.GAgentService.Tests/Application/ServiceCommandApplicationServiceTests.cs:47: restored behavior-level coverage for create/update/default service definition command branches after projection priming removal (addresses reviewer:tests evidence MAF-Inspired Framework Improvements #3).
  • (A) test/Aevatar.GAgentService.Tests/Application/ServiceCommandApplicationServiceTests.cs:81: restored behavior-level coverage for create/prepare/publish/retire revision command branches after projection priming removal (addresses reviewer:tests evidence MAF-Inspired Framework Improvements #3).
  • (A) test/Aevatar.GAgentService.Tests/Application/ServiceCommandApplicationServiceTests.cs:123: restored behavior-level coverage for activate/deactivate deployment command branches after projection priming removal (addresses reviewer:tests evidence MAF-Inspired Framework Improvements #3).
  • (A) test/Aevatar.GAgentService.Tests/Application/ServiceCommandApplicationServiceTests.cs:197: restored behavior-level coverage for advance/pause/rollback rollout command branches after projection priming removal (addresses reviewer:tests evidence MAF-Inspired Framework Improvements #3).
  • (A) test/Aevatar.GAgentService.Tests/Application/ServiceCommandApplicationServiceTests.cs:235: added source regression guard asserting command source has no EnsureProjectionAsync or ActivateAsync( calls (addresses reviewer:tests evidence Refactor workflow execution lifecycle and align MessageId semantics #5).
  • (A) test/Aevatar.GAgentService.Tests/Infrastructure/ResponsesAgentToolStateCommandAdapterTests.cs:49: restored todo parser coverage for single-string todo, fallback content key, malformed/null JSON, and objects without content (addresses reviewer:tests evidence Aevatar context database #4).
  • (A) test/Aevatar.GAgentService.Tests/Infrastructure/ResponsesAgentToolStateCommandAdapterTests.cs:124: restored task description fallback-key/non-object/malformed JSON coverage (addresses reviewer:tests evidence Aevatar context database #4).
  • (A) test/Aevatar.GAgentService.Tests/Infrastructure/ResponsesAgentToolStateCommandAdapterTests.cs:182: restored generated web trace id coverage (addresses reviewer:tests evidence Aevatar context database #4).
  • (A) test/Aevatar.GAgentService.Tests/Infrastructure/ResponsesAgentToolStateCommandAdapterTests.cs:224: added source regression guard asserting changed registration adapters have no EnsureProjectionAsync or ActivateAsync( calls (addresses reviewer:tests evidence Refactor workflow execution lifecycle and align MessageId semantics #5).
  • (A) src/platform/Aevatar.GAgentService.Projection/Orchestration/ServiceCommittedStateProjectionActivationPlanProvider.cs:21: split GetPlans into compact actor-specific helpers while preserving exact descriptor checks and DurablePlan<TContext> (addresses reviewer:quality's evidence Refactor/project namespace #1).

Rejected as false positive

  • None.

Blocked (cannot fix this round)

  • None.

Build status

  • build: pass (dotnet build aevatar.slnx --nologo, 48 existing warnings, 0 errors)
  • tests: pass (dotnet test test/Aevatar.CQRS.Projection.Core.Tests/Aevatar.CQRS.Projection.Core.Tests.csproj --nologo --no-build: 151 pass, 1 existing skip; dotnet test test/Aevatar.Foundation.Core.Tests/Aevatar.Foundation.Core.Tests.csproj --nologo --no-build: 235 pass; dotnet test test/Aevatar.GAgentService.Tests/Aevatar.GAgentService.Tests.csproj --nologo --no-build: 523 pass; dotnet test test/Aevatar.Workflow.Host.Api.Tests/Aevatar.Workflow.Host.Api.Tests.csproj --nologo --no-build: 330 pass)
  • guards: pass (bash tools/ci/test_stability_guards.sh; bash tools/ci/query_projection_priming_guard.sh; bash tools/ci/architecture_guards.sh)

Recommendation for next round

  • expect unanimous

⟦AI:AUTO-LOOP⟧

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

📊 状态卡片 — reviewer 派出

维度
阶段 派出 codex(role=reviewer)
codex log review-pr744-architect-r2.log
工作目录 /Users/auric/aevatar
timeout 3600s(~60 min 上限)
上下文 r2 architect
下一步自动会做 1. 三 reviewer 完成 verdict marker 2. controller 计算 consensus 3. unanimous → auto-merge / reject → fix r<N+1>
是否需要人介入 ❌ 否(自动推进)

🤖 controller status banner

⟦AI:AUTO-LOOP⟧

@loning loning closed this May 20, 2026
@loning loning force-pushed the refactor/iter18-cluster-006-committed-state-publication branch from a7873ae to 69f128f Compare May 20, 2026 11:29
@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

📊 状态卡片 — reviewer 派出

维度
阶段 派出 codex(role=reviewer)
codex log review-pr744-tests-r2.log
工作目录 /Users/auric/aevatar
timeout 3600s(~60 min 上限)
上下文 r2 tests
下一步自动会做 1. 三 reviewer 完成 verdict marker 2. controller 计算 consensus 3. unanimous → auto-merge / reject → fix r<N+1>
是否需要人介入 ❌ 否(自动推进)

🤖 controller status banner

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

📊 状态卡片 — reviewer 派出

维度
阶段 派出 codex(role=reviewer)
codex log review-pr744-quality-r2.log
工作目录 /Users/auric/aevatar
timeout 3600s(~60 min 上限)
上下文 r2 quality
下一步自动会做 1. 三 reviewer 完成 verdict marker 2. controller 计算 consensus 3. unanimous → auto-merge / reject → fix r<N+1>
是否需要人介入 ❌ 否(自动推进)

🤖 controller status banner

⟦AI:AUTO-LOOP⟧

loning added a commit that referenced this pull request May 20, 2026
⟦AI:AUTO-LOOP⟧

Co-Authored-By: codex-refactor-loop fix r2 <noreply@aevatar>
@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

🤖 Quality r2 review: approve

TL;DR

  • 这是什么: PR 744 的 code quality 复审,重点看命名、简单性、死代码和自文档注释。
  • 结论: approve;r1 提到的 GetPlans 过长问题已拆成 actor-specific helpers。
  • 下一步: maintainer/controller 可以继续合并前的其他角色门禁。

详细说明

本轮用 prompt 指定的三点 diff 复查,并打开了关键 touched files 的完整内容。新增的 CommittedStateProjectionActivationHookProjectionActivationPlanDispatcherIProjectionActivationPlanProvider 等命名能直接表达“committed state publication 触发现有 projection scope 激活”的业务意图;IProjectionActivationPlanProvider 也已有 service/governance/workflow 三个具体 provider,不是单实现抽象。

r1 的可读性意见集中在 ServiceCommittedStateProjectionActivationPlanProvider.GetPlans 过长。r2 里它已经收敛成紧凑 switch,并把 definition/deployment/serving/current-state 等映射拆到小 helper。Refactor Old/New 自文档注释在主要入口和迁移点存在且可读,没有发现无关 cleanup 或死私有成员。


📎 完整 codex 原始输出(存档备查)
---
pr: 744
role: quality
verdict: approve
---

## Verdict
Approve: the r2 diff is readable, focused on committed-state projection activation, and the prior large routing method has been split into clear actor-specific helpers.

## Evidence
- `src/platform/Aevatar.GAgentService.Projection/Orchestration/ServiceCommittedStateProjectionActivationPlanProvider.cs:21`: `GetPlans` is now a compact actor-type switch that delegates descriptor-specific logic to narrowly named helpers such as `DefinitionPlans`, `DeploymentPlans`, and `ServingSetPlans`; the earlier method-size/readability concern is resolved.
- `src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:14`: `CommittedStateProjectionActivationHook`, `IProjectionActivationPlanProvider`, `ProjectionActivationPlan`, and `ProjectionActivationPlanDispatcher` describe the committed-state activation responsibility directly and have multiple concrete provider callers registered in service, governance, and workflow projection modules, so this is not a dead or single-implementer abstraction smell.
- `src/Aevatar.Foundation.Core/GAgentBase.TState.cs:254`: the mandated `// Refactor (iter18/cluster-006):` Old/New block is present at the publication hook call site and reads as a concrete migration note, not a placeholder.
- `src/platform/Aevatar.GAgentService.Application/Services/ServiceCommandApplicationService.cs:133`, `src/platform/Aevatar.GAgentService.Governance.Application/Services/ServiceGovernanceCommandApplicationService.cs:96`, and `src/workflow/Aevatar.Workflow.Infrastructure/Runs/WorkflowRunActorPort.cs:69`: removed command-path projection activation is focused on the cluster intent; I did not find unrelated whitespace/typo cleanup or dead private members left behind.

## What would change your verdict (only if comment or reject)
N/A.

REVIEW_DONE:744:quality:approve

⟦AI:AUTO-LOOP

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

🤖 架构评审通过:PR 744 未发现新增架构违规

TL;DR

  • 这是什么:architect 视角复审 PR 744 r2 的 CLAUDE/AGENTS 架构合规性。
  • 结论:approve;命令路径 projection priming 已移除,改为 committed-state publication hook 触发既有 projection scope。
  • 下一步:controller 可以把本角色结论计入共识,无需作者补改。

详细说明

我按三点检查:一是 Refactor (iter18/cluster-006) Old/New 注释是否覆盖新增/重构的架构接缝;二是新增行是否命中 Task.DelayTypeUrl.ContainsGetAwaiter().GetResult()、中间层事实字典、Host/Application 订阅 EventEnvelope 等已知禁用模式;三是 diff 是否仍在 cluster-006 的 declared scope 或已记录 SCOPE_EXTEND

结论是未发现 blocking 架构问题。核心路径从 command/application service 中删除同步 EnsureProjectionAsync / ActivateAsync,在 actor commit 后、observer publication 前通过 ICommittedStatePublicationHook 生成 projection activation plan;这更贴近“Command -> Event,Query -> ReadModel”和“committed domain event 必须可观察”的要求。唯一新增的 HashSet<PlanKey> 是方法内去重集合,不是服务级 actor/session fact state。


📎 完整 codex 原始输出(存档备查)

pr: 744
role: architect
verdict: approve

Verdict

approve - merge OK from the architect angle; r2 removes command-path projection priming and routes projection activation from the committed-state publication boundary without introducing a new CLAUDE/AGENTS violation.

Evidence

  • src/Aevatar.Foundation.Core/GAgentBase.TState.cs:254: the committed publication hook is invoked before observer publication, matching CLAUDE.md: "committed domain event 必须可观察:write-side 完成 committed event 后必须送入 projection 主链;禁止只落 event store 而不进入可观察流."
  • src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:11 and src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:30: required Refactor (iter18/cluster-006) Old/New comments are present on the new type and key method.
  • src/platform/Aevatar.GAgentService.Application/Services/ServiceCommandApplicationService.cs:150, src/platform/Aevatar.GAgentService.Governance.Application/Services/ServiceGovernanceCommandApplicationService.cs:89, and src/workflow/Aevatar.Workflow.Infrastructure/Runs/WorkflowRunActorPort.cs:69: command/application paths now dispatch commands without EnsureProjectionAsync / ActivateAsync projection priming, aligning with CLAUDE.md: "读写分离:Command -> EventQuery -> ReadModel;异步完成通过事件通知,不在会话内拼装流程."
  • src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:37: the only added HashSet in production is method-local de-duplication, not service-level actor/session fact state, so it does not violate CLAUDE.md: "方法内局部临时集合可用,不得提升为服务级/单例级事实状态字段."
  • Scope check: production/doc changes match the cluster-006 consensus file list in .refactor-loop/prompts/implement-cluster-006.md; the extra project/test files are documented as SCOPE_EXTEND in .refactor-loop/runs/implement-cluster-006.md.
  • Anti-pattern scan on added lines found no new actor.HandleEventAsync( outside runtime, SubscribeAsync<EventEnvelope> in host/application, production Task.Delay(, GetAwaiter().GetResult(), TypeUrl.Contains(...), raw HttpClient constructor, disabled tests, proto field changes, NyxID/chrono references, or service-level cross-actor dictionary facts.

REVIEW_DONE:744:architect:approve

⟦AI:AUTO-LOOP⟧

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

🤖 Tests review:拒绝,projection activation provider 分支仍缺测试

TL;DR

  • 这是什么: PR 744 r2 的测试质量复审。
  • 结论: reject,r2 已补回 hook/command/adapter 覆盖,但新增 projection activation provider 仍有多条映射分支未测。
  • 需要 maintainer 做什么: 补齐 provider branch/event-family 行为测试后再重跑 review。

详细说明

阻塞点集中在 IProjectionActivationPlanProvider(committed-state event 到 projection activation plan 的映射器)测试。ServiceCommittedStateProjectionActivationPlanProvider 新增了 revision catalog、serving set、rollout、service-run 等 actor 分支,但当前测试只覆盖 definition、deployment、LLM session、responses tool 和 negative case;这些未测分支是稳定路由逻辑,不是 DTO 字段。

同类问题还在 governance/workflow provider:governance provider 接受 9 类事件 descriptor,但测试只走了 ServiceBindingCreatedEvent;workflow provider 对 WorkflowRunGAgent 的非 bind event 有“只启动 execution materialization”的分支,当前也没有行为断言。稳定性检查方面没有发现新增 Task.Delay / Thread.Sleep / [Skip] / manual trait,allowlist 也没改。


📎 完整 codex 原始输出(存档备查)

pr: 744
role: tests
verdict: reject

Verdict

Reject: r2 fixes the earlier hook/command/adapter gaps, but several net-new projection activation mapping branches still lack behavior coverage.

Evidence

  • src/platform/Aevatar.GAgentService.Projection/Orchestration/ServiceCommittedStateProjectionActivationPlanProvider.cs:31-37 adds separate branches for ServiceRevisionCatalogGAgent, ServiceServingSetManagerGAgent, ServiceRolloutManagerGAgent, ServiceRunGAgent, LlmSessionGAgent, and ResponsesAgentToolStateGAgent; test/Aevatar.GAgentService.Tests/Projection/ServiceCommittedStateProjectionActivationPlanProviderTests.cs:16-80 only asserts definition-created, deployment-activated, LLM session, responses tool, and unrelated cases. There is no behavior assertion for revision catalog, serving set -> serving/traffic, rollout, or service-run current-state plan output.
  • src/platform/Aevatar.GAgentService.Governance.Projection/Orchestration/ServiceGovernanceCommittedStateProjectionActivationPlanProvider.cs:29-37 accepts nine event descriptors, but test/Aevatar.GAgentService.Tests/Projection/ServiceGovernanceCommittedStateProjectionActivationPlanProviderTests.cs:16-53 covers only ServiceBindingCreatedEvent plus a negative case. The updated/retired binding, endpoint catalog, policy, and legacy import event branches are net-new stable routing logic without tests.
  • src/workflow/Aevatar.Workflow.Projection/Orchestration/WorkflowCommittedStateProjectionActivationPlanProvider.cs:33-45 intentionally yields execution materialization for any WorkflowRunGAgent committed event, with an additional binding plan only for BindWorkflowRunDefinitionEvent; test/Aevatar.Workflow.Host.Api.Tests/WorkflowCommittedStateProjectionActivationPlanProviderTests.cs:30-57 covers the bind case and unrelated actor case, but not a non-bind WorkflowRunGAgent event that should produce only execution materialization.
  • Clean checks: the test diff adds no Task.Delay, Thread.Sleep, WaitUntilAsync, [Skip], or [Trait("Category","Manual")]; tools/ci/test_polling_allowlist.txt is unchanged.

What would change your verdict (only if comment or reject)

Add focused provider tests for every new mapping branch/event family: service revision catalog, serving set serving+traffic, rollout, service-run current-state, the governance descriptor alternatives, and a workflow-run non-bind event that proves only execution materialization is activated.

REVIEW_DONE:744:tests:reject
⟦AI:AUTO-LOOP⟧

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

📊 codex 进展 review-pr744-architect-r2 (⏳ 进行中; 已跑 7 min)

+pr: 744
+role: architect
+verdict: approve
+---
+
+## Verdict
+approve - merge OK from the architect angle; r2 removes command-path projection priming and routes projection activation from the committed-state publication boundary without introducing a new CLAUDE/AGENTS violation.
+
+## Evidence
+- `src/Aevatar.Foundation.Core/GAgentBase.TState.cs:254`: the committed publication hook is invoked before observer publication, matching CLAUDE.md: "committed domain event 必须可观察:write-side 完成 committed event 后必须送入 projection 主链;禁止只落 event store 而不进入可观察流."
+- `src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:11` and `src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:30`: required `Refactor (iter18/cluster-006)` Old/New comments are present on the new type and key method.
+- `src/platform/Aevatar.GAgentService.Application/Services/ServiceCommandApplicationService.cs:150`, `src/platform/Aevatar.GAgentService.Governance.Application/Services/ServiceGovernanceCommandApplicationService.cs:89`, and `src/workflow/Aevatar.Workflow.Infrastructure/Runs/WorkflowRunActorPort.cs:69`: command/application paths now dispatch commands without `EnsureProjectionAsync` / `ActivateAsync` projection priming, aligning with CLAUDE.md: "读写分离:`Command -> Event`,`Query -> ReadModel`;异步完成通过事件通知,不在会话内拼装流程."
+- `src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:37`: the only added `HashSet` in production is method-local de-duplication, not service-level actor/session fact state, so it does not violate CLAUDE.md: "方法内局部临时集合可用,不得提升为服务级/单例级事实状态字段."
+- Scope check: production/doc changes match the cluster-006 consensus file list in `.refactor-loop/prompts/implement-cluster-006.md`; the extra project/test files are documented as `SCOPE_EXTEND` in `.refactor-loop/runs/implement-cluster-006.md`.
+- Anti-pattern scan on added lines found no new `actor.HandleEventAsync(` outside runtime, `SubscribeAsync<EventEnvelope>` in host/application, production `Task.Delay(`, `GetAwaiter().GetResult()`, `TypeUrl.Contains(...)`, raw `HttpClient` constructor, disabled tests, proto field changes, NyxID/chrono references, or service-level cross-actor dictionary facts.
+
+REVIEW_DONE:744:architect:approve
+
+⟦AI:AUTO-LOOP⟧

tokens used
126,540
Done.

Wrote the review artifact at [.refactor-loop/runs/review-pr744-architect-r2.md](/Users/auric/aevatar/.refactor-loop/runs/review-pr744-architect-r2.md) with verdict `approve`.

自动更新每 10 分钟;edit-in-place 不堆评论;codex 完成后此 comment 自动删除(per Auric "完成后删掉就好了 否则太占空间")。
🤖 controller progress reporter

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

📊 codex 进展 review-pr744-quality-r2 (⏳ 进行中; 已跑 7 min)

+verdict: approve
+---
+
+## Verdict
+Approve: the r2 diff is readable, focused on committed-state projection activation, and the prior large routing method has been split into clear actor-specific helpers.
+
+## Evidence
+- `src/platform/Aevatar.GAgentService.Projection/Orchestration/ServiceCommittedStateProjectionActivationPlanProvider.cs:21`: `GetPlans` is now a compact actor-type switch that delegates descriptor-specific logic to narrowly named helpers such as `DefinitionPlans`, `DeploymentPlans`, and `ServingSetPlans`; the earlier method-size/readability concern is resolved.
+- `src/Aevatar.CQRS.Projection.Core/Orchestration/CommittedStateProjectionActivationHook.cs:14`: `CommittedStateProjectionActivationHook`, `IProjectionActivationPlanProvider`, `ProjectionActivationPlan`, and `ProjectionActivationPlanDispatcher` describe the committed-state activation responsibility directly and have multiple concrete provider callers registered in service, governance, and workflow projection modules, so this is not a dead or single-implementer abstraction smell.
+- `src/Aevatar.Foundation.Core/GAgentBase.TState.cs:254`: the mandated `// Refactor (iter18/cluster-006):` Old/New block is present at the publication hook call site and reads as a concrete migration note, not a placeholder.
+- `src/platform/Aevatar.GAgentService.Application/Services/ServiceCommandApplicationService.cs:133`, `src/platform/Aevatar.GAgentService.Governance.Application/Services/ServiceGovernanceCommandApplicationService.cs:96`, and `src/workflow/Aevatar.Workflow.Infrastructure/Runs/WorkflowRunActorPort.cs:69`: removed command-path projection activation is focused on the cluster intent; I did not find unrelated whitespace/typo cleanup or dead private members left behind.
+
+## What would change your verdict (only if comment or reject)
+N/A.
+
+REVIEW_DONE:744:quality:approve
+
+⟦AI:AUTO-LOOP⟧

tokens used
104,937
Quality review complete: verdict `approve`.

Artifact written: [.refactor-loop/runs/review-pr744-quality-r2.md](/Users/auric/aevatar/.refactor-loop/runs/review-pr744-quality-r2.md)

自动更新每 10 分钟;edit-in-place 不堆评论;codex 完成后此 comment 自动删除(per Auric "完成后删掉就好了 否则太占空间")。
🤖 controller progress reporter

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 20, 2026

📊 codex 进展 review-pr744-tests-r2 (⏳ 进行中; 已跑 7 min)

+pr: 744
+role: tests
+verdict: reject
+---
+
+## Verdict
+Reject: r2 fixes the earlier hook/command/adapter gaps, but several net-new projection activation mapping branches still lack behavior coverage.
+
+## Evidence
+- `src/platform/Aevatar.GAgentService.Projection/Orchestration/ServiceCommittedStateProjectionActivationPlanProvider.cs:31`-`37` adds separate branches for `ServiceRevisionCatalogGAgent`, `ServiceServingSetManagerGAgent`, `ServiceRolloutManagerGAgent`, `ServiceRunGAgent`, `LlmSessionGAgent`, and `ResponsesAgentToolStateGAgent`; `test/Aevatar.GAgentService.Tests/Projection/ServiceCommittedStateProjectionActivationPlanProviderTests.cs:16`-`80` only asserts definition-created, deployment-activated, LLM session, responses tool, and unrelated cases. There is no behavior assertion for revision catalog, serving set -> serving/traffic, rollout, or service-run current-state plan output.
+- `src/platform/Aevatar.GAgentService.Governance.Projection/Orchestration/ServiceGovernanceCommittedStateProjectionActivationPlanProvider.cs:29`-`37` accepts nine event descriptors, but `test/Aevatar.GAgentService.Tests/Projection/ServiceGovernanceCommittedStateProjectionActivationPlanProviderTests.cs:16`-`53` covers only `ServiceBindingCreatedEvent` plus a negative case. The updated/retired binding, endpoint catalog, policy, and legacy import event branches are net-new stable routing logic without tests.
+- `src/workflow/Aevatar.Workflow.Projection/Orchestration/WorkflowCommittedStateProjectionActivationPlanProvider.cs:33`-`45` intentionally yields execution materialization for any `WorkflowRunGAgent` committed event, with an additional binding plan only for `BindWorkflowRunDefinitionEvent`; `test/Aevatar.Workflow.Host.Api.Tests/WorkflowCommittedStateProjectionActivationPlanProviderTests.cs:30`-`57` covers the bind case and unrelated actor case, but not a non-bind `WorkflowRunGAgent` event that should produce only execution materialization.
+- Clean checks: the test diff adds no `Task.Delay`, `Thread.Sleep`, `WaitUntilAsync`, `[Skip]`, or `[Trait("Category","Manual")]`; `tools/ci/test_polling_allowlist.txt` is unchanged.
+
+## What would change your verdict (only if comment or reject)
+Add focused provider tests for every new mapping branch/event family: service revision catalog, serving set serving+traffic, rollout, service-run current-state, the governance descriptor alternatives, and a workflow-run non-bind event that proves only execution materialization is activated.
+
+REVIEW_DONE:744:tests:reject
+⟦AI:AUTO-LOOP⟧

tokens used
82,119
Wrote the tests review artifact at [.refactor-loop/runs/review-pr744-tests-r2.md](/Users/auric/aevatar/.refactor-loop/runs/review-pr744-tests-r2.md).

Verdict: `reject`, due to uncovered net-new projection activation provider mapping branches.

自动更新每 10 分钟;edit-in-place 不堆评论;codex 完成后此 comment 自动删除(per Auric "完成后删掉就好了 否则太占空间")。
🤖 controller progress reporter

loning added a commit that referenced this pull request May 20, 2026
…mmitted-state-publication

refactor: cluster-006 committed-state publication hook(replacing closed PR #744)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-loop Created by codex-refactor-loop skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant