From 18d574df74464bd8ce8bb3abfaa2c21d8fea7e2c Mon Sep 17 00:00:00 2001 From: Alperen Cetin <22790042+hacetin@users.noreply.github.com> Date: Mon, 30 Nov 2026 18:52:49 +0300 Subject: [PATCH 1/7] docs: allow requested notes-only GitHub releases Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: cae1c384-1978-45b6-b0a5-593e18503225 --- .agents/skills/release-preparation/SKILL.md | 9 +++++++-- RELEASE_POLICY.md | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.agents/skills/release-preparation/SKILL.md b/.agents/skills/release-preparation/SKILL.md index 3c1c6d3..cbb9848 100644 --- a/.agents/skills/release-preparation/SKILL.md +++ b/.agents/skills/release-preparation/SKILL.md @@ -56,6 +56,11 @@ local-package smoke tests on the pull request. After the pull request is merged, release preparation is complete. -Do not run `npm publish`, create a GitHub Release, or add publishing credentials +Do not run `npm publish` or add publishing credentials, publishing workflows, or internal pipeline configuration. A Microsoft maintainer runs the internal -release pipeline. +ESRP release pipeline; npm publishing remains exclusive to that pipeline. + +Only when explicitly requested, a maintainer may create a notes-only GitHub +Release on an existing immutable version tag, using the changelog and upgrade +notes from that tag. Do not move or recreate tags or attach release assets. +GitHub Releases do not publish npm packages. diff --git a/RELEASE_POLICY.md b/RELEASE_POLICY.md index a2e1a23..fb9f5d3 100644 --- a/RELEASE_POLICY.md +++ b/RELEASE_POLICY.md @@ -20,7 +20,11 @@ release pipeline to build and publish the packages to npm. ## Publishing Boundary - Do not run `npm publish` for the Microsoft release. -- Do not create a GitHub Release manually. +- Only when explicitly requested, a maintainer may create a notes-only GitHub + Release on an existing immutable version tag, using the changelog and upgrade + notes from that tag. Do not move or recreate tags, attach release assets, or + add publishing workflows. GitHub Releases do not publish npm packages; + npm publishing remains exclusively in Microsoft's internal ESRP release pipeline. - Do not request or store Microsoft publishing credentials in this repository. For release questions, open a GitHub issue without including credentials or From 443579e9af4b273d611c353a66b6def452adeaae Mon Sep 17 00:00:00 2001 From: Alperen Cetin <22790042+hacetin@users.noreply.github.com> Date: Tue, 1 Dec 2026 13:18:23 +0300 Subject: [PATCH 2/7] Harden Node runtime release and packaging guardrails Require the Node 22 floor to ship in 0.4.0, validate all six packed engines declarations, and explain missing optional native packages without losing the original error. Keep floating smoke runners on current patches. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: cae1c384-1978-45b6-b0a5-593e18503225 --- .agents/skills/release-preparation/SKILL.md | 11 +++ .github/workflows/build.yml | 3 + CHANGELOG.md | 5 ++ RELEASE_POLICY.md | 16 +++- __tests__/native_loader.test.js | 85 +++++++++++++++++++++ __tests__/package_engines.test.js | 80 +++++++++++++++++++ ci/smoke/README.md | 13 ++++ ci/smoke/check-engines.js | 47 ++++++++++++ docs/user-guide.md | 10 +++ lib/duroxide.js | 18 ++++- 10 files changed, 286 insertions(+), 2 deletions(-) create mode 100644 __tests__/native_loader.test.js create mode 100644 __tests__/package_engines.test.js create mode 100644 ci/smoke/check-engines.js diff --git a/.agents/skills/release-preparation/SKILL.md b/.agents/skills/release-preparation/SKILL.md index cbb9848..78dda01 100644 --- a/.agents/skills/release-preparation/SKILL.md +++ b/.agents/skills/release-preparation/SKILL.md @@ -19,6 +19,11 @@ Before editing, identify: Follow Semantic Versioning and the policy in [RELEASE_POLICY.md](../../../RELEASE_POLICY.md). +A runtime-floor increase is a breaking change and requires at least the next +minor version while the SDK is on 0.x. The Node.js 22 floor on `main` must first +ship in **0.4.0**, not 0.3.1 or any other 0.3.x release. Prepare any 0.3.x patch +from a branch based on `v0.3.0`, preserving its Node.js 18 floor. + ## 2. Synchronize npm Versions Set the target version in: @@ -30,6 +35,12 @@ Set the target version in: All six package versions and all five optional dependency versions must match. Do not change the `Cargo.toml` package version as part of an npm-only release. +Also synchronize `engines.node` in the root and all five platform manifests, +including the root entry in `package-lock.json`. The 0.4.0 floor is `>=22`. +After packing, run `node ci/smoke/check-engines.js ` to check +all six distributable manifests, not just the source files. A future intentional +floor increase must update this check and the supported-runtime documentation. + ## 3. Finalize the Changelog In `CHANGELOG.md`: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbc0aae..f44eff4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,6 +116,8 @@ jobs: done - name: Pack main package run: npm pack --pack-destination "$GITHUB_WORKSPACE/tarballs" + - name: Check packed runtime requirements + run: node ci/smoke/check-engines.js tarballs - name: List tarballs run: ls -lh tarballs/ - name: Upload tarballs @@ -156,6 +158,7 @@ jobs: - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ matrix.node }} + check-latest: true - name: Download tarballs uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index f8ceeb3..699adb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 and its native platform packages. Upgrade from Node.js 18 or 20 before installing 0.4.0. The requirement for 0.3.0 is unchanged. +### Fixed + +- Explain possible runtime and install-time Node.js version causes when a + native platform package is missing, while preserving the original error. + ## [0.3.0] - 2026-11-30 ### Changed diff --git a/RELEASE_POLICY.md b/RELEASE_POLICY.md index fb9f5d3..f212d59 100644 --- a/RELEASE_POLICY.md +++ b/RELEASE_POLICY.md @@ -9,7 +9,8 @@ execution remain outside this repository. Contributors can prepare a release through a pull request: 1. Keep the root package version, every `npm/npm/*/package.json` version, and - all platform `optionalDependencies` aligned. + all platform `optionalDependencies` aligned. Keep `engines.node` aligned + across all six manifests and the lockfile root, and check the packed tarballs. 2. Update `CHANGELOG.md` and relevant documentation. 3. Open a pull request for review. GitHub Actions runs the build, tests, and package smoke checks. @@ -17,6 +18,19 @@ Contributors can prepare a release through a pull request: After the release change is merged, a Microsoft maintainer runs the internal release pipeline to build and publish the packages to npm. +## Supported Runtimes + +Use maintained Node.js releases and current security patches. Review the +[Node.js release schedule](https://nodejs.org/en/about/previous-releases) before +each release; Node.js 22 reaches end of life on 2027-04-30. Plan runtime-floor +increases before end of life and document their migration requirements. + +A runtime-floor increase requires at least the next minor SDK version on 0.x. +The Node.js 22 floor on `main` must first ship in 0.4.0, not a 0.3.x patch. +Prepare 0.3.x patches from a branch based on `v0.3.0`, keeping its Node.js 18 +floor. See the [user guide](docs/user-guide.md#installation) for installation +requirements. + ## Publishing Boundary - Do not run `npm publish` for the Microsoft release. diff --git a/__tests__/native_loader.test.js b/__tests__/native_loader.test.js new file mode 100644 index 0000000..fdb3e16 --- /dev/null +++ b/__tests__/native_loader.test.js @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { describe, it } = require('node:test'); +const assert = require('node:assert/strict'); +const { spawnSync } = require('node:child_process'); +const { copyFileSync, mkdtempSync, mkdirSync, readFileSync, rmSync } = require('node:fs'); +const os = require('node:os'); +const path = require('node:path'); +const vm = require('node:vm'); + +const root = path.join(__dirname, '..'); +const source = readFileSync(path.join(root, 'lib', 'duroxide.js'), 'utf8'); + +describe('native loader diagnostics', () => { + it('still exports the SDK when native bindings load successfully', () => { + const context = { + module: { exports: {} }, + require(name) { + assert.equal(name, '../index.js'); + return {}; + }, + }; + vm.runInNewContext(source, context); + for (const name of ['SqliteProvider', 'PostgresProvider', 'Client', 'Runtime']) { + assert.equal(typeof context.module.exports[name], 'function'); + } + }); + + it('explains a missing optional package through the real generated loader', (t) => { + const directory = mkdtempSync(path.join(os.tmpdir(), 'duroxide-loader-')); + t.after(() => rmSync(directory, { recursive: true, force: true })); + mkdirSync(path.join(directory, 'lib')); + copyFileSync(path.join(root, 'index.js'), path.join(directory, 'index.js')); + copyFileSync(path.join(root, 'lib', 'duroxide.js'), path.join(directory, 'lib', 'duroxide.js')); + const script = ` + const assert = require('node:assert/strict'); + assert.throws(() => require('./lib/duroxide'), (error) => { + assert.match(error.message, /Cannot find module 'duroxide-/); + assert.match(error.message, /running on Node.js older than 22/); + assert.match(error.message, /installing with Node.js older than 22/); + assert.match(error.message, /install-time Node.js version/); + assert.match(error.message, /Other causes include omitted optional dependencies/); + assert.match(error.message, /reinstall with optional dependencies enabled/); + assert.equal(error.cause.code, 'MODULE_NOT_FOUND'); + assert.ok(error.message.startsWith(error.cause.message)); + assert.match(error.cause.stack, /index.js/); + assert.ok(error.cause.requireStack.some((file) => file.endsWith('index.js'))); + return true; + }); + `; + const child = spawnSync(process.execPath, ['-e', script], { + cwd: directory, encoding: 'utf8', env: { ...process.env, NODE_PATH: '' }, timeout: 10000, + }); + assert.equal(child.status, 0, child.stderr || String(child.error)); + }); + + it('keeps the original error and its existing cause', () => { + const cause = new Error('underlying failure'); + const original = new Error("Cannot find module 'duroxide-linux-x64-gnu'", { cause }); + original.code = 'MODULE_NOT_FOUND'; + assert.throws(() => vm.runInNewContext(source, { + require() { throw original; }, + }), (error) => { + assert.equal(error.cause, original); + assert.equal(error.cause.cause, cause); + return true; + }); + }); + + for (const [code, message] of [ + ['MODULE_NOT_FOUND', "Cannot find module 'unrelated-dependency'"], + ['MODULE_NOT_FOUND', "Cannot find module '../index.js'"], + ['ERR_DLOPEN_FAILED', 'Native library could not be opened'], + [undefined, 'Unsupported architecture'], + ]) { + it(`does not replace unrelated load errors: ${message}`, () => { + const original = new Error(message); + original.code = code; + assert.throws(() => vm.runInNewContext(source, { + require() { throw original; }, + }), (error) => error === original); + }); + } +}); diff --git a/__tests__/package_engines.test.js b/__tests__/package_engines.test.js new file mode 100644 index 0000000..5353763 --- /dev/null +++ b/__tests__/package_engines.test.js @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { describe, it } = require('node:test'); +const assert = require('node:assert/strict'); +const { execFileSync } = require('node:child_process'); +const { mkdtempSync, mkdirSync, writeFileSync, rmSync } = require('node:fs'); +const os = require('node:os'); +const path = require('node:path'); +const { checkPackedEngines } = require('../ci/smoke/check-engines'); +const { name, optionalDependencies } = require('../package.json'); + +function packedManifests(t, change = () => {}) { + const root = mkdtempSync(path.join(os.tmpdir(), 'duroxide-engines-')); + t.after(() => rmSync(root, { recursive: true, force: true })); + const directory = path.join(root, 'tarballs'); + const packageDirectory = path.join(root, 'package'); + mkdirSync(directory); + mkdirSync(packageDirectory); + const manifests = [name, ...Object.keys(optionalDependencies)] + .map((name) => ({ name, version: '0.4.0', engines: { node: '>=22' } })); + change(manifests); + for (const [index, manifest] of manifests.entries()) { + writeFileSync(path.join(packageDirectory, 'package.json'), JSON.stringify(manifest)); + execFileSync('tar', [ + '-czf', path.join(directory, `${index}.tgz`), '-C', root, 'package/package.json', + ]); + } + return directory; +} + +describe('packed runtime requirements', () => { + it('accepts all six tarballs with engines.node >=22', (t) => { + checkPackedEngines(packedManifests(t)); + }); + + for (const floor of ['>=18', '>=20', '>=24']) { + it(`rejects all six agreeing on the wrong floor ${floor}`, (t) => { + const directory = packedManifests(t, (manifests) => { + for (const manifest of manifests) manifest.engines.node = floor; + }); + assert.throws(() => checkPackedEngines(directory), /must declare engines.node >=22/); + }); + } + + it('rejects all six missing engines', (t) => { + const directory = packedManifests(t, (manifests) => { + for (const manifest of manifests) delete manifest.engines; + }); + assert.throws(() => checkPackedEngines(directory), /must declare engines.node >=22/); + }); + + for (const name of Object.keys(optionalDependencies)) { + it(`rejects a missing floor in ${name}`, (t) => { + const directory = packedManifests(t, (manifests) => { + manifests.find((manifest) => manifest.name === name).engines = {}; + }); + assert.throws(() => checkPackedEngines(directory), /engines.node must match/); + }); + } + + it('rejects a platform floor that differs from the main package', (t) => { + const directory = packedManifests(t, (manifests) => { + manifests[1].engines.node = '>=18'; + }); + assert.throws(() => checkPackedEngines(directory), /engines.node must match/); + }); + + it('rejects a missing platform tarball', (t) => { + const directory = packedManifests(t, (manifests) => manifests.pop()); + assert.throws(() => checkPackedEngines(directory), /all five platform tarballs/); + }); + + it('rejects a duplicate platform in place of another', (t) => { + const directory = packedManifests(t, (manifests) => { + manifests[1].name = manifests[2].name; + }); + assert.throws(() => checkPackedEngines(directory), /all five platform tarballs/); + }); +}); diff --git a/ci/smoke/README.md b/ci/smoke/README.md index 2116cbf..0477587 100644 --- a/ci/smoke/README.md +++ b/ci/smoke/README.md @@ -6,6 +6,18 @@ napi-rs platform subpackage, runs a minimal SQLite-backed orchestration. CI packs the tarballs on Node.js 24 and tests those same tarballs on Node.js 22, 24, and 26 for each supported OS and architecture. +Floating smoke versions use `check-latest: true` to pick up current security +patches rather than an older runner-cached version. + +Before uploading tarballs, `node ci/smoke/check-engines.js tarballs` checks the +packed `package.json` for the main package and all five platform packages. +All six `engines.node` values must match and must explicitly be `>=22`; agreement +on a missing or outdated floor is rejected. Run the focused packaging and +loader tests without a native build or database: + +```bash +node --test __tests__/package_engines.test.js __tests__/native_loader.test.js +``` Motivated by [microsoft/duroxide#13](https://github.com/microsoft/duroxide/issues/13): the Windows platform subpackage was renamed from `duroxide-win32-x64-msvc` to @@ -18,6 +30,7 @@ back to the local `.node` binary when run from the repo. | File | Purpose | |--------------------------|-------------------------------------------------| | `smoke.mjs` | Hello-world orchestration using `SqliteProvider`. | +| `check-engines.js` | Assert the Node.js floor in all six packed manifests. | | `run-local.sh` / `.ps1` | Install from local tarballs (pre-publish). | | `run-registry.sh` / `.ps1` | Install from npm registry (post-publish). | diff --git a/ci/smoke/check-engines.js b/ci/smoke/check-engines.js new file mode 100644 index 0000000..f4688af --- /dev/null +++ b/ci/smoke/check-engines.js @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const assert = require('node:assert/strict'); +const { execFileSync } = require('node:child_process'); +const { readdirSync } = require('node:fs'); +const path = require('node:path'); + +const packageNames = [ + 'duroxide', + 'duroxide-darwin-arm64', + 'duroxide-darwin-x64', + 'duroxide-linux-arm64-gnu', + 'duroxide-linux-x64-gnu', + 'duroxide-windows-x64', +]; + +function checkPackedEngines(directory) { + const manifests = readdirSync(directory) + .filter((name) => name.endsWith('.tgz')) + .map((name) => JSON.parse(execFileSync( + 'tar', ['-xOf', path.resolve(directory, name), 'package/package.json'], + { encoding: 'utf8' }, + ))); + + assert.deepEqual( + manifests.map((manifest) => manifest.name).sort(), + packageNames, + 'Expected exactly the main package and all five platform tarballs', + ); + const main = manifests.find((manifest) => manifest.name === 'duroxide'); + assert.equal(main.engines?.node, '>=22', 'duroxide must declare engines.node >=22'); + for (const manifest of manifests) { + assert.equal( + manifest.engines?.node, main.engines.node, + `${manifest.name} engines.node must match duroxide (>=22)`, + ); + } +} + +if (require.main === module) { + assert.equal(process.argv.length, 3, 'Usage: node ci/smoke/check-engines.js '); + checkPackedEngines(process.argv[2]); + console.log('All six packed engines.node values match >=22'); +} + +module.exports = { checkPackedEngines }; diff --git a/docs/user-guide.md b/docs/user-guide.md index a04f51a..07ae91b 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -4,6 +4,16 @@ This guide covers how to build workflows with duroxide-node. For architecture de ## Installation +Starting with SDK 0.4.0, use Node.js 22 or newer for both installation and +execution. SDK 0.3.0 still declares Node.js 18 as its minimum. Upgrade Node.js +before installing 0.4.0; if you previously installed on an older Node.js version, +reinstall with optional dependencies enabled so npm includes the native package. + +Use a maintained Node.js release with current security patches. Node.js 22 +reaches end of life on 2027-04-30; plan an upgrade before then. Runtime-floor +increases require at least a minor SDK release while the SDK is on 0.x, with +migration notes. See the [supported-runtime policy](../RELEASE_POLICY.md#supported-runtimes). + ```bash npm install duroxide ``` diff --git a/lib/duroxide.js b/lib/duroxide.js index 8d00044..38aaab6 100644 --- a/lib/duroxide.js +++ b/lib/duroxide.js @@ -9,7 +9,23 @@ */ // Load native bindings from the auto-generated napi-rs loader -const { JsSqliteProvider, JsPostgresProvider, JsClient, JsRuntime, activityTraceLog, orchestrationTraceLog, activityIsCancelled, activityGetClient, activityTag, orchestrationSetCustomStatus, orchestrationResetCustomStatus, orchestrationGetCustomStatus, orchestrationSetValue, orchestrationGetValue, orchestrationClearValue, orchestrationClearAllValues, orchestrationGetKvAllValues, orchestrationGetKvAllKeys, orchestrationGetKvLength, orchestrationPruneKvValues, initTracing } = require('../index.js'); +let nativeBinding; +try { + nativeBinding = require('../index.js'); +} catch (error) { + if (error?.code === 'MODULE_NOT_FOUND' && /^Cannot find module ['"]duroxide-[^'"]+['"]/.test(error.message)) { + throw new Error( + `${error.message}\nThe native platform package is missing. Possible causes include ` + + 'running on Node.js older than 22 or installing with Node.js older than 22: npm may skip ' + + 'optional packages based on the install-time Node.js version. Other causes include omitted ' + + 'optional dependencies or an incomplete install. Use Node.js 22+ for both installation and ' + + 'execution, then reinstall with optional dependencies enabled.', + { cause: error }, + ); + } + throw error; +} +const { JsSqliteProvider, JsPostgresProvider, JsClient, JsRuntime, activityTraceLog, orchestrationTraceLog, activityIsCancelled, activityGetClient, activityTag, orchestrationSetCustomStatus, orchestrationResetCustomStatus, orchestrationGetCustomStatus, orchestrationSetValue, orchestrationGetValue, orchestrationClearValue, orchestrationClearAllValues, orchestrationGetKvAllValues, orchestrationGetKvAllKeys, orchestrationGetKvLength, orchestrationPruneKvValues, initTracing } = nativeBinding; // ─── Generator Driver ──────────────────────────────────────────── From 2adced176fd4a8fb9bc5fdfd2925fb432d26d40d Mon Sep 17 00:00:00 2001 From: Alperen Cetin <22790042+hacetin@users.noreply.github.com> Date: Tue, 1 Dec 2026 13:43:56 +0300 Subject: [PATCH 3/7] docs: use generic internal release pipeline wording Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: cae1c384-1978-45b6-b0a5-593e18503225 --- .agents/skills/release-preparation/SKILL.md | 2 +- RELEASE_POLICY.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.agents/skills/release-preparation/SKILL.md b/.agents/skills/release-preparation/SKILL.md index 78dda01..3e1866c 100644 --- a/.agents/skills/release-preparation/SKILL.md +++ b/.agents/skills/release-preparation/SKILL.md @@ -69,7 +69,7 @@ After the pull request is merged, release preparation is complete. Do not run `npm publish` or add publishing credentials, publishing workflows, or internal pipeline configuration. A Microsoft maintainer runs the internal -ESRP release pipeline; npm publishing remains exclusive to that pipeline. +release pipeline; npm publishing remains exclusive to that pipeline. Only when explicitly requested, a maintainer may create a notes-only GitHub Release on an existing immutable version tag, using the changelog and upgrade diff --git a/RELEASE_POLICY.md b/RELEASE_POLICY.md index f212d59..dcef312 100644 --- a/RELEASE_POLICY.md +++ b/RELEASE_POLICY.md @@ -38,7 +38,7 @@ requirements. Release on an existing immutable version tag, using the changelog and upgrade notes from that tag. Do not move or recreate tags, attach release assets, or add publishing workflows. GitHub Releases do not publish npm packages; - npm publishing remains exclusively in Microsoft's internal ESRP release pipeline. + npm publishing remains exclusively in Microsoft's internal release pipeline. - Do not request or store Microsoft publishing credentials in this repository. For release questions, open a GitHub issue without including credentials or From 40f08313fc5ffa8799172c201404cb1b9833f7e4 Mon Sep 17 00:00:00 2001 From: Alperen Cetin <22790042+hacetin@users.noreply.github.com> Date: Tue, 1 Dec 2026 13:45:13 +0300 Subject: [PATCH 4/7] docs: require notes-only GitHub releases for release tags Let developer requests control timing independently of npm publication, retaining explicit tag authorization and internal registry publishing boundaries. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: cae1c384-1978-45b6-b0a5-593e18503225 --- .agents/skills/release-preparation/SKILL.md | 18 +++++++++++------- RELEASE_POLICY.md | 17 ++++++++++------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.agents/skills/release-preparation/SKILL.md b/.agents/skills/release-preparation/SKILL.md index 3e1866c..0fbeca0 100644 --- a/.agents/skills/release-preparation/SKILL.md +++ b/.agents/skills/release-preparation/SKILL.md @@ -5,8 +5,8 @@ description: Preparing a duroxide-node npm release PR without publishing. Use wh # Preparing a duroxide-node Release -Prepare the public release changes for review. Publishing is performed separately -by a Microsoft maintainer through the internal release pipeline. +Prepare the public release changes for review. Registry publishing is performed +separately by a Microsoft maintainer through the internal release pipeline. ## 1. Confirm the Release @@ -65,13 +65,17 @@ local-package smoke tests on the pull request. ## 5. Maintainer Handoff -After the pull request is merged, release preparation is complete. +After the pull request is merged, the release-preparation PR work is complete. +The release process also requires a notes-only GitHub Release for every release +tag. Do not run `npm publish` or add publishing credentials, publishing workflows, or internal pipeline configuration. A Microsoft maintainer runs the internal release pipeline; npm publishing remains exclusive to that pipeline. -Only when explicitly requested, a maintainer may create a notes-only GitHub -Release on an existing immutable version tag, using the changelog and upgrade -notes from that tag. Do not move or recreate tags or attach release assets. -GitHub Releases do not publish npm packages. +Create the required notes-only GitHub Release on the existing immutable version +tag, using the changelog and upgrade notes from that tag. Creating a new tag +requires explicit developer authorization. The developer's request controls +timing: the GitHub Release may precede or follow npm publication and is +independent of internal registry publication. Do not move or recreate tags or +upload package assets. GitHub Releases do not publish npm packages. diff --git a/RELEASE_POLICY.md b/RELEASE_POLICY.md index dcef312..ccb183d 100644 --- a/RELEASE_POLICY.md +++ b/RELEASE_POLICY.md @@ -1,8 +1,8 @@ # Release Policy `duroxide` and its platform packages are published to npm by Microsoft's -internal open-source release infrastructure. Publishing credentials and release -execution remain outside this repository. +internal open-source release infrastructure. Registry publishing credentials +and execution remain outside this repository. ## Contributor Workflow @@ -34,11 +34,14 @@ requirements. ## Publishing Boundary - Do not run `npm publish` for the Microsoft release. -- Only when explicitly requested, a maintainer may create a notes-only GitHub - Release on an existing immutable version tag, using the changelog and upgrade - notes from that tag. Do not move or recreate tags, attach release assets, or - add publishing workflows. GitHub Releases do not publish npm packages; - npm publishing remains exclusively in Microsoft's internal release pipeline. +- Every release tag must have a notes-only GitHub Release, using the changelog + and upgrade notes from that tag. Create it on the existing immutable version + tag; creating a new tag requires explicit developer authorization. +- The developer's request controls timing: the GitHub Release may precede or + follow npm publication and is independent of internal registry publication. + Do not move or recreate tags, upload package assets, or add publishing + workflows. GitHub Releases do not publish npm packages; npm publishing + remains exclusively in Microsoft's internal release pipeline. - Do not request or store Microsoft publishing credentials in this repository. For release questions, open a GitHub issue without including credentials or From fec3c8adec572eb054a823ff2b26baf8944e17f4 Mon Sep 17 00:00:00 2001 From: Alperen Cetin <22790042+hacetin@users.noreply.github.com> Date: Tue, 1 Dec 2026 13:48:30 +0300 Subject: [PATCH 5/7] docs: simplify runtime requirements guidance Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: cae1c384-1978-45b6-b0a5-593e18503225 --- RELEASE_POLICY.md | 5 ----- docs/user-guide.md | 11 ++--------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/RELEASE_POLICY.md b/RELEASE_POLICY.md index ccb183d..2ca7606 100644 --- a/RELEASE_POLICY.md +++ b/RELEASE_POLICY.md @@ -20,11 +20,6 @@ release pipeline to build and publish the packages to npm. ## Supported Runtimes -Use maintained Node.js releases and current security patches. Review the -[Node.js release schedule](https://nodejs.org/en/about/previous-releases) before -each release; Node.js 22 reaches end of life on 2027-04-30. Plan runtime-floor -increases before end of life and document their migration requirements. - A runtime-floor increase requires at least the next minor SDK version on 0.x. The Node.js 22 floor on `main` must first ship in 0.4.0, not a 0.3.x patch. Prepare 0.3.x patches from a branch based on `v0.3.0`, keeping its Node.js 18 diff --git a/docs/user-guide.md b/docs/user-guide.md index 07ae91b..677587e 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -4,15 +4,8 @@ This guide covers how to build workflows with duroxide-node. For architecture de ## Installation -Starting with SDK 0.4.0, use Node.js 22 or newer for both installation and -execution. SDK 0.3.0 still declares Node.js 18 as its minimum. Upgrade Node.js -before installing 0.4.0; if you previously installed on an older Node.js version, -reinstall with optional dependencies enabled so npm includes the native package. - -Use a maintained Node.js release with current security patches. Node.js 22 -reaches end of life on 2027-04-30; plan an upgrade before then. Runtime-floor -increases require at least a minor SDK release while the SDK is on 0.x, with -migration notes. See the [supported-runtime policy](../RELEASE_POLICY.md#supported-runtimes). +SDK 0.4.0 and later require Node.js 22 or newer. +SDK 0.3.0 requires Node.js 18 or newer. ```bash npm install duroxide From b9a6370f11cc834d661c640a49dbabd45dd2043a Mon Sep 17 00:00:00 2001 From: Alperen Cetin <22790042+hacetin@users.noreply.github.com> Date: Wed, 2 Dec 2026 12:09:51 +0300 Subject: [PATCH 6/7] Address runtime packaging and release procedure feedback Limit native load advice to published packages, preserve error fields, and cover the engines CLI with relative tar paths. Document exact-tag verification, publication timing and historical release boundaries without unsupported maintenance release guidance. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: cae1c384-1978-45b6-b0a5-593e18503225 --- .agents/skills/release-preparation/SKILL.md | 55 ++++++++++++++++----- CHANGELOG.md | 5 +- RELEASE_POLICY.md | 32 ++++++++---- __tests__/native_loader.test.js | 51 ++++++++++++++++++- __tests__/package_engines.test.js | 26 ++++++++-- ci/smoke/README.md | 3 +- ci/smoke/check-engines.js | 5 +- docs/user-guide.md | 2 + lib/duroxide.js | 19 ++++++- 9 files changed, 166 insertions(+), 32 deletions(-) diff --git a/.agents/skills/release-preparation/SKILL.md b/.agents/skills/release-preparation/SKILL.md index 0fbeca0..bd8946a 100644 --- a/.agents/skills/release-preparation/SKILL.md +++ b/.agents/skills/release-preparation/SKILL.md @@ -21,8 +21,8 @@ Follow Semantic Versioning and the policy in A runtime-floor increase is a breaking change and requires at least the next minor version while the SDK is on 0.x. The Node.js 22 floor on `main` must first -ship in **0.4.0**, not 0.3.1 or any other 0.3.x release. Prepare any 0.3.x patch -from a branch based on `v0.3.0`, preserving its Node.js 18 floor. +ship in **0.4.0**, not 0.3.1 or any other 0.3.x release. +No further 0.3.x releases are planned from the current release pipeline. ## 2. Synchronize npm Versions @@ -39,7 +39,9 @@ Also synchronize `engines.node` in the root and all five platform manifests, including the root entry in `package-lock.json`. The 0.4.0 floor is `>=22`. After packing, run `node ci/smoke/check-engines.js ` to check all six distributable manifests, not just the source files. A future intentional -floor increase must update this check and the supported-runtime documentation. +floor increase must update this check, the loader hint in `lib/duroxide.js`, +its tests in `__tests__/native_loader.test.js`, and the runtime documentation. +This check covers GitHub-built tarballs, not internal-pipeline artifacts. ## 3. Finalize the Changelog @@ -62,20 +64,51 @@ Create a pull request targeting `main`. GitHub Actions validates the full SDK test suite, cross-platform builds, and local-package smoke tests on the pull request. +Confirm the `Build & Smoke` workflow succeeds before merging and for the exact +approved release commit before tagging or publishing GitHub notes. ## 5. Maintainer Handoff After the pull request is merged, the release-preparation PR work is complete. -The release process also requires a notes-only GitHub Release for every release -tag. +Going forward, the release process requires a notes-only GitHub Release for each +new SDK version tag (`vX.Y.Z`, including prereleases), not `npm-v*` tags. +Existing historical releases and assets remain unchanged; do not backfill them +as part of this procedure. GitHub package assets ended with 0.2.4; install from npm. Do not run `npm publish` or add publishing credentials, publishing workflows, or internal pipeline configuration. A Microsoft maintainer runs the internal release pipeline; npm publishing remains exclusive to that pipeline. -Create the required notes-only GitHub Release on the existing immutable version -tag, using the changelog and upgrade notes from that tag. Creating a new tag -requires explicit developer authorization. The developer's request controls -timing: the GitHub Release may precede or follow npm publication and is -independent of internal registry publication. Do not move or recreate tags or -upload package assets. GitHub Releases do not publish npm packages. +### Tag Authorization + +Tag creation is a separate action requiring explicit developer authorization +for the version and exact release commit SHA, not the current tip of `main`. +Confirm the approved commit contains the merged release changes and has a +successful `Build & Smoke` run. Check local and remote tags first. If the tag +already exists, verify its commit matches the approved SHA and do not recreate it. +If absent and authorized, create it with `git tag "$TAG" "$RELEASE_SHA"` and push +only that tag with `git push origin "refs/tags/$TAG"`. Never move or delete tags. + +### GitHub Notes + +The notes step never creates a tag. Fetch the existing remote tag without force +and compare `git rev-parse "$TAG^{commit}"` with the exact approved release SHA. +Stop if the remote tag is missing or the commits differ. Inspect existing +GitHub release state, body, and assets before acting; do not create duplicates +or modify historical releases/assets. Stop on inconsistent state. + +Use the tagged changelog and upgrade notes. Ask which order to use if timing is +unspecified: GitHub notes may precede or follow npm, independently of registry +publication. An explicit developer request to publish notes is approval; do not +ask again for the same action. Tag authorization alone is not notes-publication +approval. Without publication approval, a safe draft may be prepared. + +Create notes with `gh release create "$TAG" --verify-tag --notes-file "$NOTES_FILE"`, +adding `--draft` for draft preparation, `--latest=false` for older/non-highest +stable versions, and `--prerelease` for prereleases. Check these flags when +publishing an existing draft too. Do not upload package assets. + +If notes are published before npm, include "npm publication pending" and update +the status when npm publication is confirmed. If publication is abandoned, +update those notes to say the version was not published; never move or delete +the tag. GitHub Releases do not publish npm packages. diff --git a/CHANGELOG.md b/CHANGELOG.md index 699adb6..e847586 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,14 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- The next minor release (0.4.0) requires Node.js 22 or newer for `duroxide` +- Starting with 0.4.0, Node.js 22 or newer is required for `duroxide` and its native platform packages. Upgrade from Node.js 18 or 20 before installing 0.4.0. The requirement for 0.3.0 is unchanged. ### Fixed - Explain possible runtime and install-time Node.js version causes when a - native platform package is missing, while preserving the original error. + published native platform package is missing, while preserving the original + error as the cause and retaining its `code` and `requireStack`. ## [0.3.0] - 2026-11-30 diff --git a/RELEASE_POLICY.md b/RELEASE_POLICY.md index 2ca7606..d511460 100644 --- a/RELEASE_POLICY.md +++ b/RELEASE_POLICY.md @@ -22,22 +22,36 @@ release pipeline to build and publish the packages to npm. A runtime-floor increase requires at least the next minor SDK version on 0.x. The Node.js 22 floor on `main` must first ship in 0.4.0, not a 0.3.x patch. -Prepare 0.3.x patches from a branch based on `v0.3.0`, keeping its Node.js 18 -floor. See the [user guide](docs/user-guide.md#installation) for installation -requirements. +No further 0.3.x releases are planned from the current release pipeline. +See the [user guide](docs/user-guide.md#installation) for installation requirements. ## Publishing Boundary - Do not run `npm publish` for the Microsoft release. -- Every release tag must have a notes-only GitHub Release, using the changelog - and upgrade notes from that tag. Create it on the existing immutable version - tag; creating a new tag requires explicit developer authorization. +- Going forward, every new SDK version tag (`vX.Y.Z`, including prereleases) + must have a notes-only GitHub Release using that tag's changelog and upgrade + notes. `npm-v*` tags are not SDK release tags. Existing historical releases + and assets stay unchanged; this rule does not require historical backfills. +- Creating a tag requires explicit developer authorization for the exact + approved release commit. The notes step never creates tags: verify the + existing immutable tag points to that commit and use `--verify-tag`. + Confirm `Build & Smoke` passed for the approved release commit; its packed + engines check covers GitHub-built tarballs, not internal-pipeline artifacts. - The developer's request controls timing: the GitHub Release may precede or follow npm publication and is independent of internal registry publication. - Do not move or recreate tags, upload package assets, or add publishing - workflows. GitHub Releases do not publish npm packages; npm publishing - remains exclusively in Microsoft's internal release pipeline. + Ask for timing if unspecified. An explicit request to publish notes approves + that action; tag authorization alone does not. A safe draft may be prepared. + If notes precede npm, mark npm publication pending; if publication is abandoned, + update those notes to say the version was not published. +- Check existing release state, notes, and assets before acting. Never create + duplicates; stop on inconsistencies rather than altering historical assets. + Use `--latest=false` for older/non-highest stable releases and `--prerelease` + for prereleases. Do not move, recreate, or delete tags, upload package assets, + or add publishing workflows. GitHub Releases do not publish npm packages; + npm publishing remains exclusively in Microsoft's internal release pipeline. - Do not request or store Microsoft publishing credentials in this repository. +GitHub package assets ended with 0.2.4; install packages from npm. + For release questions, open a GitHub issue without including credentials or internal pipeline configuration. diff --git a/__tests__/native_loader.test.js b/__tests__/native_loader.test.js index fdb3e16..2a6b0b2 100644 --- a/__tests__/native_loader.test.js +++ b/__tests__/native_loader.test.js @@ -11,6 +11,7 @@ const vm = require('node:vm'); const root = path.join(__dirname, '..'); const source = readFileSync(path.join(root, 'lib', 'duroxide.js'), 'utf8'); +const manifest = require('../package.json'); describe('native loader diagnostics', () => { it('still exports the SDK when native bindings load successfully', () => { @@ -32,6 +33,7 @@ describe('native loader diagnostics', () => { t.after(() => rmSync(directory, { recursive: true, force: true })); mkdirSync(path.join(directory, 'lib')); copyFileSync(path.join(root, 'index.js'), path.join(directory, 'index.js')); + copyFileSync(path.join(root, 'package.json'), path.join(directory, 'package.json')); copyFileSync(path.join(root, 'lib', 'duroxide.js'), path.join(directory, 'lib', 'duroxide.js')); const script = ` const assert = require('node:assert/strict'); @@ -43,6 +45,8 @@ describe('native loader diagnostics', () => { assert.match(error.message, /Other causes include omitted optional dependencies/); assert.match(error.message, /reinstall with optional dependencies enabled/); assert.equal(error.cause.code, 'MODULE_NOT_FOUND'); + assert.equal(error.code, 'MODULE_NOT_FOUND'); + assert.equal(error.requireStack, error.cause.requireStack); assert.ok(error.message.startsWith(error.cause.message)); assert.match(error.cause.stack, /index.js/); assert.ok(error.cause.requireStack.some((file) => file.endsWith('index.js'))); @@ -59,15 +63,60 @@ describe('native loader diagnostics', () => { const cause = new Error('underlying failure'); const original = new Error("Cannot find module 'duroxide-linux-x64-gnu'", { cause }); original.code = 'MODULE_NOT_FOUND'; + original.requireStack = ['index.js', 'lib/duroxide.js']; assert.throws(() => vm.runInNewContext(source, { - require() { throw original; }, + require(name) { + if (name === '../package.json') return manifest; + throw original; + }, }), (error) => { assert.equal(error.cause, original); assert.equal(error.cause.cause, cause); + assert.equal(error.code, original.code); + assert.equal(error.requireStack, original.requireStack); return true; }); }); + for (const packageName of ['duroxide-linux-x64-musl', 'duroxide-win32-arm64', 'duroxide-freebsd-x64']) { + it(`does not give reinstall or Node-version advice for unpublished ${packageName}`, () => { + const original = new Error(`Cannot find module '${packageName}'`); + original.code = 'MODULE_NOT_FOUND'; + assert.throws(() => vm.runInNewContext(source, { + require(name) { + if (name === '../package.json') return manifest; + throw original; + }, + }), (error) => { + assert.equal(error, original); + assert.doesNotMatch(error.message, /Node.js|reinstall/); + return true; + }); + }); + } + + it('preserves the native error when the package manifest cannot be read', () => { + const original = new Error("Cannot find module 'duroxide-linux-x64-gnu'"); + original.code = 'MODULE_NOT_FOUND'; + assert.throws(() => vm.runInNewContext(source, { + require(name) { + if (name === '../package.json') throw new SyntaxError('Invalid package manifest'); + throw original; + }, + }), (error) => error === original); + }); + + it('preserves the native error when the manifest has no optional dependencies', () => { + const original = new Error("Cannot find module 'duroxide-linux-x64-gnu'"); + original.code = 'MODULE_NOT_FOUND'; + assert.throws(() => vm.runInNewContext(source, { + require(name) { + if (name === '../package.json') return {}; + throw original; + }, + }), (error) => error === original); + }); + for (const [code, message] of [ ['MODULE_NOT_FOUND', "Cannot find module 'unrelated-dependency'"], ['MODULE_NOT_FOUND', "Cannot find module '../index.js'"], diff --git a/__tests__/package_engines.test.js b/__tests__/package_engines.test.js index 5353763..d516e1b 100644 --- a/__tests__/package_engines.test.js +++ b/__tests__/package_engines.test.js @@ -3,7 +3,7 @@ const { describe, it } = require('node:test'); const assert = require('node:assert/strict'); -const { execFileSync } = require('node:child_process'); +const { execFileSync, spawnSync } = require('node:child_process'); const { mkdtempSync, mkdirSync, writeFileSync, rmSync } = require('node:fs'); const os = require('node:os'); const path = require('node:path'); @@ -23,13 +23,33 @@ function packedManifests(t, change = () => {}) { for (const [index, manifest] of manifests.entries()) { writeFileSync(path.join(packageDirectory, 'package.json'), JSON.stringify(manifest)); execFileSync('tar', [ - '-czf', path.join(directory, `${index}.tgz`), '-C', root, 'package/package.json', - ]); + '-czf', path.join('tarballs', `${index}.tgz`), 'package/package.json', + ], { cwd: root }); } return directory; } describe('packed runtime requirements', () => { + it('the CLI succeeds on valid tarballs and fails when all six have the wrong floor', (t) => { + const checker = path.join(__dirname, '..', 'ci', 'smoke', 'check-engines.js'); + for (const floor of ['>=22', '>=18']) { + const directory = packedManifests(t, (manifests) => { + for (const manifest of manifests) manifest.engines.node = floor; + }); + const child = spawnSync(process.execPath, [checker, path.basename(directory)], { + cwd: path.dirname(directory), encoding: 'utf8', timeout: 10000, + }); + assert.ifError(child.error); + if (floor === '>=22') { + assert.equal(child.status, 0, child.stderr); + assert.match(child.stdout, /All six packed engines.node values match >=22/); + } else { + assert.notEqual(child.status, 0); + assert.match(child.stderr, /must declare engines.node >=22/); + } + } + }); + it('accepts all six tarballs with engines.node >=22', (t) => { checkPackedEngines(packedManifests(t)); }); diff --git a/ci/smoke/README.md b/ci/smoke/README.md index 0477587..69e1f1e 100644 --- a/ci/smoke/README.md +++ b/ci/smoke/README.md @@ -10,7 +10,8 @@ Floating smoke versions use `check-latest: true` to pick up current security patches rather than an older runner-cached version. Before uploading tarballs, `node ci/smoke/check-engines.js tarballs` checks the -packed `package.json` for the main package and all five platform packages. +packed `package.json` for the main package and all five platform packages built +by GitHub CI. It does not verify packages built by the internal release pipeline. All six `engines.node` values must match and must explicitly be `>=22`; agreement on a missing or outdated floor is rejected. Run the focused packaging and loader tests without a native build or database: diff --git a/ci/smoke/check-engines.js b/ci/smoke/check-engines.js index f4688af..d2cfd10 100644 --- a/ci/smoke/check-engines.js +++ b/ci/smoke/check-engines.js @@ -4,7 +4,6 @@ const assert = require('node:assert/strict'); const { execFileSync } = require('node:child_process'); const { readdirSync } = require('node:fs'); -const path = require('node:path'); const packageNames = [ 'duroxide', @@ -19,8 +18,8 @@ function checkPackedEngines(directory) { const manifests = readdirSync(directory) .filter((name) => name.endsWith('.tgz')) .map((name) => JSON.parse(execFileSync( - 'tar', ['-xOf', path.resolve(directory, name), 'package/package.json'], - { encoding: 'utf8' }, + 'tar', ['-xOf', name, 'package/package.json'], + { cwd: directory, encoding: 'utf8' }, ))); assert.deepEqual( diff --git a/docs/user-guide.md b/docs/user-guide.md index 677587e..1e2b350 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -6,6 +6,8 @@ This guide covers how to build workflows with duroxide-node. For architecture de SDK 0.4.0 and later require Node.js 22 or newer. SDK 0.3.0 requires Node.js 18 or newer. +GitHub package assets ended with 0.2.4; new GitHub Releases are notes-only. +Install packages from npm. ```bash npm install duroxide diff --git a/lib/duroxide.js b/lib/duroxide.js index 38aaab6..1c04835 100644 --- a/lib/duroxide.js +++ b/lib/duroxide.js @@ -13,8 +13,20 @@ let nativeBinding; try { nativeBinding = require('../index.js'); } catch (error) { - if (error?.code === 'MODULE_NOT_FOUND' && /^Cannot find module ['"]duroxide-[^'"]+['"]/.test(error.message)) { - throw new Error( + const missingPackage = error?.code === 'MODULE_NOT_FOUND' && + /^Cannot find module ['"](duroxide-[^'"]+)['"]/.exec(error.message); + if (missingPackage) { + let manifest; + try { + manifest = require('../package.json'); + } catch { + throw error; + } + if (!manifest?.optionalDependencies || + !Object.hasOwn(manifest.optionalDependencies, missingPackage[1])) { + throw error; + } + const wrapped = new Error( `${error.message}\nThe native platform package is missing. Possible causes include ` + 'running on Node.js older than 22 or installing with Node.js older than 22: npm may skip ' + 'optional packages based on the install-time Node.js version. Other causes include omitted ' + @@ -22,6 +34,9 @@ try { 'execution, then reinstall with optional dependencies enabled.', { cause: error }, ); + wrapped.code = error.code; + wrapped.requireStack = error.requireStack; + throw wrapped; } throw error; } From e7b7cb3dc39a3c357397dddefe56f86fffd8c6fd Mon Sep 17 00:00:00 2001 From: Alperen Cetin <22790042+hacetin@users.noreply.github.com> Date: Wed, 2 Dec 2026 12:23:01 +0300 Subject: [PATCH 7/7] docs: keep release policy generic and durable Remove version-specific exceptions and historical details from shared release guidance; retain generic runtime guardrails and concise verified-tag publication steps. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: cae1c384-1978-45b6-b0a5-593e18503225 --- .agents/skills/release-preparation/SKILL.md | 57 +++++++++------------ RELEASE_POLICY.md | 48 ++++++++--------- 2 files changed, 47 insertions(+), 58 deletions(-) diff --git a/.agents/skills/release-preparation/SKILL.md b/.agents/skills/release-preparation/SKILL.md index bd8946a..9c0977a 100644 --- a/.agents/skills/release-preparation/SKILL.md +++ b/.agents/skills/release-preparation/SKILL.md @@ -19,10 +19,9 @@ Before editing, identify: Follow Semantic Versioning and the policy in [RELEASE_POLICY.md](../../../RELEASE_POLICY.md). -A runtime-floor increase is a breaking change and requires at least the next -minor version while the SDK is on 0.x. The Node.js 22 floor on `main` must first -ship in **0.4.0**, not 0.3.1 or any other 0.3.x release. -No further 0.3.x releases are planned from the current release pipeline. +A runtime-floor increase is a breaking change requiring at least the next minor +version on 0.x. Maintenance releases are outside the current release flow and +require a separate approved plan. ## 2. Synchronize npm Versions @@ -36,7 +35,8 @@ All six package versions and all five optional dependency versions must match. Do not change the `Cargo.toml` package version as part of an npm-only release. Also synchronize `engines.node` in the root and all five platform manifests, -including the root entry in `package-lock.json`. The 0.4.0 floor is `>=22`. +including the root entry in `package-lock.json`; the manifests define the +supported floor. After packing, run `node ci/smoke/check-engines.js ` to check all six distributable manifests, not just the source files. A future intentional floor increase must update this check, the loader hint in `lib/duroxide.js`, @@ -64,16 +64,13 @@ Create a pull request targeting `main`. GitHub Actions validates the full SDK test suite, cross-platform builds, and local-package smoke tests on the pull request. -Confirm the `Build & Smoke` workflow succeeds before merging and for the exact -approved release commit before tagging or publishing GitHub notes. +Confirm the `Build & Smoke` workflow succeeds before merging. ## 5. Maintainer Handoff After the pull request is merged, the release-preparation PR work is complete. -Going forward, the release process requires a notes-only GitHub Release for each -new SDK version tag (`vX.Y.Z`, including prereleases), not `npm-v*` tags. -Existing historical releases and assets remain unchanged; do not backfill them -as part of this procedure. GitHub package assets ended with 0.2.4; install from npm. +Every new SDK version tag requires notes-only GitHub release notes. +Adopting this policy does not change existing tags or releases. Do not run `npm publish` or add publishing credentials, publishing workflows, or internal pipeline configuration. A Microsoft maintainer runs the internal @@ -91,24 +88,20 @@ only that tag with `git push origin "refs/tags/$TAG"`. Never move or delete tags ### GitHub Notes -The notes step never creates a tag. Fetch the existing remote tag without force -and compare `git rev-parse "$TAG^{commit}"` with the exact approved release SHA. -Stop if the remote tag is missing or the commits differ. Inspect existing -GitHub release state, body, and assets before acting; do not create duplicates -or modify historical releases/assets. Stop on inconsistent state. - -Use the tagged changelog and upgrade notes. Ask which order to use if timing is -unspecified: GitHub notes may precede or follow npm, independently of registry -publication. An explicit developer request to publish notes is approval; do not -ask again for the same action. Tag authorization alone is not notes-publication -approval. Without publication approval, a safe draft may be prepared. - -Create notes with `gh release create "$TAG" --verify-tag --notes-file "$NOTES_FILE"`, -adding `--draft` for draft preparation, `--latest=false` for older/non-highest -stable versions, and `--prerelease` for prereleases. Check these flags when -publishing an existing draft too. Do not upload package assets. - -If notes are published before npm, include "npm publication pending" and update -the status when npm publication is confirmed. If publication is abandoned, -update those notes to say the version was not published; never move or delete -the tag. GitHub Releases do not publish npm packages. +1. The notes step never creates a tag. Fetch the existing remote tag without + force; compare `git rev-parse "$TAG^{commit}"` with the approved release SHA + and confirm `Build & Smoke` passed for that commit. Stop on a missing tag or + mismatched SHA. Inspect existing release state, body, and assets; stop on + inconsistencies; reuse a matching approved draft instead of creating a + duplicate, and do not alter unrelated existing releases. +2. Use the tagged changelog and upgrade notes. Ask for timing if unspecified: + notes may precede or follow npm. An explicit request to publish notes is + approval; tag authorization alone is not. Without publication approval, + prepare only a safe draft. +3. Use `gh release create "$TAG" --verify-tag --notes-file "$NOTES_FILE"`, + adding `--draft` for preparation, `--latest=false` for older/non-highest + stable versions, and `--prerelease` for prereleases. Check these flags when + publishing an approved draft too. Do not upload package assets. +4. If notes precede npm, include "npm publication pending". Update those notes + when publication is confirmed, or state that the version was not published + if abandoned. Never move or delete the tag. diff --git a/RELEASE_POLICY.md b/RELEASE_POLICY.md index d511460..268b290 100644 --- a/RELEASE_POLICY.md +++ b/RELEASE_POLICY.md @@ -20,38 +20,34 @@ release pipeline to build and publish the packages to npm. ## Supported Runtimes -A runtime-floor increase requires at least the next minor SDK version on 0.x. -The Node.js 22 floor on `main` must first ship in 0.4.0, not a 0.3.x patch. -No further 0.3.x releases are planned from the current release pipeline. -See the [user guide](docs/user-guide.md#installation) for installation requirements. +The supported Node.js floor is defined by the package manifests' `engines.node`. +Increasing it is a breaking change requiring at least the next minor SDK +version on 0.x. Maintenance releases are not supported by the current release +flow and require a separate approved plan. ## Publishing Boundary - Do not run `npm publish` for the Microsoft release. -- Going forward, every new SDK version tag (`vX.Y.Z`, including prereleases) - must have a notes-only GitHub Release using that tag's changelog and upgrade - notes. `npm-v*` tags are not SDK release tags. Existing historical releases - and assets stay unchanged; this rule does not require historical backfills. -- Creating a tag requires explicit developer authorization for the exact - approved release commit. The notes step never creates tags: verify the - existing immutable tag points to that commit and use `--verify-tag`. - Confirm `Build & Smoke` passed for the approved release commit; its packed - engines check covers GitHub-built tarballs, not internal-pipeline artifacts. -- The developer's request controls timing: the GitHub Release may precede or - follow npm publication and is independent of internal registry publication. - Ask for timing if unspecified. An explicit request to publish notes approves - that action; tag authorization alone does not. A safe draft may be prepared. - If notes precede npm, mark npm publication pending; if publication is abandoned, - update those notes to say the version was not published. -- Check existing release state, notes, and assets before acting. Never create - duplicates; stop on inconsistencies rather than altering historical assets. - Use `--latest=false` for older/non-highest stable releases and `--prerelease` - for prereleases. Do not move, recreate, or delete tags, upload package assets, - or add publishing workflows. GitHub Releases do not publish npm packages; - npm publishing remains exclusively in Microsoft's internal release pipeline. +- Do not upload package assets or add publishing workflows. - Do not request or store Microsoft publishing credentials in this repository. -GitHub package assets ended with 0.2.4; install packages from npm. +## GitHub Releases + +Every new SDK version tag must have a notes-only GitHub Release using that tag's +changelog and upgrade notes. Verify the immutable tag matches the approved +release commit; creating tags requires separate explicit authorization. +The notes step never creates tags or duplicates releases. Adopting this policy +does not change existing tags or releases; never move, recreate, or delete tags. + +The developer's request controls whether notes precede or follow npm publication. +Ask if timing is unspecified. An explicit request to publish notes is approval; +tag authorization alone is not. A safe draft may be prepared without publication +approval. If notes precede npm, mark publication pending and update the status +when confirmed or abandoned. Stop on inconsistent release state. + +GitHub Releases are independent of npm publication and do not publish packages. +See the [release-preparation skill](.agents/skills/release-preparation/SKILL.md) +for verification and publication steps. For release questions, open a GitHub issue without including credentials or internal pipeline configuration.