父 issue
背景
#718 已完成 pending/active remote turn binding facade。E 的下一切片应继续治理 serviceTurnRuntime 内部状态的直接访问,但不要一次混入 pendingSteers 和 progress。
当前 compactTurns direct access 主要集中在 service_compact.go,另有 BindPendingRemoteCommand 中为 compact dispatch 绑定 command id 的路径。相比 pendingSteers 和 progress,compact lifecycle 的状态 owner 更集中,适合先收口为 runtime/service facade。
范围
本 issue 只覆盖 compact turn binding 的 direct map access:
s.turns.compactTurns
compact start/promote/complete/fail/restore/problem handling
compact command id binding
compact busy / active / ownership 查询
不覆盖:
目标
把 compact turn binding 的直接 map access 收口到 serviceTurnRuntime / Service 级 compact helper,避免 compact lifecycle 写入、清理、查询散落在业务路径中。
非目标
不改变 /compact 用户体验、busy 判断、owner card lifecycle、失败恢复或 dispatch 语义。
不改变 remote surface state machine。
不处理 pending steer 或 progress runtime。
不跨包拆 orchestrator。
相关文档
docs/general/remote-surface-state-machine.md
docs/general/issue-orchestration-workflow.md
涉及文件
internal/core/orchestrator/service_runtime_clusters.go
internal/core/orchestrator/service_compact.go
internal/core/orchestrator/service_snapshot_runtime.go
internal/core/orchestrator/service_compact_notice.go
internal/core/orchestrator/service_queue_binding.go
internal/core/orchestrator/service_reply_auto_steer.go
internal/core/orchestrator/service_routing_blockers.go
compact / queue / snapshot 相关测试
建议范围
先补结构测试,锁定除 owner/facade 文件外不应直接访问 s.turns.compactTurns。
在 serviceTurnRuntime 上补 compact binding get/bind/clear/command lookup/helper 方法。
迁移 service_compact.go 和 command binding 相关 direct access。
保持 compact busy、promote、complete、fail、restore、problem handling 语义等价。
跑 compact/queue/snapshot/remote 目标测试与 remote-state-machine guardrail。
完成标准
除 owner/facade 文件外,生产代码不再直接读写 s.turns.compactTurns。
compact lifecycle 的 create/promote/complete/fail/restore/problem handling 通过统一 facade。
/compact 相关测试和 broader orchestrator/daemon 测试通过。
remote-state-machine guardrail 已复核;如行为未变,文档无需更新但需记录结论。
中型结构重构默认需要独立 verifier pass。
实现参考
允许的 owner/facade 文件建议为:
service_runtime_clusters.go
service_compact.go
如果 service_compact.go 仍作为 compact lifecycle facade,则其它文件只调用 Service 级 compact helper,不直接访问 runtime map。
检查参考
rg -n 's\.turns\.compactTurns' internal/core/orchestrator --glob '*.go' --glob '!*_test.go'
go test ./internal/core/orchestrator -run 'Compact|Queue|Dispatch|Remote|Snapshot|ReplyAutoSteer|Routing' -count=1
go test ./internal/core/orchestrator -count=1
go test ./...
bash scripts/check/go-file-length.sh && git diff --check
收尾参考
执行决策
是否拆分:不再拆。本 issue 是 调研核心大包与高耦合结构拆分方案 #713 /E 的第二执行切片,只覆盖 compact turn binding facade。
当前执行单元:orchestrator compact turn binding facade。
verifier:需要。该 issue 触及 compact lifecycle 状态 owner,默认需要独立 verifier。
执行快照
当前阶段:plan
当前执行点:子 issue 已创建,等待 prepare/lint 后进入实现。
已完成:收口 orchestrator remote turn binding facade #718 已完成 pending/active remote binding facade;E 下一切片选择 compactTurns。
下一步:运行 issue workflow prepare/lint;通过后按 TDD 先补结构测试再实现。
当前阻塞:无产品决策阻塞。
最后一致状态:master 与 origin/master 同步到 76d8d90f,工作区干净。
未完成尾项:prepare、lint、实现、验证、remote guardrail、verifier、回卷 调研核心大包与高耦合结构拆分方案 #713 、commit/push、close。
恢复步骤:读取本 issue 与 调研核心大包与高耦合结构拆分方案 #713 ;确认 s.turns.compactTurns direct access 现状;先补结构测试,再实现 facade。
父 issue
背景
#718 已完成 pending/active remote turn binding facade。E 的下一切片应继续治理
serviceTurnRuntime内部状态的直接访问,但不要一次混入pendingSteers和progress。当前
compactTurnsdirect access 主要集中在service_compact.go,另有BindPendingRemoteCommand中为 compact dispatch 绑定 command id 的路径。相比pendingSteers和progress,compact lifecycle 的状态 owner 更集中,适合先收口为 runtime/service facade。范围
本 issue 只覆盖 compact turn binding 的 direct map access:
s.turns.compactTurns不覆盖:
pendingSteerspendingRemote/activeRemote(已由 收口 orchestrator remote turn binding facade #718 处理)s.progress.*目标
把 compact turn binding 的直接 map access 收口到
serviceTurnRuntime/ Service 级 compact helper,避免 compact lifecycle 写入、清理、查询散落在业务路径中。非目标
/compact用户体验、busy 判断、owner card lifecycle、失败恢复或 dispatch 语义。相关文档
docs/general/remote-surface-state-machine.mddocs/general/issue-orchestration-workflow.md涉及文件
internal/core/orchestrator/service_runtime_clusters.gointernal/core/orchestrator/service_compact.gointernal/core/orchestrator/service_snapshot_runtime.gointernal/core/orchestrator/service_compact_notice.gointernal/core/orchestrator/service_queue_binding.gointernal/core/orchestrator/service_reply_auto_steer.gointernal/core/orchestrator/service_routing_blockers.go建议范围
s.turns.compactTurns。serviceTurnRuntime上补 compact binding get/bind/clear/command lookup/helper 方法。service_compact.go和 command binding 相关 direct access。完成标准
s.turns.compactTurns。/compact相关测试和 broader orchestrator/daemon 测试通过。实现参考
允许的 owner/facade 文件建议为:
service_runtime_clusters.goservice_compact.go如果
service_compact.go仍作为 compact lifecycle facade,则其它文件只调用 Service 级 compact helper,不直接访问 runtime map。检查参考
rg -n 's\.turns\.compactTurns' internal/core/orchestrator --glob '*.go' --glob '!*_test.go'go test ./internal/core/orchestrator -run 'Compact|Queue|Dispatch|Remote|Snapshot|ReplyAutoSteer|Routing' -count=1go test ./internal/core/orchestrator -count=1go test ./...bash scripts/check/go-file-length.sh && git diff --check收尾参考
执行决策
执行快照
76d8d90f,工作区干净。s.turns.compactTurnsdirect access 现状;先补结构测试,再实现 facade。