Skip to content

refactor(cli): start the command registry, migrate merge-chunks (#1212) - #2292

Closed
PathGao wants to merge 1 commit into
Graphify-Labs:v8from
PathGao:refactor-cli-commands-registry
Closed

refactor(cli): start the command registry, migrate merge-chunks (#1212)#2292
PathGao wants to merge 1 commit into
Graphify-Labs:v8from
PathGao:refactor-cli-commands-registry

refactor(cli): start the command registry, migrate merge-chunks (#1212)

928779f
Select commit
Loading
Failed to load commit list.
Graphify Labs / Graphify succeeded Jul 29, 2026 in 0s

Graphify — looks good

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).

Details

Graphify reviewed this change.

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).


Graphify review — findings

This PR begins refactoring the monolithic dispatch_command if/elif chain in graphify/cli.py into a new graphify/commands/ package (per issue #1212). It adds a COMMANDS registry that dispatch_command now consults before falling through to the remaining if/elif chain, and migrates the merge-chunks command as the first example—moving its branch body verbatim into graphify/commands/merge_chunks.py and removing the old branch. It also adds a MIGRATION.md playbook documenting how to port additional commands, plus a test_commands_registry.py test asserting the registry is populated and callable. The surface area is limited to CLI dispatch plumbing and the merge-chunks handler.

No blocking issues surfaced.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 202 functions depend on the 56 node(s) this change touches.

Health — grade A; 5 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):

  • dispatch_command() — 2 callers, 108 callees (high)
  • main() — 79 callers, 2 callees (high)
  • _run_hook_guard() — 3 callers, 6 callees (medium)
  • _invoke() — 15 callers, 1 callees (medium)
  • _stale_graph_sources() — 7 callers, 2 callees (medium)

Verification — 202 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 164 function(s) in the blast radius were not formally verified this run