chore(package): make validation extensible - #20
Conversation
|
Thanks for this, Reaan. I reviewed it by running it, not only reading it: an isolated copy of the branch on Node 22.14 and Node 24.20, plus the CI logs. The recursive inventory design looks right. Two things need to change before merge. 1.
|
|
Fixed in commits
The PR is ready for another review and merge decision. |
There was a problem hiding this comment.
🔵 Needs a closer look
Allowlisted directory roots are omitted from the derived inventory, which can reject legitimate package contents.
Pull request overview
This maintenance PR extends package validation with recursive inventory checks, canonical skill enforcement, and Node unit tests.
Changes:
- Added recursive publication inventory validation.
- Added seven validation tests.
- Updated
npm testto run validation and tests. - Documented scope and verification evidence.
File summaries
| File | Summary |
|---|---|
tests/validate-package.test.mjs |
Adds validation helper and boundary tests. |
scripts/validate-package.mjs |
Implements recursive inventory and publication validation. |
package.json |
Runs package validation and Node tests. |
odd/tasks/issue-9-package-validation.md |
Records task scope and verification evidence. |
Review details
Suppressed comments (1)
scripts/validate-package.mjs:245
- This drops every allowlisted directory entry from the derived inventory instead of expanding it. It works for
skills/only becauseskillFilesis added separately above, but adding thebin/,lib/, or test directories called out in issue #9 topublishedTopLevelPathswould leave their files out ofexpectedFiles, causingcompareTarballFilesto reject the legitimate package contents. Expand allowlisted directory roots when deriving the inventory (while keeping the canonical-skill check separate), or represent those roots through an equivalent recursive mechanism.
return [...publishedTopLevelPaths.filter((path) => !path.endsWith("/")), ...skillFiles];
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Addressed the review feedback about allowlisted directory roots. The package inventory now recursively expands every allowlisted directory while preserving direct file entries and canonical skill validation. Added a regression test for |
|
Approved, go ahead. I re-verified head Two follow-ups I am tracking outside this PR, so there is nothing to change here: the derived inventory still disagrees with npm's ignore rules (a Nice work on the fix, and thanks for turning it around quickly. |
Closes #9
Type
Summary
Changes
scripts/validate-package.mjstests/validate-package.test.mjspackage.jsonTest Plan
npm testnpm run pack:checkgit diff --checkContributor Checklist
type:*label (type:chore).Co-Authored-Bytrailers.