Skip to content

Make Studio team command ACK responses honest#765

Open
louis4li wants to merge 4 commits into
devfrom
design/issue-547-studio-team-command-ack
Open

Make Studio team command ACK responses honest#765
louis4li wants to merge 4 commits into
devfrom
design/issue-547-studio-team-command-ack

Conversation

@louis4li
Copy link
Copy Markdown
Contributor

Summary

  • Change Studio team update/archive endpoints to return 202 Accepted command receipts instead of post-state snapshots.
  • Stop re-reading eventually consistent team read models after dispatch and document the ACK semantics in ADR-0024.
  • Update console web clients/tests to treat team command responses as accepted receipts and reject unexpected ACK stages.

Test plan

  • npm --prefix /Users/liyingpei/Desktop/Code/aevatar/apps/aevatar-console-web run tsc
  • npm --prefix /Users/liyingpei/Desktop/Code/aevatar/apps/aevatar-console-web run test -- src/shared/studio/api.test.ts src/pages/teams/detail.test.tsx --runInBand

Closes #547

🤖 Generated with Claude Code

louis4li and others added 3 commits May 19, 2026 18:34
Return accepted receipts for team update/archive so write responses no longer imply readmodel freshness, and document the new contract for clients.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Clarify accepted-command UI messaging and reject unexpected ACK stages so the frontend does not imply read-model freshness beyond the backend contract.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.48%. Comparing base (9888995) to head (4ffccb4).
⚠️ Report is 503 commits behind head on dev.

@@           Coverage Diff           @@
##              dev     #765   +/-   ##
=======================================
  Coverage   82.47%   82.48%           
=======================================
  Files         941      941           
  Lines       60101    60114   +13     
  Branches     7872     7872           
=======================================
+ Hits        49571    49586   +15     
  Misses       7132     7132           
+ Partials     3398     3396    -2     
Flag Coverage Δ
ci 82.48% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
...dServices/ActorDispatchStudioTeamCommandService.cs 96.87% <100.00%> (+0.48%) ⬆️

... 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
Copy link
Copy Markdown
Contributor

loning commented May 26, 2026

🤖 Phase 10 主动 advisory review 派出(非 auto-merge gate)

维度
Phase 10 主动 PR review pool(新 skill 引入,首次 advisory)
PR #765 Make Studio team command ACK responses honest
Author @louis4li(maintainer)
Scope +892 / -96
已 review 0 reviews,9 pass + 4 skip CI
codex 任务 architect / tests / quality 各 1,timeout 3600s
是否需要人介入 ❌ 否(advisory only;maintainer 完全控制 merge)

性质说明:本仓 auto-loop 自动扫开 PR 池主动派 advisory review,不会 auto-merge 本 PR,verdict 仅供 maintainer 参考。可忽略 / 部分采纳 / 全采纳。

🤖 controller status banner

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor

loning commented May 26, 2026

🤖 Phase 10 advisory review — quality

TL;DR

  • 这是什么: PR765 的 readability / naming / simplicity / dead-code 角度 advisory review。
  • 结论: verdict = reject, 只因为 touched PR-head 文件缺少本轮强制的 // Refactor (iterN/cluster-XXX): Old/New 自说明块。
  • 需要 maintainer 做什么: 若要消除该质量阻塞,在核心 contract/service/endpoint 变更处补一段清晰 Old/New refactor self-doc 即可。

详细说明

我按要求用 origin/dev...origin/design/issue-547-studio-team-command-ack 三点 diff 检查,并用 git show origin/design/issue-547-studio-team-command-ack:<path> 阅读 PR head 的完整 touched files。实现本身看起来聚焦: 新的 StudioTeamCommandAcceptedResponse 命名表达业务语义,新增 helper 有调用点,没有看到明显 dead code、过度抽象、大方法或无关 cleanup。

阻塞点是本 review checklist 明确要求 refactor self-doc: // Refactor (iterN/cluster-XXX): 且包含 Old/New blocks。这个 PR 改的是 update/archive 的同步返回语义,属于主要行为重构;但在 touched PR-head 文件里没有找到该 marker。建议在 StudioTeamService.UpdateAsync/ArchiveAsync 附近补一段,说明旧行为是 dispatch 后 reread eventually consistent readmodel,新行为是返回 honest accepted receipt 且不承诺 post-state。

这是 auto-loop 主动 advisory review(非 auto-merge gate)。verdict 仅参考;PR author / maintainer 可忽略 / 部分采纳 / 全采纳 — controller 不会 auto-merge 本 PR,maintainer 控制 merge 决策。


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

## Verdict
Reject from the quality checklist because the major refactor has no mandated `// Refactor (iterN/cluster-XXX):` Old/New self-doc block in the touched PR-head files.

## Evidence
- `src/Aevatar.Studio.Application/Studio/Contracts/TeamContracts.cs:30` introduces the new `StudioTeamCommandAcceptedResponse` public contract, but the touched file has no `// Refactor (iterN/cluster-XXX):` marker or Old/New block explaining the response-shape shift.
- `src/Aevatar.Studio.Application/Studio/Services/StudioTeamService.cs:59` and `src/Aevatar.Studio.Application/Studio/Services/StudioTeamService.cs:94` change update/archive from "dispatch then reread readmodel" to "return accepted receipt", but the PR-head file has no mandated self-doc block at the behavior change site.
- `src/Aevatar.Studio.Hosting/Endpoints/StudioTeamEndpoints.cs:191` and `src/Aevatar.Studio.Hosting/Endpoints/StudioTeamEndpoints.cs:220` change PATCH/archive success responses to `202 Accepted`, but the PR-head file has no `Refactor` Old/New block.
- Exact check run: `git grep -n "Refactor (iter\\|Old:\\|New:" origin/design/issue-547-studio-team-command-ack -- <touched files>` returned no matches. I did not find dead code, harmful single-implementer abstraction, large new methods, or unrelated drive-by cleanup in the implementation pass.

## What would change your verdict (only if comment or reject)
Add a clear self-doc block near the main contract/behavior change, for example `// Refactor (iter96/cluster-547):` with short `Old:` and `New:` lines explaining that update/archive used to dispatch then reread an eventually consistent readmodel, and now return an honest accepted command receipt without post-state. One block in the central service plus endpoint/contract notes if desired would satisfy the quality checklist.

REVIEW_DONE:765:quality:reject

⟦AI:AUTO-LOOP

REVIEW_DONE:765:quality-advisory:reject

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor

loning commented May 26, 2026

🤖 Phase 10 advisory review — architect

TL;DR

  • 这是什么: architecture compliance advisory review for PR 765。
  • 结论: reject advisory;代码主链路把 update/archive 改成 202 Accepted receipt 是符合 ACK 诚实方向的。
  • 需要 maintainer 做什么: 只需在新增 docs/history/... 设计稿正文顶部补一句“非权威归档”声明。
  • 📢 cc 原作者:@louis4li 请 sanity-check 这个 docs governance 小修。

详细说明

我按 CLAUDE.md / AGENTS.md 和 PR diff 做了架构角度检查。StudioTeamService.UpdateAsync / ArchiveAsync 不再 dispatch 后立即读 eventually consistent readmodel,endpoint 返回 202 Accepted + StudioTeamCommandAcceptedResponse,这和 ACK 诚实Query -> ReadModel 分离方向一致;targeted scan 里也没有新增 Task.DelayGetAwaiter().GetResult()TypeUrl.Contains(...)、actor inline dispatch、外部 NyxID / chrono-* 依赖、.proto 字段变更或 disabled tests。

阻塞点只有文档治理:PR 新增 docs/history/2026-05/2026-05-19-issue-547-studio-team-command-ack-design.md,但正文没有明确说它是非权威归档。CLAUDE.md 原文要求:docs/history/ 仅放归档快照,正文必须明确非权威,不得被实现或测试当作规范来源。建议在 H1 后加一行类似“本文为历史设计归档,非当前权威规范;当前决策以 ADR-0024 为准。”,保留 docs/adr/0024-studio-team-command-ack-semantics.md 作为权威决策记录即可。


📎 完整 codex 原始输出(存档备查)
---
pr: 765
role: architect
verdict: reject
---

## Verdict
Reject: the implementation aligns with command ACK/readmodel separation, but the PR introduces a new `docs/history/` document that does not explicitly mark itself non-authoritative.

## Evidence
- `docs/history/2026-05/2026-05-19-issue-547-studio-team-command-ack-design.md:7`: the body starts directly with the design content and never states that the archived document is non-authoritative. This violates `CLAUDE.md` engineering docs rule: "`docs/history/` 仅放归档快照,正文必须明确非权威,不得被实现或测试当作规范来源。"

## What would change your verdict
Add an explicit non-authoritative archive notice to the body of `docs/history/2026-05/2026-05-19-issue-547-studio-team-command-ack-design.md`, near the top after the H1/frontmatter, so readers and future agents cannot treat it as the active specification. Keep ADR-0024 as the authoritative decision record for the ACK semantics.

REVIEW_DONE:765:architect-advisory:reject
⟦AI:AUTO-LOOP

这是 auto-loop 主动 advisory review(非 auto-merge gate)。verdict 仅参考;PR author / maintainer 可忽略 / 部分采纳 / 全采纳 — controller 不会 auto-merge 本 PR,maintainer 控制 merge 决策。

REVIEW_DONE:765:architect-advisory:reject
⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor

loning commented May 26, 2026

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

+role: architect
+verdict: reject
+---
+
+## Verdict
+Reject: the implementation aligns with command ACK/readmodel separation, but the PR introduces a new `docs/history/` document that does not explicitly mark itself non-authoritative.
+
+## Evidence
+- `docs/history/2026-05/2026-05-19-issue-547-studio-team-command-ack-design.md:7`: the body starts directly with the design content and never states that the archived document is non-authoritative. This violates `CLAUDE.md` engineering docs rule: "`docs/history/` 仅放归档快照,正文必须明确非权威,不得被实现或测试当作规范来源。"
+
+## What would change your verdict
+Add an explicit non-authoritative archive notice to the body of `docs/history/2026-05/2026-05-19-issue-547-studio-team-command-ack-design.md`, near the top after the H1/frontmatter, so readers and future agents cannot treat it as the active specification. Keep ADR-0024 as the authoritative decision record for the ACK semantics.
+
+REVIEW_DONE:765:architect-advisory:reject
+⟦AI:AUTO-LOOP⟧

tokens used
81,929
Completed architecture advisory review for PR 765.

Artifact written: [.refactor-loop/artifacts/review-pr765-architect-r1.md](/Users/auric/aevatar/.refactor-loop/artifacts/review-pr765-architect-r1.md)

GitHub comment posted:
`POSTED:architect:765:https://github.com/aevatarAI/aevatar/pull/765#issuecomment-4543396190:Phase 10 advisory review — architect`

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

@loning
Copy link
Copy Markdown
Contributor

loning commented May 26, 2026

📊 codex 进展 review-pr765-quality-advisory (⏳ 进行中; 已跑 11 min)

+
+## Verdict
+Reject from the quality checklist because the major refactor has no mandated `// Refactor (iterN/cluster-XXX):` Old/New self-doc block in the touched PR-head files.
+
+## Evidence
+- `src/Aevatar.Studio.Application/Studio/Contracts/TeamContracts.cs:30` introduces the new `StudioTeamCommandAcceptedResponse` public contract, but the touched file has no `// Refactor (iterN/cluster-XXX):` marker or Old/New block explaining the response-shape shift.
+- `src/Aevatar.Studio.Application/Studio/Services/StudioTeamService.cs:59` and `src/Aevatar.Studio.Application/Studio/Services/StudioTeamService.cs:94` change update/archive from "dispatch then reread readmodel" to "return accepted receipt", but the PR-head file has no mandated self-doc block at the behavior change site.
+- `src/Aevatar.Studio.Hosting/Endpoints/StudioTeamEndpoints.cs:191` and `src/Aevatar.Studio.Hosting/Endpoints/StudioTeamEndpoints.cs:220` change PATCH/archive success responses to `202 Accepted`, but the PR-head file has no `Refactor` Old/New block.
+- Exact check run: `git grep -n "Refactor (iter\\|Old:\\|New:" origin/design/issue-547-studio-team-command-ack -- <touched files>` returned no matches. I did not find dead code, harmful single-implementer abstraction, large new methods, or unrelated drive-by cleanup in the implementation pass.
+
+## What would change your verdict (only if comment or reject)
+Add a clear self-doc block near the main contract/behavior change, for example `// Refactor (iter96/cluster-547):` with short `Old:` and `New:` lines explaining that update/archive used to dispatch then reread an eventually consistent readmodel, and now return an honest accepted command receipt without post-state. One block in the central service plus endpoint/contract notes if desired would satisfy the quality checklist.
+
+REVIEW_DONE:765:quality:reject
+
+⟦AI:AUTO-LOOP⟧

tokens used
103,660
Completed the quality review for PR 765.

Artifact: [.refactor-loop/runs/review-pr765-quality-r1.md](/Users/auric/aevatar/.refactor-loop/runs/review-pr765-quality-r1.md)

Posted GitHub comment: https://github.com/aevatarAI/aevatar/pull/765#issuecomment-4543332214

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

@loning
Copy link
Copy Markdown
Contributor

loning commented May 26, 2026

🤖 Phase 10 advisory review — tests

TL;DR

  • 这是 PR765 的 tests 视角主动 advisory review。
  • 结论: approve; ACK 语义相关的新行为有对应后端、端点和前端 API/页面测试覆盖。
  • maintainer 不需要为 tests 角度追加阻断修改;前端依赖未安装,未能本地执行 jest。

详细说明

我按三点 diff 检查了本次 touched 的生产文件和对应测试文件。核心语义是 Studio Team 的 update/archive 只返回 accepted ACK,不把弱 ACK 伪装成 readmodel 已可见;对应测试已经覆盖了 StudioTeamService 不再回读 query port、command service receipt 与 envelope 绑定、PATCH/archive 端点返回 202 Accepted 和 receipt body,以及前端 API 解码 accepted ACK 并拒绝未知 ackStage

轮询稳定性也检查过:diff 没有新增 Task.DelayThread.Sleep[Skip] 或 manual trait。bash tools/ci/test_stability_guards.sh 通过;dotnet test test/Aevatar.Studio.Tests/Aevatar.Studio.Tests.csproj --nologo --filter "FullyQualifiedName~StudioTeam" 通过 122 个测试。前端目标测试命令因本机 pnpm/jest 依赖不可用未执行:裸 pnpm 不存在,corepack pnpm ... 启动后报 jest: command not found


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

## Verdict
Test coverage and quality are adequate for the ACK semantics diff.

## Evidence
- `test/Aevatar.Studio.Tests/StudioTeamServiceTests.cs:111` and `:125` assert update/archive return the command-port receipt while a throwing query port would fail any post-dispatch readmodel reread.
- `test/Aevatar.Studio.Tests/ActorDispatchStudioTeamCommandServiceTests.cs:67`, `:107`, and `:151` cover update/archive dispatch receipts, envelope command IDs/timestamps, and the no-op update branch with no dispatch and null `CommandId`.
- `test/Aevatar.Studio.Tests/StudioTeamEndpointTests.cs:95`, `:244`, `:263`, and `:287` cover `202 Accepted`, `Location`, no-op ACK, escaped receipt location, and receipt bodies that do not contain post-state fields.
- `apps/aevatar-console-web/src/shared/studio/api.test.ts:1219` and `:1362` assert update/archive decode accepted receipts and reject unknown ACK stages; `apps/aevatar-console-web/src/pages/teams/detail.test.tsx:1170` and `:1231` assert accepted user messages and refetch behavior.
- No added `Task.Delay`, `Thread.Sleep`, `[Skip]`, manual trait, or bump-only assertion was found in the diff. `bash tools/ci/test_stability_guards.sh` passed. `dotnet test test/Aevatar.Studio.Tests/Aevatar.Studio.Tests.csproj --nologo --filter "FullyQualifiedName~StudioTeam"` passed with 122 passed, 0 failed, 0 skipped.
- Frontend targeted tests were not run locally because dependencies are unavailable in this checkout: bare `pnpm` was missing, and `corepack pnpm --dir apps/aevatar-console-web test -- --runInBand src/shared/studio/api.test.ts src/pages/teams/detail.test.tsx` failed with `jest: command not found`.

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

REVIEW_DONE:765:tests:approve

这是 auto-loop 主动 advisory review(非 auto-merge gate)。verdict 仅参考;PR author / maintainer 可忽略 / 部分采纳 / 全采纳 — controller 不会 auto-merge 本 PR,maintainer 控制 merge 决策。

REVIEW_DONE:765:tests-advisory:approve
⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor

loning commented May 26, 2026

🤖 Phase 10 advisory review 完成(汇总)

维度 r1 verdict 链接
architect ❌ reject 见上面 architect 评论
tests ✅ approve 见上面 tests 评论
quality ❌ reject 见上面 quality 评论

整体:2/3 reject,1 approve(tests)。

性质:这是 auto-loop 主动 advisory review(非 auto-merge gate)。controller 不会 派 fix codex 改本 PR,不会 auto-merge,不 escalate@louis4li 可:

  • 全采纳 / 部分采纳 / 全忽略
  • 看 architect + quality 评论的具体 evidence 决定是否调整

advisory review 给的 verdict 不进入 Phase 8 fix-merge loop;maintainer 完全控制 merge 决策。

📢 cc @louis4li(PR author)

🤖 controller status banner

⟦AI:AUTO-LOOP⟧

@loning loning added the phase10-reviewed Phase 10 advisory review已完成,head SHA 变即失效 label May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase10-reviewed Phase 10 advisory review已完成,head SHA 变即失效

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Studio team command ACK semantics honest

2 participants