Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,24 @@ jobs:
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Enable Corepack
run: corepack enable

- name: Activate the reviewed package manager
run: corepack prepare --activate

- name: Install dependencies
run: npm ci --registry https://registry.npmjs.org/
run: pnpm install --frozen-lockfile --registry https://registry.npmjs.org/

- name: Audit production dependencies
run: npm audit --omit=dev --audit-level=high
run: pnpm audit --prod --audit-level=high

- name: Check formatting
run: npm run format:check
run: pnpm run format:check

- name: Check types
run: npm run check
run: pnpm run check

- name: Run tests
run: npm test
run: pnpm test
19 changes: 14 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,23 @@ jobs:
node-version: 24.18.0
package-manager-cache: false

- name: Enable Corepack
run: corepack enable

- name: Activate the reviewed package manager
run: corepack prepare --activate
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved

- name: Use the reviewed npm release
run: npm install --global npm@11.18.0 --registry https://registry.npmjs.org/

- name: Install dependencies
run: npm ci --registry https://registry.npmjs.org/
run: pnpm install --frozen-lockfile --registry https://registry.npmjs.org/

- name: Run the gate
run: npm run format:check && npm run check && npm test && npm audit --omit=dev --audit-level=high
run: pnpm run format:check && pnpm run check && pnpm test && pnpm audit --prod --audit-level=high

- name: Prepare and verify the release tarball
run: npm run release:pack -- -- --require-clean --require-main-ancestor --require-release-tag --expected-release-commit "${RELEASE_COMMIT}"
run: node scripts/release-package.mjs pack --require-clean --require-main-ancestor --require-release-tag --expected-release-commit "${RELEASE_COMMIT}"

- name: Upload the prepared release
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
Expand Down Expand Up @@ -107,13 +113,16 @@ jobs:
- name: Refuse invalid normal release metadata
run: node scripts/release-package.mjs normal-release-check --expected-release-commit "${RELEASE_COMMIT}"

- name: Set up Node.js and npm
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24.18.0
registry-url: https://registry.npmjs.org
package-manager-cache: false

- name: Use the reviewed npm release
run: npm install --global npm@11.18.0 --registry https://registry.npmjs.org/

- name: Verify the public npm registry
run: test "$(npm config get registry)" = "https://registry.npmjs.org/"

Expand All @@ -124,4 +133,4 @@ jobs:
path: .release

- name: Publish the verified prepared tarball
run: npm run release:publish -- -- --expected-release-commit "${RELEASE_COMMIT}"
run: node scripts/release-package.mjs publish --expected-release-commit "${RELEASE_COMMIT}"
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm-lock.yaml
17 changes: 11 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ Read [AGENTS.md](AGENTS.md) and
Pull requests must pass the complete gate on Node.js 22 and 24:

```sh
npm ci
npm run format:check
npm run check
npm test
npm audit --omit=dev --audit-level=high
npm install -g corepack
corepack enable
pnpm install --frozen-lockfile
pnpm run format:check
pnpm run check
pnpm test
pnpm audit --prod --audit-level=high
```

`npm test` starts Azurite. Identity uniqueness, repair, challenge consumption,
Corepack is bundled with Node.js 22 and 24. On Node 25 or newer, the
`npm install -g corepack` step is required before `corepack enable`.

`pnpm test` starts Azurite. Identity uniqueness, repair, challenge consumption,
and counter transitions must agree between the memory store and the real
adapter where storage races are involved.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ One honest admission, stated rather than buried: an account recoverable by
emailed code is exactly as secure as the mailbox behind it. Every consumer
service works this way; almost none say it. We say it.

## Development

```sh
npm install -g corepack
corepack enable
pnpm install --frozen-lockfile
```

The gate runs on Node.js 22 and 24, where Corepack is bundled. On Node 25 or
newer, install Corepack before enabling it.

See [CONTRIBUTING.md](CONTRIBUTING.md) for the complete gate.

## License

MIT © RetireGolden, LLC
34 changes: 20 additions & 14 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ a protected signed annotated tag already on `origin/main`.
## Release invariants

The release tool verifies the single public workspace, stable package version,
exact runtime pins, matching lockfile, package metadata, package-local README
and LICENSE, prepack build, test exclusion, dist-only allowlist, exports, and a
production dependency audit. Every direct runtime lock entry must carry an
exact public-registry URL and SHA-512 integrity. Release commands discard
exact runtime pins, matching pnpm lockfile, package metadata, package-local
README and LICENSE, prepack build, test exclusion, dist-only allowlist,
exports, and a production dependency audit. Every direct runtime lock entry
must carry SHA-512 integrity and public-registry provenance. Release commands
discard
inherited npm configuration, use isolated temporary config files, and pass the
public registry explicitly. Packing builds once, checks the complete file
inventory and hashes, and imports the package from a clean consumer
Expand Down Expand Up @@ -96,10 +97,10 @@ deliberately refuses `0.0.0`.

## Normal release

A release pull request updates the root, package, and lockfile versions,
status documentation, and release notes, then passes the complete gate on Node
22 and 24. After merge, create and verify a protected signed annotated tag on
the exact `origin/main` commit:
A release pull request updates the root, package, and `pnpm-lock.yaml`
versions, status documentation, and release notes, then passes the complete
gate on Node 22 and 24. After merge, create and verify a protected signed
annotated tag on the exact `origin/main` commit:

```sh
git fetch origin
Expand All @@ -115,12 +116,17 @@ gh release create v0.1.0 --verify-tag --title "v0.1.0"
The workflow rejects prerelease events, tag/version mismatches, and every
normal package version below `0.1.0` immediately after checkout, before
fetching the protected branch or installing anything. CI and preparation use
an isolated npm user config plus an explicit public-registry override; the
release tool repeats that isolation for audit, clean-consumer install,
registry comparison, and publish.
Corepack to activate the reviewed `packageManager`, an isolated npm user
config, and an explicit public-registry override; the release tool repeats
that isolation for audit, clean-consumer install, registry comparison, and
publish. Registry publish remains `npm publish` so trusted-publisher OIDC
keeps its configured allowed action.

The unprivileged preparation job verifies the signed tag, release-event
commit, main ancestry, full gate, production audit, package inventory,
consumer import, and hashes. Only the environment-scoped publish job receives
OIDC authority; it installs no dependencies and publishes the downloaded
prepared artifact with provenance.
consumer import, and hashes. It activates the reviewed pnpm via Corepack and
installs the reviewed `npm@11.18.0` for pack, registry view, and the trusted
publishing version gate. Only the environment-scoped publish job receives
OIDC authority; it installs no workspace dependencies, does not download
Corepack pnpm, and publishes the downloaded prepared artifact with
`node scripts/release-package.mjs publish`.
2 changes: 1 addition & 1 deletion docs/THREAT_MODEL.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Dependency and release compromise matter because this library executes in an
authentication path. Runtime versions are exact, the lockfile is reviewed,
and every direct runtime lock entry requires public-registry provenance and
SHA-512 integrity. Release operations isolate npm config and explicitly
override hostile inherited registries. `npm audit` gates preparation, CI
override hostile inherited registries. `pnpm audit` gates preparation, CI
actions are SHA-pinned, Node 22 and 24 run the complete gate, package contents
are allowlisted, tests are excluded from the tarball, and publishing uses a
prepared artifact with trusted-publisher OIDC. A bootstrap `0.0.0` exists only
Expand Down
Loading