Upgrades
Semver promise
Section titled “Semver promise”- Major - breaking wire-protocol changes. Plan a coordinated upgrade.
- Minor - additive features, fully backward-compatible for one major.
- Patch - bug fixes, no behavior changes.
See versioning for the full policy.
Upgrade order
Section titled “Upgrade order”- Upgrade the brain first. Newer brains accept older agents up to one major version behind.
- Upgrade agents on a schedule. Rolling restarts are fine; agents auto-reconnect.
- Monitor for “agent version mismatch” banners in the dashboard.
Database migrations
Section titled “Database migrations”Migrations run automatically on brain start. For multi-replica deploys (v1.1+), run migrations explicitly from one-shot jobs:
docker run --rm \ -e Z4J_DATABASE_URL=... \ z4jdev/z4j:v1.1.0 z4j-brain migrateThen deploy the new image to the actual brain replicas.
Rolling back
Section titled “Rolling back”z4j migrations are forward-only by policy. Roll back with:
- Restore Postgres from backup (point-in-time or snapshot).
- Redeploy the previous brain image.
Test this procedure on staging before you need it.
Version skew tolerance
Section titled “Version skew tolerance”| Brain | Agent | Behavior |
|---|---|---|
| v1.x | v1.x | Full feature parity |
| v1.x | v1.(x-1) | Works; new v1.x features may be unavailable on old agents |
| v1.x | v1.(x-2) | Works; upgrade banner shown |
| v1.x | v0.x | Rejected with handshake error |
| v2.x | v1.x | Rejected with handshake error (major break) |
Reading release notes
Section titled “Reading release notes”Every release ships a changelog entry at /reference/changelog. Breaking changes are called out with a ⚠️ marker.
Upgrading Postgres
Section titled “Upgrading Postgres”Separate concern - the brain supports Postgres 17 and 18. Use pg_upgrade or logical replication; the brain is agnostic.