-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Summary
Add four missing validation checks to Validate-Collections.ps1 that close gaps between what the validator enforces and what collection integrity requires.
Problem
The collection validator checks manifest-inward only: it verifies declared items exist on disk, IDs are unique, paths resolve, kind-suffix conventions hold, and maturity values are valid. It does not detect:
- Orphaned artifacts — files on disk not listed in any collection (especially
hve-core-all) - Intra-collection duplicates — the same
kind+pathlisted twice within a single manifest - Missing companion
.collection.md— a manifest without its paired markdown description file - hve-core-all coverage gaps — items exclusive to a themed collection but absent from the canonical superset
Approach
1. Orphaned artifact detection
PluginHelpers.psm1 already exports Get-ArtifactFiles which discovers all artifacts under .github/ (excluding .github/**/hve-core/). Compare that set against the union of all collection manifest items.
Severity levels:
- Error: Artifact on disk but absent from
hve-core-all - Warning: Artifact only in
hve-core-allbut not in any themed collection
2. Intra-collection duplicate detection
Get-CollectionItemKey already builds kind|path composite keys. Track keys per manifest and flag when the same key appears twice within a single collection.
3. Companion .collection.md validation
For each .collection.yml in collections/, verify a matching .collection.md (same base name) exists. Report missing companions as warnings.
4. hve-core-all coverage enforcement
Verify every item in any themed collection also exists in hve-core-all. The existing canonical entry check only triggers when an item appears in 2+ collections; items exclusive to one themed collection are never checked.
Acceptance Criteria
- Validator discovers all on-disk artifacts using
Get-ArtifactFilesand reports artifacts absent from all collections as errors - Artifacts on disk but absent from
hve-core-allspecifically receive a clear error message - Artifacts under
.github/**/hve-core/remain excluded (repo-specific, not distributed) - Duplicate
kind+pathentries within a single collection manifest produce an error identifying the collection ID and duplicated item - Each
.collection.ymlwithout a matching.collection.mdproduces a warning - Items in themed collections but absent from
hve-core-allproduce errors - Pester tests cover all four new validation scenarios
- CI validation (
npm run plugin:validate) catches all new error types