iter27 cluster-003: delete channel registration backfill + live repair_lark_mirror surface#805
Conversation
… repair_lark_mirror,保留 register_lark_via_nyx + rebuild_projection 违反 CLAUDE.md "读写分离"(ChannelBotRegistrationScopeBackfill 从 readmodel 反推 write candidate)+ "命名/架构" maintainer 反馈(repair_lark_mirror / backfill 暴露技术词,业务语义不清)。 变更(reflector#2 force-pick "delete-repair-surface"): - 删 ChannelBotRegistrationScopeBackfill / NyxRelayApiKeyOwnershipVerifier / RepairLocalMirrorAsync - 删 live route POST /api/channels/registrations/repair-lark-mirror + tool action repair_lark_mirror - rebuild_projection 改 projection-only(不读 readmodel,不调 backfill) - 保留 ChannelBotScopeIdRepairedEvent replay(committed event 兼容) - 删 backfill/repair specific tests; docs/operations runbook 简化 - prompt config / system-prompt 同步:stale readmodel → rebuild_projection;missing local mirror → register_lark_via_nyx Verification: 789 ChannelRuntime tests pass, architecture+docs lint guards green。 LOC: -2651 net production+tests。 Closes #779 ⟦AI:AUTO-LOOP⟧ Co-Authored-By: codex-refactor-loop <noreply@aevatar>
📊 状态卡片 — reviewer 派出
🤖 controller status banner ⟦AI:AUTO-LOOP⟧ |
📊 状态卡片 — reviewer 派出
🤖 controller status banner ⟦AI:AUTO-LOOP⟧ |
📊 状态卡片 — reviewer 派出
🤖 controller status banner ⟦AI:AUTO-LOOP⟧ |
🤖 架构评审通过:未发现 CLAUDE/AGENTS 回归TL;DR
详细说明我按要求读了 重点核对项: 📎 完整 codex 原始输出(存档备查)---
pr: 805
role: architect
verdict: approve
---
## Verdict
Approve from the architecture compliance angle: the PR deletes the readmodel-derived backfill and live `repair_lark_mirror` recovery surface without introducing a new CLAUDE/AGENTS violation.
## Evidence
- No blocking architectural issues found.
- `agents/channels/Aevatar.GAgents.Channel.NyxIdRelay/ChannelCallbackEndpoints.cs:18` and `:182` carry the required `Refactor (iter27/cluster-003-channel-registration-scope-backfill)` Old/New comments, and `HandleRebuildRegistrationsAsync` now dispatches only the projection rebuild command instead of reading `IChannelBotRegistrationQueryPort` and backfilling write candidates. This aligns with CLAUDE.md: "读写分离:`Command -> Event`,`Query -> ReadModel`;异步完成通过事件通知,不在会话内拼装流程。"
- `src/Aevatar.AI.ToolProviders.ChannelAdmin/ChannelRegistrationTool.cs:19`, `:45`, and `:270` remove `repair_lark_mirror` from the tool schema and keep `rebuild_projection` as a command-only dispatch. This aligns with CLAUDE.md: "单一主干,插件扩展:只保留一条权威业务主链路;新能力以插件/模块挂载,禁止平行\"第二系统\"。"
- `agents/Aevatar.GAgents.Channel.Runtime/ChannelBotRegistrationGAgent.cs:20` keeps `ChannelBotScopeIdRepairedEvent` state transition for already-committed replay while removing the live `ChannelBotRepairScopeIdCommand` handler. This aligns with CLAUDE.md: "正常路径禁止 replay:query path 和 projection path 不依赖 `event replay/rebuild/backfill`;replay 只属于后台修复/迁移/灾难恢复。"
- `agents/Aevatar.GAgents.Channel.Runtime/protos/channel_bot_registration.proto:63` removes `ChannelBotRepairScopeIdCommand`; `:93` keeps `ChannelBotScopeIdRepairedEvent` with field numbers `1..4` unchanged. No field-number reuse or renumbering was introduced.
- Scope honesty checked against the implement prompt scope: all diff paths are under the declared channel runtime, NyxIdRelay, NyxidChat, ChannelAdmin tool, or ChannelRuntime test scope; no `docs/canon/*.md` drift and no new NyxID/chrono external-repo dependency were introduced.
- Added-line grep for the requested anti-patterns found no production additions of `actor.HandleEventAsync(`, `SubscribeAsync<EventEnvelope>`, `Task.Delay(`, `GetAwaiter().GetResult()`, `TypeUrl.Contains(...)`, raw `HttpClient`, disabled tests, or new middle-layer cross-request dictionaries. JSON additions are endpoint/tool transport serialization only, not actor state or committed payload storage.
REVIEW_DONE:805:architect:approve
⟦AI:AUTO-LOOP⟧⟦AI:AUTO-LOOP⟧ |
🤖 Quality review:PR 805 建议小修后通过TL;DR
详细说明我没有发现命名漂移、大方法新增、三处以上重复复制,或偏离本 cluster 的 drive-by cleanup。主要问题是两个删除后留下的可读性残留:
refactor self-doc 检查通过:主路径上的 📎 完整 codex 原始输出(存档备查)---
pr: 805
role: quality
verdict: comment
---
## Verdict
Comment: the PR is focused and the refactor self-docs are clear, but two small dead/stale coupling leftovers should be cleaned up.
## Evidence
- `agents/channels/Aevatar.GAgents.Channel.NyxIdRelay/NyxLarkProvisioningService.cs:352` keeps private `NormalizeOptional`, but the PR branch has no remaining caller after `RepairLocalMirrorAsync` was deleted. This is straightforward dead private code left by the removal.
- `src/Aevatar.AI.ToolProviders.ChannelAdmin/ChannelRegistrationTool.cs:106` routes `rebuild_projection` through `ExecuteWithStoreAsync`, whose delegate still requires `IChannelBotRegistrationQueryPort` and whose body resolves/fails on it at lines 123-134. The lambda's `queryPort` parameter is intentionally unused because rebuild is now projection-only, but this keeps a stale read-side dependency in the tool path and makes the new intent harder to read.
- Refactor self-docs are present and legible in the main touched surfaces, including `ChannelBotRegistrationGAgent.cs:20`, `ChannelCallbackEndpoints.cs:17`, `NyxLarkProvisioningService.cs:75`, `ChannelRegistrationTool.cs:19`, and the proto event comment. I did not find naming drift, large new methods, or unrelated drive-by cleanup beyond the stated deletion.
## What would change your verdict (only if comment or reject)
Delete the unused `NormalizeOptional` helper from `NyxLarkProvisioningService`, and split `ChannelRegistrationTool`'s store helper so projection-only rebuild resolves only `IActorRuntime` + `IActorDispatchPort` while delete keeps the query-port dependency.
REVIEW_DONE:805:quality:comment
⟦AI:AUTO-LOOP⟧⟦AI:AUTO-LOOP⟧ |
🤖 测试审查通过:PR 805 覆盖足够TL;DR
详细说明我检查了 touched 测试文件和 PR 分支源码,重点看是否有只为凑覆盖的测试、// 轮询、/Manual trait、断言变松,以及删除 live repair surface 后是否有 no-regression 断言。 关键覆盖点足够: 校验 不再出现在工具描述和 action enum, 只 dispatch 且不读 ; 校验 HTTP rebuild 不再输出 backfill 字段、readmodel 不可用时仍能 dispatch,并确认 endpoint 未注册; 覆盖 仅作为 replay 兼容事件,并断言 live handler 不存在。 验证命令在 PR worktree 运行通过: 正在确定要还原的项目… 已通过! - 失败: 0,通过: 816,已跳过: 0,总计: 816,持续时间: 4 s - Aevatar.GAgents.ChannelRuntime.Tests.dll (net10.0) 为 789 passed / 0 failed / 0 skipped;Test stability guard passed (polling waits constrained by allowlist). 通过。 📎 完整 codex 原始输出(存档备查)
⟦AI:AUTO-LOOP⟧ |
🤖 测试审查通过:PR 805 覆盖足够TL;DR
详细说明我检查了 touched 测试文件和 PR 分支源码,重点看是否有只为凑覆盖的测试、 关键覆盖点足够: 验证命令在 PR worktree 📎 完整 codex 原始输出(存档备查)
⟦AI:AUTO-LOOP⟧ |
📊 codex 进展 review-pr805-architect-r1 (⏳ 进行中; 已跑 8 min)
|
📊 codex 进展 review-pr805-quality-r1 (⏳ 进行中; 已跑 8 min)
|
📊 codex 进展 review-pr805-tests-r1 (⏳ 进行中; 已跑 8 min)
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## auto-refact-dev #805 +/- ##
================================================
Coverage 82.98% 82.98%
================================================
Files 970 970
Lines 61251 61251
Branches 7997 7997
================================================
Hits 50828 50828
Misses 6968 6968
Partials 3455 3455
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Summary
iter27 cluster-003 (high — Auric 命名/架构反馈触发,reflector#2 force-pick)。
ChannelBotRegistrationScopeBackfill从 readmodel 反推 write 候选;并行存在 liverepair_lark_mirrorHTTP/tool/service surface,maintainer 反馈 "整个架构,命名也是很差"。rebuild_projection改 projection-only;运维路径只剩register_lark_via_nyx+rebuild_projection。保留ChannelBotScopeIdRepairedEventreplay 兼容 committed event。违反 CLAUDE.md:
读写分离(readmodel 不可反推 write)+命名语义优先(技术词暴露)+ Auric maintainer 反馈"工具也要业务命名"。Scope
18 files changed (+215/-2866 net -2651)。789 ChannelRuntime tests pass,architecture+docs lint guards green。
设计共识:issue #779 reflector#2 force-pick delete-repair-surface(经 r1-r8 + 2 reflector 收敛)
🤖 Auto-loop / codex-refactor-loop iter27
⟦AI:AUTO-LOOP⟧