diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb2e26b..ed1d7df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,8 +9,9 @@ # Stage B (publish): runs only on workflow_dispatch with publish=true AND the # protected `npm-release` environment's approval. Downloads Stage A's exact # artifacts, verifies checksums / tag / declared versions, refuses to overwrite -# any existing version, publishes in dependency order with provenance, verifies -# via `npm view` + a clean registry install, and only then creates the GitHub +# any existing version, publishes in dependency order with provenance under the +# `latest` dist-tag, verifies via `npm view` (version + dist-tag) + a clean +# registry install, and only then creates the GitHub # prerelease. # # Auth: npm trusted publishing (GitHub Actions OIDC) — configured on @@ -187,7 +188,9 @@ jobs: fi done echo "no target version exists — safe to publish" - - name: Publish in dependency order (--access public --tag alpha --provenance) + # --tag latest even for prereleases: OIDC trusted publishing cannot run + # dist-tag mutations, so the publish itself must set the tag installs use. + - name: Publish in dependency order (--access public --tag latest --provenance) run: | set -euo pipefail VERSION="${RELEASE_TAG#v}" @@ -198,34 +201,34 @@ jobs: # of a file path and tries git ls-remote (run 29307312478). t="./release-artifacts/git-agentic-sentinel-$p-$VERSION.tgz" echo "publishing @git-agentic/sentinel-$p@$VERSION" - if ! npm publish "$t" --access public --tag alpha --provenance; then + if ! npm publish "$t" --access public --tag latest --provenance; then echo "::error::publish of @git-agentic/sentinel-$p failed. Already published (immutable): ${published:-none}. Do NOT unpublish; fix forward."; exit 1 fi published="$published @git-agentic/sentinel-$p" echo "- @git-agentic/sentinel-$p@$VERSION published" >> "$GITHUB_STEP_SUMMARY" done - name: Verify every published package via npm view + # Hard cap: the loop's deadline is checked between polls, and a hung + # `npm view` could otherwise outlast it. + timeout-minutes: 12 run: | set -euo pipefail VERSION="${RELEASE_TAG#v}" + # The registry can take minutes to show a fresh publish (run + # 44750832298 gave up after 75 s although every package was out). + # One shared 10-minute deadline covers all seven packages. + deadline=$(( $(date +%s) + 600 )) for p in core proxy sandbox mcp steward cli action; do - for i in 1 2 3 4 5; do - got="$(npm view "@git-agentic/sentinel-$p@$VERSION" version 2>/dev/null || true)" - [ "$got" = "$VERSION" ] && break + while :; do + got="$(npm view "@git-agentic/sentinel-$p@$VERSION" version --prefer-online 2>/dev/null || true)" + latest="$(npm view "@git-agentic/sentinel-$p" dist-tags.latest --prefer-online 2>/dev/null || true)" + [ "$got" = "$VERSION" ] && [ "$latest" = "$VERSION" ] && break + if [ "$(date +%s)" -ge "$deadline" ]; then + echo "::error::@git-agentic/sentinel-$p: version ${got:-missing}, dist-tag latest ${latest:-missing}; expected $VERSION after 10 minutes"; exit 1 + fi sleep 15 done - [ "$got" = "$VERSION" ] || { echo "::error::@git-agentic/sentinel-$p@$VERSION not visible after publish"; exit 1; } - tag_alpha="$(npm view "@git-agentic/sentinel-$p" dist-tags.alpha)" - [ "$tag_alpha" = "$VERSION" ] || { echo "::error::@git-agentic/sentinel-$p dist-tag alpha is $tag_alpha, expected $VERSION"; exit 1; } - # npm auto-creates `latest` on a package's first publish (even with - # --tag alpha) and never moves it. OIDC trusted publishing cannot - # run dist-tag mutations, so drift is surfaced here, not fixed here. - tag_latest="$(npm view "@git-agentic/sentinel-$p" dist-tags.latest 2>/dev/null || true)" - if [ -n "$tag_latest" ] && [ "$tag_latest" != "$VERSION" ]; then - echo "::warning::@git-agentic/sentinel-$p dist-tag latest is $tag_latest (stale). Until a stable release exists, retarget it: npm dist-tag add @git-agentic/sentinel-$p@$VERSION latest" - echo "- ⚠ sentinel-$p latest→$tag_latest is stale; run: \`npm dist-tag add @git-agentic/sentinel-$p@$VERSION latest\`" >> "$GITHUB_STEP_SUMMARY" - fi - echo "@git-agentic/sentinel-$p@$VERSION visible, dist-tag alpha OK" + echo "@git-agentic/sentinel-$p@$VERSION visible, dist-tag latest OK" done verify-registry-install: diff --git a/README.md b/README.md index 3e17f75..4157d09 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,10 @@ macOS Seatbelt enforcement is exercised on maintainers' machines) — but this has not yet been hardened by production use, and APIs may change without notice. The complete phase-by-phase build log lives in [docs/adr/](./docs/adr/) (one ADR per phase). **Published as an alpha -preview**: all seven packages ship under the `alpha` -dist-tag (`npm install -g @git-agentic/sentinel-cli@alpha @git-agentic/sentinel-proxy@alpha`) — see +preview**: every release, alphas included, is published as the `latest` +dist-tag (`npm install -g @git-agentic/sentinel-cli @git-agentic/sentinel-proxy`; +until `0.1.0-alpha.4` ships, `latest` still names `0.1.0-alpha.2` for most +packages, so append `@0.1.0-alpha.3` to get the current release) — see the [release notes](./docs/releases/) and [release process](./docs/release-process.md); building from source (Quickstart below) remains fully supported. Threat model: diff --git a/SECURITY.md b/SECURITY.md index a2e8d9c..a4a206f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,7 +6,7 @@ sandbox for the npm ecosystem. We treat reports against it accordingly. ## Supported versions Sentinel is pre-1.0. Only the tip of `main` and the most recent published -prerelease (`@git-agentic/sentinel-*@alpha`) are supported; +prerelease (the `latest` dist-tag of `@git-agentic/sentinel-*`) are supported; there are no maintained release branches. Prereleases are snapshots of `main` — fixes ship as the next prerelease, never as patches to an old one. diff --git a/docs/release-process.md b/docs/release-process.md index 7cbc400..427dced 100644 --- a/docs/release-process.md +++ b/docs/release-process.md @@ -21,17 +21,14 @@ failure without unpublishing anything already released. ## Prerelease versioning -- Pre-1.0 releases use `0.1.0-alpha.N` (then `-beta.N`, `-rc.N`) with the - npm dist-tag matching the prerelease channel (`alpha`, `beta`, `rc`). -- **The `latest` dist-tag, pre-stable:** npm force-creates `latest` on a - package's first publish (even with `--tag alpha`) and never moves it; it - also cannot be deleted. Until a stable release exists, `latest` is - therefore kept pointing at the **newest prerelease** — retargeted manually - after each release (`npm dist-tag add @git-agentic/sentinel-
@ @ @ @