Skip to content

Retire unused Todo coordination command paths - #4723

Merged
huangruiteng merged 6 commits into
mainfrom
codex/retire-unused-coordination-wires
Sep 19, 2026
Merged

huangruiteng merged 6 commits into
mainfrom
codex/retire-unused-coordination-wires

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

  • Goal/source and gap: the command audit found two typed internal execution wrappers with no product consumers, and an unused public todo capture-followups command whose migration cost was not justified by product value.
  • Observable before → after, with the validation row that proves it: coordination.local_authority.mutate, coordination.local_authority.todo_compatibility_edit, and todo capture-followups are no longer registered or importable; shared projection reduction/commit preparation and runtime shadow capture remain; todo suggest remains a manual read-only entrypoint. The full control-plane suite, focused Python tests, CLI negative/readback tests, and selected shared-authority ladder rows pass.
  • Issue/task and intended base: owner-requested retirement review against main; supersedes the command-migration direction in refactor(todos): unify follow-up capture with atomic canonical authority #4719.

Scope And Continuation

  • Completed scope and remaining work: removes the two internal wrappers, their request/result contract keys and dedicated tests; directly retires the complete capture-followups CLI/implementation/event/test surface; updates shared-authority fixtures and bilingual RFC checkpoints. Existing todo add remains available, but this PR does not claim to preserve the retired command's atomic batch, deduplication, or replay contract.
  • Slice boundary / successor: complete within this scope. Legacy Python writers and runtime shadow capture remain governed by their existing cutover checkpoints. todo suggest remains intentionally read-only and is not a provider-default prerequisite.

Validation

  • Tested revision: bc3e0c63ad2dd8e63aae2f3e734c37184835b131
  • Run state: finished
  • Input classes: synthetic, public_fixture
Check kind Result Public-safe evidence / limitation
static passed npm run typecheck:control-plane; focused Ruff on every changed extant Python file; mypy on 22 affected source files; git diff --check.
unit passed Focused affected Python suites: 156 passed; CLI diagnostics: 94 passed; todo suggestion prompt smoke passed.
integration passed PATH="$PWD/.venv/bin:$PATH" npm run test:control-plane: 2,017 passed, 18 repository-defined skips, 0 failed.
real_entrypoint passed Selected authority ladder rows s2c1.every_writer_family_captures, s2c1.dual_runtime_root_consistency, and s2c2.parity_equal: 3 passed, 0 failed/pending/unverified.
regression_parity passed Shared-authority fixture callers now use retained domain commands; retired writer-class expectations were removed and sustained Python/TypeScript parity remained matched.
static passed loopx check public-boundary scan: 0 errors; two unrelated global-state warnings.
integration passed loopx canary premerge --from-git-diff --goal-id loopx-meta: 19 selected checks passed, 0 failures, valid exact-head quality receipt cqr_a26a6d9fe750474e0276.
  • Coverage and gaps: covers registration failure for the retired public command, retained suggest behavior, typed contract generation, shared reducer users, shadow capture, and mixed Python/TypeScript writer parity. No live external backend was exercised because no provider implementation, routing, promotion, or storage semantics changed; the removed generic wrapper had no production caller. Existing external callers of the retired public command, if any, will now receive argparse's unknown-command failure by design.

Frontend / Visual Evidence

  • UI impact: none
  • Before: N/A
  • After: N/A
  • States and viewports shown: N/A
  • Source data: none

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)
  • Capability or extension (providers, adapters, skills)
  • Public docs or presentation surface (README, protocols, dashboard)
  • Build, packaging, installer, or CI
  • Host or runtime integration

Technical Direction

  • Direction / acceptance reference, when applicable: TypeScript control-plane migration T4 and shared Goal Authority writer-retirement checkpoints.

Shared-authority RFC fixture impact

  • Production-scale fixture schema: unchanged; rows for the retired public command are removed and retained todo add calls cover the surviving writer path.
  • Semantic dimensions changed, or reviewed no-impact rationale: the required legacy writer-family set no longer includes todo_capture_followups; runtime shadow capture, projection parity, cursor ordering, and provider semantics are unchanged.
  • Provider conformance arms run: full TypeScript control-plane suite plus selected deterministic shared-authority ladder rows; no provider implementation changed.
  • Read-only legacy/file/PostgreSQL three-arm rehearsal (required for promotion, runtime-routing, or compatibility-projection changes): not applicable; this PR does not change promotion, runtime routing, compatibility projection, or a provider backend.

Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths (including .loopx/, .codex/goals/, and live ACTIVE_GOAL_STATE.md).
  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • I kept the change scoped to the linked issue/task.
  • I completed the visual evidence section for UI changes, or marked UI impact none.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).

Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

Reviewed exact head: bc3e0c63ad2dd8e63aae2f3e734c37184835b131(merge-base da6d79778f,当前 main 已到 a064de4521,本 PR 处于 BEHIND)。评审在改动的精确 head 上执行,结论与证据一一对应。

动机

这次改动的目标来自一次命令审计:两个类型化内部执行包装(coordination.local_authority.mutate、coordination.local_authority.todo_compatibility_edit)没有产品调用方,公开的 todo capture-followups 批量命令也没有值得继续迁移的产品价值。你在 PR 描述里明确它取代了 #4719 的“继续迁移该命令”方向,并且 #4719 已被你关闭,所以这里的交付目标是「退役」而不是「迁移」,这个判断与仓库当前方向一致。

改前 main:todo 子命令表里注册着 capture-followups,解析器接受可重复的 --follow-up,事件映射里有 todo_capture_followups,实现落在 loopx/todo_followups.py::capture_followup_todos;同时 effect 分发表把两个 coordination 方法暴露给调用方。改后:该命令不再是合法子命令,两个 effect kind 从分发表和生成的共享契约里消失,而 todo add、todo suggest、todo update、任务租约、handoff-mode、runtime shadow 捕获全部保留。

我把这次处置成一个完整、可独立评审的切片:退役范围(两个包装 + 一条公开命令 + 其测试/夹具/文档检查点)自洽,回滚面小(几乎全是删除)。todo add 仍然可用,但 PR 明确不承诺保留被退役命令的批量、去重与重放语义,这一点写得诚实,没有把退役包装成等价迁移。

改动思路

调用链是:loopx/cli_commands/todo_registration.py(公开命令面)→ loopx/cli_commands/todo.py::handle_todo_command(适配层)→ effect runtime → TypeScript 控制面的权威所有者(coordination_projection.ts 的规约/提交准备,effect_runtime_handlers.ts 的分发表)。这次删除严格沿着这条链把“没有调用方的端点”剪掉,没有新增任何模块、开关或第二条权威。

架构上值得肯定的两点:

  1. 删除是“删端点”而不是“加兼容层”。两个包装被删时,local_authority_runtime.ts 里的保留入口(sourceAuthorityFor、pollLocalCoordinationMonitor、promoteLocalCoordinationAuthority)和 coordination_projection.ts 的 prepareCoordinationProjectionCommit 都留着,仍然被 monitor-poll、租约获取、runtime shadow 使用,所以权威所有者没有被拆分。
  2. 生成物与生成器同步改:coordination_state_contract_v0.json、coordination_state_contract.generated.ts、coordination_state_contract_generated.py 与 scripts/generate_coordination_state_contract.py 一起调整。我在 head 上重跑生成器,git status --porcelain 为空,说明生成物没有漂移。

测试侧的重接也合理:examples/shared-goal-authority-e2e/mutants.py、阶梯行(authority_e2e_rows_stage2c*.py)、fence 兄弟调用方夹具都把原先用批量命令做的“第二次写入”换成了 add_todo(flag="added",与同文件既有用法一致),并把 todo_capture_followups 从 writer 家族列表里移除。文档侧在四份双语 RFC 与 docs/reference/protocols/todo-suggestion-prompt-v0.md 里记录了退役边界,并明确 todo suggest 仍是人工只读入口。

唯一的思路缺口在变异oracle:被删掉的正是唯一会走到“legacy fence 生效并输出完整 remediation”的 CLI 行,而 python_fence_remediation_truncated 这个变异用例被重新绑到了一个走规范路径、不会输出这段文字的行上,于是它不再能失败。这是本次唯一的阻塞项。

具体改动

关键代码讲解

  • examples/shared-goal-authority-e2e/mutants.py:342(Case("python_fence_remediation_truncated", ...) 的目标行绑定)
    职责:把“截断 LEGACY_WRITER_FENCED_REMEDIATION”这个变异绑定到必须能发现它的 CLI 对等行。
    改前绑定 test_fence_caller_parity[cli-todo_capture_followups-engaged],夹具期望里带着完整 remediation(authority mode / goal / fence / “the primary record was not changed”);改后绑定 [cli-todo_update_status-engaged],该行的期望是规范路径的 reason_code: handoff_mode_requires_lease,根本不经过 fence remediation 分支。
    后果:变异体在 head 上 control_exit 0 / mutant_exit 0 / killed_by_assertion false,即“改坏了也不会被发现”。这是本次阻塞项的根因(详见下节)。

  • loopx/cli_commands/todo_registration.py:43(todo 子命令 choices 与帮助文本)
    职责:定义公开 todo 命令面。
    改动:从 choices 里删除 capture-followups,删除 --follow-up(action="append")参数定义,并把帮助文本末尾关于批量命令的句子去掉。保留 archive-completed、suggest、plan、project-markdown。
    不变量:未注册的子命令必须以 argparse 的 invalid choice 失败、并且诊断里带上该 token,而不是落到陈旧的分支上;tests/test_cli_argument_diagnostics.py::test_todo_capture_followups_is_not_a_registered_command 正面覆盖了这一点(我在 head 上跑:1 passed)。

  • loopx/control_plane/effect_runtime_handlers.ts:517(createEffectRuntimeHandlers 分发表)
    职责:effect kind → TypeScript 实现的唯一映射。
    改动:删除 ["coordination.local_authority.todo_compatibility_edit", editLocalCoordinationTodo] 与 ["coordination.local_authority.mutate", mutateLocalCoordinationAuthority],并同步删除对应 import;todo_read/list/update/claim/terminal/archive/archive_ack/monitor_poll 等条目保留。
    不变量:一个可命名的方法只能有一个实现,删方法必须同时删实现,避免“第二个权威”残留。我在 head 上 grep 过 to 其余引用:仓库内除 RFC 文本外没有任何地方再引用这两个方法名。

  • loopx/control_plane/coordination/local_authority_runtime.ts:371(promoteLocalCoordinationAuthority 及保留入口)
    职责:被 effect runtime、handoff-mode 与 shadow 对等测试共同使用的 coordination runtime。
    改动:删除 mutateLocalCoordinationAuthority / editLocalCoordinationTodo 两个导出,保留 runtimeRoot、sourceAuthorityFor、pollLocalCoordinationMonitor、promoteLocalCoordinationAuthority 等。
    不变量:删除包装不得改变保留路径的 authority/fence 检查。head 上 22 条 fence 对等 CLI 行全部通过,说明保留路径的行为没有被这次删除带偏。

其余改动按面归纳:

  • 生产代码:删除 loopx/todo_followups.py(-203)、todo_compatibility_edit.ts(-142);coordination_projection.ts 裁掉 mutation 相关的类型/输入输出(-157);cli_commands/todo.py(-22)、todo_argument_validation.py(-36/+4)、todo_event.py(-1)、todo_registration.py(-9/+1)同步收口;生成的 coordination 契约与生成器同步裁剪。
  • 测试/夹具:legacy_writer_fence_caller_parity_v0.json 删除 4 条 capture-followups 行(现共 42 行,21 cli / 21 ts_entry);test_shadow_observable_e2e.py 的批量预览用例改名为 test_handoff_mode_quiescence 并只保留 handoff-mode 断言;authority_store_conformance.ts、local_authority_runtime.test.ts、coordination_projection.test.ts、test_shadow_writer_boundaries.py 等删除只服务于已删包装的用例;阶梯行改为 todo add。
  • 文档:四份双语 RFC(human-attention-wishlist、shared-goal-authority-state-provider、typescript-control-plane-migration)+ todo-suggestion-prompt-v0.md 记录退役边界。
  • 构建/配置:tsconfig.control-plane.json 与 workflow 未改动,我确认它们没有引用被删除的文件(git ls-files | grep todo_compatibility_edit 为 0,tsconfig 里也没有该路径)。

对主干的风险

阻塞(P1):变异门禁在精确 head 上失败,且走失了一个安全相关的不变量。

  • 触发:在 head 上运行 python examples/shared-goal-authority-e2e/mutants.py --output .local/stage2c-mutants。
  • 路径:mutants.py:342 把 python_fence_remediation_truncated(截断 loopx/control_plane/coordination/legacy_writer_fence.py 的 LEGACY_WRITER_FENCED_REMEDIATION)绑到 test_fence_caller_parity[cli-todo_update_status-engaged];该行是规范路径行,期望 reason_code: handoff_mode_requires_lease,不会读 remediation 文本。
  • 观测:CI 日志里 {"name": "python_fence_remediation_truncated", "control_exit": 0, "mutant_exit": 0, "killed_by_assertion": false},全量为 53/54 killed,随后 ##[error]Process completed with exit code 1;stage2c-correctness-e2e 只是聚合断言 test "$STAGE2C_RESULT" = success,因此连带失败,merge-gate 亦然。
  • 我本地独立复现了同一根因,并做了 base/head 对照:merge-base da6d79778f 上同一 case 绑的是 [cli-todo_capture_followups-engaged],结果 mutant_exit 1 / killed_by_assertion true;head bc3e0c63 上 mutant_exit 0 / killed_by_assertion false。也就是这条覆盖是被本 PR 引入地弄丢的,不是既有 flake。
  • 影响面:退役后夹具里已经没有任何 cli 行期望 legacy_coordination_writer_fenced(只剩 ts_entry 行),因此 Python 侧“fence remediation 必须完整”的不变量失去了唯一的变异 oracle;而这段文本正是写给被 fence 的 legacy writer 运维者的处置指引,静默截断属于难发现的行为退化。
  • 最小修复(任一即可,然后必须重跑):(a) 把变异重新绑到一条仍会真正执行 legacy fence 写入的保留行(必要时补一条这样的 CLI 行);(b) 或者补一个聚焦的 Python 测试,直接断言 legacy_todo_write_transaction 产出的 remediation 全文;(c) 或者在明确记录“覆盖边界已退役”的前提下撤掉该用例。之后运行 python examples/shared-goal-authority-e2e/mutants.py --output .local/stage2c-mutants,要求 54/54 killed。
  • 重跑命令:stage2c (mutants 0) 与 stage2c-correctness-e2e 必须转绿。

其余风险(非阻塞,已核对):

  • 公开命令删除没有过渡期:外部调用方(若有)会直接收到 argparse 的 invalid choice。PR 已在 “Type of Change” 勾选 breaking change 并在 RFC 里记录,属于已披露的有意兼容性变更;release notes 在发版 PR 阶段单独生成,此处不强求。
  • 生成物/文档面没有留下漂移:我在 head 重跑生成器无 diff,examples/cli-help-manpage-smoke.py 通过(cli-help-manpage-smoke ok),说明删除 todo 子命令不会让 man/loopx.1 或帮助契约失效。
  • 阶梯行把 todo capture-followups 换成 todo add:属于同语义替换(同样是新增一条 todo),flag="added" 与同文件既有用法一致;保留行 22/22 通过。
  • 分支状态:PR 处于 BEHIND(merge-base da6d79778f,当前 main a064de4521)。修复后需要 rebase 再跑一次,避免把 main 的新增改动叠加进结论。

我的整体评价

方向我同意,范围也合理:这是“删掉没有调用方的端点”,净减 ~1480 行生产代码,没有引入新抽象、新配置或第二权威,生成物与生成器保持一致,退役边界在双语文档里写清楚了,保留路径与公开 CLI 阴性用例都有正面证据。我不会因为“代码几乎全是删除”就放松要求,但这里的删除确实降低了后续每次控制面改动都要背着的迁移与变异维护成本。

但当前 head 不能合并:stage2c (mutants 0)(以及由它聚合出的 stage2c-correctness-e2e、merge-gate)在精确 head 上失败,根因是本 PR 自己把 python_fence_remediation_truncated 重绑到了一个无法发现该变异的行上,等于在删掉旧调用方的同时顺手弄丢了 Python 侧 fence remediation 的变异覆盖。这是必须修的覆盖回归,而不是可以留待后续的清理项。

复审所需证据:修复后的新 head 上 (1) python examples/shared-goal-authority-e2e/mutants.py --output .local/stage2c-mutants 报告 54/54 killed;(2) stage2c (mutants 0)、stage2c-correctness-e2e、merge-gate 全绿;(3) rebase 到最新 main 后重跑一次精确 head 结论。满足后我会重新在那一刻的精确 head 上给结论。

残余风险与最强缺失验证:退役命令无过渡期(已披露),未跑真实 PostgreSQL authority 与安装轮子路径(本次改动不涉及存储/provider 语义,属于已记录的本地证据边界)。修复若选择“补一条 fenced CLI 行”,请一并给出该行的 base/head 对等收据。

English verdict: REQUEST_CHANGES - reviewed exact head 4723@bc3e0c63ad2dd8e63aae2f3e734c37184835b131; one P1 blocker: the python_fence_remediation_truncated mutation case was rebound to test_fence_caller_parity[cli-todo_update_status-engaged], which never exercises the legacy fence remediation, so the mutant survives (control_exit 0, mutant_exit 0, killed_by_assertion false, 53/54 killed) and stage2c (mutants 0) plus the aggregated stage2c-correctness-e2e and merge-gate fail at the exact head, while the same case is killed at merge-base da6d797. Validation executed at head: pytest tests/control_plane/test_shadow_fence_caller_parity_e2e.py -> 22 passed; pytest tests/test_cli_argument_diagnostics.py -k capture_followups -> 1 passed; scripts/generate_coordination_state_contract.py -> no diff; examples/cli-help-manpage-smoke.py -> ok; mutants case reproduced locally (base killed, head survives). Minimum repair: rebind the mutant to a retained fenced caller row, add a focused Python test on the remediation text, or retire the case with an explicit coverage-boundary record, then rerun the mutation gate to 54/54 and rebase onto latest main.

Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

复审 exact head: 8f780185079aafa20b163a525b9d6d6e1ba099c8(上一轮结论在 bc3e0c63ad2dd8e63aae2f3e734c37184835b131,本轮只新增一个 commit:test: rebind retired fence remediation mutant)。下面是覆盖整篇 PR 的完整评审,并标出与上一轮的差异。

动机

目标仍来自那次命令审计:coordination.local_authority.mutate 与 coordination.local_authority.todo_compatibility_edit 两个类型化内部包装没有产品调用方,公开的 todo capture-followups 批量命令也不值得继续迁移;PR 明确取代 #4719 的迁移方向,而 #4719 已被作者关闭,因此交付目标是「退役」。

改前的两个真实问题保持一致:一是死端点让每次控制面改动都要带着它们做迁移、文档与变异维护;二是这些命令对外是公开的,退役本身是一次有意的破坏性变更。改后 todo capture-followups 不再是合法子命令、两个 effect kind 从分发表与生成的共享契约中消失,而 todo add、todo suggest、todo update、任务租约、handoff-mode、runtime shadow 捕获全部保留;PR 也如实说明不承诺保留被退役命令的批量、去重与重放语义。

与上一轮相比,动机层面没有变化,变化的是「退役过程中不能顺带弄丢护栏」这一点已经被修复:上一轮我指出的阻塞项是这次退役把 python_fence_remediation_truncated 变异重绑到了一个走规范路径、根本不会输出 fence remediation 的行上,导致 54 个变异里 53 个被杀、该变异存活,stage2c (mutants 0) 与聚合的 stage2c-correctness-e2e 在精确 head 上失败。本轮的 commit 正是修这个问题。

改动思路

架构路径不变:loopx/cli_commands/todo_registration.py(公开命令面)→ todo.py::handle_todo_command(适配层)→ effect runtime → TypeScript 权威所有者(coordination_projection.ts 的规约/提交准备、effect_runtime_handlers.ts 分发表)。删除严格沿着“没有调用方的端点”执行,没有新增模块、开关或第二权威;local_authority_runtime.ts 与 coordination_projection.ts 保留的入口(sourceAuthorityFor、pollLocalCoordinationMonitor、promoteLocalCoordinationAuthority、prepareCoordinationProjectionCommit)仍被 monitor-poll、租约获取与 shadow 使用。

生成物与生成器同步调整(coordination_state_contract_v0.json + .generated.ts + _generated.py + scripts/generate_coordination_state_contract.py),我在 head 上重跑生成器,git status --porcelain 为空。

本轮修复的设计选择我认为比上一版更合理:不再是“把变异绑到某条 CLI 行”,而是绑到既有的聚焦测试 tests/control_plane/test_legacy_coordination_writer_fence.py::test_present_fence_delegates_to_typescript_and_blocks。该测试直接断言 str(exc_info.value) 等于完整 remediation 文案,并用 _RENDER_CASES 覆盖多种 authority mode / fence id 组合,因此对“截断 remediation”这一变异是语义上必然敏感的,而不是依赖某个端到端行恰好经过该分支。这也避免为了保住 oracle 而专门补一条 CLI 行。

具体改动

关键代码讲解

  • examples/shared-goal-authority-e2e/mutants.py:342(python_fence_remediation_truncated 的目标绑定,本 PR 的修复点)
    上一版:绑定 test_fence_caller_parity[cli-todo_update_status-engaged];该行的期望是规范路径的 reason_code: handoff_mode_requires_lease,从不读取 remediation,于是变异存活(control_exit 0 / mutant_exit 0 / killed_by_assertion false)。
    本版:绑定 tests/control_plane/test_legacy_coordination_writer_fence.py::test_present_fence_delegates_to_typescript_and_blocks。我在 head 上单跑该 case:{"control_exit": 0, "mutant_exit": 1, "killed_by_assertion": true};对照 merge-base da6d79778f(当时绑定的是 cli-todo_capture_followups-engaged)同样是 killed,说明恢复到了退役前的护栏强度。

  • tests/control_plane/test_legacy_coordination_writer_fence.py:162
    被复用的既有测试,断言 LegacyCoordinationWriterFenced 的 code、被调用的方法名以及完整 remediation 文案,并保留完整 write-check payload。本 PR 未改其内容,只把它接成变异 oracle;我在 head 上跑该文件:13 passed。

  • loopx/cli_commands/todo_registration.py:43(公开命令面)
    从 choices 删除 capture-followups,删除 --follow-up(action="append")参数,去掉帮助文本里广告批量命令的句子;保留 archive-completed、suggest、plan、project-markdown。不变量:未注册子命令必须以 argparse invalid choice 失败且诊断带 token——head 上 pytest -k capture_followups 1 passed。

  • loopx/control_plane/effect_runtime_handlers.ts:517(effect 分发表)
    删除 todo_compatibility_edit 与 mutate 两个 entries 并同步删 import;todo_read/list/update/claim/terminal/archive/archive_ack/monitor_poll 保留。不变量:可命名的方法只能有一个实现,删方法必须同时删实现,避免第二权威残留。head 上除 RFC 文本外已无这两个名字的引用。

其余改动与上一轮一致:删除 loopx/todo_followups.py(-203)、todo_compatibility_edit.ts(-142);coordination_projection.ts 裁掉 mutation 类型与输入输出(-157);todo.py(-22)、todo_argument_validation.py(-36/+4)、todo_event.py(-1)、todo_registration.py(-9/+1)同步收口;夹具删除 4 条 capture-followups 行(仍 42 行,21 cli / 21 ts_entry);阶梯行把批量命令换成 todo add(flag="added",与同文件既有用法一致);test_shadow_observable_e2e.py 的批量预览用例改名保留 handoff-mode 断言;authority_store_conformance.ts、local_authority_runtime.test.ts、coordination_projection.test.ts、test_shadow_writer_boundaries.py 删除只服务于已删包装的用例;四份双语 RFC 与 docs/reference/protocols/todo-suggestion-prompt-v0.md 记录退役边界。tsconfig 与 workflow 未引用被删文件(已核对)。

对主干的风险

上一轮的阻塞项已解除。 我在这个精确 head 上重新取证:变异被杀死、目标测试 13 passed、CI 的 stage2c (mutants 0) 与 stage2c-correctness-e2e 均为 success(上一轮这两条是红的),残余风险如下:

  • CLI 端到端覆盖缩小(P3,非阻塞):夹具里现在已经没有任何 cli 行期望 legacy_coordination_writer_fenced(只剩 ts_entry 行),Python 侧这段 remediation 文案改由聚焦单测覆盖。护栏强度没有下降——断言更直接、还覆盖多个渲染组合——但“通过真实 CLI 行回读这条消息”的路径确实随退役命令一起消失了。若将来有保留的 legacy fence CLI 调用方(例如写状态的 loopx project 路径),可以补一条 fixture 行并把变异绑回去;否则保持单测覆盖并记录该边界即可。
  • 公开命令无过渡期:外部调用方会直接收到 argparse invalid choice;PR 已勾选 breaking change 并在 RFC 记录,属已披露的有意变更。
  • 生成物/文档不会漂移:head 上生成器重跑无 diff,cli-help-manpage-smoke ok,说明删除子命令不会让 man/loopx.1 或帮助契约失效。
  • 分支状态:PR 仍为 BEHIND(merge-base da6d79778f,当前 main 更靠前)。这属于合并前流程问题,不改变本 head 的代码结论;如果 rebase 出新 head,本结论需要按新 head 重跑。
  • 夹具/阶梯行改写:todo capture-followups → todo add 属同语义替换,保留行 22/22 通过,未削弱其余 writer 家族覆盖。

我的整体评价

修复到位,我批准这个 head。理由不是“CI 变绿了”,而是根因被正确修掉:变异 oracle 从一条语义无关的规范路径行,移到了直接断言完整 remediation 文案(并按 authority mode / fence id 参数化)的聚焦测试上;我在本地对 head 与 merge-base 分别复现了 killed/survived 的对照,且 CI 的两条关键 lane 已转绿。

本次验证的边界我明确记录:仓库内可复现的部分全部执行了(变异单测、22 条 fence 对等行、退役命令阴性用例、聚焦 fence 套件 13 passed、生成器幂等、man page smoke;CI 精确 head 上的 mutants 与 correctness lane 为 success,其余 lane 见 issue/checks 页面);未跑真实 PostgreSQL authority 或安装轮子路径,因为本改动不涉及存储与 provider 语义。合并权限仍在维护者,本结论只针对 8f780185079aafa20b163a525b9d6d6e1ba099c8 这个不变 head;任何 rebase 或新增 commit 都需要重新出结论。

English verdict: APPROVE - reviewed exact head 4723@8f780185079aafa20b163a525b9d6d6e1ba099c8; the previously published P1 blocker is fixed - python_fence_remediation_truncated is rebound to tests/control_plane/test_legacy_coordination_writer_fence.py::test_present_fence_delegates_to_typescript_and_blocks, which asserts the exact fence remediation string, so the mutant is killed again (local run: killed_by_assertion true, matching merge-base da6d797) and CI stage2c (mutants 0) plus stage2c-correctness-e2e are success at this head. Validation executed here: pytest -q tests/control_plane/test_shadow_fence_caller_parity_e2e.py -> 22 passed; pytest -q tests/test_cli_argument_diagnostics.py -k capture_followups -> 1 passed; pytest -q tests/control_plane/test_legacy_coordination_writer_fence.py -> 13 passed; scripts/generate_coordination_state_contract.py -> no diff; examples/cli-help-manpage-smoke.py -> ok; mutant case killed. One non-blocking P3: no CLI parity row expects legacy_coordination_writer_fenced any more, so that message's end-to-end CLI coverage is replaced by focused unit coverage - add a fenced CLI row and rebind if a retained ledger caller still engages the fence, otherwise record the boundary.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Reviewed exact head: 8f780185079aafa20b163a525b9d6d6e1ba099c8(merge-base da6d79778f;当前 main 为 a064de4521)。这是对整个 base-to-head diff 的新审查,不继承旧 head 的结论。

动机

当前目标是直接退役两个没有产品调用方的内部 Effect 包装(coordination.local_authority.mutate、coordination.local_authority.todo_compatibility_edit)和没有继续迁移价值的公开 todo capture-followups 命令。这个方向有明确的 owner 证据:#4719 已关闭,owner 评论明确改为由 #4723 直接退役命令,同时保留独立的 runtime shadow capture。

改前,CLI/Effect registry 仍接受这些入口,后续每次契约生成、writer-fence 审计和迁移夹具都要维护它们。改后,capture-followups 在 argparse 层以 invalid choice 失败,两个 Effect id 以 unsupported_method 失败;todo add/update/claim/terminal/archive、todo suggest、共享 projection reducer/commit builder 和 runtime shadow capture 都保持可用。

这不是整个 shared-authority cutover 的完成,而是一个有用且完整的 justified_increment:退役入口、实现、生成契约、夹具、测试和双语 RFC 检查点一起收口,能独立验证和回滚;遗留 Python writers 与 shadow cutover 继续由现有迁移检查点负责,不需要为已完成的退役另造后续任务。

改动思路

最强的反对理由是:公开命令被直接删除会影响未知外部脚本,而且旧 head 在删除唯一的 capture-followups fence 行后,把 python_fence_remediation_truncated 变异错误绑定到了一个不会渲染 remediation 的 todo_update_status 行,导致变异体存活。后者已在新 head 用一行窄修复解决:复用现有 test_present_fence_delegates_to_typescript_and_blocks,不增加新测试层或新运行时机制。

架构路径保持单一:CLI 命令面由 register_todo_command 定义,Effect 方法面由 createEffectRuntimeHandlers 定义,保留的状态语义继续由 TypeScript projection reducer、commit builder 和 operation-specific runtime handlers 拥有。此次只删除无调用方端点,没有新增开关、状态、兼容 shim 或第二权威;生成 JSON/Python/TypeScript bindings 与生成器同步裁剪。

正向路径:保留命令 → 现有 handler → typed reducer/provider → 原有 receipt/projection;todo suggest 仍只读。负向路径:退役 token/id → parser/map 精确查找失败 → 在读写 provider 前终止,不回退为 todo add,也不触发 shadow 写入。

具体改动

关键代码讲解

  • loopx/cli_commands/todo_registration.py:18 — register_todo_command 删除 capture-followups 与 --follow-up,保留现有 Todo 命令集合;tests/test_cli_argument_diagnostics.py 证明退役 token 以 exit 2 / invalid choice 失败。
  • loopx/cli_commands/todo.py:189 — handle_todo_command 删除 batch handler/import,保留 suggest 的只读 prompt 路径和所有 operation-specific 写路径。
  • loopx/control_plane/effect_runtime_handlers.ts:382 — createEffectRuntimeHandlers 删除两个泛化 coordination 映射;dispatchEffectRuntimeMethod 对它们返回既有 unsupported_method,其他 Todo/shadow handler 不变。
  • loopx/control_plane/coordination/coordination_projection.ts:346 — prepareCoordinationProjectionCommit 与 reducer 保留为共享写语义所有者;删除的是其上方无调用方的执行包装,而不是 canonical projection 规则。
  • examples/shared-goal-authority-e2e/mutants.py:338 — 把 Python fence-remediation 变异绑定到现有直接 adapter 断言。旧绑定结果为 control=0 / mutant=0 / killed=false;新绑定为 control=0 / mutant=1 / killed=true。

按职责归类:12 个生产文件 +14/-716,17 个测试/夹具文件 +126/-938,9 个文档文件 +73/-28,3 个生成契约文件 +1/-11;总计 41 files、+214/-1693。没有机械搬移,也没有新产品机制。

对主干的风险

未发现剩余 blocker。

  • 兼容风险:这是已披露的 breaking change。未知外部 todo capture-followups 调用方需要显式迁移;本 PR 不虚构 batch/dedup/replay 等价性。PR body 与双语 RFC 已记录边界,release communication 仍由 release owner 负责。
  • 回归风险:旧 head 的 mutation oracle 缺口已修复。完整变异集合第一次顺序运行在第 32 个无关 SIGKILL control 上超时(此前 31/31 killed);该 control 单独重跑 32.60s 通过,续跑剩余 23/23 killed,因此总覆盖为 54/54,且保留了失败后重跑的区别。
  • 环境风险:新 head 首次 TypeScript 全套由 Node 子进程误用系统 Python 3.9,因 dataclass(slots=True) 失败;按仓库规定把 worktree .venv/bin 放入 PATH 后重跑为 2,017 passed / 18 repository-defined skips / 0 failed。这是来源环境失败,不是产品失败。
  • 集成风险:分支仍显示 BEHIND,但与当前 main 无路径重叠,git merge-tree 无冲突。未跑真实 PostgreSQL,因为本 PR 不改 provider/storage/routing/promotion 语义;完整 file/SQLite/control-plane conformance 已在 TypeScript 套件中通过。

验证汇总:受影响 Python/CLI 集合 242 passed;fence 单测 13 passed;Ruff、mypy、TypeScript typecheck、生成契约回读、DCO、diff/private-boundary 检查通过;loopx canary premerge --from-git-diff --goal-id loopx-meta 选择 19 项、0 failures、0 manual holds;严格质量凭据 cqr_47e81e5f8a3e59614528 对当前 diff 指纹有效。

我的整体评价

APPROVE。新 head 完成了 owner 已确认的直接退役,保留的 authority owner、状态/receipt 语义和用户入口有正向证据,退役入口有 fail-closed 证据;旧审查指出的 mutation blocker 已用最小的一行复用修复,并通过了对应反例与完整门禁。范围以删除为主、单一目的、没有新权威或隐藏默认行为。

本结论只批准 exact head 8f780185079aafa20b163a525b9d6d6e1ba099c8。仓库 AGENTS.md 明确规定 loopx/**、控制面和 CLI/API contract 变化即使验证通过也不得作者自合并,因此这里发布 COMMENTED 的作者自审批准记录,最终 merge 必须由 maintainer 执行。

English verdict: APPROVE - exact head 4723@8f780185079aafa20b163a525b9d6d6e1ba099c8 removes the unused CLI and Effect endpoints, preserves the existing typed authority owners, fixes the stale Python fence-remediation mutation oracle, and passes 2,017 TypeScript tests, 242 affected Python tests, all 54 mutation cases (31+23 after one isolated timeout retry), 19 premerge checks, strict change-quality receipt cqr_47e81e5f8a3e59614528, DCO, diff, and public-boundary validation; no blocker remains, but repository policy requires maintainer merge.

Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Reviewed exact head: 0c75dd18f11e7ddefcecb3b7731e9a8339d7c278(base/current main:a064de4521)。分支已通过带 DCO 的 merge commit 同步当前主干;这是对整个最新 base-to-head diff 的新审查,不继承旧 head 的结论。

动机

当前目标是直接退役两个没有产品调用方的内部 Effect 包装(coordination.local_authority.mutate、coordination.local_authority.todo_compatibility_edit)和没有继续迁移价值的公开 todo capture-followups 命令。这个方向有明确的 owner 证据:#4719 已关闭,owner 评论明确改为由 #4723 直接退役命令,同时保留独立的 runtime shadow capture。

改前,CLI/Effect registry 仍接受这些入口,后续每次契约生成、writer-fence 审计和迁移夹具都要维护它们。改后,capture-followups 在 argparse 层以 invalid choice 失败,两个 Effect id 以 unsupported_method 失败;todo add/update/claim/terminal/archive、todo suggest、共享 projection reducer/commit builder 和 runtime shadow capture 都保持可用。

这不是整个 shared-authority cutover 的完成,而是一个有用且完整的 justified_increment:退役入口、实现、生成契约、夹具、测试和双语 RFC 检查点一起收口,能独立验证和回滚;遗留 Python writers 与 shadow cutover 继续由现有迁移检查点负责,不需要为已完成的退役另造后续任务。

改动思路

最强的反对理由是:公开命令被直接删除会影响未知外部脚本,而且旧 head 在删除唯一的 capture-followups fence 行后,把 python_fence_remediation_truncated 变异错误绑定到了一个不会渲染 remediation 的 todo_update_status 行,导致变异体存活。后者已在新 head 用一行窄修复解决:复用现有 test_present_fence_delegates_to_typescript_and_blocks,不增加新测试层或新运行时机制。

架构路径保持单一:CLI 命令面由 register_todo_command 定义,Effect 方法面由 createEffectRuntimeHandlers 定义,保留的状态语义继续由 TypeScript projection reducer、commit builder 和 operation-specific runtime handlers 拥有。此次只删除无调用方端点,没有新增开关、状态、兼容 shim 或第二权威;生成 JSON/Python/TypeScript bindings 与生成器同步裁剪。

正向路径:保留命令 → 现有 handler → typed reducer/provider → 原有 receipt/projection;todo suggest 仍只读。负向路径:退役 token/id → parser/map 精确查找失败 → 在读写 provider 前终止,不回退为 todo add,也不触发 shadow 写入。

具体改动

关键代码讲解

  • loopx/cli_commands/todo_registration.py:18 — register_todo_command 删除 capture-followups 与 --follow-up,保留现有 Todo 命令集合;tests/test_cli_argument_diagnostics.py 证明退役 token 以 exit 2 / invalid choice 失败。
  • loopx/cli_commands/todo.py:189 — handle_todo_command 删除 batch handler/import,保留 suggest 的只读 prompt 路径和所有 operation-specific 写路径。
  • loopx/control_plane/effect_runtime_handlers.ts:382 — createEffectRuntimeHandlers 删除两个泛化 coordination 映射;dispatchEffectRuntimeMethod 对它们返回既有 unsupported_method,其他 Todo/shadow handler 不变。
  • loopx/control_plane/coordination/coordination_projection.ts:346 — prepareCoordinationProjectionCommit 与 reducer 保留为共享写语义所有者;删除的是其上方无调用方的执行包装,而不是 canonical projection 规则。
  • examples/shared-goal-authority-e2e/mutants.py:338 — 把 Python fence-remediation 变异绑定到现有直接 adapter 断言。旧绑定结果为 control=0 / mutant=0 / killed=false;新绑定为 control=0 / mutant=1 / killed=true。

按职责归类:12 个生产文件 +14/-716,17 个测试/夹具文件 +126/-938,9 个文档文件 +73/-28,3 个生成契约文件 +1/-11;总计 41 files、+214/-1693。没有机械搬移,也没有新产品机制。

对主干的风险

未发现剩余 blocker。

  • 兼容风险:这是已披露的 breaking change。未知外部 todo capture-followups 调用方需要显式迁移;本 PR 不虚构 batch/dedup/replay 等价性。PR body 与双语 RFC 已记录边界,release communication 仍由 release owner 负责。
  • 回归风险:旧 head 的 mutation oracle 缺口已修复。完整变异集合第一次顺序运行在第 32 个无关 SIGKILL control 上超时(此前 31/31 killed);该 control 单独重跑 32.60s 通过,续跑剩余 23/23 killed,因此总覆盖为 54/54,且保留了失败后重跑的区别。
  • 环境风险:新 head 首次 TypeScript 全套由 Node 子进程误用系统 Python 3.9,因 dataclass(slots=True) 失败;按仓库规定把 worktree .venv/bin 放入 PATH 后重跑为 2,017 passed / 18 repository-defined skips / 0 failed。这是来源环境失败,不是产品失败。
  • 集成风险:分支已包含当前 main;同步前路径交集为 0,同步后 PR diff 仍是相同 41 个文件。未跑真实 PostgreSQL,因为本 PR 不改 provider/storage/routing/promotion 语义;完整 file/SQLite/control-plane conformance 已在 TypeScript 套件中通过。

验证汇总:受影响 Python/CLI 集合 242 passed;fence 单测 13 passed;Ruff、mypy、TypeScript typecheck、生成契约回读、DCO、diff/private-boundary 检查通过;同步主干后再次验证 fence 单测和修复后的 mutant;loopx canary premerge --from-git-diff --goal-id loopx-meta 选择 19 项、0 failures、0 manual holds;严格质量凭据 cqr_a37f5aaf2923fe682e58 对当前 diff 指纹有效。

我的整体评价

APPROVE。新 head 完成了 owner 已确认的直接退役,保留的 authority owner、状态/receipt 语义和用户入口有正向证据,退役入口有 fail-closed 证据;旧审查指出的 mutation blocker 已用最小的一行复用修复,并通过了对应反例与完整门禁。范围以删除为主、单一目的、没有新权威或隐藏默认行为。

本结论只批准 exact head 0c75dd18f11e7ddefcecb3b7731e9a8339d7c278。仓库 AGENTS.md 明确规定 loopx/**、控制面和 CLI/API contract 变化即使验证通过也不得作者自合并,因此这里发布 COMMENTED 的作者自审批准记录,最终 merge 必须由 maintainer 执行。

English verdict: APPROVE - exact head 4723@0c75dd18f11e7ddefcecb3b7731e9a8339d7c278 contains current main, removes the unused CLI and Effect endpoints, preserves the existing typed authority owners, fixes the stale Python fence-remediation mutation oracle, and passes 2,017 TypeScript tests, 242 affected Python tests, all 54 mutation cases (31+23 after one isolated timeout retry), 19 premerge checks, strict change-quality receipt cqr_a37f5aaf2923fe682e58, DCO, diff, and public-boundary validation; no blocker remains, but repository policy requires maintainer merge.

Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
@huangruiteng
huangruiteng merged commit 9f19169 into main Sep 19, 2026
28 of 29 checks passed
@huangruiteng
huangruiteng deleted the codex/retire-unused-coordination-wires branch September 19, 2026 07:23

@huangruiteng huangruiteng left a comment •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

合并后补记(exact-head 记录补齐):本 PR 以 9f1916960306b3650d795895b89f331eeae2516e squash 合入 main,合并时的 PR head 是我尚未单独出结论的 merge-sync commit bde721b2f0f95aa26a30190893a0d9ad21f21738。按仓库规则,作者自合并的 head 也应带有已发布的 exact-head 结论,因此这里把该 head 的结论补上。

动机

评审纪律要求“合并的那个 head”本身带有已发布结论;#4723 是在 merge-sync head bde721b2 上被合并的,而我此前只在 8f780185 上出过结论。这篇的目的就是回答一个问题:merge-sync 是否改变了我在 8f780185 上已经验证过的内容。如果等价,则该 head 可以沿用同一结论;如果不等价,就需要重新评审。

改动思路

不重做一轮完整评审,而是用两条可独立核对的证据判等价性:(1) 该 head 相对 merge-base 的完整 diff 与我评审过的 head 是否逐字一致;(2) 该 head 上是否重跑通过关键证据(fence parity、退役命令诊断、聚焦 fence 用例、生成器幂等)以及变异 oracle 的绑定是否仍是修复后的版本。任一不成立就应该就地转为 REQUEST_CHANGES。

具体改动

  • 在 bde721b2 上重算 git diff <merge-base 936e043a68> HEAD:41 个文件、+214/-1693,与我评审过的 8f780185079aafa20b163a525b9d6d6e1ba099c8 逐字一致;
  • 该 head 上重跑的关键证据全部通过:tests/control_plane/test_shadow_fence_caller_parity_e2e.py 22 passed、tests/test_cli_argument_diagnostics.py -k capture_followups 1 passed、tests/control_plane/test_legacy_coordination_writer_fence.py 13 passed、协调契约生成器重跑无 diff;
  • 变异 oracle 仍是修复后的绑定(python_fence_remediation_truncated → tests/control_plane/test_legacy_coordination_writer_fence.py::test_present_fence_delegates_to_typescript_and_blocks),未被 merge-sync 回退。

对主干的风险

无阻塞项。 结论与 8f780185 上一致:退役范围自洽、生成物与生成器一致、fence remediation 不变量恢复可检测、保留路径与公开 CLI 阴性用例均有正面证据。唯一保留的非阻塞项仍是那条 P3:夹具中已没有任何 cli 行期望 legacy_coordination_writer_fenced,该文案的端到端 CLI 覆盖改由聚焦单测承担。

另附一条环境说明,避免把合并后 main 的两条红 public smoke 误归因到本 PR:cli-help-manpage 自 936e043a6(#4706 把 goal-acceptance 同时放进 man page 列表与 MANPAGE_COMMAND_HELP_ONLY)起就红;todo-projection-shared-helper-smoke 在 9f1916960(本 PR 的 squash)上仍通过,是随后 a20e71395c(#4725)才变红。两条已分别记录在对应 PR 的评审里。

我的整体评价

merge-sync head 与已评审 head 内容等价、关键证据在该 head 上重跑通过,因此沿用 APPROVE;这条补记是记录补齐,不改变原结论。

English verdict: APPROVE - merge-head record for 4723@bde721b2f0f95aa26a30190893a0d9ad21f21738 (squashed into main as 9f19169); the diff at this head is byte-identical to the previously reviewed head 8f78018 (41 files, +214/-1693) and the key receipts were re-run here: fence parity 22 passed, retired-command diagnostic 1 passed, focused fence suite 13 passed, coordination contract generator produces no diff, and the rebound fence-remediation mutant is intact. Main's current two red public smokes are not caused by this PR: cli-help-manpage has been red since 936e043 (#4706) and todo-projection-shared-helper-smoke passed at this PR's squash 9f19169 and only turned red with a20e713 (#4725).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant