refactor(skill-parity): own canonical↔copies body rule in one module#87
Merged
Conversation
Promote a Skill Body Parity module that owns frontmatter stripping and the canonical-vs-distributed-copies body comparison, sourcing paths from the Distribution Inventory. installer (strip/extract_frontmatter), doctor (_check_skill_body_parity), and scripts/validate_skill_copies.py now call it instead of re-implementing the rule. Deletes doctor's importlib+uuid dynamic load of validate_skill_copies.py: since parity now only reads files (no target-repo code executed), the check runs without --run-scripts. Observable behavior is otherwise unchanged; --run-scripts still gates the marketplace script load. Closes #81
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #81.
What
Promotes a Skill Body Parity module (
src/codeforerunner/skill_parity.py) that owns:split_frontmatter,body_of)check_skill_body_parity→ParityResult)sourcing artifact paths from the Distribution Inventory. The rule previously lived in three places; now there is one owner:
installer.py—strip_frontmatter/extract_frontmatterdelegate to the module (names kept for callers/tests).doctor.py—_check_skill_body_paritymapsParityResult→Findings.scripts/validate_skill_copies.py— calls the module; its own strip+compare removed.Leaky seam deleted
doctor.pyno longer dynamically loadsscripts/validate_skill_copies.pyviaimportlib+ auuid-suffixed module name to borrowstrip_frontmatter. Because parity now only reads files (no target-repo code executed), the body-parity check runs without--run-scripts. That flag still gates the marketplace check, which does load a repo script. No other observable behavior changes.Tests (TDD)
tests/test_skill_parity.py— 9 tests: frontmatter split/body (incl. CRLF), parity ok, drift, missing copy, missing canonical.282 pytest + node green locally;
validate_skill_copies.pygreen.🤖 Generated with Claude Code