paperclip/doc/RELEASING.md

254 lines
7.3 KiB
Markdown
Raw Normal View History

2026-03-09 08:49:42 -05:00
# Releasing Paperclip
Maintainer runbook for shipping Paperclip across npm, GitHub, and the website-facing changelog surface.
2026-03-09 08:49:42 -05:00
The release model is now commit-driven:
2026-03-09 08:49:42 -05:00
1. Every push to `master` publishes a canary automatically.
2. Stable releases are manually promoted from a chosen tested commit or canary tag.
3. Stable release notes live in `releases/vYYYY.MDD.P.md`.
4. Only stable releases get GitHub Releases.
2026-03-09 08:49:42 -05:00
## Versioning Model
2026-03-09 08:49:42 -05:00
Paperclip uses calendar versions that still fit semver syntax:
2026-03-09 08:49:42 -05:00
- stable: `YYYY.MDD.P`
- canary: `YYYY.MDD.P-canary.N`
2026-03-09 08:49:42 -05:00
Examples:
2026-03-09 08:49:42 -05:00
- first stable on March 18, 2026: `2026.318.0`
- second stable on March 18, 2026: `2026.318.1`
- fourth canary for the `2026.318.1` line: `2026.318.1-canary.3`
2026-03-09 08:49:42 -05:00
Important constraints:
2026-03-09 08:49:42 -05:00
- the middle numeric slot is `MDD`, where `M` is the UTC month and `DD` is the zero-padded UTC day
- use `2026.303.0` for March 3, not `2026.33.0`
- do not use leading zeroes such as `2026.0318.0`
- do not use four numeric segments such as `2026.3.18.1`
- the semver-safe canary form is `2026.318.0-canary.1`
2026-03-09 08:49:42 -05:00
## Release Surfaces
2026-03-09 08:49:42 -05:00
Every stable release has four separate surfaces:
2026-03-09 08:49:42 -05:00
1. **Verification** — the exact git SHA passes typecheck, tests, and build
2. **npm**`paperclipai` and public workspace packages are published
3. **GitHub** — the stable release gets a git tag and GitHub Release
4. **Website / announcements** — the stable changelog is published externally and announced
2026-03-09 08:49:42 -05:00
A stable release is done only when all four surfaces are handled.
2026-03-09 08:49:42 -05:00
Canaries only cover the first two surfaces plus an internal traceability tag.
2026-03-09 08:49:42 -05:00
## Core Invariants
2026-03-09 08:49:42 -05:00
- canaries publish from `master`
- stables publish from an explicitly chosen source ref
- tags point at the original source commit, not a generated release commit
- stable notes are always `releases/vYYYY.MDD.P.md`
- canaries never create GitHub Releases
- canaries never require changelog generation
2026-03-09 08:49:42 -05:00
## TL;DR
2026-03-09 08:49:42 -05:00
### Canary
2026-03-09 08:49:42 -05:00
Every push to `master` runs the canary path inside [`.github/workflows/release.yml`](../.github/workflows/release.yml).
It:
- verifies the pushed commit
- computes the canary version for the current UTC date
- publishes under npm dist-tag `canary`
Harden release flow with registry verification and dist-tag checks (#4800) ## Thinking Path > - Paperclip orchestrates AI agents for zero-human companies > - Paperclip is distributed as npm packages, including plugins like `plugin-e2b` > - The release process publishes canary and stable builds via npm dist-tags > - But there was no automated verification that published packages actually landed with the correct dist-tags, and broken canary publishes could silently ship to users > - This PR adds a registry verification script that checks published packages match their expected dist-tags, and wires it into PR CI so regressions are caught before merge > - The benefit is release integrity is verified automatically, and broken dist-tag states are caught early ## What Changed - Added `scripts/verify-release-registry-state.mjs` — verifies that published npm packages have correct dist-tag assignments and detects orphaned or mispointed tags - Added `scripts/verify-release-registry-state.test.mjs` — test coverage for the verification logic - Updated `scripts/release.sh` to include canary dist-tag safety checks before publishing - Updated `.github/workflows/pr.yml` to run registry verification as a CI step - Updated `doc/PUBLISHING.md` and `doc/RELEASING.md` with the new verification workflow ## Verification - `pnpm test` — all tests pass including new verification script tests - `node scripts/verify-release-registry-state.mjs` — runs against the live npm registry and reports current state - CI: the new PR workflow step runs on every PR push ## Risks - Low risk. This is additive CI and tooling — no runtime code changes. The registry verification is read-only (queries npm, does not publish). The release script changes add safety checks that abort before publishing if state is unexpected. ## Model Used Codex GPT 5.4 high via Paperclip. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [ ] If this change affects the UI, I have included before/after screenshots - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] I will address all Greptile and reviewer comments before requesting merge
2026-04-29 15:56:20 -07:00
- verifies that `canary` resolves to the just-published version and that published internal dependencies exist on npm
- fails by default if npm leaves `latest` pointing at a canary; use `--allow-canary-latest` only when that state is intentional
- creates a git tag `canary/vYYYY.MDD.P-canary.N`
2026-03-09 13:55:30 -05:00
Users install canaries with:
```bash
2026-03-09 13:55:30 -05:00
npx paperclipai@canary onboard
2026-03-18 07:59:32 -05:00
# or
npx paperclipai@canary onboard --data-dir "$(mktemp -d /tmp/paperclip-canary.XXXXXX)"
```
### Stable
2026-03-09 08:49:42 -05:00
Use [`.github/workflows/release.yml`](../.github/workflows/release.yml) from the Actions tab with the manual `workflow_dispatch` inputs.
2026-03-09 08:49:42 -05:00
[Run the action here](https://github.com/paperclipai/paperclip/actions/workflows/release.yml)
Inputs:
2026-03-09 08:49:42 -05:00
- `source_ref`
- commit SHA, branch, or tag
- `stable_date`
- optional UTC date override in `YYYY-MM-DD`
- enter a date like `2026-03-18`, not a version like `2026.318.0`
- `dry_run`
- preview only when true
2026-03-09 08:49:42 -05:00
Before running stable:
2026-03-09 08:49:42 -05:00
1. pick the canary commit or tag you trust
2. resolve the target stable version with `./scripts/release.sh stable --date "$(date +%F)" --print-version`
3. create or update `releases/vYYYY.MDD.P.md` on that source ref
4. run the stable workflow from that source ref
2026-03-09 08:49:42 -05:00
Example:
- `source_ref`: `master`
- `stable_date`: `2026-03-18`
- resulting stable version: `2026.318.0`
The workflow:
2026-03-09 08:49:42 -05:00
- re-verifies the exact source ref
- computes the next stable patch slot for the chosen UTC date
- publishes `YYYY.MDD.P` under npm dist-tag `latest`
- creates git tag `vYYYY.MDD.P`
- creates or updates the GitHub Release from `releases/vYYYY.MDD.P.md`
2026-03-09 08:49:42 -05:00
## Local Commands
2026-03-09 08:49:42 -05:00
### Preview a canary locally
2026-03-09 08:49:42 -05:00
```bash
./scripts/release.sh canary --dry-run
2026-03-09 08:49:42 -05:00
```
### Preview a stable locally
2026-03-09 09:06:45 -05:00
```bash
./scripts/release.sh stable --dry-run
2026-03-09 09:06:45 -05:00
```
### Publish a stable locally
2026-03-09 08:49:42 -05:00
This is mainly for emergency/manual use. The normal path is the GitHub workflow.
2026-03-09 09:06:45 -05:00
```bash
./scripts/release.sh stable
git push public-gh refs/tags/vYYYY.MDD.P
PUBLISH_REMOTE=public-gh ./scripts/create-github-release.sh YYYY.MDD.P
2026-03-09 09:06:45 -05:00
```
## Stable Changelog Workflow
2026-03-09 08:49:42 -05:00
Stable changelog files live at:
2026-03-09 08:49:42 -05:00
- `releases/vYYYY.MDD.P.md`
2026-03-09 08:49:42 -05:00
Canaries do not get changelog files.
2026-03-09 08:49:42 -05:00
Recommended local generation flow:
2026-03-09 08:49:42 -05:00
```bash
VERSION="$(./scripts/release.sh stable --date 2026-03-18 --print-version)"
claude --print --output-format stream-json --verbose --dangerously-skip-permissions --model claude-opus-4-6 "Use the release-changelog skill to draft or update releases/v${VERSION}.md for Paperclip. Read doc/RELEASING.md and .agents/skills/release-changelog/SKILL.md, then generate the stable changelog for v${VERSION} from commits since the last stable tag. Do not create a canary changelog."
2026-03-09 08:49:42 -05:00
```
The repo intentionally does not run this through GitHub Actions because:
2026-03-09 08:49:42 -05:00
- canaries are too frequent
- stable notes are the only public narrative surface that needs LLM help
- maintainer LLM tokens should not live in Actions
2026-03-09 08:49:42 -05:00
## Smoke Testing
2026-03-09 09:06:45 -05:00
For a canary:
2026-03-09 08:49:42 -05:00
```bash
PAPERCLIPAI_VERSION=canary ./scripts/docker-onboard-smoke.sh
```
For the current stable:
```bash
PAPERCLIPAI_VERSION=latest ./scripts/docker-onboard-smoke.sh
```
Useful isolated variants:
```bash
HOST_PORT=3232 DATA_DIR=./data/release-smoke-canary PAPERCLIPAI_VERSION=canary ./scripts/docker-onboard-smoke.sh
HOST_PORT=3233 DATA_DIR=./data/release-smoke-stable PAPERCLIPAI_VERSION=latest ./scripts/docker-onboard-smoke.sh
```
2026-03-18 07:59:32 -05:00
Automated browser smoke is also available:
```bash
gh workflow run release-smoke.yml -f paperclip_version=canary
gh workflow run release-smoke.yml -f paperclip_version=latest
```
2026-03-09 08:49:42 -05:00
Minimum checks:
2026-03-09 13:55:30 -05:00
- `npx paperclipai@canary onboard` installs
- onboarding completes without crashes
2026-03-18 07:59:32 -05:00
- authenticated login works with the smoke credentials
- the browser lands in onboarding on a fresh instance
- company creation succeeds
- the first CEO agent is created
- the first CEO heartbeat run is triggered
2026-03-09 13:55:30 -05:00
## Rollback
2026-03-09 08:49:42 -05:00
Rollback does not unpublish versions.
2026-03-09 13:55:30 -05:00
It only moves the `latest` dist-tag back to a previous stable:
2026-03-09 13:55:30 -05:00
```bash
./scripts/rollback-latest.sh 2026.318.0 --dry-run
./scripts/rollback-latest.sh 2026.318.0
2026-03-09 13:55:30 -05:00
```
Then fix forward with a new stable patch slot or release date.
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
## Failure Playbooks
2026-03-09 08:49:42 -05:00
### If the canary publishes but smoke testing fails
2026-03-09 08:49:42 -05:00
Do not run stable.
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
Instead:
2026-03-09 08:49:42 -05:00
1. fix the issue on `master`
2. merge the fix
3. wait for the next automatic canary
4. rerun smoke testing
2026-03-09 08:49:42 -05:00
### If stable npm publish succeeds but tag push or GitHub release creation fails
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
This is a partial release. npm is already live.
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
Do this immediately:
2026-03-09 08:49:42 -05:00
1. push the missing tag
2. rerun `PUBLISH_REMOTE=public-gh ./scripts/create-github-release.sh YYYY.MDD.P`
3. verify the GitHub Release notes point at `releases/vYYYY.MDD.P.md`
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
Do not republish the same version.
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
### If `latest` is broken after stable publish
2026-03-09 08:49:42 -05:00
Roll back the dist-tag:
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
```bash
./scripts/rollback-latest.sh YYYY.MDD.P
2026-03-09 13:55:30 -05:00
```
2026-03-09 08:49:42 -05:00
Then fix forward with a new stable release.
2026-03-09 08:49:42 -05:00
## Related Files
2026-03-09 08:49:42 -05:00
- [`scripts/release.sh`](../scripts/release.sh)
- [`scripts/release-package-map.mjs`](../scripts/release-package-map.mjs)
- [`scripts/create-github-release.sh`](../scripts/create-github-release.sh)
- [`scripts/rollback-latest.sh`](../scripts/rollback-latest.sh)
- [`doc/PUBLISHING.md`](PUBLISHING.md)
- [`doc/RELEASE-AUTOMATION-SETUP.md`](RELEASE-AUTOMATION-SETUP.md)