Skip to content

Deepen Skill Body Parity behind one seam #81

@derek-palmer

Description

@derek-palmer

This was generated by AI from an Architecture Review (arch-review).

What to build

One rule — "a distributed skill copy's body (frontmatter stripped) must equal the canonical skill body" — is currently implemented three times: the installer owns strip_frontmatter/extract_frontmatter and does the parity compare in its install planning; scripts/validate_skill_copies.py re-implements the same strip + compare; and the doctor health check dynamically loads that validation script by file path (via importlib + a uuid-suffixed module name) just to borrow strip_frontmatter. The installer's own docstring admits the coupling ("Body extraction matching scripts/validate_skill_copies.py"). Change one, the other two silently drift.

Promote a single Skill Body Parity module that owns frontmatter stripping and the canonical-vs-copies comparison, sourcing artifact paths from the Distribution Inventory. The installer's install planning, the doctor parity check, and the skill-copy validator all consult it instead of re-deriving the logic. The doctor's importlib/uuid script-loading seam is deleted.

This is a deepening refactor: observable behavior (install body-parity abort, doctor finding, validator exit code) is unchanged — only the owner of the rule moves.

Acceptance criteria

  • A single module owns frontmatter stripping and canonical↔copies body comparison, consuming Distribution Inventory paths.
  • Installer install-planning, doctor parity check, and scripts/validate_skill_copies.py all call this module; no duplicate strip/compare implementations remain.
  • Doctor no longer dynamically loads scripts/validate_skill_copies.py (no importlib/uuid script loader) for body parity.
  • Body parity is covered by direct unit tests (canonical + copies in, result out) — not only through the doctor --run-scripts path or a full installer write.
  • Existing installer, doctor, and validator behavior/tests pass unchanged; full suite green.

Blocked by

None - can start immediately.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions