Skip to content

fix(miner): restore the strict flat-only pack-safety allowlist#3781

Merged
JSONbored merged 1 commit into
mainfrom
revert/miner-pack-strict-allowlist
Jul 6, 2026
Merged

fix(miner): restore the strict flat-only pack-safety allowlist#3781
JSONbored merged 1 commit into
mainfrom
revert/miner-pack-strict-allowlist

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

No issue filed — small, self-evident cleanup of a redundant, just-merged change.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused — one regex revert + one test update, nothing else.
  • This follows CONTRIBUTING.md and does not touch site/, CNAME, or GitHub Pages.
  • No issue linked; the summary explains why.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npx vitest run test/unit/check-miner-package.test.ts — 8/8 passed, including the real-workspace-package test and both rejection cases (one-level and two-level nesting)
  • npm audit --audit-level=moderate
  • npm run test:coverage in full — not run; scripts/** is excluded from codecov/patch (only src/** is measured), and the directly affected test file was run in full above

If any required check was skipped, explain why:

  • Full coverage run skipped: this PR only touches scripts/check-miner-package.mjs and its dedicated test file, neither under src/**.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • No auth/cookie/CORS/GitHub App/Cloudflare/session changes.
  • No API/OpenAPI/MCP behavior changed.
  • No UI changes.
  • This PR tightens, not weakens, a security-relevant allowlist.

Notes

#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.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.29%. Comparing base (ede8961) to head (8fdd4de).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3781   +/-   ##
=======================================
  Coverage   93.29%   93.29%           
=======================================
  Files         317      317           
  Lines       32368    32368           
  Branches    11872    11872           
=======================================
  Hits        30199    30199           
  Misses       1537     1537           
  Partials      632      632           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 5172dc4 into main Jul 6, 2026
10 checks passed
@JSONbored
JSONbored deleted the revert/miner-pack-strict-allowlist branch July 6, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant