Skip to content

iter49 issue-882 script-command-readmodel-activation: 移 activation 出 command service#886

Merged
loning merged 4 commits into
auto-refact-devfrom
refactor/iter49-cluster-049-script-command-readmodel-activation
May 23, 2026
Merged

iter49 issue-882 script-command-readmodel-activation: 移 activation 出 command service#886
loning merged 4 commits into
auto-refact-devfrom
refactor/iter49-cluster-049-script-command-readmodel-activation

Conversation

@loning
Copy link
Copy Markdown
Contributor

@loning loning commented May 23, 2026

摘要

iter49 issue-882 cluster-049-script-command-readmodel-activation(high,R04-cqrs-read-write-separation)。

Phase 9 共识

META_JUDGE_DONE:consensus:structural:move scope-script authority readmodel activation out of command service into scripting committed-state projection activation plans, with command receipts accepted-only

改动范围

6 files (+217/-41):

  • ScopeScriptCommandApplicationService.cs:删 ActivateAsync calls
  • ScriptingCommittedStateProjectionActivationPlanProvider.cs(新):committed-state activation plan
  • DI 注册:Scripting.Projection ServiceCollectionExtensions
  • 测试:ScopeScriptCommandApplicationServiceTests + ScriptingCommittedStateProjectionActivationPlanProviderTests + ScriptingProjectWiringTests

不引入新 actor。

Closes #882

📢 cc: @loning

🤖 Auto-loop / codex-refactor-loop iter49

⟦AI:AUTO-LOOP⟧

…command service,改 committed-state plan provider

按 issue #882 Phase 9 r1 consensus(meta-judge: structural):

- ScopeScriptCommandApplicationService 删 ActivateAsync(definitionActorId/catalogActorId)
- 新 scripting committed-state projection activation plan provider(参考 PR #875 HealthProbe pattern)
- command receipts accepted-only,不暗示 readmodel visibility

不引入新 actor / 不改外部 contract。

Closes #882

⟦AI:AUTO-LOOP⟧
@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

PR #886 quality review r1

Marker: REVIEW_DONE:886:quality:reject

Scope reviewed:

  • git diff origin/auto-refact-dev...origin/refactor/iter49-cluster-049-script-command-readmodel-activation
  • PR HEAD: 11ffa0aee0d5873a41130b2995ef09fa3c8d705d

Verdict: reject.

Findings

  • Blocking: test/Aevatar.GAgentService.Integration.Tests/ScopeScriptCapabilityServiceTests.cs:40 still constructs ScopeScriptCommandApplicationService with the removed IScriptAuthorityReadModelActivationPort argument. The production constructor now takes only definitionCommandPort, catalogCommandPort, and options, so this project no longer compiles. The same test also still asserts the old pre-write activation calls at line 63, which contradicts the intended "activation moves out of command service" behavior.

Quality Notes

  • ScriptingCommittedStateProjectionActivationPlanProvider is long but clear and consistent with existing names like ServiceCommittedStateProjectionActivationPlanProvider and WorkflowCommittedStateProjectionActivationPlanProvider. It accurately says this is scripting-specific, committed-state-triggered, and returns projection activation plans.
  • The production ScopeScriptCommandApplicationService no longer injects IScriptAuthorityReadModelActivationPort and no longer calls ActivateAsync before write commands. That part matches the Phase 9 structural consensus.
  • DI registration is straightforward: dispatcher, committed-state hook, and provider are colocated in AddScriptingProjectionComponents() beside the existing authority projection runtime/port registrations. I did not see a second activation registration surface introduced by this PR.
  • The plan provider maps the same authority readmodel materialization scope used by ScriptDefinitionSnapshotProjector and ScriptCatalogEntryProjector, and the event filters line up with the committed state events those projectors consume.

Verification

  • git diff --check origin/auto-refact-dev...origin/refactor/iter49-cluster-049-script-command-readmodel-activation passed.
  • dotnet test test/Aevatar.GAgentService.Tests/Aevatar.GAgentService.Tests.csproj --no-restore --nologo --filter FullyQualifiedName~ScopeScriptCommandApplicationServiceTests passed: 9 passed.
  • dotnet test test/Aevatar.Scripting.Core.Tests/Aevatar.Scripting.Core.Tests.csproj --no-restore --nologo --filter FullyQualifiedName~ScriptingCommittedStateProjectionActivationPlanProviderTests passed: 3 passed.
  • dotnet test test/Aevatar.GAgentService.Integration.Tests/Aevatar.GAgentService.Integration.Tests.csproj --nologo --filter FullyQualifiedName~ScopeScriptCapabilityServiceTests failed at compile time with CS1729: 'ScopeScriptCommandApplicationService' does not contain a constructor that takes 4 arguments.

REVIEW_DONE:886:quality:reject
⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

PR #886 Tests Review r1

Role: Phase 8 Reviewer (tests)
Head: 11ffa0a
Diff: origin/auto-refact-dev...origin/refactor/iter49-cluster-049-script-command-readmodel-activation

Verdict

reject

Scope Checked

  • ScopeScriptCommandApplicationServiceTests deletion-path coverage.
  • ScriptingCommittedStateProjectionActivationPlanProviderTests plan coverage.
  • Prohibited test patterns: [Skip] and Task.Delay.
  • Compile impact on adjacent scope script tests.

Blocking Finding

test/Aevatar.GAgentService.Integration.Tests/ScopeScriptCapabilityServiceTests.cs was not updated for the command-service activation removal.

The PR removes IScriptAuthorityReadModelActivationPort from ScopeScriptCommandApplicationService, but the integration test still constructs the service with the old fourth constructor argument at line 40 and still asserts the old pre-write activation calls at line 63. That makes Aevatar.GAgentService.Integration.Tests fail to compile, so the test suite does not pass on this PR head.

Required fix:

  • Update ScopeScriptCapabilityServiceTests to construct ScopeScriptCommandApplicationService with the new constructor.
  • Remove or invert the stale assertion that expects definition/catalog readmodel activation from the command service.
  • Keep activation behavior covered through the committed-state projection activation plan provider tests.

Coverage Notes

  • ScopeScriptCommandApplicationServiceTests.UpsertAsync_ShouldDispatchAcceptedOnlyCommandsWithoutReadModelActivation covers the intended deletion path by asserting the execution log is only definition-upsert, then catalog-promote, and by checking the accepted command receipts.
  • ScopeScriptCommandApplicationServiceTests.Constructor_ShouldNotDependOnAuthorityReadModelActivationPort adds a regression guard against reintroducing the activation port dependency.
  • ScriptingCommittedStateProjectionActivationPlanProviderTests covers definition upsert, catalog promotion, rollback requested, rollback completed, and negative cases for unrelated actor/event combinations.
  • ScriptingProjectWiringTests covers DI registration of the scripting activation plan provider.
  • Static scans found no [Skip] or Task.Delay in the changed test files or diff.

Verification

  • git diff --check origin/auto-refact-dev...HEAD: passed.
  • bash tools/ci/test_stability_guards.sh: passed.
  • dotnet test test/Aevatar.GAgentService.Tests/Aevatar.GAgentService.Tests.csproj --no-restore --filter FullyQualifiedName~ScopeScriptCommandApplicationServiceTests --nologo: passed, 9 passed, 0 failed, 0 skipped.
  • dotnet test test/Aevatar.Scripting.Core.Tests/Aevatar.Scripting.Core.Tests.csproj --no-restore --filter 'FullyQualifiedName~ScriptingCommittedStateProjectionActivationPlanProviderTests|FullyQualifiedName~ScriptingProjectWiringTests' --nologo: passed, 5 passed, 0 failed, 0 skipped.
  • dotnet test test/Aevatar.GAgentService.Integration.Tests/Aevatar.GAgentService.Integration.Tests.csproj --nologo --filter FullyQualifiedName~ScopeScriptCapabilityServiceTests: failed at compile time with CS1729: 'ScopeScriptCommandApplicationService' does not contain a constructor that takes 4 arguments.

REVIEW_DONE:886:tests:reject

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

🤖 architect r1: 结构方向正确,但 PR #886 仍需退回修测试编译

TL;DR


详细说明

生产路径我没有看到架构倒退:ScopeScriptCommandApplicationService 已不再注入 IScriptAuthorityReadModelActivationPort,也没有可执行的 ActivateAsync 调用;新增的 ScriptingCommittedStateProjectionActivationPlanProvider 走 committed-state hook 触发已有 projection scope,模式与 #875HealthProbeCommittedStateProjectionActivationPlanProvider 一致;command receipt 仍是 accepted-only handle,没有暗示 committed/read-model-observed;六文件 diff 没引入新 actor type。

阻塞点在 PR HEAD 的未改测试文件:test/Aevatar.GAgentService.Integration.Tests/ScopeScriptCapabilityServiceTests.cs:40-44 仍用旧的 4 参数 constructor 创建 ScopeScriptCommandApplicationService:63 仍断言 command service 会先做 definition/catalog readmodel activation。这导致 Aevatar.GAgentService.Integration.Tests 编译失败,违反仓库规则“变更必须可验证:架构调整需同步文档,且 build/test 通过。”

📎 完整 codex 原始输出(存档备查)
---
pr: 886
role: architect
round: r1
head: 11ffa0aee0d5873a41130b2995ef09fa3c8d705d
verdict: reject
---

# PR #886 architect review r1

Marker: `REVIEW_DONE:886:architect:reject`

Scope reviewed:
- `git diff origin/auto-refact-dev...origin/refactor/iter49-cluster-049-script-command-readmodel-activation`
- PR HEAD: `11ffa0aee0d5873a41130b2995ef09fa3c8d705d`

## Verdict

Reject: the production architecture shape matches the Phase 9 structural consensus, but the PR branch is not verifiable because an integration test still depends on the removed command-service activation port and asserts the old activation behavior.

## Evidence

- `src/platform/Aevatar.GAgentService.Application/Scripts/ScopeScriptCommandApplicationService.cs:12-19` on PR HEAD only depends on `IScriptDefinitionCommandPort`, `IScriptCatalogCommandPort`, and `IOptions<ScopeScriptCapabilityOptions>`; `git grep` on the PR ref finds no executable `ActivateAsync` call in that file. This satisfies the requested "activation out of command service" check.
- `src/Aevatar.Scripting.Projection/Orchestration/ScriptingCommittedStateProjectionActivationPlanProvider.cs:23-36` maps committed `ScriptDefinitionGAgent` and `ScriptCatalogGAgent` state events to activation plans, and `src/Aevatar.Scripting.Projection/Orchestration/ScriptingCommittedStateProjectionActivationPlanProvider.cs:39-48` starts the existing `ScriptAuthorityRuntimeLease` durable materialization scope. This follows the #875 pattern: committed-state hook owns projection activation, no command-path priming.
- `src/Aevatar.Scripting.Projection/DependencyInjection/ServiceCollectionExtensions.cs:114-120` registers `ProjectionActivationPlanDispatcher`, `CommittedStateProjectionActivationHook`, and the scripting `IProjectionActivationPlanProvider` together with the existing scripting projection components. This is the expected committed-state activation registration surface.
- `src/platform/Aevatar.GAgentService.Abstractions/ScopeScripts/ScopeScriptModels.cs:49-52` returns only `ScopeScriptCommandAcceptedHandle` values for the definition/catalog commands, and `src/Aevatar.Scripting.Core/Ports/ScriptingCommandAcceptedReceipt.cs:3-7` is an accepted receipt carrying actor id, command id, correlation id, and accepted time. I did not find committed/read-model-observed semantics added to the command receipt.
- No new actor type is introduced by the six-file diff. The only `ProjectionMaterializationScopeGAgent` / `ProjectionSessionScopeGAgent` references in the changed files are pre-existing runtime registrations in `ServiceCollectionExtensions.cs`; the new file is only a plan provider.
- Blocking verifiability issue: `test/Aevatar.GAgentService.Integration.Tests/ScopeScriptCapabilityServiceTests.cs:40-44` on PR HEAD still constructs `ScopeScriptCommandApplicationService` with the removed `IScriptAuthorityReadModelActivationPort` argument, and `test/Aevatar.GAgentService.Integration.Tests/ScopeScriptCapabilityServiceTests.cs:63` still asserts the old definition/catalog readmodel activation calls. This violates AGENTS: "变更必须可验证:架构调整需同步文档,且 `build/test` 通过。" It also leaves a test asserting the old command-path activation pattern that this PR is supposed to delete.

## What would change the verdict

- Update `test/Aevatar.GAgentService.Integration.Tests/ScopeScriptCapabilityServiceTests.cs` to use the new three-argument `ScopeScriptCommandApplicationService` constructor.
- Remove or invert the stale `authorityReadModelActivationPort.Calls` assertion so integration tests no longer encode command-path readmodel activation.
- Re-run the affected integration test project, at minimum:
  `dotnet test test/Aevatar.GAgentService.Integration.Tests/Aevatar.GAgentService.Integration.Tests.csproj --nologo --filter FullyQualifiedName~ScopeScriptApplicationServicesTests`

## Verification

- `git diff --check origin/auto-refact-dev...origin/refactor/iter49-cluster-049-script-command-readmodel-activation`: passed.
- Greptile triage: no live Greptile comments found for PR #886.
- `dotnet test test/Aevatar.GAgentService.Integration.Tests/Aevatar.GAgentService.Integration.Tests.csproj --nologo --filter FullyQualifiedName~ScopeScriptApplicationServicesTests` in the PR worktree failed at compile time with `CS1729: 'ScopeScriptCommandApplicationService' does not contain a constructor that takes 4 arguments`.

REVIEW_DONE:886:architect:reject
⟦AI:AUTO-LOOP

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

📊 codex 进展 review-pr886-quality-r1 (⏳ 进行中; 已跑 9 min)

+
+REVIEW_DONE:886:quality:reject
+⟦AI:AUTO-LOOP⟧
diff --git a/.refactor-loop/runs/review-pr886-quality-r1.sentinel b/.refactor-loop/runs/review-pr886-quality-r1.sentinel
new file mode 100644
index 0000000000000000000000000000000000000000..e2f4f49e2469150b9a14c4bba0ba84235992a6f7
--- /dev/null
+++ b/.refactor-loop/runs/review-pr886-quality-r1.sentinel
@@ -0,0 +1,2 @@
+REVIEW_DONE:886:quality:reject
+⟦AI:AUTO-LOOP⟧

tokens used
107,305
PR #886 quality review completed: `reject`.

Blocking finding: `test/Aevatar.GAgentService.Integration.Tests/ScopeScriptCapabilityServiceTests.cs:40` still uses the removed 4-arg `ScopeScriptCommandApplicationService` constructor and asserts old activation calls, so the integration test project fails to compile.

Artifacts written:
- `.refactor-loop/artifacts/review-pr886-quality-r1.md`
- `.refactor-loop/runs/review-pr886-quality-r1.md`
- `.refactor-loop/runs/review-pr886-quality-r1.sentinel`

Posted to GitHub:
https://github.com/aevatarAI/aevatar/pull/886#issuecomment-4524863871

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

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

📊 codex 进展 review-pr886-tests-r1 (⏳ 进行中; 已跑 9 min)

+++ b/.refactor-loop/runs/review-pr886-tests-r1.sentinel
@@ -0,0 +1,3 @@
+REVIEW_DONE:886:tests:reject
+POSTED:https://github.com/aevatarAI/aevatar/pull/886#issuecomment-4524870063
+⟦AI:AUTO-LOOP⟧

tokens used
86,531
完成 Phase 8 tests review。

Marker: `REVIEW_DONE:886:tests:reject`

结论是 `reject`:`test/Aevatar.GAgentService.Integration.Tests/ScopeScriptCapabilityServiceTests.cs` 仍按旧 4 参数构造 `ScopeScriptCommandApplicationService`,并仍断言旧的 activation calls,导致 integration test project 编译失败。

已写入:
- `.refactor-loop/artifacts/review-pr886-tests-r1.md`
- `.refactor-loop/runs/review-pr886-tests-r1.sentinel`

已发 PR 评论:
`https://github.com/aevatarAI/aevatar/pull/886#issuecomment-4524870063`

验证要点:
- 定向 unit tests 通过:9 passed、5 passed、0 skipped
- `test_stability_guards.sh` 通过
- changed tests/diff 未发现 `[Skip]` / `Task.Delay`

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

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

Round 2 integration compile fix applied.

Changed:

  • Updated ScopeScriptCapabilityServiceTests.cs to use the new 3-arg ScopeScriptCommandApplicationService constructor.
  • Removed the obsolete IScriptAuthorityReadModelActivationPort fake and old ActivateAsync assertion; activation now belongs to ScriptingCommittedStateProjectionActivationPlanProvider.
  • Wrote .refactor-loop/runs/fix-pr886-r2.md.

Verification:

  • dotnet build test/Aevatar.GAgentService.Integration.Tests/Aevatar.GAgentService.Integration.Tests.csproj --nologo passed.
  • dotnet test test/Aevatar.GAgentService.Integration.Tests/Aevatar.GAgentService.Integration.Tests.csproj --no-build --nologo --filter FullyQualifiedName~ScopeScriptApplicationServicesTests passed: 7/7.
  • bash tools/ci/test_stability_guards.sh passed.
  • Full integration project test run executes past compile, but one unrelated test currently fails with 503 PROJECTION_DISABLED: ScopeDraftRunActorQueryIntegrationTests.DraftRunEndpoint_ShouldExposeCompletedActorSnapshotViaActorQuery.

FIX_DONE:886:round-2:applied-1:rejected-0:blocked-0

⟦AI:AUTO-LOOP⟧

按 PR #886 r1 全 3 reject 根本因(CS1729 编译错误):

- ScopeScriptCapabilityServiceTests.cs:40 更新 constructor 到新 signature
- 删除/更新旧 ActivateAsync 断言(activation 已移到 ScriptingCommittedStateProjectionActivationPlanProvider)

applied=1 rejected=0 blocked=0(per fix-pr886-r2 codex)

⟦AI:AUTO-LOOP⟧
@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

📊 codex 进展 fix-pr886-r2 (⏳ 进行中; 已跑 9 min)

-        {
-            ct.ThrowIfCancellationRequested();
-            Calls.Add(actorId);
-            return Task.CompletedTask;
-        }
     }
 
     private sealed class FakeScriptCatalogCommandPort : IScriptCatalogCommandPort

tokens used
52,291
Applied PR #886 round 2 fix.

Changed [ScopeScriptCapabilityServiceTests.cs](/Users/auric/aevatar-wt-iter49-cluster-049-script-command-readmodel-activation/test/Aevatar.GAgentService.Integration.Tests/ScopeScriptCapabilityServiceTests.cs): updated `ScopeScriptCommandApplicationService` to the new 3-arg constructor and removed the obsolete activation fake/assertion.

Report written: [.refactor-loop/runs/fix-pr886-r2.md](/Users/auric/aevatar-wt-iter49-cluster-049-script-command-readmodel-activation/.refactor-loop/runs/fix-pr886-r2.md)

Verification:
- `dotnet build test/Aevatar.GAgentService.Integration.Tests/Aevatar.GAgentService.Integration.Tests.csproj --nologo` passed.
- Focused scope-script tests passed: 7/7.
- `bash tools/ci/test_stability_guards.sh` passed.
- Full integration test project compiles and runs, but has one unrelated runtime failure: `503 PROJECTION_DISABLED` in `ScopeDraftRunActorQueryIntegrationTests`.

Posted GH comment: https://github.com/aevatarAI/aevatar/pull/886#issuecomment-4524890702

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

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

🤖 Phase 8 Reviewer — architect (round r2)

TL;DR: approve. r2 removes the stale integration-test constructor/activation assertion, the affected integration tests compile and pass, and no new architecture violation was found in the full PR diff. GitHub would not accept a formal approval from this account because it owns the PR, so this is posted as the review result comment.

Raw artifact
## Phase 8 Reviewer - `architect` (round r2)

PR: #886
HEAD: `df8c6233f4f2eeb92c3cc4d2c9f72fc576e79b98`
Base diff reviewed: `origin/auto-refact-dev...HEAD`

Verdict: approve

### Scope checked

- r1 architect artifact: `.refactor-loop/artifacts/review-pr886-architect-r1.md`
- r2 delta commit: `df8c6233f4f2eeb92c3cc4d2c9f72fc576e79b98`
- Full PR diff against `origin/auto-refact-dev`
- Architecture-sensitive scripting command/projection activation boundary

### Evidence

- `test/Aevatar.GAgentService.Integration.Tests/ScopeScriptCapabilityServiceTests.cs:39`: r2 now constructs `ScopeScriptCommandApplicationService` with the current three-argument signature; the stale `IScriptAuthorityReadModelActivationPort` test double and old activation assertion are gone.
- `src/platform/Aevatar.GAgentService.Application/Scripts/ScopeScriptCommandApplicationService.cs:16`: the command service depends only on definition command port, catalog command port, and options. It no longer injects or calls the authority readmodel activation port.
- `src/platform/Aevatar.GAgentService.Application/Scripts/ScopeScriptCommandApplicationService.cs:50`: `UpsertAsync` dispatches definition/catalog commands and returns accepted command handles; it does not prime or activate read models in the request path.
- `src/Aevatar.Scripting.Projection/Orchestration/ScriptingCommittedStateProjectionActivationPlanProvider.cs:23`: committed scripting authority state events are mapped to durable authority projection activation plans from the committed-state hook path.
- `src/Aevatar.Scripting.Projection/DependencyInjection/ServiceCollectionExtensions.cs:114`: the projection activation dispatcher, committed-state hook, and scripting activation plan provider are registered on the projection composition surface.

### Verification

- `git diff --check origin/auto-refact-dev...HEAD`: passed.
- `dotnet test test/Aevatar.GAgentService.Integration.Tests/Aevatar.GAgentService.Integration.Tests.csproj --nologo --filter FullyQualifiedName~ScopeScriptApplicationServicesTests`: passed, 7 passed, 0 failed, 0 skipped.
- `dotnet test test/Aevatar.GAgentService.Tests/Aevatar.GAgentService.Tests.csproj --nologo --filter FullyQualifiedName~ScopeScriptCommandApplicationServiceTests`: passed, 9 passed, 0 failed, 0 skipped.
- `dotnet test test/Aevatar.Scripting.Core.Tests/Aevatar.Scripting.Core.Tests.csproj --nologo --filter "FullyQualifiedName~ScriptingCommittedStateProjectionActivationPlanProviderTests|FullyQualifiedName~ScriptingProjectWiringTests"`: passed, 5 passed, 0 failed, 0 skipped.
- `dotnet test test/Aevatar.Architecture.Tests/Aevatar.Architecture.Tests.csproj --nologo --filter FullyQualifiedName~CqrsBoundaryTests`: passed, 13 passed, 0 failed, 0 skipped.
- `bash tools/ci/query_projection_priming_guard.sh`: passed.
- `bash tools/ci/test_stability_guards.sh`: passed.
- `DIFF_RANGE=origin/auto-refact-dev...HEAD bash tools/ci/architecture_guards.sh`: passed. `playground_asset_drift_guard` reported `pnpm not found, skipping`, matching the guard's built-in skip behavior.

REVIEW_DONE:886:architect:approve

⟦AI:AUTO-LOOP

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

Phase 8 Reviewer — tests (round r2)

TL;DR: approve. The r1 integration compile blocker is fixed at HEAD df8c6233f4f2eeb92c3cc4d2c9f72fc576e79b98; affected integration tests compile and pass, related targeted tests pass, and the applicable guards pass.

Evidence:

  • ScopeScriptCapabilityServiceTests.cs now uses the current 3-arg ScopeScriptCommandApplicationService constructor.
  • The stale command-path IScriptAuthorityReadModelActivationPort fake/assertion is gone.
  • ScopeScriptApplicationServicesTests: 7 passed.
  • ScopeScriptCommandApplicationServiceTests: 9 passed.
  • ScriptingCommittedStateProjectionActivationPlanProviderTests|ScriptingProjectWiringTests: 5 passed.
  • test_stability_guards.sh, query_projection_priming_guard.sh, and projection_route_mapping_guard.sh: passed.
  • Static scan in changed files found no [Skip], Task.Delay, WaitUntilAsync, GetAwaiter().GetResult(), or TypeUrl.Contains.

Full integration-suite note: Aevatar.GAgentService.Integration.Tests compiles and runs, but currently reports one unrelated runtime failure: ScopeDraftRunActorQueryIntegrationTests... returns 503 PROJECTION_DISABLED. I verified the same isolated test fails on origin/auto-refact-dev with the same response, so this is not a PR #886 regression.

Artifact: .refactor-loop/artifacts/review-pr886-tests-r2.md

REVIEW_DONE:886:tests:approve

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

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

+++ b/.refactor-loop/runs/review-pr886-architect-r2.sentinel
@@ -0,0 +1 @@
+REVIEW_DONE:886:architect:approve

tokens used
139,139
完成。PR #886 r2 architect verdict: `approve`.

Artifact:
- `.refactor-loop/runs/review-pr886-architect-r2.md`
- `.refactor-loop/runs/review-pr886-architect-r2.sentinel`

Marker:
- `REVIEW_DONE:886:architect:approve`

验证通过:
- affected integration tests: `7 passed`
- command service unit tests: `9 passed`
- scripting projection tests: `5 passed`
- CQRS boundary architecture tests: `13 passed`
- `query_projection_priming_guard.sh`
- `test_stability_guards.sh`
- `architecture_guards.sh`

GitHub formal approve 被拒,因为当前账号不能 approve 自己的 PR;已按 review result 发 PR comment:

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

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

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

+⟦AI:AUTO-LOOP⟧
diff --git a/.refactor-loop/runs/review-pr886-tests-r2.sentinel b/.refactor-loop/runs/review-pr886-tests-r2.sentinel
new file mode 100644
index 0000000000000000000000000000000000000000..ce396fc2bbb20121f2701911ab5364a90025b2e5
--- /dev/null
+++ b/.refactor-loop/runs/review-pr886-tests-r2.sentinel
@@ -0,0 +1,3 @@
+REVIEW_DONE:886:tests:approve
+POSTED:https://github.com/aevatarAI/aevatar/pull/886#issuecomment-4524911500
+⟦AI:AUTO-LOOP⟧

tokens used
136,655
Phase 8 tests r2 completed: `approve`.

Artifact and sentinel written:
- `.refactor-loop/artifacts/review-pr886-tests-r2.md`
- `.refactor-loop/runs/review-pr886-tests-r2.md`
- `.refactor-loop/runs/review-pr886-tests-r2.sentinel`

Posted GitHub comment:
https://github.com/aevatarAI/aevatar/pull/886#issuecomment-4524911500

Marker: `REVIEW_DONE:886:tests:approve`

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

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

PR #886 quality review r2

Marker: REVIEW_DONE:886:quality:reject

Scope reviewed:

Verdict: reject.

Findings

Evidence

  • r2 changed only test/Aevatar.GAgentService.Integration.Tests/ScopeScriptCapabilityServiceTests.cs, deleting the stale constructor argument/assertions that encoded command-path readmodel activation.
  • The affected integration class now compiles and passes when targeted under its current name, ScopeScriptApplicationServicesTests: 7 passed, 0 failed.
  • The full Aevatar.GAgentService.Integration.Tests project also compiles locally, so the previous CS1729 blocker is gone.
  • CI coverage-quality fails on run 26328689784, job 77510904092, after these test failures:
    • Aevatar.Foundation.VoicePresence.Tests.VoicePresenceSessionResolverTests.VoicePresenceCapabilityReadModelProjector_should_upsert_committed_runtime_state: timestamp mismatch by 1 ms.
    • Aevatar.GAgentService.Integration.Tests.ScopeDraftRunActorQueryIntegrationTests.DraftRunEndpoint_ShouldExposeCompletedActorSnapshotViaActorQuery: expected 200, got 503 {"code":"PROJECTION_DISABLED","message":"Projection pipeline is disabled."}.
    • Aevatar.Integration.Tests.ScriptAutonomousEvolutionE2ETests.ScriptOnlyFlow_ShouldSpawnTempAndNewAgents_AndPromoteEvolution: Script evolution projection is disabled.
    • Aevatar.Integration.Tests.ScriptAutonomousEvolutionComprehensiveE2ETests.ScriptOnlyFlow_ShouldSelfEvolveAcrossGenerations_WithoutFrameworkChanges: Script evolution projection is disabled.
    • Aevatar.Integration.Tests.ScriptAutonomousEvolutionComprehensiveE2ETests.ScriptOnlyFlow_ShouldDriveMultiScriptMultiRoundEvolution_AndDynamicLifecycle: Script evolution projection is disabled.
    • Aevatar.Integration.Tests.ScriptExternalEvolutionE2ETests.ExternalEvolutionFlow_ShouldPromoteRevisionThroughUnifiedManagerChain: Script evolution projection is disabled.

Verification

  • git diff --check origin/auto-refact-dev...df8c6233: passed.
  • dotnet test test/Aevatar.GAgentService.Tests/Aevatar.GAgentService.Tests.csproj --nologo --no-restore --filter ScopeScriptCommandApplicationServiceTests: passed, 9 passed.
  • dotnet test test/Aevatar.Scripting.Core.Tests/Aevatar.Scripting.Core.Tests.csproj --nologo --no-restore --filter "ScriptingCommittedStateProjectionActivationPlanProviderTests|ScriptingProjectWiringTests": passed, 5 passed.
  • dotnet test test/Aevatar.GAgentService.Integration.Tests/Aevatar.GAgentService.Integration.Tests.csproj --nologo --no-build --filter ScopeScriptApplicationServicesTests: passed, 7 passed.
  • dotnet test test/Aevatar.GAgentService.Integration.Tests/Aevatar.GAgentService.Integration.Tests.csproj --nologo --no-restore: compiled, then failed at runtime on ScopeDraftRunActorQueryIntegrationTests with PROJECTION_DISABLED.
  • gh pr checks 886: coverage-quality failed.

REVIEW_DONE:886:quality:reject
⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

Round 3 Codecov coverage-gap fix applied.

Changed:

  • Added guard/negative-path tests in ScriptingCommittedStateProjectionActivationPlanProviderTests for null context, missing StateEvent / EventData, and ScriptCatalogGAgent with a non-authority payload.
  • This targets the new provider coverage gaps in ScriptingCommittedStateProjectionActivationPlanProvider.cs without changing production code.

Codecov detail:

Verification:

  • dotnet test test/Aevatar.Scripting.Core.Tests/Aevatar.Scripting.Core.Tests.csproj --nologo --no-restore --filter "FullyQualifiedName~ScriptingCommittedStateProjectionActivationPlanProviderTests|FullyQualifiedName~ScriptingProjectWiringTests" --collect:"XPlat Code Coverage" --results-directory artifacts/coverage/pr886-r3-after passed: 7/7.
  • Focused Cobertura for ScriptingCommittedStateProjectionActivationPlanProvider.cs: line-rate 1, branch-rate 1, misses [], partials [].
  • bash tools/ci/test_stability_guards.sh passed.
  • git diff --check passed.

Report: /Users/auric/aevatar/.refactor-loop/runs/fix-pr886-r3.md
Commit: d7d1cfeb

FIX_DONE:886:round-3:applied-1:rejected-0:blocked-0

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

📊 状态 — fix-r3 done + quality reviewer r3 dispatch

fix-r3 commit d7d1cfeb 已存 PR head;coverage 测试补 ScriptingCommittedStateProjectionActivationPlanProvider gap。

r2 only quality reject → r3 派 quality 单 reviewer 验证(architect/tests r2 已 approve);quality approve + CI green → merge。

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

📊 状态 — quality r3 reject(CI infra),派 investigator

quality r3 reject 原因不是 PR 代码:coverage-quality CI integration test 抛 Script evolution projection is disabled(RuntimeScriptEvolutionInteractionService.cs:52)。同 fail pattern 也阻塞 #883/#884

派独立 investigator codex 查根因 → 决策 → 准备 infra fix。本 PR 暂保 reviewing,等 infra issue/PR fix 后重审 quality。

⟦AI:AUTO-LOOP⟧

loning added a commit that referenced this pull request May 23, 2026
…-run projection(同 pattern)

Follow-up #889:同根 PROJECTION_DISABLED pattern 但走 draft-run lifecycle 而非 evolution session。test fixture 调 query 前没 activate draft-run projection → 抛 Projection disabled。

修法同 #889 pattern:test-only DI wrapper,前置 EnsureActorProjectionAsync,不动 production。

验证:
- ScopeDraftRunActorQueryIntegrationTests PASS
- coverage_quality_guard.sh PASS,reached coverage analysis line 88.3% branch 72.3%
- test_stability_guards PASS

#883/#884/#886/#872 等本 PR merge 后应可全 unblock CI。

⟦AI:AUTO-LOOP⟧
loning added a commit that referenced this pull request May 23, 2026
…projection (#890)

* fix(#889): integration fixture pre-activate script evolution session projection

Root: attach-only projection lifecycle refactor 后,integration test 调 ProposeAsync 之前没 activate evolution session projection → RuntimeScriptEvolutionInteractionService 抛 'Script evolution projection is disabled'。CI coverage-quality 暴露此 fixture drift。

修法:test/Aevatar.Integration.Tests/ScriptEvolutionIntegrationTestKit.cs 加 test-only DI wrapper(IScriptEvolutionApplicationService + IScriptEvolutionProposalPort),normalize ScopeId/ProposalId 同 production,resolve sessionActorId via IScriptingActorAddressResolver,EnsureActorProjectionAsync 前置 lease,null 时显式失败。Host-backed 测试 ScriptAutonomousEvolutionOrleans3ClusterConsistencyTests 同样 post-AddScriptCapability 应用。

不动 production runtime semantics。

注:coverage_quality_guard.sh 仍可能 exit 1,因独立 ScopeDraftRunActorQueryIntegrationTests 也走相同 PROJECTION_DISABLED 路径(draft-run 而非 evolution session)— 已 follow-up。

⟦AI:AUTO-LOOP⟧

* fix(#890): ScopeDraftRunActorQueryIntegrationTests pre-activate draft-run projection(同 pattern)

Follow-up #889:同根 PROJECTION_DISABLED pattern 但走 draft-run lifecycle 而非 evolution session。test fixture 调 query 前没 activate draft-run projection → 抛 Projection disabled。

修法同 #889 pattern:test-only DI wrapper,前置 EnsureActorProjectionAsync,不动 production。

验证:
- ScopeDraftRunActorQueryIntegrationTests PASS
- coverage_quality_guard.sh PASS,reached coverage analysis line 88.3% branch 72.3%
- test_stability_guards PASS

#883/#884/#886/#872 等本 PR merge 后应可全 unblock CI。

⟦AI:AUTO-LOOP⟧
@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.81%. Comparing base (116c724) to head (f9199fe).

@@                 Coverage Diff                 @@
##           auto-refact-dev     #886      +/-   ##
===================================================
+ Coverage            82.79%   82.81%   +0.02%     
===================================================
  Files                  991      992       +1     
  Lines                62523    62560      +37     
  Branches              8099     8104       +5     
===================================================
+ Hits                 51763    51807      +44     
+ Misses                7256     7254       -2     
+ Partials              3504     3499       -5     
Flag Coverage Δ
ci 82.81% <100.00%> (+0.02%) ⬆️

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

Files with missing lines Coverage Δ
...DependencyInjection/ServiceCollectionExtensions.cs 96.09% <100.00%> (+0.22%) ⬆️
...gCommittedStateProjectionActivationPlanProvider.cs 100.00% <100.00%> (ø)
...on/Scripts/ScopeScriptCommandApplicationService.cs 93.93% <ø> (+1.08%) ⬆️

... and 3 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 loning merged commit 8596686 into auto-refact-dev May 23, 2026
12 checks passed
@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 23, 2026

🎉 Merged ✅(coverage-quality re-run with #890 fix → 全 GREEN)。Closes #882
⟦AI:AUTO-LOOP⟧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant