# Release Process

## Versioning Strategy

Each package is versioned independently using [Changesets](https://github.com/changesets/changesets).

### Adding a Changeset

When your PR changes a package's public API or behavior:

```bash
pnpm changeset
```

This prompts you to select which packages changed and whether the change is a patch, minor, or major bump. It creates a markdown file in `.changeset/` describing the change.

### Version Bumping

On merge to `main`, the release workflow:

1. Collects all changesets since last release
2. Bumps versions in each affected `package.json`
3. Updates `CHANGELOG.md` per package
4. Creates a "Version Packages" PR
5. Merging that PR triggers publishing

## Publishing

### npm Packages

Published automatically by `.github/workflows/release-and-publish.yml`:

| Package | npm Name | Registry |
|---------|----------|----------|
| `packages/remnic-core` | `@remnic/core` | npm |
| `packages/remnic-server` | `@remnic/server` | npm |
| `packages/remnic-cli` | `@remnic/cli` | npm |
| `packages/plugin-openclaw` | `@remnic/plugin-openclaw` | npm |
| `packages/shim-openclaw-engram` | `@joshuaswarren/openclaw-engram` | npm |
| `packages/plugin-claude-code` | `@remnic/plugin-claude-code` | npm |
| `packages/plugin-codex` | `@remnic/plugin-codex` | npm |
| `packages/connector-replit` | `@remnic/replit` | npm |
| `packages/bench` | `@remnic/bench` | npm |
| `packages/export-weclone` | `@remnic/export-weclone` | npm |
| `packages/import-weclone` | `@remnic/import-weclone` | npm |
| `packages/connector-weclone` | `@remnic/connector-weclone` | npm |
| `packages/hermes-provider` | `@remnic/hermes-provider` | npm |

All npm publishes include provenance attestations.

For the first public Remnic publish, the workflow treats the workspace root
`package.json` version as authoritative while `@remnic/core` is still absent
from npm. That bootstrap rule prevents the release job from inheriting the old
Engram `v9.x` tag line before the `1.0.0` Remnic packages exist on the
registry.

### PyPI Package

`packages/plugin-hermes` is published separately by `.github/workflows/hermes-python.yml`:

```bash
# Manual publish (maintainers only)
cd packages/plugin-hermes
python -m build
twine upload dist/*
```

### Marketplace Publishing

- **Claude Code plugin** → Anthropic marketplace (manual submission)
- **Codex plugin** → OpenAI Codex marketplace (manual submission)

## Backward Compatibility

### The `@remnic/plugin-openclaw` Package

The `packages/plugin-openclaw/` directory publishes as `@remnic/plugin-openclaw` on npm. OpenClaw installs should now target that package directly.

### The Root Package

The root `package.json` is a workspace root and is NOT published. It exists only for workspace management.

### Deprecation Notice

The old `@joshuaswarren/openclaw-engram` scope package now lives at `packages/shim-openclaw-engram/` as a frozen compatibility shim. It re-exports the OpenClaw bridge plugin, forwards `engram-access`, prints a postinstall rename banner, and carries the npm deprecation notice pointing users to the new `@remnic/*` packages.

## Emergency Hotfix

For critical fixes that can't wait for the normal changeset flow:

```bash
git checkout -b hotfix/critical-fix main
# make fix
pnpm changeset   # create changeset with patch bump
git push
# merge PR → auto-publishes
```
