Skip to content

Harden public package docs release contents - #3

Merged
andrei-hasna merged 2 commits into
mainfrom
fix/public-package-docs-safety
Jul 24, 2026
Merged

Harden public package docs release contents#3
andrei-hasna merged 2 commits into
mainfrom
fix/public-package-docs-safety

Conversation

@andrei-hasna

Copy link
Copy Markdown
Contributor

Summary

  • Replace the broad npm package docs and scripts file entries with explicit public allowlists.
  • Add scripts/validate-public-package.mjs to validate npm pack --dry-run --json output before publish.
  • Add focused package-release tests and docs/security release notes for public package contents.
  • Ignore generated .hasna/ project knowledge state to avoid accidental commits.

Investigation

package.json previously shipped the whole docs directory, and npm pack --dry-run --json included docs/canonical-secrets-bootstrap-2026-06-08.md. The fix avoids opening or changing that evidence document and enforces package contents through pack metadata only.

Validation

  • npm run release:pack:check passed: 6 public docs, 3 public smoke scripts.
  • npm run test:package passed: 2 tests, 25 assertions.
  • bun test passed: 120 tests, 1476 assertions.
  • bun run build passed.
  • bun src/cli.ts storage validate --scope project --json passed. The requested --strict flag is not supported by this branch's CLI parser.

Adversarial Review

Kant reviewed the original staged diff and found two blockers: broad scripts packaging shipped the validator path literal, and the new validator/test files needed to be staged. Reconciled by allowlisting public scripts, making the validator itself a forbidden pack path, staging the new files, and adding .hasna/ to .gitignore. Re-review found no blockers and approved PR readiness.

Replace broad docs/scripts entries in package.json files with an explicit
allowlist so the internal secrets-bootstrap runbook
(docs/canonical-secrets-bootstrap-2026-06-08.md) never ships in the public npm
tarball. Add a fail-closed release:pack:check validator (wired into
prepublishOnly) plus a package-release test, and document the policy in README
and SECURITY. Bump to 0.2.88.
spawnSync('npm', ...) only resolves the npm.cmd launcher through a shell on
Windows; add shell:true on win32 and surface spawn errors so the release
validator and its test run on the windows-latest CI matrix.
@andrei-hasna
andrei-hasna force-pushed the fix/public-package-docs-safety branch from 344a7e9 to 7e182e8 Compare July 24, 2026 15:15
@andrei-hasna
andrei-hasna merged commit 30699a5 into main Jul 24, 2026
3 of 7 checks passed
@andrei-hasna
andrei-hasna deleted the fix/public-package-docs-safety branch July 24, 2026 15:16
andrei-hasna added a commit that referenced this pull request Jul 24, 2026
Bring in #22/#26/#27/#29/#3 (hosted-url scrub, --json error contract,
reject unknown top-level commands, FTS query parser, public-package
docs hardening). Renumber this change to 0.2.90 (main consumed 0.2.88
and 0.2.89); rebuild bin/ and dist/ from merged sources.
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