fix(miner): accept lib/ subdirectory modules in the package checker - #3778
Merged
Conversation
check-miner-package.mjs's file-list validation only ever matched flat lib/<name>.(js|d.ts) files. #3704 added lib/calibration/{index,types} as a one-level subdirectory, which both the ALLOWED regex and the "missing lib/*.js artifacts" check missed -- breaking main's validate-code check for every subsequent PR regardless of its own changes. Closes #3777
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3778 +/- ##
=======================================
Coverage ? 93.29%
=======================================
Files ? 317
Lines ? 32368
Branches ? 11872
=======================================
Hits ? 30199
Misses ? 1537
Partials ? 632 🚀 New features to boost your workflow:
|
16 tasks
JSONbored
added a commit
that referenced
this pull request
Jul 6, 2026
#3778 widened scripts/check-miner-package.mjs's ALLOWED regex to accept one level of subdirectory under lib/, to accommodate the calibration module's nested lib/calibration/{index,types}.{js,d.ts} layout from #3704. #3772 (merged minutes earlier, independently fixing the same main-red CI break) took the opposite approach: it flattened that module to lib/calibration.js + lib/calibration-types.js instead, matching every other module in the package. With the nested directory gone, #3778's widening is dead weight -- it permanently weakens a security-relevant pack-safety allowlist (the only guard against an arbitrary nested file sneaking into the published npm package) for zero remaining benefit. Restore the strict flat-only pattern and turn the now-obsolete "accepts a subdirectory" test into a rejection test, so a future nested lib/ file is caught here instead of requiring another regex widening.
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.
Summary
scripts/check-miner-package.mjs's file-list validation only ever matched flatlib/<name>.(js|d.ts)files (both theALLOWEDallowlist regex and the "missing lib/*.js artifacts" check).packages/gittensory-miner/lib/calibration/{index,types}.{js,d.ts}— a one-level subdirectory — which neither pattern accounts for, since they don't allow a/insidelib/.main: the latest push-triggered CI run onorigin/mainfailsvalidate-code> "Test with coverage" ontest/unit/check-miner-package.test.ts > passes on the real miner workspace package, meaning every PR rebased onto current main inherits this failure regardless of its own changes.lib/, matching the existing flat-file convention otherwise.Closes #3777
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateSafety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.No UI changes in this PR — a build-tooling script fix only, so the UI Evidence section below is not applicable.
Notes
scripts/**is outside Codecov'ssrc/**-only coverage measurement, so this PR owes no patch-coverage obligation, but regression tests are included anyway (one confirming the new subdirectory case passes, one confirming a file nested two levels deep is still rejected).