Skip to content

Latest commit

 

History

History
380 lines (310 loc) · 14.6 KB

RELEASING.md

File metadata and controls

380 lines (310 loc) · 14.6 KB

Releasing the Steerable Framework

This document covers two release modes:

  • Mode B — Local artifacts (no credentials needed): build tarballs/wheels into dist/ and consume them by file path. Ideal for dogfooding inside the DeepPath ecosystem before going public.
  • Mode C — Public publish: push to npm and PyPI under @steerable/* and steerable-*. Requires registry credentials and the GitHub Actions workflow configured below.

Packages in scope

Tier Package Output
1 @steerable/agent-protocol dist/npm/steerable-agent-protocol-X.Y.Z.tgz
1 steerable-agent-protocol (Py) dist/py/steerable_agent_protocol-X.Y.Z-*.whl + sdist
2 @steerable/agent-harness dist/npm/steerable-agent-harness-X.Y.Z.tgz
2 steerable-agent-harness (Py) dist/py/steerable_agent_harness-X.Y.Z-*.whl + sdist
3 steerable-agent-runtime (Py) dist/py/steerable_agent_runtime-X.Y.Z-*.whl + sdist
3 Private Rust bundle exact native wheel pin plus sidecar/egress assets selected by rust-artifacts.lock.json
3 steerable-plugin-sdk (Py) dist/py/steerable_plugin_sdk-X.Y.Z-*.whl + sdist
3 steerable-sidecar (Py) dist/py/steerable_sidecar-X.Y.Z-*.whl + sdist
4 @steerable/agent-ui dist/npm/steerable-agent-ui-X.Y.Z.tgz

All listed packages release in lock-step (every release publishes the same X.Y.Z for everything, even no-op bumps). Enforced by scripts/check_lockstep_versions.py gates framework versions and validates the independent Rust artifact lock without requiring the versions to match. See "Mode C" below for the operator workflow.


Mode B — Build local artifacts

One-shot script

make release-local
# Or, expanded:
./scripts/release/build-local-artifacts.sh

Both wrappers run the steps below; pick whichever style fits your shell.

Step-by-step

cd /path/to/steerable

# 0. Clean install + sync workspaces
pnpm install --frozen-lockfile
uv sync --all-packages

# 1. Regenerate codegen + verify drift
pnpm gen
pnpm check:drift
uv run python scripts/generate_py.py
uv run python scripts/check_drift.py

# 2. Run the full test suite (must be green before packaging)
pnpm -r test
uv run pytest -q

# 3. Build TS packages
pnpm -r --filter '@steerable/*' build

# 4. Pack TS tarballs into dist/npm/
rm -rf dist && mkdir -p dist/npm dist/py
for pkg in agent-protocol agent-harness agent-ui; do
  (cd packages/$pkg/ts && \
   pnpm pack --pack-destination "$PWD/../../../dist/npm")
done

# 5. Build Python wheels + sdists into dist/py/
uv build --all-packages --out-dir dist/py
# Drop example wheels from publishable output:
rm dist/py/steerable_example_*.{whl,tar.gz} 2>/dev/null || true

# 6. Smoke-test from a clean Node + Python environment
./scripts/release/verify-local-artifacts.sh

Smoke-test verification

The verification script (or manual equivalent below) installs the artifacts into throwaway environments and runs minimal real code.

# Python
uv venv /tmp/steerable-verify-py --python 3.12
uv pip install --python /tmp/steerable-verify-py/bin/python \
    dist/py/steerable_agent_protocol-*.whl \
    dist/py/steerable_agent_harness-*.whl \
    dist/py/steerable_agent_runtime-*.whl \
    dist/py/steerable_sidecar-*.whl
/tmp/steerable-verify-py/bin/python -c "
import asyncio
from steerable_agent_protocol import ToolCall, SSEEvent
from steerable_agent_runtime import ToolRouter, tool
router = ToolRouter()
@tool(router=router)
async def hello() -> str:  return 'hi'
print(asyncio.run(router.dispatch(ToolCall(id='c1', name='hello', arguments={}))))
"

# Node ESM
mkdir /tmp/steerable-verify-npm && cd /tmp/steerable-verify-npm
cat > package.json <<JSON
{
  "type": "module",
  "dependencies": {
    "@steerable/agent-protocol": "file:$REPO/dist/npm/steerable-agent-protocol-0.1.0.tgz",
    "@steerable/agent-harness":  "file:$REPO/dist/npm/steerable-agent-harness-0.1.0.tgz"
  },
}
JSON
cat > pnpm-workspace.yaml <<YAML
overrides:
  "@steerable/agent-protocol": $REPO/dist/npm/steerable-agent-protocol-0.1.0.tgz
  "@steerable/agent-harness":  $REPO/dist/npm/steerable-agent-harness-0.1.0.tgz
YAML
pnpm install --no-frozen-lockfile
node --input-type=module -e "
import { decideToolMode, isTerminalResult } from '@steerable/agent-harness';
console.log({mode: decideToolMode('read_file'), done: isTerminalResult({success:true,terminal:true})});
"

Why overrides? Tarballs of internal packages declare each other as registry dependencies (workspace:* is rewritten on pnpm pack). Without overrides, pnpm fetches them from registry.npmjs.org and fails.

They go in pnpm-workspace.yaml: pnpm 10 stopped reading a pnpm field in package.json, and an override takes a bare path — a file: prefix is read as part of the path.

scripts/release/verify-local-artifacts.sh does all of this for the whole batch; run it instead of wiring a project by hand.

Consuming Mode B artifacts from another project

TypeScript (Next.js / Vite / Electron)

{
  "dependencies": {
    "@steerable/agent-protocol": "file:../steerable/dist/npm/steerable-agent-protocol-0.1.0.tgz",
    "@steerable/agent-ui":       "file:../steerable/dist/npm/steerable-agent-ui-0.1.0.tgz"
  }
}

With the matching pnpm-workspace.yaml beside it:

overrides:
  "@steerable/agent-protocol": ../steerable/dist/npm/steerable-agent-protocol-0.1.0.tgz

Python (FastAPI / Sidecar embedder)

uv add /path/to/dist/py/steerable_agent_protocol-0.1.0-py3-none-any.whl
uv add /path/to/dist/py/steerable_agent_harness-0.1.0-py3-none-any.whl
uv add /path/to/dist/py/steerable_agent_runtime-0.1.0-py3-none-any.whl

uv add writes a SHA256 to uv.lock, so you get reproducible installs even without a registry.


Mode C — Public publish

Prerequisites (one-time)

  1. Reserve the names:

    • npm scope @steerable — already registered (May 2026). All four publishable names (agent-protocol, agent-harness, agent-ui) return HTTP 404 on the registry, confirming the slot is free.
    • PyPI project names steerable-agent-protocol, steerable-agent-harness, steerable-agent-runtime, steerable-plugin-sdk, steerable-sidecar. See "Configuring PyPI publish" below.
  2. Configure NPM_TOKEN:

    • Generate a Granular Access Token (recommended over the legacy "automation" type) at https://www.npmjs.com/settings/~/tokens:

      • Permissions → "Read and write"
      • Packages and scopes → restrict to the @steerable scope
      • Expiry: pick something ≥1 year so a release tag push doesn't fail on silent token expiry; rotate by setting a new token before the old expires.
    • Drop it into the repo:

      gh secret set NPM_TOKEN \
        --repo pathlyapp/steerable \
        --body "<paste-the-token>"
  3. Configure PyPI publish (pick one):

    • (A — recommended) Trusted Publishing, no long-lived secret:

      • Go to https://pypi.org/manage/account/publishing/ for each project (or the umbrella account if all four projects share an owner).
      • Add a publisher: owner pathlyapp, repo steerable, workflow publish-pypi.yml, environment pypi.
      • In the GitHub repo, create an Environment named pypi (Settings → Environments → New environment) and (optionally) gate it on a maintainer-approval rule.
    • (B) API token:

      # On https://pypi.org/manage/account/token/, scope it to all four
      # `steerable-*` projects.
      gh secret set PYPI_API_TOKEN \
        --repo pathlyapp/steerable \
        --body "pypi-XXXX..."

    publish-pypi.yml auto-detects which mode is active (presence of PYPI_API_TOKEN selects mode B, otherwise OIDC / Trusted Publishing). Until either is configured the workflow short-circuits with a clear notice — it will not fail the release.

  4. Framework release and Rust adoption are separate

    # Adopt an already-published private Rust bundle when needed:
    python scripts/use_rust_artifacts.py X.Y.Z
         └─► verifies PyPI wheels + rust-vX.Y.Z Release
             and updates rust-artifacts.lock.json + exact native pins
    
    # Release framework packages without changing the Rust bundle:
    ./scripts/release/bump_to.sh A.B.C
    git commit -am "chore(release): vA.B.C"
    git tag vA.B.C
    git push origin develop vA.B.C
         └─► release.yml verifies the pinned bundle, builds the platform
             sidecar bundles, runs the quickstart gate, then publishes
             npm (workspace packages, platform runtimes, CLI) and PyPI
    

    bump_to.sh never edits the native pin. A framework release may reuse the same Rust artifact version indefinitely. The private repository creates dedicated, immutable rust-vX.Y.Z Releases in this repository.

    Why no release-please? Per-component release PRs (release-please's default) repeatedly desynced TS↔Py copies of the same logical package, breaking the lockstep validator. Tag-driven releases are lockstep-by-construction — bump_to.sh is the only writer of versions, and the gate refuses anything else.

Re-running a publish after a partial failure

The publish workflows skip packages already on the registry, so the canonical recovery is just to re-trigger the chain:

# Re-run release.yml for a specific version (re-validates lockstep,
# re-creates the GH Release if missing, re-chains publish-{npm,pypi}.yml).
gh workflow run release.yml --ref main -f version=X.Y.Z

# Or re-trigger a single publish workflow directly:
gh workflow run publish-npm.yml --ref vX.Y.Z
gh workflow run publish-pypi.yml --ref vX.Y.Z
gh workflow run publish-native.yml --ref vX.Y.Z

Manual publish (escape hatch)

If the GitHub Actions runner is unreachable entirely, publish from a clean checkout of the tagged commit:

git checkout vX.Y.Z

# TS — workspace packages first
pnpm install --frozen-lockfile
pnpm gen
pnpm -r --filter '@steerable/*' build
NODE_AUTH_TOKEN="$NPM_TOKEN" \
  pnpm -r --filter '@steerable/*' publish --no-git-checks

# Platform runtimes, then the CLI that names them. These packages are
# generated into dist/runtime/ and are NOT workspace members, so the
# `pnpm --filter` above cannot publish them.
VERSION=$(node -p "require('./packages/agent-cli/ts/package.json').version")
python scripts/set_runtime_optional_deps.py prepare --version "$VERSION"
( cd packages/agent-cli/ts && pnpm pack --pack-destination ../../../dist/npm )
( cd packages/agent-runtime/ts && pnpm pack --pack-destination ../../../dist/npm )
# Assembles dist/runtime/runtime-<target>/ from the built sidecar bundles.
python scripts/assemble_runtime_packages.py \
  --sidecar-root <sidecar-artifacts> --egress-root <egress-artifacts> --out dist/runtime
for dir in dist/runtime/runtime-*; do
  ( cd "$dir" && NODE_AUTH_TOKEN="$NPM_TOKEN" npm publish --access public --provenance )
done
( cd packages/agent-cli/ts && NODE_AUTH_TOKEN="$NPM_TOKEN" npm publish --access public --provenance )
( cd packages/agent-runtime/ts && NODE_AUTH_TOKEN="$NPM_TOKEN" npm publish --access public --provenance )
python scripts/set_runtime_optional_deps.py restore

# Py — PyPI
uv build --all-packages --out-dir dist/py
rm dist/py/steerable_example_*.{whl,tar.gz} 2>/dev/null || true
uv publish --token "$PYPI_API_TOKEN" dist/py/steerable_*.whl dist/py/steerable_*.tar.gz

Before publishing anything, run the packaged-install gate. It packs the batch, installs it into a clean project and imports it, which is the only check that sees a missing cross-package export:

python scripts/check_package_install.py

Versioning rules

  • Lockstep: every release publishes the same X.Y.Z for every registry package — including steerable-agent-runtime-native — and the unpublished Rust crates. No-op packages (no source change since the previous release) still bump; the cost is a few extra registry versions per release, the benefit is lockstep is structurally enforced — not a manual reconciliation step.
  • Bump granularity is operator-chosen: bump_to.sh 0.2.3 for a patch, bump_to.sh 0.3.0 for a minor, etc. There's no automated conventional-commit-driven version inference.
  • Pre-1.0: minor (0.X) is the breaking-change axis. Don't ship 1.0 until the public API is stable for at least one minor release cycle.

Common pitfalls

  • Forgetting pnpm gen before packing — drift checker will fire in CI but not in local pack. Always pnpm gen && pnpm check:drift first.
  • Stale uv.lock — uv build doesn't re-resolve. If you bumped a workspace package, run uv sync --all-packages first.
  • additionalProperties: false regressions — some envelopes are intentionally open (SSEEvent, ChatMessage); some are intentionally closed (ToolCall, SidecarRequest). Don't flip these without a major bump.
  • Examples leaking into releases — dist/py/steerable_example_* are built by uv build --all-packages but must not be published. The local build script removes them; the publish workflow does too.
  • Missing .js extensions in TS source — every relative import/export in TypeScript source must end in .js (yes, even though the source is .ts). Required for Node ESM. The codegen template enforces it; new hand-authored modules must follow suit.

Release checklist

Run locally before tagging vX.Y.Z:

  • pnpm install --frozen-lockfile ✓
  • uv sync --all-packages ✓
  • pnpm gen && pnpm check:drift ✓
  • uv run python scripts/generate_py.py && uv run python scripts/check_drift.py ✓
  • pnpm -r test ✓
  • uv run pytest -q ✓
  • examples/py-minimal, examples/ts-minimal, examples/sidecar-roundtrip all run
  • Mode B verification (./scripts/release/verify-local-artifacts.sh) ✓
  • ./scripts/release/bump_to.sh X.Y.Z ✓ (refreshes lockfiles, runs lockstep gate)
  • git diff reviewed ✓
  • git commit -am "chore(release): vX.Y.Z" && git tag vX.Y.Z ✓
  • git push origin main vX.Y.Z ✓ (CI takes over from here)

Post-release (after CI is green and registries show the new version):

  • Lockfiles refreshed in three downstream repos:
    • cd deeppath && pnpm update @steerable/agent-protocol @steerable/agent-ui
    • cd deeppath-agent && pnpm update @steerable/agent-harness @steerable/agent-protocol
    • cd deeppath-api && uv lock --upgrade-package steerable-agent-protocol \ --upgrade-package steerable-agent-harness \ --upgrade-package steerable-agent-runtime \ --upgrade-package steerable-sidecar && uv sync