Skip to content

refactor(cli): own the promotion control commands in their own module - #4642

Closed
BigDataDZ wants to merge 1 commit into
loopx-project:mainfrom
BigDataDZ:refactor/support-control-promotion-ownership
Closed

BigDataDZ wants to merge 1 commit into
loopx-project:mainfrom
BigDataDZ:refactor/support-control-promotion-ownership

Conversation

@BigDataDZ

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

  • Goal/source and gap: GH-C06 asks for one remaining oversized CLI ownership seam to be characterized and moved into a bounded module. loopx/cli_commands/support_control.py registered seven unrelated top-level commands in one 898-line module, and the canary-promotion group had no owner of its own.
  • Observable before → after: before, promotion-gate, promotion-readiness, and upgrade-plan are registered and dispatched inside the shared support-control seam, so any new promotion flag grows a module that also owns update, registry, and status serving; after, loopx/cli_commands/support_control_promotion.py owns both halves of that group, support_control.py drops to 758 lines, and the module-size/ownership smoke plus a new ownership test pin the boundary.
  • Issue/task and intended base: Closes [Task]: own the promotion-gate, promotion-readiness, and upgrade-plan commands in a bounded module (GH-C06) #4639 (GH-C06); base main.

Scope And Continuation

  • Completed scope and remaining work: complete within this slice — the three promotion commands' registration and dispatch move together into one new module, and tests/test_support_control_promotion_ownership.py pins set membership, single registration, both halves living in the new module, and fall-through for unrelated commands. update, registry, registry-boundary, and serve-status stay in support_control.py and are the next GH-C06 slice.
  • Slice boundary / successor: the three commands are one group — canary promotion readiness and the local default upgrade plan that follows it — so they move as one unit and leave a smaller but still-coherent support-control seam for a later slice.

Validation

  • Tested revision: e1ca326fc (rebased onto current main)
  • Run state: finished
  • Input classes: synthetic
Check kind Result Public-safe evidence / limitation
static passed python3 examples/cli-command-module-size-ownership-command-modularization-smoke.py — ok; each of the three commands is registered by exactly one module and every module stays inside its budget
unit passed python3 -m pytest -q tests/test_support_control_promotion_ownership.py tests/test_cli_entrypoint.py tests/test_command_invocation.py — 22 passed, 1 skipped; the new ownership test covers set membership, single registration, both halves in the owner module, and fall-through
real_entrypoint passed python3 -m loopx.cli --format json --registry <synthetic project registry> --runtime-root <temp runtime> promotion-gate and ... upgrade-plan emit their usual payloads; promotion-readiness record --dashboard-readiness skipped stays a dry run (appended: false)
regression_parity passed baseline-versus-head comparison of the three commands' JSON output on the same synthetic registry: promotion-gate and upgrade-plan are byte-identical, promotion-readiness record differs only in its generated_at timestamp; no flag, payload key, help text, or exit code changed
integration blocked python3 regression/cli-command-module-contract.py fails on this checkout at the doctor step because no installed loopx CLI is on PATH; verified identical failure on unmodified main (stash/pop), so it is an environment prerequisite, not this diff
  • Coverage and gaps: the smoke covers the ownership invariant that motivated the slice, the new test covers registration and dispatch living together, and the parity comparison covers the "public invocation unchanged" claim directly rather than by test count. Gap: the remaining support-control commands are untouched by design and remain a later slice; regression/cli-command-module-contract.py could not be run to completion in this environment for the reason above.

Frontend / Visual Evidence

  • UI impact: none

Type of Change

  • Refactoring (no functional changes)
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)

Technical Direction

Shared-authority RFC fixture impact

  • N/A

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).

`support_control.py` registered seven unrelated top-level commands in one
898-line module. Move `promotion-gate`, `promotion-readiness` (with its
`record` subcommand), and `upgrade-plan` into
`cli_commands/support_control_promotion.py` so one cohesive canary-promotion
and upgrade-propagation group has a bounded owner.

Registration and dispatch move together, the three commands stay inside
`SUPPORT_CONTROL_COMMANDS`, and no public invocation, flag, payload, or exit
code changes: `promotion-gate` and `upgrade-plan` emit byte-identical JSON
before and after, and `promotion-readiness record` differs only in its
`generated_at` timestamp.

Refs loopx-project#4639, GH-C06

Signed-off-by: BigDataDZ <76271875+BigDataDZ@users.noreply.github.com>
@YZJF

YZJF commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Closing in favour of the same change re-pushed from a different fork, so upstream keeps one PR for #4639. No content difference; the replacement PR is linked from #4640's sibling branch and references #4639.

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.

[Task]: own the promotion-gate, promotion-readiness, and upgrade-plan commands in a bounded module (GH-C06)

2 participants