Skip to content

[Bug] Module detection fails after clean install - commands show as available but don't execute #552

@danieldekay

Description

@danieldekay

Bug Report: Module Detection Fails After Clean Install

Environment

  • SpecFact Version: 0.46.18
  • OS: Linux (Ubuntu/Debian)
  • Python: 3.12.11
  • Installation Method: specfact init --profile solo-developer

Issue Description

After a clean installation, the code command group fails to execute despite modules showing as "enabled" in specfact module list.

Steps to Reproduce

  1. Remove existing modules: rm -rf ~/.specfact/modules/
  2. Fresh install: specfact init --profile solo-developer
  3. Verify installation: specfact module list (shows nold-ai/specfact-codebase as enabled)
  4. Try to run command: specfact code --help

Expected Behavior

specfact code --help should display help for code commands.

Actual Behavior

Command produces no output except timing info:

⏱️  Started: 2026-05-06 10:58:23
✓ Finished: 2026-05-06 10:58:23 | Duration: 0.19s

Or sometimes shows error:

Module 'nold-ai/specfact-codebase' is not installed.
The code command group is provided by that module.

Diagnostic Information

Module List Output

$ specfact module list | grep specfact-codebase
│ nold-ai/specfact-codebase    │ 0.41.9  │ enabled │ [official] │ nold-ai   │

Python Import Test

$ python -c "import importlib.util; spec = importlib.util.find_spec('specfact_codebase'); print(spec)"
None  # Module not found in Python path

Module File Structure

$ ls ~/.specfact/modules/specfact-codebase/
src/  # Module code is in src/specfact_codebase/

Root Cause Hypothesis

The modules are installed in ~/.specfact/modules/specfact-codebase/src/, but this path is not being added to sys.path when SpecFact loads modules. Python cannot import specfact_codebase even though the files exist.

Workaround Attempted

  • Uninstall + reinstall module: No effect
  • Run specfact init multiple times: No effect
  • Module shows as enabled but commands don't work

Impact

Cannot use SpecFact codebase import functionality, blocking brownfield code analysis workflow.

Additional Context

  • Bootstrap completes successfully: "Modules discovered: 10 (enabled=10, disabled=0)"
  • Command indexing completes: "Indexing CLI commands for help cache…"
  • Issue persists across multiple clean reinstalls

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdependenciesDependency resolution and managementmarketplaceModule marketplace features

Type

No fields configured for Bug.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions