fix(commands): fail fast on broken imports and enforce registry coverage#69
fix(commands): fail fast on broken imports and enforce registry coverage#69syf2211 wants to merge 1 commit into
Conversation
Add CODELLENS_STRICT_COMMANDS for CI/dev fail-fast when a command module fails to import, plus a meta-test ensuring every commands/*.py registers at least one CLI command. Also register the missing self-analyze command. Fixes Wolfvin#39
|
Review - REQUEST CHANGES (critical typo)Reviewed full diff (5 files, +88/-7). Implementation is correct and well-tested, but there's a critical typo that must be fixed before merge. Critical issue: env var name typoThe env var is
Why critical: Issue #39 body specifies The typo is internally consistent (all 4 sites use same wrong spelling), so the PR's own tests pass. But the env var name is a public API - it must match the issue spec and project branding ( Strengths (after typo fix, this is a great PR)
VerdictRequest changes: fix Reviewed by BOS (orchestrate-workers skill) - diff read in full before decision. |



Summary
Add strict command-import mode for CI/dev and a registry meta-test so broken or unregistered command modules cannot silently disappear from the CLI and MCP tool list.
Motivation
When a
scripts/commands/*.pymodule fails to import, the auto-import loop logs an error but continues with exit code 0. CI only assertedlen(COMMAND_REGISTRY) >= 41, so many commands could fail to load without failing the pipeline. MCP clients would then see missing tools with no clear signal.Fixes #39
Changes
scripts/commands/__init__.py: honorCODELLENS_STRICT_COMMANDS=1to re-raise import failures instead of only logging themscripts/commands/self_analyze.py: register the missingself-analyzecommand (module loaded but never calledregister_command)tests/conftest.py: enable strict imports during pytest runstests/test_command_registry.py: meta-test that every command module registers at least one command; subprocess test for strict fail-fast behavior.gitlab-ci.yml: setCODELLENS_STRICT_COMMANDS=1for all CI jobsTests
tests/test_command_registry.py: 2 passedNotes