Skip to content

Installer and doctor consult the Distribution Inventory instead of restating it #99

Description

@derek-palmer

From the 2026-06-09 Architecture Review. Recommendation strength: Worth exploring.

Files

  • src/codeforerunner/distribution.py
  • src/codeforerunner/installer.py:19-23 (constant re-exports), installer.py:120 (hardcoded marketplace path)
  • src/codeforerunner/doctor.py:20-25 (constant re-exports)

Problem

The Distribution Inventory defines marketplace_destination(), yet installer.py::resolve_marketplace_target() hardcodes .codex/marketplaces/codeforerunner.json inline. Installer and doctor also re-export inventory constants (MARKER_BEGIN, CANONICAL_SKILL_REL, …), so the same distribution fact has three import paths — a typo or path change in one is not caught by the others, and tests inconsistently import from either source.

Solution

Every distribution fact flows through the Distribution Inventory's interface:

  1. resolve_marketplace_target() calls _dist.marketplace_destination() (matching how resolve_skill_target() already uses _dist.skill_destination()).
  2. Delete the re-exports in installer and doctor; callers and tests import from codeforerunner.distribution directly.

Benefits

  • Locality: install paths and markers change in one module.
  • Deletion test: the re-exports vanish and nothing reappears — they were pure pass-throughs.
  • Tests: one import path; test files stop choosing between two sources for the same constant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureArchitecture Review / Deepening OpportunityenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions