# Versioning

`pi-context-firewall` uses semantic versioning: `MAJOR.MINOR.PATCH`.

## PATCH: `0.1.x`

Use a patch release for safe, backward-compatible changes:

- README, docs, examples, wording, metadata;
- additions to command classification regexes;
- validation/typecheck/test improvements;
- internal refactors with no user-facing API changes.

Example: `0.1.2 -> 0.1.3`.

## MINOR: `0.x.0`

Use a minor release for new backward-compatible capability:

- new commands/tools/options;
- customizable classification rules or config settings;
- expanded CLI status/reporting tools inside Pi.

Example: `0.1.3 -> 0.2.0`.

## MAJOR: `x.0.0`

Use a major release for breaking changes:

- changing or removing existing hook configuration options;
- changing core rewriter engine behavior in a way that breaks existing tool chains;
- removing commands or support for the underlying `cfw` binary formats.

Example: `1.4.2 -> 2.0.0`.

## Release checklist

1. Update `package.json` with `npm version <patch|minor|major> --no-git-tag-version`.
2. Update `CHANGELOG.md` under the new version.
3. Run:

   ```bash
   npm run validate
   npm run typecheck
   npm run pack:check
   ```

4. Commit with a clear release-prep message.
5. Tag the version: `git tag vX.Y.Z`.
6. Push `main` and the tag.
7. Publish to npm:

   ```bash
   npm publish --access public
   ```

8. Create a GitHub release for the tag.
9. Install the published package and validate it:

   ```bash
   pi remove npm:pi-context-firewall || true
   pi install npm:pi-context-firewall@X.Y.Z
   ```
