Changelog
On this page
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
[Unreleased]
[0.3.1] - 2026-11-21
Changed
Building ztick now requires Zig 0.17.1. The build generates OpenSSL bindings with translate-c and uses the official OpenTelemetry Zig SDK for OTLP exports.
Zig 0.16.0 migration (F024) — Bumped
minimum_zig_versionto0.16.0and migrated the codebase off deprecated 0.15 APIs. Adopted the Juicy Main signature (pub fn main(init: std.process.Init) !void) and routedinit.minimal.argsthroughcli.zig(replacingstd.process.argsAlloc/argsFree). Replaced@Type(.enum_literal)with the@EnumLiteralbuiltin. Migratedstd.io/std.fs/std.netreferences to thestd.Ionamespace (includingstd.Io.Reader.fixed/std.Io.Writer.fixedin place of the removedstd.io.fixedBufferStream) andstd.time.Instant/Timertostd.Io.Clock.Timestamp—iois stored onClockto preserve allocation-free per-tick semantics. Bumpedzig-o11y/opentelemetry-sdkto v0.2.0 and switchedsam701/zig-clito thezig-0.15branch hash compatible with 0.16. TCP/HTTP protocols, persistence framing, and OTLP export are unchanged.
[0.3.0] - 2026-05-13
Changed
- Hexagonal architecture refactoring — Extracted persistence codec from infrastructure to application layer (
persistence_codec.zig), introduced vtable-basedPersistencePortinterface to decouple the scheduler from concrete backends, and madeSchedulergeneric viaSchedulerWith(comptime Backend: type). Promoted domain types (timestamp.zig,shell_config.zig,telemetry_config.zig) and OTel instruments (instruments.zig) out of infrastructure into their proper layers. Extracted shared subprocess logic intorunner/subprocess.zig.
[0.2.0] - 2026-05-11
Added
- Thread-per-connection HTTP concurrency (F022) — HTTP server now spawns a detached thread per accepted connection so multiple clients can issue requests simultaneously without blocking the accept loop. An
active_connectionsatomic counter andjoin_all()with 5-second polling timeout enable graceful shutdown that drains in-flight requests before process exit. - Channel batch drain —
Channel.drain()batch-consumes all pending requests in a single lock/unlock cycle, reducing lock contention from per-message to per-tick under concurrent TCP workers. - Event-driven database tick —
Clocknow uses condition-variabletimedWait()instead of unconditionalThread.sleep(), waking the database thread immediately when a request arrives. Cuts single-worker p50 latency from ~2 ms to sub-millisecond.
Changed
- Priority queue for job storage (F021) —
JobStoragereplaced sortedArrayListwithstd.PriorityQueuefor O(log n) job insertion, eliminating linear scan overhead as the scheduled job count grows. - Normalized public API naming to
snake_case(setInstruments→set_instruments,setStatContext→set_stat_context) and private HTTP helpers (toEpochSeconds→to_epoch_seconds,isLeapYear→is_leap_year). - Query channel capacity expanded from 64 to 1024.
- Forced LLVM backend for all build targets to work around a glibc 2.43+
.sframerelocation incompatibility with Zig’s self-hosted linker (ziglang/zig#31272).
Fixed
- HTTP server returned
405 Method Not Allowedinstead of404 Not Foundfor unmatched rule routes. - AWF runner arg-freeing logic now uses index-based iteration to avoid use-after-free.
[0.1.0] - 2026-04-27
Initial release of ztick, a time-based job scheduler written in Zig with hexagonal architecture.
Added
- Redis runner (F020) — Hand-rolled, stdlib-only RESP2 codec (
src/infrastructure/redis/resp.zig) and Redis adapter (src/infrastructure/runner/redis.zig) issuingPUBLISH,RPUSH,LPUSH, orSETcommands per matching job. Rules with runner typeredisnow dispatch to a Redis server; allowed commands are validated case-sensitively atRULE SETparse time so unsupported commands (e.g.FLUSHALL) are rejected before persistence. URL formatredis://[user[:password]@]host[:port][/db];rediss://is rejected at parse time and TLS deferred (see ADR-0006). Each execution opens a fresh TCP connection, optionally sendsAUTH(single-arg or ACL two-arg form) thenSELECT <db>whendb != 0, sends the configured command with the job identifier as the value/payload, then closes — fire-and-forget, no pooling. URL credentials are redacted at every log site (NFR-002).PUBLISHwith zero subscribers is treated as success (matchesredis-clidefaults); RESP error replies, connection refused, malformed URLs, and slow brokers all returnsuccess = falsewithout crashing the processor; 30 sSO_RCVTIMEO/SO_SNDTIMEOcaps slow-broker exposure. Persistence uses discriminant byte5(the next available value after0=shell,1=amqp,2=direct,3=awf,4=http); existing logfiles are unaffected. Bundledcompose.yamlboots aredis:7-alpineservice bound to127.0.0.1:6379. Optional broker-dependent integration tests are gated by a new-Dredis-integrationbuild flag. ADR-0006 documents the design decisions. - AMQP runner (F019) — Hand-rolled, stdlib-only AMQP 0-9-1 publisher in
src/infrastructure/amqp_runner.zig. Rules with runner typeamqpnow actually publish to a broker on match (previously returnederror.UnsupportedRunner). Each execution opens a fresh TCP connection, runs the full handshake (Start/StartOk → Tune/TuneOk → Open/OpenOk → Channel.Open → Basic.Publish → Channel.Close → Connection.Close), then closes — fire-and-forget, no publisher confirms. The message body is the job identifier as a u128 hex string. DSN credentials are redacted at every log site (NFR-002). Plaintext only —amqps://is rejected at parse time and TLS deferred (see ADR-0005). Connection refused, authentication rejection (server-initiatedConnection.Closewith reply-code 403), malformed DSNs, and slow brokers all returnsuccess = falsewithout crashing the processor; 30 sSO_RCVTIMEO/SO_SNDTIMEOcaps slow-broker exposure. Bundledcompose.yamlboots a RabbitMQ 4.3 dev stack with the management UI on:15672. Optional broker-dependent integration tests are gated by a new-Damqp-integrationbuild flag. ADR-0005 documents the design decisions. - STAT command with authentication wiring (F018) — Server health metrics query with 15 key-value metrics (uptime, connection count, job/rule counts, execution pipeline state, persistence backend, compression status, auth/TLS configuration). STAT reports
auth_enabledbased on server configuration and requires authentication whenauth_fileis configured. STAT is namespace-independent — any authenticated client can call it regardless of token scope. - Core scheduler with three-thread architecture (controller, database, processor) and bounded FIFO channels for inter-thread communication
- TCP protocol — line-based text protocol on
127.0.0.1:5678with request/response routing and quoted string supportSET— schedule a job at a given timestampGET— retrieve a single job by IDQUERY— prefix-based job lookup with multi-line responseREMOVE— delete a job by IDRULE SET— create a recurring rule with runner typeREMOVERULE— delete a rule by IDLISTRULES— list all configured rules
- Persistence — append-only logfile with 4-byte length-prefixed binary framing, supporting jobs, rules, and removal entries
- In-memory persistence backend — alternative to logfile for ephemeral
workloads, selectable via
persistence = "memory"in config - Background compression — scheduled deduplication of logfile entries with atomic rename, clock regression guard, and configurable interval
- Shell runner — execute shell commands on job trigger
- TLS encryption — optional TLS 1.3 via system OpenSSL with
tls_certandtls_keyconfiguration (ADR-0003) - Logfile dump command — offline inspection with text, JSON, and compact output modes, plus follow (tail) mode with signal handling
- Startup logging — configurable log levels (off, error, warn, info, debug, trace) with data restoration and connection lifecycle logging
- OpenTelemetry instrumentation — distributed tracing and metrics via
OTLP/HTTP using zig-o11y/opentelemetry-sdk (ADR-0004)
ztick.requestspans with server span kind, command type, request ID, and success attributesservice.nameandservice.versionresource attributes via customResourceAwareOTLPExporter
- Configuration — custom TOML parser with sections for
[log],[controller],[database], and[telemetry] - Hexagonal architecture — four strict layers (domain, application, infrastructure, interfaces) with barrel exports
- Comprehensive documentation — ADRs, user guides, reference docs, tutorials, and example configurations
- Functional test suite — integration tests covering all protocol commands, persistence backends, TLS, dump modes, compression, and telemetry