Skip to content

v0.1.25.15 — audit-log retention TTL (rolls up v0.1.25.14 trace_id correlation)

Choose a tag to compare

@amavashev amavashev released this 18 Apr 23:37
· 331 commits to main since this release
f5a5773

Rolled-up release covering both v0.1.25.14 (W3C Trace Context cross-surface correlation) and v0.1.25.15 (audit-log retention TTL fix). Cumulative changelog below; per-version detail in CHANGELOG.md.


v0.1.25.15 — Fixed

  • Runtime-written audit-log entries now respect a configurable retention TTL (default 400 days). Previously, AuditRepository.log() wrote audit:log:{id} keys with no EXPIRE, so runtime-written rows persisted indefinitely until Redis eviction — silently failing to participate in the 400-day retention tier the admin plane applies to authenticated audit rows. Matches cycles-server-admin's audit.retention.authenticated.days=400. Runtime never writes the admin-plane __admin__ / __unauth__ sentinels, so a single tier suffices.

v0.1.25.15 — Added

  • audit.retention.days config (default 400, env AUDIT_RETENTION_DAYS). Set to 0 for indefinite retention (legal hold, archive-store deployments).
  • audit.sweep.cron config (default 0 0 3 * * *, env AUDIT_SWEEP_CRON). Daily @Scheduled sweep prunes stale audit:logs:{tenantId} and audit:logs:_all ZSET pointers whose target audit:log:{id} key has TTL-expired. Self-contained and idempotent — safe to run alongside admin's sweep.

v0.1.25.15 — Internal

  • AuditRepository.LOG_AUDIT_LUA now reads ARGV[4] as an optional TTL in seconds (0 or negative = no EX). Same shape as admin's script, minus the sentinel branching.

v0.1.25.14 — Added

  • W3C Trace Context correlation per cycles-protocol-v0.yaml revision 2026-04-18. Every response now carries an X-Cycles-Trace-Id header. The server accepts a traceparent (W3C version 00) or X-Cycles-Trace-Id header on inbound requests and echoes back the same trace_id; when neither is present it generates a fresh 128-bit id (32 lowercase hex). Malformed headers are silently ignored.
  • trace_id field on ErrorResponse, Event, WebhookDelivery, and AuditLogEntry bodies. Optional for wire back-compat; conformant servers populate it on every payload causally downstream of the request.
  • trace_flags (^[0-9a-f]{2}$) and traceparent_inbound_valid (boolean) on WebhookDelivery per governance-admin spec v0.1.25.28. These preserve the upstream W3C sampling decision so the events sidecar can reconstruct an outbound traceparent with the correct trace-flags byte instead of defaulting to 01.
  • SLF4J MDC now carries traceId alongside requestId for every request.
  • ReservationExpiryService mints a fresh trace_id per sweep batch so reservation.expired events emitted in the same sweep correlate to each other.

v0.1.25.14 — Internal

  • New TraceContextFilter (@Order(0)) runs before RequestIdFilter and sets the cyclesTraceId request attribute for downstream code.
  • EventEmitterService.emit(...) gains a final String traceId parameter (full-arity emitBalanceEvents(...) likewise). Three prior overloads kept as delegating wrappers (traceId = null) for source compatibility.
  • BaseController exposes protected resolveRequestId and resolveTraceId helpers.

Compatibility

  • Wire-additive only — no breaking changes for existing clients. All new fields are optional.
  • No DB migration required.
  • Backward TTL behavior: rows written before v0.1.25.15 stay un-TTL'd until Redis memory pressure evicts them; new writes get the configured TTL.