Conversation
`loopx/cli_commands/todo.py` had grown to 1185 lines, above the 1098-line frozen budget in `examples/cli-command-module-size-ownership-command-modularization-smoke.py`, which turned the Full Public Smokes baseline red. Follow the smoke's own instruction and the `turn_dsh_host.py` precedent (loopx-project#3856): extract one cohesive command owner instead of raising the budget. Move the `loopx todo complete` owner into `loopx/cli_commands/todo_complete.py`: the settlement-requirement and settlement-error rules, the turn-scoped settlement gate plus `complete_goal_todo` write (`run_todo_complete`), and the post-commit settlement readback and post-writeback hook dispatch (`finalize_committed_todo_completion`). `handle_todo_command` keeps the subcommand dispatch, rollout-event append, and runtime-shadow mirror; it hands the completion outcome to the finalizer after those observers run, preserving the original ordering and payload mutation. The moved code is byte-identical apart from the two helpers losing their private underscore (they are now the owner module's API) and the inline project/state-file expansion being replaced by the equivalent `path_args` mapping. Bounded future-facing pass: applied. `todo.py` drops to 972 lines, inside the 1000-line default, so the frozen `"todo.py": 1098` budget entry is retired rather than left as slack (a tighter budget, not a raise). No compatibility wrapper: the only importers of the moved helpers were two tests, updated to the new owner. No CLI flags, output, or defaults change. Validation: - python3 examples/cli-command-module-size-ownership-command-modularization-smoke.py -> ok - python3 -m pytest tests/test_cli_argument_diagnostics.py tests/control_plane/test_quota_settlement.py tests/control_plane/test_coordination_runtime_shadow_adapter.py tests/test_cli_entrypoint.py tests/test_goal_mode_mcp_completion_validation.py -> 174 passed (same set green before the move) - examples/control_plane/heartbeat-quota-flow-smoke.py, monitor-poll-writeback-smoke.py, task-lease-runtime-smoke.py, examples/multi-agent-role-successor-todos-smoke.py, examples/cli-control-plane-command-modularization-smoke.py -> all ok - pyflakes clean on changed Python files (ruff not installed locally) Signed-off-by: song <liusongstep@gmail.com> (cherry picked from commit 766c562a32c3e157cdd90f6a129cef506d07dd05)
This was referenced Sep 4, 2026
Collaborator
Author
|
Closing to keep the review queue small. With |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
loopx/cli_commands/todo.pyreached 1185 lines, above the 1098-line frozen budget inexamples/cli-command-module-size-ownership-command-modularization-smoke.py, which is one of the shard-0 failures keepingFull Public Smokesred onmain. Follow the smoke's own instruction and theturn_dsh_host.pyprecedent (fix(ci): repair public smoke regressions #3856): extract one cohesive command owner instead of raising the budget.loopx todo completeowner intoloopx/cli_commands/todo_complete.py: the settlement-requirement and settlement-error rules, the turn-scoped settlement gate pluscomplete_goal_todowrite (run_todo_complete), and the post-commit settlement readback and post-writeback hook dispatch (finalize_committed_todo_completion,TodoCompletionOutcome).handle_todo_commandkeeps subcommand dispatch, rollout-event append, and the runtime-shadow mirror, then hands the outcome to the finalizer, preserving the original ordering and payload mutation.path_argsmapping. No compatibility wrapper: the only importers were two tests, re-pointed to the new owner.todo.pydrops to 972 lines, inside the 1000-line default, so the frozen"todo.py": 1098entry is retired (a tightening, not a raise). No CLI flags, outputs, or defaults change.mainthe same smoke also fails onturn.py, which reached 1047 lines in fix(coordination): route the legacy todo write transaction through the effective runtime root #3904 with no frozen entry. This PR does not touchturn.py; whether to pin it or extract another owner is a maintainer decision.Companion baseline PRs for the other shard failures: #3942 (goal configuration catalog smoke) and #3943 (concise help and manpage parity). Each is independent and can merge in any order.
Issue Or Task
Full Public Smokesworkflow onmain(shard 0)Validation
python3 -m py_compile loopx/cli_commands/todo.py loopx/cli_commands/todo_complete.pypython3 examples/cli-command-module-size-ownership-command-modularization-smoke.py->todo.pybudget satisfied; the only remaining assertion failure is the pre-existingturn.py1047 > 1000 from fix(coordination): route the legacy todo write transaction through the effective runtime root #3904tests/test_cli_argument_diagnostics.py,tests/control_plane/test_quota_settlement.py,tests/control_plane/test_coordination_runtime_shadow_adapter.py,tests/test_cli_entrypoint.py,tests/test_goal_mode_mcp_completion_validation.py-> 174 passedheartbeat-quota-flow,monitor-poll-writeback,task-lease-runtime,multi-agent-role-successor-todos,cli-control-plane-command-modularizationsmokes -> okpython3 -m pytest tests -q -k "todo or cli or help"-> 1132 passedloopx canary premerge --from-git-diff --git-diff-base <official main>-> 18/18 selected checks passed, 0 manual holdsgit diff --checkclean; commit carries the DCO trailerType of Change
LoopX Area
Technical Direction
Core control-plane hardening
Target base branch:
mainDirection tracker or promotion unit:
Full Public SmokesbaselineBoundary Checklist
.loopx/,.codex/goals/, liveACTIVE_GOAL_STATE.md, credentials, private benchmark traces, verifier output, raw agent sessions, internal document links, or local machine paths.Signed-off-bytrailer (git commit -s).