Release Notes
A running log of what shipped in each zero release, newest first. The planned work lives on the Roadmap page.
TIP
These pages track main and Zig 0.17. Use the version menu at the top to read the frozen Zig 0.16 docs. Pin a tagged release in your own project. The Getting Started guide shows how.
Release & Zig support
| Release | Zig toolchain |
|---|---|
up to 0.0.3 | Zig 0.15.2 |
up to 0.5.3 | Zig 0.16.0 |
0.5.4 (unreleased) and newer | Zig 0.17.0 |
0.5.4 (unreleased)
Zero 0.5.4 is the Zig 0.17 line. It starts from 0.5.3 and moves the framework and every example onto Zig 0.17.0. It also hardens security, makes startup fail fast, and promotes OpenTelemetry out of experimental.
This section tracks the experimental-0.17 branch. It covers every change from the v0.5.3 tag up to the 0.5.4 release tag.
Before you upgrade
Read these first. They can change how your app builds or behaves.
- Zig 0.17.0 is required.
build.zig.zonsetsminimum_zig_version = "0.17.0". Zig 0.16 will not build this line. - Rewrite the run step in
build.zig. Replaceif (b.args) |args| run_cmd.addArgs(args);withrun_cmd.addPassthruArgs();. A protobuf step becomesgen_proto.dependOn(protoc_step.step);. See Hello world. - Dependencies moved to 0.17-ready forks. httpz, dotenv, zul, okredis, mqttz, nats, protobuf (5 → 7), and regexp changed. The
jwtdependency is nowzig_jwt. - API keys stored in KV must contain the token. A key under
auth:apikey:<token>whose stored value is anything else is now rejected. Metadata-only values break. - Five-field cron schedules changed. They now mean minute, hour, day, month, weekday and run at second 0. Use six fields when you meant every second.
- Message slices are short-lived. The per-message arena is freed when the hook returns. Copy
m.payloadif you need it later. - Custom pub/sub backends need a new argument. The
publishvtable method takeskey: ?[]const u8.Publish(subject, payload)still works from app code. HEALTH_CHECK_TIMEOUT_MSis gone. The key is no longer read. Health checks use the snapshot interval instead.- Vault values live in the config map. Code that reads
std.process.environdirectly won't see them. Useconfig.get*().
Zig 0.17 migration
- The framework and all examples were ported to Zig 0.17. CI images followed.
- SQLite and the
zbenchharness were updated for 0.17. - Zig 0.17 changed struct reflection. The code now uses
field_names/field_types/field_attrsinstead of@typeInfo(T).@"struct".fields. - Kafka and DuckDB are weak-linked and on by default. Build a smaller binary with
zig build -Dkafka=false -Dduckdb=false. Examples forward the flags. - The
experimental-0.17branch also reverts a vault overrides removal, sovault_overridesstays as an owned config map.
Observability
- OpenTelemetry is stable. It starts when you set
OTEL_EXPORTER_OTLP_ENDPOINT,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, orOTEL_EXPORTER_OTLP_LOGS_ENDPOINT.OTEL_EXPERIMENTALis no longer read. See OpenTelemetry. - A cardinality cap is on by default. Each metric keeps at most 4096 label sets. Extra sets are dropped and counted in
otel_metric_overflow. SetMETRICS_CARDINALITY_LIMIT=0to turn it off. The earlier code read the cap from the raw environment and left it off. - Label hashing no longer collides.
{"ab","c"}and{"a","bc"}now hash differently. Error-path HTTP metrics use fixed labels such as/_error, so a URL scanner can't create unbounded series. app_sql_responsenow uses the real query type for itsoperationlabel.- Health checks run in the background. A refresher thread publishes a snapshot, and the probe reads it.
HEALTH_SNAPSHOT_REFRESH_MSsets the interval, default5000ms. Set it to0to probe inline. A hung check stays down without blocking the others, and the thread is joined at shutdown. See Container. - A service timeout is now enforced.
SERVICE_<NAME>_TIMEOUT_MScovers connect, headers, and body. It returnserror.RequestTimeouton a late response. It used to be a warning only.
Reliability and resilience
- SQLite uses a connection pool and WAL.
SQLITE_POOL_SIZEdefaults to 4 and caps at 64. Writable connections enable WAL and a 5-second busy timeout. A request waits for a free connection rather than failing. See SQLite. - Outbound calls retry
429as well as5xx. They honor an integerRetry-Afterheader, capped at 60 seconds, and fall back tobase × attempt. See Http Service. - Redis heals its shared connection. A failed health
PINGcallsreconnect()once. The KV store and the Redis rate limiter use that same connection, so they recover with it. - Shutdown is signal-safe. The signal handler only sets a flag. The main thread stops accepting requests and cron jobs, then drains in-flight requests for up to
SHUTDOWN_DRAIN_TIMEOUT_MS, default 10000 ms. - Startup fails fast. A failed SQL or pub/sub backend registration returns an error instead of dropping the backend. Postgres and DuckGres connect errors no longer call
std.process.exit(1). - The per-message arena leak is fixed. Hook functions now free their arena on success. Payloads kept past the hook are no longer valid.
- SQS and GCP consumer threads are joined before their state is freed. Context cleanup runs per request, though the SQL rollback in it is currently commented out.
Security and audit fixes
- Basic auth parses safely. Credentials split on the first colon, so passwords can contain colons. A colon-less credential returns
InvalidCredentials.AUTH_KEYSentries are trimmed and allocated at their exact length. - API keys in KV are compared in constant time, and only an exact value match authenticates.
- JWT claims are copied into the request allocator, and an error path no longer destroys the wrong object.
- MySQL sets
NO_BACKSLASH_ESCAPESon every connection before the first query. The client escapes single quotes only, so a backslash stays ordinary data. - SigV4 signs without silent fallbacks. Signing-key allocation errors propagate, the payload hash is copied instead of pointing at a stack buffer, and SQS builds JSON bodies with
std.json. Retry-Aftermath is fixed. It reports the time left in the window, with a minimum of one second. The old calculation always reported one.RATE_LIMIT_TRUSTED_PROXIESis wired up. List the proxy IPs or CIDRs allowed to setX-Forwarded-For. An empty list means never trust it. See Rate Limiter.- Cron schedules are validated. Schedules need exactly five or six fields. A zero step and inverted ranges are rejected.
Architecture additions
- Named SQL and pub/sub handles.
app.addSQL(name, ds),app.addPubSub(name, ps),ctx.GetSQL(name), andctx.GetPubSub(name)are additive.ctx.SQLandctx.pubsubstill point at the default, registered under"default". See Architecture. addOutboxis available as a preview.app.addOutbox(.{ ... })registers a poll job that publishes pending rows from an outbox table. It needs a SQL datasource and a pub/sub backend. Check the branch before using it; see the caveat below.- Health checks can be registered with
app.addHealthCheckand now run against a published snapshot.
Configuration and tooling
configs/.env.exampleis new. It lists every supported key in one place, including the new health, metrics, rate-limit, and TLS keys.- SBOMs are generated for tagged releases.
scripts/gen-sbom.shwrites CycloneDX JSON, and a workflow runs it on pushes, PRs, and manual triggers. - Dockerize steps were added for a quick local look, and a minimal
zero-starterexample ships a multi-stage Dockerfile. - New examples:
zero-starter,zero-rate-limit,zero-gcs,zero-supabase, andzero-vault-pg. The Vault loader now trims inputs and retries a missing path withdata/inserted for KV v2. - A broken migration example was fixed in
zero-otel, and CI now runszig fmt --check,test-validation, and a tighter release gate.
Known discrepancies on the branch
These are places where the changelog disagrees with the code. Check the branch before you rely on them.
Kafka TLS is not on by default.
KAFKA_SECURITY_PROTOCOLstill defaults toPLAINTEXT.KAFKA_TLS_INSECURE_SKIP_VERIFYchanged fromtruetofalse, and the code passes it toenable.ssl.certificate.verification. So verification is now off by default, even though the changelog says otherwise. Set the keys explicitly.The 0.5.4 release file is missing.
CHANGELOG.mdlinksRELEASE_NOTES_0.5.4.md, but that file is not in the branch.addOutboxwon't build when an app registers it. The poll path insrc/outbox.zighas three problems:ctx.SQL.queryRows(OutboxRow, sel, args)leaves out thectxargument. The method needsqueryRows(self, ctx, Type, stmt, args).pubsub.PublishRetrying(topic, payload, opts)leaves out theioargument. The method needsPublishRetrying(self, io, subject, payload, opts)because backoff sleeps need an I/O handle.queryRowsandexecboth takecomptime stmt, but the outbox buildssel,ddl, andupdat runtime withstd.fmt.allocPrint. Zig won't accept a runtime slice in a comptime parameter.
The framework still builds, because Zig analyzes those function bodies only when the outbox cron hook is used. Treat
addOutboxas preview until the poll path is rewritten.The v0.5.4 Dockerfile still pins Zig 0.16.0 in
examples/zero-basic/Dockerfile.multi-stage, and the Helm chart now reportsappVersion: 1.0.0.
0.5.3 (2026-10-24)
Zero 0.5.3 is the cloud-backends release. It targets Zig 0.16.0.
This release adds AWS and Google managed services, rebuilds the MySQL client on a real connection pool with TLS, keeps outbound connections honest (websocket client, circuit breakers), and raises test coverage to 90% with a kcov pipeline that actually reports.
Breaking changes
Read these before you upgrade.
- Datasource
Interface.initsignature — if you registered a custom datasource backend,Interface.initnow also takes the circuit breaker and metricz handles. Apps that only reach datasources throughctx.SQL/ctx.NoSQL/ … are unaffected. - WebSocket OAuth token field —
wsclient.zigreadoauth.tokeninstead oftoken.access_token; outbound OAuth on the websocket client failed at connect time. Fixed in this release (pick up the fix, no action needed).
New data sources
- DGraph backs
ctx.Graphover its HTTP query/mutate API. Auto-wired from config; a mock backend covers tests. See Dgraph. - ArangoDB backs
ctx.NoSQLover HTTP. - Meilisearch got a full HTTP client (
meiliClient.zig): index documents, query, fetch and delete by id. This is the handle thectx.Searchinterface rides on. - OpenTSDB backs
ctx.Timeseriesover HTTP. - Supabase SQL — set
DB_DIALECT=supabase+SUPABASE_DB_*. Reuses the Postgres backend with SSL forced and project-scoped host/port. See Supabase. - GCS file store —
FILE_STORE_BACKEND=gcs+GCS_*. OAuth2 client-credentials, or a suppliedGCS_ACCESS_TOKENfor workload-identity setups. Supabase Storage reuses the S3 backend. See File Store.
MySQL rebuilt
The MySQL dialect is now a native client:
- Connection pool with per-request sessions. There is no shared transaction state between concurrent requests.
MYSQL_SSL_MODE=disabled|preferred|required; withMYSQL_SSL_CAthe handshake verifies the server cert and host.- Configurable pool size (
MYSQL_POOL_SIZE). - TLS identity uses RSA-OAEP from a simplified pure-Zig RSA (
src/datasource/sql/rsa.zig), unit-tested on a pinned key.
TLS (experimental)
A shared OpenSSL TLS layer (src/tls/openssl.zig), already linked for Postgres, now serves the MySQL client and the NoSQL drivers, starting with Cassandra TLS (CASSANDRA_TLS_ENABLED=true; CASSANDRA_TLS_VERIFY checks the server cert against CASSANDRA_TLS_CA, system trust store when empty). Still experimental.
Pub/Sub
- AWS SQS and GCP Pub/Sub join MQTT/Kafka/NATS/Redis behind
PUBSUB_BACKEND. SQS signs requests with a pure-Zig SigV4 (src/utils/sigv4.zig, header + query variants, shared with S3); GCP authenticates via OAuth2 client-credentials. See AWS SQS and GCP Pub/Sub. - Dispatch semantics —
pubsub/dispatch.zigintroduces aDispatchStatus. Backends acknowledge a message only when its hook succeeded, or when the message itself landed in the dead-letter queue. An unhandled failure is left for the native redelivery. (Fixes the silent socket close that surfaced asWriteFailedon reconnect.)
Outbound WebSocket client
zero-ws-client is an example that connects out to a websocket server. It spins its own thread, auto-reconnects with backoff, and self-terminates on app shutdown. zero.WebSocketClient sends text/binary frames through the same service-oauth/breaker plumbing as the HTTP client. Includes an install script for the zero binary. See WebSocket Client and Getting Started.
Security & secrets
- Vault injection — set
VAULT_ADDR+ a token or AppRole login, and everyVAULT_SECRETS_PATHmapping is merged into the process environment before datasources wire up. Credentials never live in a file or an image, and secret values are never logged. See Vault. - Distributed rate limiting (
RATE_LIMIT_STORE=memory|redis) — the limiter now keeps shared buckets when Redis is configured. See Rate Limiter. - W3C baggage propagation (
mw/baggage.zig) — the middleware parses the inbound header behind a hard member cap, handlers read/modify members viactx, and the outbound service client re-emits them downstream. - Auth hardening (security-audit remediation) — KV-stored credentials for basic/API-key auth, fixed OAuth validation, RBAC refinements, expanded authz branches behind feature flags. See Authentication.
- The outbound service client validates its OAuth flow end-to-end (Keycloak round-trip) and threads failures through the circuit breaker.
Observability & bench
- The bench harness grew a route probe and an allocation probe that write JSON reports; plus a k6 script driving the same routes.
- Fixed metric counts over-counting hits and a mixed structured/plain log output issue, so the OTel view stays consistent.
Fixes
- MySQL connect timeout — asking Zig 0.16's I/O backend for a connect timeout panicked (
netConnectIpPosiximplements no timeout); the dial no longer requests one, and a blocked connect surfaces as the usual connection error instead. - Cast fix in SQL
lastInsertIdhandling. - CLI app leak — one-shot exit runs leaked the command context.
- Migration leak — re-running migrations leaked SQL buffers.
- Gated config changes — experimental switches no longer activate silently.
- WebSocket timeout — unavailable switch case handled.
- Example configs —
.envupdates across all examples; migration dialect list extended to MySQL.
Quality
- Coverage 88.92% measured by kcov in CI (Docker image
imng/zero-kcov:0.3.4), up from 0. Zig 0.16 Debug emits DWARFv5 that kcov cannot read; the test step now builds withuse_llvmto emit a readable DWARFv4 CU. - Three test layers:
zig build test(191 tests through kcov), atest-integrationlayer (153, with a real Postgres / fakeserver-backed suites) and atest-validationlayer (3, proofs that request memory is released per request/cron/pubsub). - FakeServers for search, SQS, GCP Pub/Sub, and GCS. The cloud clients run their tests without cloud access.
- All 14 Zig deps are vendored in
zig-pkg/at Zig 0.16-compatible versions.
Soak and Gates tests
Soak & chaos testing (new): an independent pipeline runs against every commit, booting 12+ example services wired to real backends (Postgres, MySQL, SQLite, DuckDB, Cassandra, Redis, Solr, InfluxDB, RustFS/S3, some over TLS) under load, with three gates:
- Leak gate — VmRSS sampled every 10s; a leak is flagged only when growth passes both relative and absolute thresholds; passing services hold flat RSS after startup.
- Chaos gate — backend IP blackholed (iptables) for 2s under live traffic; server must survive and the data route recover.
- Functional gate — health, GraphQL query, and filestore upload→download→delete round-trips under load.
- Full per-service logs, RSS samples and thresholds published at zero-extended.
Upgrade checklist
- Install Zig 0.16.0 (the deps are vendored; no fetch needed).
- Opt into the new backends via config keys:
DB_DIALECT=supabase,FILE_STORE_BACKEND=gcs,PUBSUB_BACKEND=SQS|GCP,RATE_LIMIT_STORE=redis, or leave defaults for local behavior. - If you keep a custom datasource backend, adapt to the new
Interface.init. - MySQL users: go from
MYSQL_SSL_MODE=disabledtopreferred/requiredwithMYSQL_SSL_CA. - Re-run
zig build testand your example builds.
0.5.2 (2026-09-27)
Released as the v0.5.2 tag:
Data sources
- Cassandra rewired into a generic
ctx.NoSQLhandle — verbs now take a full CQL statement instead of collection+key args. The pure-Zig client speaks the CQL native binary protocol v4. Cassandra is now experimental; see Cassandra. - ClickHouse (experimental) — columnar OLAP over HTTP, on
ctx.SQL. See ClickHouse. - Couchbase (experimental) — document store over N1QL/HTTP, on
ctx.NoSQL. See Couchbase. - MongoDB (experimental) —
ctx.NoSQLover the OP_MSG wire protocol with SCRAM-SHA-256 auth and optional TLS. See MongoDB. - InfluxDB v3 (experimental) —
ctx.Timeseriesnow hits/api/v3/write_lp,/api/v3/query_sql, and/api/v3/configure/database. See InfluxDB.
Migrations & metrics
- NoSQL migrations — new
.nosqltarget runs CQL throughctx.NoSQL; SQL dialects now cover duckdb (SQLite-shaped DDL) and clickhouse (MergeTree). See Migrations. - Unified datasource metrics —
app_datasource_response(histogram) andapp_datasource_error_total(counter), labeled bybackend/operation/status. See Observability.
Auth & runtime
- Auth header fix — API Key / Basic auth no longer crashes on a malformed or bare header; the request is rejected with
401instead. See Authentication. zfresource module — cross-platform system-info gathering replaces direct/procreads (works on macOS too).- Stability — memory-leak fixes across the examples and a
metriczshutdown segfault fix.
v0.5.1 (2026-09-20)
Highlights of the 0.5.1 release:
- Automated migration creation - a new
zeroCLI (zig build zero) scaffolds migrations withzero migrator add --name <name>, generatingsrc/migrations/<name>.zigand auto-regeneratingsrc/migrations/all.zig. See Migrations. - Experimental OpenTelemetry — opt-in traces and logs over OTLP HTTP/protobuf, default-targeting the rootPrint OSS collector (any OTLP HTTP collector works). Automatic server spans,
traceparentpropagation, and astd.log→ OTel logs bridge. See OpenTelemetry. - RBAC limited via JSON config, remote log-level retrieval format revisited.
- HTTP server tuning — new knobs:
ZERO_HTTP_WORKERS(I/O workers),ZERO_HTTP_THREAD_POOL_COUNT(handler threads),ZERO_HTTP_MAX_BODY_SIZE(413 on overflow), andZERO_KEEPALIVE_TIMEOUT_MS(idle keep-alive now defaults to 60s). Inbound concurrency is now bulkhead-capped at 1024 by default. See Configuration. - Postgres pool tuning —
PG_POOL_SIZEandPG_POOL_ACQUIRE_TIMEOUT_MS. See Configuration. - Bootstrap arena —
ZERO_FRAMEWORK_MEM_SIZEsizes a fixed bootstrap allocator for early / short-lived allocations. See Configuration. - OAuth hardening —
OAUTH_AUDIENCE/OAUTH_ISSUERenforce the JWTaud/issclaims when set. See Configuration. - Health & startup probe — new
GET /.well-known/startupendpoint plusapp.addHealthCheck(...), per-check timeout viaHEALTH_CHECK_TIMEOUT_MS. See Container.
v0.5.0 (2026-09-14)
The 0.16 baseline.
std.Ioinjection threaded throughApp → container → Context, enabling the new pluggable I/O layer.- New data layers: DuckDB, NoSQL via Cassandra, Time Series via InfluxDB, Search via Solr.
- Per-service circuit breaker, rate limiter, and outbound auth for HTTP clients.
- SQL handler API refresh for ergonomics.
- Interface dispatch for datasource and pubsub examples.
- Expanded metrics surface.
- Zig 0.16 support.
- 144 test blocks (unit + integration + validation).
v0.0.3 (2026-06-03)
- Stable 0.15.2 support.
v0.0.2 (2026-05-23)
- Circuit breaker for the HTTP client.
- Custom metrics registration.
v0.0.0 (2025-11-16)
Initial public surface.