Skip to content

refactor(cli): remove redundant command registry - #357

Merged
davidabram merged 1 commit into
mainfrom
refactor/cli-command-routing-simplification
Nov 24, 2026
Merged

davidabram merged 1 commit into
mainfrom
refactor/cli-command-routing-simplification

Conversation

@davidabram

Copy link
Copy Markdown
Member

Summary

Remove the redundant top-level CommandRegistry name table and default request constructors. The Clap schema already owns the command grammar; the parser can construct RuntimeCommand directly.

Changes

  • Remove DEFAULT_COMMAND_NAMES, CommandRegistry, build_default_registry, and default_runtime_command from services/command_registry.rs; retain the static RuntimeCommand enum and its direct execution dispatch.
  • Remove the registry field and parameters from AppRuntime, command lifecycle dispatch, and parser.
  • Construct synthetic top-level help directly and route global --version to the existing version variant with the default text format.
  • Use Clap's actual subcommand definition for the known-command check rather than command_surface::is_known_command.
  • Keep the existing custom top-level banner, hidden commands, command-local help, longest-valid-parent fallback, errors, and exit classification untouched.
  • Update current architecture and CLI documentation to remove obsolete registry claims.

Tests

  • Reuse existing parser and app lifecycle tests, updating calls to the new signature.
  • Add only one focused test for the global --version path.
  • No unrelated or obsolete tests retained specifically for deleted registry behavior.

Validation

  • Reviewed the staged Git tree and verified that the removed registry helpers are no longer referenced in affected runtime files.
  • Rust tests and nix flake check have not been executed: this environment lacks the Rust/Nix toolchains and outbound git DNS. Run the repository's normal nix flake check before making this PR ready for merge.
  • Opened as draft until checks and review confirm behavioral compatibility.

No automatic merge or production deployment requested.

@davidabram
davidabram force-pushed the refactor/cli-command-routing-simplification branch from f4ae105 to 5120fda Compare November 23, 2026 19:17
@davidabram
davidabram marked this pull request as ready for review November 23, 2026 19:18
@davidabram
davidabram merged commit 967d27d into main Nov 24, 2026
11 checks passed
@davidabram
davidabram deleted the refactor/cli-command-routing-simplification branch November 24, 2026 12:56
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