Skip to content

Commit 8417d73

Browse files
committed
fix: prepare 0.1.0 stable release
1 parent 07fc263 commit 8417d73

20 files changed

Lines changed: 979 additions & 109 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ jobs:
9797
run: npm run build
9898
- name: Validate the package shape
9999
run: npm run test:package
100+
- name: Execute the documented examples against a packed artifact
101+
run: npm run test:examples
100102
- name: Verify live-smoke semantic checks with mocked transport
101103
run: npm run test:live-contract
102104
- name: Test packed-package fixtures
@@ -188,6 +190,7 @@ jobs:
188190
name: Latest OpenAI 6.x canary / Node.js 24
189191
if: >-
190192
github.event_name == 'schedule' ||
193+
github.event_name == 'workflow_dispatch' ||
191194
(github.event_name == 'pull_request' && github.actor == 'dependabot[bot]')
192195
runs-on: ubuntu-latest
193196
timeout-minutes: 20

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ jobs:
135135
npm run test:package -- \
136136
--tarball "${{ steps.pack.outputs.tarball }}" \
137137
--tag "${{ github.event.release.tag_name }}"
138+
npm run test:examples -- --tarball "${{ steps.pack.outputs.tarball }}"
138139
npm run test:fixtures -- --tarball "${{ steps.pack.outputs.tarball }}"
139140
- name: Upload the verified release artifact
140141
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

.github/workflows/release-please.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414

1515
jobs:
1616
release-please:
17-
name: Prepare or publish a reviewed release
17+
name: Prepare a reviewed release pull request
1818
if: vars.RELEASE_PLEASE_ENABLED == 'true'
1919
runs-on: ubuntu-latest
2020
timeout-minutes: 10
@@ -27,3 +27,4 @@ jobs:
2727
with:
2828
config-file: release-please-config.json
2929
manifest-file: .release-please-manifest.json
30+
skip-github-release: true

AGENTS.md

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,13 @@ repository.
5151
merely to complete lifecycle cleanup. Fail closed and report the exact state
5252
whenever a required cleanliness, fetch, or fast-forward condition is not met.
5353

54-
## Current Milestone: Public Preview
55-
56-
Private Remote Validation and Public Preview pre-visibility preparation are
57-
complete. The repository remains private at the visibility authorization gate.
58-
Repository-local source, tests, documentation, metadata, fixtures, and
59-
workflows may be changed and verified locally. Private topic pushes, pull
60-
requests, merges, and credential-free CI are permitted only when the current
61-
maintainer request explicitly authorizes them; this file records scope and does
62-
not grant that authorization. Stop before changing repository visibility:
63-
making the canonical repository public and configuring or exercising
64-
public-only settings, protected environments, secrets, or live smoke require
65-
separate explicit maintainer authorization.
54+
## Current Milestone: Stable 0.1.0
55+
56+
Private Remote Validation, Public Preview, and Registry Alpha are complete.
57+
The canonical repository is public, and `0.1.0-alpha.3` is available from npm's
58+
`next` channel with OIDC provenance and verified public-install evidence. The
59+
current work promotes the existing 0.1 protocol surface to `0.1.0` on npm's
60+
`latest` channel. Do not begin the 0.2 provider adapters during this milestone.
6661

6762
The accepted identity is:
6863

@@ -82,28 +77,13 @@ The unscoped `cometapi` package is the primary Node SDK. `@cometapi` is the
8277
standard scope for future official scoped packages; do not introduce new
8378
official packages under `@cometapi-dev`.
8479

85-
Before requesting visibility-change authorization:
86-
87-
1. Confirm the current `main` includes every approved private closeout and that
88-
its blocking Node.js 22 and 24 CI checks pass.
89-
2. Run the complete local offline, package, fixture, compatibility,
90-
self-containment, public-content, secret, workflow-static-validation, and
91-
Public Preview gates from the final private `main`.
92-
3. Review open failing dependency-update pull requests before visibility
93-
changes and repair, close, or explicitly defer them with a recorded reason;
94-
do not treat their branch failures as evidence that the current `main`
95-
failed validation.
96-
4. Confirm the repository remains private and that public-only repository or
97-
tag rules, Private Vulnerability Reporting, secrets, protected environments,
98-
Trusted Publishing, live smoke, tags, releases, and registry publication
99-
have not been configured or exercised.
100-
5. Record the final private evidence and stop for explicit maintainer
101-
authorization before changing repository visibility.
102-
103-
Private repository creation, the sanitized first history, and the initial push
104-
are complete historical steps and must not be repeated. Their procedure and
105-
evidence belong in `RELEASING.md`. Keep Release Please disabled through the
106-
initial manual alpha.
80+
Stable promotion uses Release Please only for its reviewed version and
81+
changelog pull request. Because the pinned Release Please v5 path is vulnerable
82+
to an upstream single-package tagging defect, it must skip GitHub release
83+
creation. A maintainer creates and reviews the immutable `v0.1.0` release
84+
manually against the exact merged release commit. The publish workflow then
85+
performs exact-artifact verification, the bounded live smoke, npm OIDC
86+
publication, and registry verification.
10787

10888
## Product Contract
10989

@@ -211,6 +191,7 @@ npm run lint
211191
npm run format:check
212192
npm run test:secrets
213193
npm run test:package
194+
npm run test:examples
214195
npm run test:live-contract
215196
npm run test:fixtures
216197
npm run test:compat
@@ -266,7 +247,7 @@ Before Public Preview, run `npm run check:public-preview`. The gate must fail
266247
after reporting all violations until canonical identity, contacts, repository
267248
metadata, and durable public-facing content are complete.
268249

269-
### First-publication bootstrap
250+
### First-publication bootstrap history
270251

271252
The normal npm release path uses Trusted Publishing on a GitHub-hosted runner
272253
with Node.js 22.14.0 or later, npm CLI 11.5.1 or later, and an exact
@@ -278,10 +259,9 @@ short-lived granular read/write token with the minimum available scope and
278259
non-interactive 2FA bypass from an owner account protected by 2FA. Expose it
279260
only through a protected GitHub Environment for one reviewed immutable-tag run,
280261
publish with public access and provenance, then immediately configure OIDC,
281-
remove the secret, revoke the token, restrict token-based publishing, and
282-
publish `0.1.0-alpha.2` through OIDC. Verify its provenance and confirm the
283-
`next` dist-tag resolves to `0.1.0-alpha.2`. Never make this exception a
284-
reusable workflow path.
262+
remove the secret, revoke the token, and restrict token-based publishing. This
263+
historical bootstrap ended with `0.1.0-alpha.1`; `0.1.0-alpha.3` subsequently
264+
verified the OIDC-only path. Never make the exception a reusable workflow path.
285265

286266
## Authorization and evidence
287267

COMPATIBILITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ streaming, and model-list return types.
8484
```bash
8585
npm run test
8686
npm run test:package
87+
npm run test:examples
8788
npm run test:live-contract
8889
npm run test:fixtures
8990
npm run test:compat

README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ For source-checkout testing, retain and verify one exact tarball:
5353
mkdir -p .artifacts
5454
npm pack --pack-destination .artifacts
5555
npm run test:package -- --tarball .artifacts/cometapi-0.1.0-alpha.3.tgz
56+
npm run test:examples -- --tarball .artifacts/cometapi-0.1.0-alpha.3.tgz
5657
npm run test:fixtures -- --tarball .artifacts/cometapi-0.1.0-alpha.3.tgz
5758
```
5859

@@ -93,6 +94,17 @@ const response = await client.responses.create({
9394
});
9495

9596
console.log(response.output_text);
97+
98+
const stream = await client.chat.completions.create({
99+
model: "gpt-5.4",
100+
messages: [{ role: "user", content: "Write one sentence about comets." }],
101+
stream: true,
102+
});
103+
104+
for await (const chunk of stream) {
105+
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
106+
}
107+
process.stdout.write("\n");
96108
```
97109
98110
## CommonJS quick start
@@ -103,6 +115,12 @@ const { CometAPI } = require("cometapi");
103115
const client = new CometAPI();
104116

105117
async function main() {
118+
const completion = await client.chat.completions.create({
119+
model: "gpt-5.4",
120+
messages: [{ role: "user", content: "Reply with one short greeting." }],
121+
});
122+
console.log(completion.choices[0]?.message?.content ?? "");
123+
106124
const models = await client.models.list();
107125
for (const model of models.data) {
108126
console.log(model.id);
@@ -115,26 +133,10 @@ main().catch((error) => {
115133
});
116134
```
117135
118-
## Streaming Chat Completions
119-
120-
```js
121-
import { CometAPI } from "cometapi";
122-
123-
const client = new CometAPI();
124-
const stream = await client.chat.completions.create({
125-
model: "gpt-5.4",
126-
messages: [{ role: "user", content: "Write one sentence about comets." }],
127-
stream: true,
128-
});
129-
130-
for await (const chunk of stream) {
131-
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
132-
}
133-
```
134-
135136
Runnable ESM and CommonJS examples are in [`examples/`](./examples/). The
136-
packed fixtures execute equivalent mocked public calls; executing live examples
137-
against a packed artifact remains a separately authorized release gate.
137+
offline example gate executes these exact files against the packed artifact with
138+
a fail-closed mocked transport. Executing them against the live API remains a
139+
separately authorized operation.
138140
139141
## Custom options
140142
@@ -186,6 +188,7 @@ npm run lint
186188
npm run format:check
187189
npm run test:secrets
188190
npm run test:package
191+
npm run test:examples
189192
npm run test:live-contract
190193
npm run test:fixtures
191194
npm run test:compat

RELEASING.md

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,11 @@ evidence is complete only when `npm owner ls cometapi` lists the
8282
maintainer-confirmed `cometapi_dev` account; until then this remains a Registry
8383
Alpha prerequisite.
8484

85-
For the current Public Preview milestone, private topic pushes, pull requests,
86-
merges, and credential-free CI are the only remote actions that may be
87-
authorized before the visibility transition. This document defines allowable
88-
release mechanics but grants no standing remote-write permission; the current
89-
maintainer request must explicitly authorize each task's remote actions.
90-
Changing repository visibility and every subsequent public-only configuration
91-
or live action require separate authorization.
85+
Public Preview and Registry Alpha are complete. For the current stable
86+
milestone, topic pushes, pull requests, merges, the immutable GitHub Release,
87+
the bounded live smoke, npm publication, and environment approvals still
88+
require authorization from the current maintainer request. This document
89+
defines allowable mechanics but grants no standing remote-write permission.
9290

9391
## Candidate verification gate
9492

@@ -103,6 +101,7 @@ npm run lint
103101
npm run format:check
104102
npm run test:secrets
105103
npm run test:package
104+
npm run test:examples
106105
npm run test:live-contract
107106
npm run test:fixtures
108107
npm run test:compat
@@ -119,7 +118,10 @@ failures, skipped checks, and unavailable runtime/tool checks.
119118

120119
`npm run test:package` builds and inspects a candidate tarball and runs package
121120
metadata, export, declaration, `publint`, Are the Types Wrong, and dry-run pack
122-
checks. `npm run test:fixtures` installs a candidate tarball into clean ESM,
121+
checks. `npm run test:examples` installs one exact tarball with the locked OpenAI
122+
version, checks dependency deduplication, and executes the canonical README ESM
123+
and CommonJS examples with fail-closed mocked transport.
124+
`npm run test:fixtures` installs a candidate tarball into clean ESM,
123125
CommonJS, and compatible-OpenAI host applications. Both commands accept
124126
`--tarball <path>` so the publication workflow can pack once, inspect and
125127
install the exact artifact, then upload that same file. `npm run test:compat`
@@ -206,8 +208,8 @@ or publishing the immutable release. Validate the exact committed state with:
206208

207209
```bash
208210
node scripts/validate-release.mjs \
209-
--tag v0.1.0-alpha.1 \
210-
--release-prerelease true \
211+
--tag v0.1.0 \
212+
--release-prerelease false \
211213
--require-final \
212214
--require-releasable-docs
213215
```
@@ -229,10 +231,16 @@ The repository maintains four independently auditable workflows:
229231
concurrency group. Scheduled and manual live execution requires
230232
`LIVE_SMOKE_ENABLED=true`.
231233
- `release-please.yml`: a human-reviewed version and changelog PR from
232-
Conventional Commits and requires `RELEASE_PLEASE_ENABLED=true`. It remains
233-
disabled through the initial manual alpha. Merging a later release PR prepares
234-
a draft GitHub release; a maintainer must review and publish the draft so its
235-
`release.published` event can trigger publication.
234+
Conventional Commits and requires `RELEASE_PLEASE_ENABLED=true`. It uses the
235+
default `GITHUB_TOKEN` and deliberately skips tag and GitHub Release creation.
236+
Because that token does not trigger CI for its generated PR, a maintainer
237+
commits the stable README, security, support, compatibility, and roadmap
238+
state to the generated branch, then manually dispatches `ci.yml` with that
239+
branch as `ref`. Merge is forbidden unless `gh pr checks` reports every
240+
required context on the exact final PR head; if GitHub does not associate the
241+
dispatched checks with that commit, stop rather than bypass protection.
242+
The manual dispatch also runs the latest-compatible OpenAI 6.x lane so the
243+
candidate head has minimum, locked, and latest-within-major evidence.
236244
- `publish.yml`: rejects mutable releases and tag commits outside `main`, packs
237245
and tests one exact artifact, requires a protected live smoke for that release
238246
tag, and publishes the same file through npm OIDC. Registry token credentials
@@ -410,6 +418,22 @@ executed README examples against the packed artifact, release-PR/tag/changelog/
410418
manifest version agreement, reviewed security and compatibility status, and
411419
post-publication registry evidence.
412420

421+
Release Please is limited to the stable PR because its v5 single-package path
422+
has an open upstream tagging defect when component names are omitted from tags.
423+
After the reviewed release PR merges, create a draft `v0.1.0` GitHub Release
424+
manually against the exact merge commit, review it with `prerelease=false`, and
425+
publish it only once immutable releases are enabled. After successful manual
426+
tagging, change the merged Release Please PR label from `autorelease: pending`
427+
to `autorelease: tagged` so future release PRs are not blocked.
428+
429+
Release Please does not author the final public status text. After it opens the
430+
`0.1.0` PR, a maintainer pushes a focused documentation commit to that same
431+
branch: README switches from `next`/prerelease to `latest`/stable and records
432+
the exact publication approval; SECURITY and SUPPORT remove prerelease-only
433+
policy; COMPATIBILITY and ROADMAP identify the stable candidate without
434+
claiming it is already released. If Release Please updates the branch again,
435+
repeat the review and CI dispatch against the new final head.
436+
413437
## Verification record
414438

415439
Every release candidate records these evidence layers separately:

ROADMAP.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# CometAPI TypeScript and Node.js SDK Roadmap
22

3-
Status: Public Preview and Registry Alpha complete; 0.1.0 stable planned
4-
Last updated: 2026-07-27
3+
Status: Public Preview and Registry Alpha complete; 0.1.0 stable in progress
4+
Last updated: 2026-07-28
55
Repository contract: This roadmap is self-contained and is the public source
66
of truth for this repository's release sequence.
77

@@ -29,7 +29,7 @@ available from npm's `next` channel.
2929
| Private Remote Validation | Complete | The sanitized private repository passes real credential-free default-branch CI; public-only controls and live tests remain disabled. |
3030
| Public Preview | Complete | The public repository has blocking CI, repository rules, security reporting, protected environments, and authorized live-smoke evidence. |
3131
| 0.1.x Registry Alpha | Complete | Early adopters can install a functional, provenance-verified prerelease from npm's `next` channel through the OIDC-only publication path. |
32-
| 0.1.0 Stable | Planned | Users can install a fully verified package from npm's default channel. |
32+
| 0.1.0 Stable | In progress | Users can install a fully verified package from npm's default channel. |
3333
| 0.2.0 provider-native text | Planned | Users can opt into Anthropic Messages and Gemini text adapters through isolated subpath exports. |
3434
| 0.3.0 CometAPI resources | Planned | Users receive typed access to the first stable CometAPI-specific account or platform resources. |
3535
| Media and task APIs | Later | Users receive typed image, video, audio, upload, polling, and task lifecycle helpers after their contracts are stable. |
@@ -311,6 +311,11 @@ Stable publication requires a human-reviewed release PR and protected npm
311311
environment approval while the SDK remains pre-1.0. Manual workflows may build
312312
or dry-run packages but may not publish an arbitrary commit.
313313

314+
For the 0.1.0 promotion, Release Please creates only the reviewed PR and skips
315+
tag and Release creation. After that PR merges, a maintainer manually creates
316+
the immutable `v0.1.0` Release against its exact merge commit; publishing the
317+
Release triggers the existing verified OIDC pipeline.
318+
314319
Public Preview needs no registry workflow. Registry Alpha publishes from a
315320
human-reviewed immutable prerelease tag under the `next` dist-tag through OIDC
316321
or, only when npm cannot preconfigure Trusted Publishing, through the one-time

examples/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ default example model, `gpt-5.4`.
88
Models.
99

1010
They require `COMETAPI_KEY` for authorized live use. Do not run them against the
11-
live API without an explicit request budget and authorization. Release fixtures
12-
execute equivalent calls with mocked transport against the exact packed
13-
tarball; mocked execution is package evidence, not live compatibility evidence.
11+
live API without an explicit request budget and authorization. The
12+
`test:examples` gate executes these original files with a fail-closed mocked
13+
transport against the exact packed tarball; mocked execution is package
14+
evidence, not live compatibility evidence.
1415

15-
After the Registry Alpha is published under npm's `next` dist-tag:
16+
Registry Alpha is available under npm's `next` dist-tag:
1617

1718
```bash
1819
npm install cometapi@next

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"test:live": "node scripts/live-smoke.mjs",
6363
"test:live-contract": "node scripts/test-live-smoke-contract.mjs",
6464
"test:package": "node scripts/test-package.mjs",
65+
"test:examples": "node scripts/test-examples.mjs",
6566
"test:fixtures": "node scripts/test-fixtures.mjs",
6667
"test:compat": "node scripts/test-compat.mjs",
6768
"test:secrets": "node scripts/check-secrets.mjs",

0 commit comments

Comments
 (0)