Skip to content

Commit 817c40b

Browse files
authored
fix: publish alpha.3 through npm OIDC (#23)
1 parent 8f7dce2 commit 817c40b

9 files changed

Lines changed: 64 additions & 23 deletions

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.2"
2+
".": "0.1.0-alpha.3"
33
}

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ follows Keep a Changelog, and versions follow Semantic Versioning.
55

66
## [Unreleased]
77

8+
## [0.1.0-alpha.3] - 2026-07-27
9+
10+
### Fixed
11+
12+
- Accepted the fixed authentication sentinel value injected by
13+
`actions/setup-node` for npm Trusted Publishing while continuing to reject
14+
real registry token credentials.
15+
- Replaced the unpublished immutable alpha.2 release after its publication
16+
guard failed before invoking npm.
17+
818
## [0.1.0-alpha.2] - 2026-07-27
919

1020
### Changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ the official OpenAI JavaScript request, response, stream, and error types while
55
defaulting the client to CometAPI.
66

77
> **Registry Alpha pre-release:** the SDK is under active 0.1 development.
8-
> `0.1.0-alpha.2` is approved for npm publication under the `next` dist-tag,
8+
> `0.1.0-alpha.3` is approved for npm publication under the `next` dist-tag,
99
> and its API may change before `0.1.0`.
1010
1111
## Supported 0.1 surface
@@ -52,8 +52,8 @@ For source-checkout testing, retain and verify one exact tarball:
5252
```bash
5353
mkdir -p .artifacts
5454
npm pack --pack-destination .artifacts
55-
npm run test:package -- --tarball .artifacts/cometapi-0.1.0-alpha.2.tgz
56-
npm run test:fixtures -- --tarball .artifacts/cometapi-0.1.0-alpha.2.tgz
55+
npm run test:package -- --tarball .artifacts/cometapi-0.1.0-alpha.3.tgz
56+
npm run test:fixtures -- --tarball .artifacts/cometapi-0.1.0-alpha.3.tgz
5757
```
5858

5959
Install that path in a separate consumer when needed. Do not treat a locally
@@ -210,8 +210,9 @@ parent.
210210
211211
The repository has completed Public Preview. Blocking CI, protected repository
212212
rules, security reporting, protected environments, and the authorized live
213-
smoke have passed. Registry Alpha `0.1.0-alpha.1` is available from npm, and
214-
`0.1.0-alpha.2` is approved for OIDC publication. Mocked responses, packed
213+
smoke have passed. Registry Alpha `0.1.0-alpha.1` is available from npm. The
214+
immutable `0.1.0-alpha.2` GitHub release failed before invoking npm, and
215+
`0.1.0-alpha.3` is approved for OIDC publication. Mocked responses, packed
215216
artifacts, GitHub Actions, trusted live tests, and npm publication remain
216217
separate evidence layers and must not be represented as another.
217218

RELEASING.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Release status is evidence-based:
99
| Local code-complete | Required source, tests, documentation, metadata, fixtures, and workflows exist, and every applicable offline check passes. |
1010
| Private Remote Validation ready | Local gates pass, the sanitized history and maintainer-confirmed identity are complete, and real credential-free private default-branch CI passes. |
1111
| Public Preview ready | After visibility changes, public-only repository rules, security reporting, environments, default-branch CI, the content gate, and authorized protected live smoke all pass. |
12-
| Registry Alpha candidate | The exact `0.1.0-alpha.2` artifact passes package and clean-install gates. |
12+
| Registry Alpha candidate | The exact `0.1.0-alpha.3` artifact passes package and clean-install gates after preserving the unpublished immutable alpha.2 failure record. |
1313
| Registry Alpha released | The public npm artifact installs from the `next` channel, passes post-publication verification, and has verified provenance plus any documented one-time bootstrap evidence. |
1414
| Stable released | Every stable 0.1.0 local, remote, live, review, provenance, and registry gate has recorded evidence. |
1515

@@ -337,11 +337,17 @@ one-time exception:
337337
publication; the bootstrap does not change or defer that requirement.
338338
5. A maintainer immediately configures OIDC, removes the environment variable
339339
and secret, revokes the token, and restricts token-based publishing.
340-
6. The project immediately prepares and publishes `0.1.0-alpha.2` through
341-
OIDC, verifies its provenance and public installation, and confirms that
342-
`next` resolves to `0.1.0-alpha.2`.
343-
7. The release record documents the exception and both public-install evidence
344-
layers.
340+
6. The project prepared the immutable `0.1.0-alpha.2` GitHub release through
341+
OIDC. Exact-artifact verification and the protected live smoke passed, but
342+
the local publication guard rejected the fixed `actions/setup-node`
343+
authentication placeholder before npm was invoked. No alpha.2 registry
344+
artifact was published.
345+
7. Preserve that immutable failure record, prepare and publish
346+
`0.1.0-alpha.3` through OIDC with regression coverage for the placeholder,
347+
verify its provenance and public installation, and confirm that `next`
348+
resolves to `0.1.0-alpha.3`.
349+
8. The release record documents the exception, the unpublished alpha.2
350+
attempt, and both public-install evidence layers.
345351

346352
This exception must never become a reusable source-controlled publishing path.
347353

ROADMAP.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ Private Remote Validation and Public Preview are complete for the sanitized
1515
repository. The repository is public with blocking CI, protected repository and
1616
tag rules, Private Vulnerability Reporting, protected environments, and
1717
authorized live-smoke evidence. The functional `0.1.0-alpha.1` prerelease is
18-
available from npm; Registry Alpha remains open until `0.1.0-alpha.2` completes
19-
the OIDC, provenance, ownership, and public-install verification sequence.
18+
available from npm. The immutable `0.1.0-alpha.2` GitHub release failed locally
19+
before invoking npm because its publication guard rejected the fixed
20+
`actions/setup-node` authentication placeholder. Registry Alpha remains open
21+
until `0.1.0-alpha.3` completes the OIDC, provenance, ownership, and
22+
public-install verification sequence.
2023

2124
## Milestones
2225

@@ -25,7 +28,7 @@ the OIDC, provenance, ownership, and public-install verification sequence.
2528
| Repository foundation | In progress | The repository has reproducible development, contribution, security, and release processes. |
2629
| Private Remote Validation | Complete | The sanitized private repository passes real credential-free default-branch CI; public-only controls and live tests remain disabled. |
2730
| Public Preview | Complete | The public repository has blocking CI, repository rules, security reporting, protected environments, and authorized live-smoke evidence. |
28-
| 0.1.x Registry Alpha | In progress | Early adopters can install a functional prerelease from npm's `next` channel; alpha.2 must prove the OIDC-only publication path. |
31+
| 0.1.x Registry Alpha | In progress | Early adopters can install a functional prerelease from npm's `next` channel; alpha.3 must prove the OIDC-only publication path. |
2932
| 0.1.0 Stable | Planned | Users can install a fully verified package from npm's default channel. |
3033
| 0.2.0 provider-native text | Planned | Users can opt into Anthropic Messages and Gemini text adapters through isolated subpath exports. |
3134
| 0.3.0 CometAPI resources | Planned | Users receive typed access to the first stable CometAPI-specific account or platform resources. |
@@ -339,9 +342,15 @@ npm does not allow configuration before the first package publication, only
339342
access and provenance, and verifies registry installation.
340343
4. A maintainer immediately configures Trusted Publishing, removes the variable
341344
and secret, revokes the token, and restricts token-based publishing.
342-
5. The project immediately publishes `0.1.0-alpha.2` through OIDC, verifies its
343-
provenance and installation, and confirms that `next` resolves to
344-
`0.1.0-alpha.2`.
345+
5. The project attempted to publish `0.1.0-alpha.2` through OIDC. Its immutable
346+
GitHub release passed exact-artifact and live-smoke verification, but the
347+
local publication guard rejected the fixed `actions/setup-node`
348+
authentication placeholder before npm was invoked; no alpha.2 registry
349+
artifact exists.
350+
6. The project preserves that immutable failure record, publishes
351+
`0.1.0-alpha.3` through OIDC with regression coverage for the placeholder,
352+
verifies provenance and installation, and confirms that `next` resolves to
353+
`0.1.0-alpha.3`.
345354

346355
This exception must be recorded in the release evidence and must never become
347356
a reusable publication path.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cometapi",
3-
"version": "0.1.0-alpha.2",
3+
"version": "0.1.0-alpha.3",
44
"description": "Official TypeScript and Node.js client for the CometAPI OpenAI-compatible API",
55
"author": "CometAPI",
66
"license": "MIT",

scripts/publish-artifact.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ set -euo pipefail
77

88
artifact_directory="${ARTIFACT_DIRECTORY:-release-artifacts}"
99

10-
if [[ -n "${NODE_AUTH_TOKEN:-}" || -n "${NPM_TOKEN:-}" ]]; then
10+
# actions/setup-node exports this fixed sentinel when registry-url is configured,
11+
# including the npm-documented Trusted Publishing workflow.
12+
setup_node_auth_placeholder="XXXXX-XXXXX-XXXXX-XXXXX"
13+
if [[ -n "${NPM_TOKEN:-}" ]] || \
14+
[[ -n "${NODE_AUTH_TOKEN:-}" && "${NODE_AUTH_TOKEN}" != "$setup_node_auth_placeholder" ]]; then
1115
echo "Registry tokens are forbidden; publication must use npm Trusted Publishing." >&2
1216
exit 1
1317
fi

tests/publish-artifact.test.mjs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { afterEach, describe, expect, it } from "vitest";
1818
const script = fileURLToPath(
1919
new URL("../scripts/publish-artifact.sh", import.meta.url),
2020
);
21+
const setupNodeAuthPlaceholder = "XXXXX-XXXXX-XXXXX-XXXXX";
2122
const temporaryDirectories = [];
2223

2324
afterEach(() => {
@@ -62,7 +63,7 @@ function runPublish({
6263
distTag = "next",
6364
nodeAuthToken = "",
6465
npmToken = "",
65-
version = "0.1.0-alpha.2",
66+
version = "0.1.0-alpha.3",
6667
} = {}) {
6768
const { bin, log, root } = fixture();
6869
const result = spawnSync("bash", [script], {
@@ -96,6 +97,16 @@ describe("publish artifact authentication", () => {
9697
);
9798
});
9899

100+
it("allows the actions/setup-node authentication placeholder", () => {
101+
const { log, result } = runPublish({
102+
nodeAuthToken: setupNodeAuthPlaceholder,
103+
});
104+
expect(result.status, result.stderr).toBe(0);
105+
expect(log).toMatch(
106+
/^token-present\npublish .* --provenance --tag next\n$/,
107+
);
108+
});
109+
99110
it.each([
100111
["NODE_AUTH_TOKEN", { nodeAuthToken: "opaque" }],
101112
["NPM_TOKEN", { npmToken: "opaque" }],

0 commit comments

Comments
 (0)