refactor(commands): consolidate 78 commands → 12 focused umbrella commands (closes #195)#196
Merged
Merged
Conversation
…mands (closes #195) Issue #195 consolidation. Maps 78 legacy commands to 12 focused umbrella commands with --check <category> dispatch. Old command names remain callable as hidden deprecated aliases (backward compat for one version) that print a redirect warning to stderr. 12 umbrella commands: scan — absorbs scan, init, rescan search — absorbs symbols, semantic-query, query-graph, search (--mode) context — absorbs context, outline, trace, orient (--check, default orient) deps — absorbs affected, dependents, circular, import-snapshot audit — absorbs dead-code, complexity, smell, staleness, perf-hint, side-effect security— absorbs secrets, vuln-scan, taint, binary-scan, regex-audit summary — absorbs summary, dashboard, arch-metrics, architecture impact — absorbs impact, diff, dataflow api-map — absorbs api-map, graph-schema doctor — absorbs doctor, env-check, lsp-status history — absorbs history, ownership, git-status graph — raw Cypher pass-through (power-user; casual callers use search --mode graph) Registry changes (commands/__init__.py): - register_command() accepts hidden + deprecated_alias_for kwargs - get_visible_commands() returns only non-hidden commands - --command-count and --help show only 12 umbrella commands - sync_command_count.py + mcp_server.py filter hidden from counts/tools 25 drop-total files deleted (adr, a11y, handbook, ask, serve, sessions, watch, registry_validate, rule_test, rule_validate, artifact_scan, css_deep, debug_leak, detect, export_snapshot, refactor_safe, resolve_types, stack_trace, benchmark, fix, self_analyze, guard, llm_framework, memory). lsp_status kept as utility (doctor imports it). migrate kept as utility wrapper (tests import cmd_migrate). 13 unaccounted commands (analyze, check, config-drift, deps-audit, entrypoints, lsp, list, missing-refs, plugin, query, state-map, test-map, type-infer) marked hidden pending BOS decision on where they belong — flagged in PR description. Shared utilities moved: - _extract_project_identity → scripts/handbook_helpers.py (was in commands/handbook.py, used by summary + analyze) - _watch_polling import removed from mcp_server.py (was unused) Tests: - tests/test_issue195_consolidation.py: 17 new tests for umbrella shape, registry invariants, --command-count, deprecation warnings - test_command_count.py: updated to count visible-only (issue #195) - test_command_registry.py: allowlist migrate.py utility module - Skipped tests for dropped commands (adr, llm, resolve-types, sessions, snapshot, memory) Docs: - README.md Command Reference rewritten with 12-command mapping table - sync_command_count.py --apply updated all headline counts (78→12, MCP 76→12) - SKILL.md, SKILL-QUICK.md, pyproject.toml, skill.json, graph_model.py auto-synced
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
5 tasks
|
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.


Closes #195
Summary
Consolidates 78 legacy commands into 12 focused umbrella commands per issue #195. Each umbrella command accepts
--check <category>(or--modefor search) to select a specific sub-analysis, or runs all by default. Legacy command names remain callable as hidden deprecated aliases (backward compat for one version) that print a redirect warning to stderr.The 12 Umbrella Commands
--check/--modechoicesscan--check scan|init|rescansearch--mode semantic|symbol|regex|graphcontext--check orient|outline|trace|context(default: orient)deps--check affected|dependents|circular|import-snapshotaudit--check dead-code|complexity|smell|staleness|perf-hint|side-effectsecurity--check secrets|vuln-scan|taint|binary-scan|regex-auditsummary--check summary|dashboard|arch-metrics|architecture(default: summary)impact--check impact|diff|dataflow(default: impact)api-map--check api-map|graph-schema(default: api-map)doctor--check doctor|env-check|lsp-status(default: doctor)history--check history|ownership|git-status(default: history)graphDefinition of Done checklist
--check/--modedispatch--helpshows only 12 commands;--command-countprints 12test_issue195_consolidation.py)Commands Dropped Total (25 files deleted)
adr,a11y,handbook,ask,serve,sessions,watch,registry-validate,rule-test,rule-validate,artifact-scan,css-deep,debug-leak,detect,export-snapshot,refactor-safe,resolve-types,stack-trace,benchmark,fix,self-analyze,guard,llm,memory.Findings (needs BOS decision)
1. 13 commands not in absorb list nor drop list
The issue body lists 78 → 12, but 13 commands are neither absorbed nor explicitly dropped:
analyze,check,config-drift,deps-audit,entrypoints,lsp,list,missing-refs,plugin,query,state-map,test-map,type-infer.These are marked hidden (callable but not in
--help) pending BOS decision on where they belong. Notable concerns:checkis the CI quality gate — deleting it would break.github/workflows/. Kept hidden but functional.analyzeis the "full repo analysis" aggregator.queryis the pre-write safety check (referenced by the oldcontextdeprecation message).Recommendation: Either (a) absorb these into a 13th umbrella, (b) drop them, or (c) keep them hidden permanently. Worker did not decide unilaterally — flagged for BOS.
2.
lsp-statusandmigratekept as utility moduleslsp_status.py— file kept (not deleted) but command unregistered.doctor --check lsp-statusimports it directly. Thecodelens --lsp-statustop-level flag still works (handled incodelens.pymain).migrate.py— file kept as a utility wrapper aroundPersistentRegistry.migrate_from_json. Themigratecommand is NOT registered (dropped per issue), but the module exists so existing tests thatfrom commands.migrate import cmd_migratecontinue to work.3.
serve(MCP server) droppedThe MCP server CLI entry point (
codelens serve) is dropped per the issue. Themcp_server.pymodule still exists and the MCP tool count is now 12 (6 static + 6 dynamic, matching the 12 umbrella commands). If MCP server access is still needed, it can be re-exposed via a different entry point in a follow-up issue.4. Shared utility extraction
_extract_project_identitymoved fromcommands/handbook.py→scripts/handbook_helpers.py(used bysummaryandanalyze)._watch_pollingimport removed frommcp_server.py(was an unused import — the MCP watcher has its own inline polling loop).Test results
tests/test_issue195_consolidation.py: 17 new tests, all passtests/test_command_count.py: 4 tests, all pass (updated for visible-only counting)tests/test_command_registry.py: 2 tests, all pass (allowlist for migrate.py utility)tests/test_persistent_registry.py::TestMigration: 3 tests, all pass (migrate wrapper)@pytest.mark.skip+ reasontest_formatters_phase2::TestCLISmoke::test_help_lists_new_formats,test_universal_grammar_loader(tree_sitter dep missing in env),test_confidenceschema-version tests — all verified to fail on clean main too.Files changed
101 files changed, +2767 / -6402 lines.
Sebelum → Sesudah
Sebelum (78 commands visible):
Sesudah (12 commands visible):
Old commands still work but warn: