Skip to content

[Story] Make module install state and command availability consistent #534

@djm81

Description

@djm81

User Story

As a SpecFact CLI user, I want module installation, init profile bootstrap, and command availability checks to share one coherent module state model, so I can recover from missing module commands without contradictory "not installed" and "already installed" messages.

Source Tracking

Problem

Module artifacts, lifecycle state, discovery roots, init/profile writes, and runtime command registration can disagree. The user-visible result is a loop where a command group reports that its module is not installed, while specfact module install says the module is already installed or already available.

Acceptance Criteria

  • specfact module install <module-id> checks lifecycle state and runtime eligibility before treating an existing manifest as a completed install.
  • If an existing module is disabled, install or missing-command diagnostics either re-enable it intentionally or print exact specfact module enable <manifest-module-id> guidance.
  • Missing known command groups distinguish truly absent modules from installed-but-disabled, installed-but-skipped, or shadowed modules.
  • specfact init --repo <repo> --profile <profile> refreshes state from the selected repo context and preserves unrelated lifecycle state.
  • Bare names, legacy namespace names, marketplace ids, and manifest ids resolve to one canonical module identity for state decisions.
  • Project/user scope shadowing remains deterministic and visible in diagnostics when it affects command availability.
  • Regression tests cover repeated install/init/profile flows across user and project scopes.

OpenSpec Artifacts

  • Proposal: openspec/changes/marketplace-07-module-install-state-consistency/proposal.md
  • Design: openspec/changes/marketplace-07-module-install-state-consistency/design.md
  • Specs:
    • module-installation
    • user-module-root
    • init-module-state
  • Tasks: openspec/changes/marketplace-07-module-install-state-consistency/tasks.md

Links

OpenSpec Change Proposal: marketplace-07-module-install-state-consistency

Metadata

Metadata

Assignees

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions