No file is published unless it is seen, selected, and confirmed.
Review the exact npm package artifact before publish. PackAttest shows the final tarball, highlights what changed since the previous release, and publishes only the files you explicitly approve.
npm install -g packattest
cd /path/to/your-package
pa reviewTypical flow:
- run
pa reviewbefore releasing - inspect the exact packaged files and warnings
- select only the files you want shipped
- commit the resulting
.packattestfile for CI - run
pa publishlocally orpa verifyin CI
Example review session:
PackAttest — review
Packing artifact... your-package-1.4.0.tgz
Fetching previous published version... v1.3.9
Diff vs previous: 2 added, 1 modified, 8 unchanged
? Select files to publish (Space to toggle, A to select all, Enter to confirm)
❯ ◯ + package/dist/index.js (18.4KB)
◯ + package/dist/index.js.map (41.2KB) [source map]
◯ + package/.env.production (0.6KB) [env file]
◯ ~ package/package.json (0.8KB)
◯ package/README.md (5.6KB)
? Type "publish 3 files" to confirm › publish 3 files
Attestation written: .packattest
? Publish now? › Yes
Repacking constrained artifact... ok
Publishing...
Done.
The point is not to guess what is safe. The point is to force review of the actual package payload before it leaves your machine.
Modern package publishing workflows rely on ignore files and implicit inclusion rules. That is fragile for three reasons:
- ignore rules are easy to forget or misconfigure
- they are defined before the final build artifact exists
- they do not force review of what will actually be published
As a result, accidental leaks often happen at the artifact stage rather than the source stage.
PackAttest is a publish-time verification layer for package release workflows.
Before a package is published, PackAttest:
- enumerates the exact files in the final artifact
- shows the full file list to the user
- requires explicit user selection of files to publish
- compares the current artifact against the previous published version
- blocks publish if changes have not been reviewed
-
Artifact is truth
Decisions are based on the final package contents, not source-tree assumptions. -
No implicit inclusion
Nothing is published merely because it exists in a folder or matched an old rule. -
Explicit human intent
The user must actively choose what to publish. -
Diff-based review
Review effort should focus on what changed since the previous published version. -
Federated trust
No single baseline file is trusted on its own. Decisions combine:- previous published artifact
- current artifact
- explicit user selection
- policy checks
npm install -g packattestOr install from source:
git clone https://github.com/Divohna/PackAttest.git
cd <repo-dir>
npm install
npm install -g .| Command | Description |
|---|---|
pa review |
Enumerate artifact, diff against previous release, interactively select files, write attestation |
pa publish |
Verify the current artifact against an existing .packattest, repack the selected files, and publish |
pa verify |
CI mode: run the same verification, repack, and publish flow with step-by-step log output |
Run pa review from your package directory to inspect the exact artifact that npm pack would publish.
The .packattest file records the exact artifact hash, selected files, reviewer identity, and source commit. Commit it to your repository for CI use.
Add to your release workflow:
pa verifypa verify re-packs the artifact, checks its hash against the .packattest attestation, repacks the constrained artifact, and publishes. It fails hard if the artifact has changed since the last pa review.
pa publish performs the same guarded publish flow locally, but with simpler interactive-oriented output.
Traditional systems trust configuration. PackAttest trusts reality and requires the user to confirm intent.
That means:
- the system may enumerate files automatically
- the system must not silently choose files on the user's behalf
- the system must not pre-select files by default
- the system must block unreviewed additions
PackAttest is designed to prevent:
- accidental inclusion of source maps
- accidental inclusion of archives or debug files
- drift in build outputs
- silent scope expansion between releases
PackAttest does not claim to prevent:
- deliberate malicious publishing
- secrets embedded inside an explicitly approved file
- compromise of the developer workstation
Version 0.1.0 is a proof of concept focused on:
npm packintegration- file enumeration
- diff against previous published package
- interactive file selection
- publish confirmation
- blocking unselected files
packattest/
├── README.md
├── LICENSE
├── package.json
├── .packattest ← written by pa review, commit for CI use
├── docs/
│ ├── RFC.md
│ └── design.md
├── test/
│ ├── helpers.js
│ ├── artifact.test.js
│ ├── attestation.test.js
│ ├── diff.test.js
│ ├── policy.test.js
│ ├── repack.test.js
│ └── ui.test.js
└── cli/
├── index.js
├── commands/
│ ├── review.js
│ ├── publish.js
│ └── verify.js
└── lib/
├── artifact.js
├── attestation.js
├── diff.js
├── policy.js
├── registry.js
├── repack.js
└── ui.js
The CLI is fully implemented. All three commands (pa review, pa publish, pa verify) are functional.
Current version: v0.1.0
Feedback, critiques, design objections, and implementation help are welcome.
git clone https://github.com/Divohna/PackAttest.git
cd <repo-dir>
npm installRun tests:
npm testRun the CLI locally without installing globally:
node cli/index.js review
node cli/index.js publish
node cli/index.js verifyAfter making changes, regenerate the .packattest attestation by running pa review (or node cli/index.js review) from the repo root and committing the updated file.
MIT