Skip to content

v0.21.0 — Box Contract v21 (Per-Route Auth & Rate-Limit Overrides, Live SIGHUP CIDR Reload, Durable schedule[] Triggers & 23-Family /metrics)

Pre-release
Pre-release

Choose a tag to compare

@robertguss robertguss released this 27 Nov 15:24
· 28 commits to main since this release
ddd6bd8

Pre-1.0 release (0.21.0) — Slice 21: Box Contract v21 & Engine Contract v18 Preserved

What's New

  • Per-route auth & rateLimit overrides on listen[].routes[] (Box Contract v21 §5, §6.7, #72):
    • Optional "auth": null | <AuthObj> and "rateLimit": null | <RateLimitObj> overrides on "http" route entries (Inherit / Disabled / Override), enabling mixed-security single-port gateways (e.g., /webhooks hmac-sha256 + global rate limit, /api dual-secret bearer + per-IP rate limit, /public auth: null, rateLimit: null).
    • Anti-enumeration: enforces listener-level auth (401 Unauthorized) before 404 {"error":"not_found"} on unmatched paths without consuming rate-limit tokens or waking tts.
    • Scrubs route-level auth env/prevEnv secrets from tts run's environment with redacted Debug, doctor, and JSON logs.
  • Fail-closed SIGHUP live reload of listen[].allowCidrs & listen[].trustedProxies alongside TLS (Box Contract v21 §6.7, #72):
    • Re-reads <manifest> on SIGHUP across serve, host, and mcp (including plain HTTP/MCP/admin manifests without tls), staging active listeners' allowCidrs and trustedProxies together with any listen[].tls and http[].tls PEM files before mutating live state.
    • Atomically swaps TLS configs and per-listener CIDR policies (tts_box_reloads_total += 1, "reload" log, http_pool flush) on success; fails closed across all listeners and outbound origins on any invalid PEM/key, corrupt JSON, missing active listener, or invalid CIDR (tts_box_reload_failures_total += 1, "reload_error" log).
  • Manifest-declared durable recurring schedule[] triggers & headless tts-box serve (Box Contract v21 §5, §6.1, §6.2, §6.8, §6.9, #73):
    • Optional top-level schedule (0..=64 entries {"name":"<id>","to":"<process>","everyMs":50..=86400000,"startImmediately"?:bool}) delivering monotonic 1-based {"from":"schedule","name":"<name>","tick":<n>} envelopes single-flight to static processes targets.
    • Persists schedule:<name> -> max_tick in wal_meta atomically within SQLite WAL turn transactions so monotonic tick continuity survives SIGKILL, online limits.compactEvery, offline wal compact, wal backup, wal verify, and replay.
    • Enables headless tts-box serve worker daemons (listen: [] + non-empty schedule) with graceful SIGTERM/SIGINT drain.
  • 23-family Prometheus /metrics (tts_box_schedule_ticks_total) & "schedule_tick" JSON logs (Box Contract v21 §7.3, #73).
  • Reproducible --release --locked benchmarks, verbatim Box Contract v21 sync & CI gates (#74):
    • Synced contract/boxes.md (Box Contract v21) verbatim from trusted-ts-checks (dbc81df3dfc1b48e2cfffcce3b915c0753bed9e0, Engine Contract v18 preserved).
    • Measured benchmarks in docs/benchmarks-v0.21.0.md.

Verification Summary (ddd6bd82)

  • Guardrails: 41 VM opcodes preserved, 0 new Cargo dependencies, 0 .config/architecture.toml cap increases (49,854 / 50,500 core token-lines, 646 headroom, 0 policy/stage violations), 0 edits to crates/tts-engine/src/runtime/.
  • Quality & Coverage: cargo fmt, clippy -D warnings, cargo doc -D warnings, 302/302 workspace & doc tests, 91.07% workspace line coverage (--fail-under-lines 90).
  • Formal Proofs: Verus 143 (0 errors), Lean 4 0 sorryAx, Kani 15/15, @tsmodel 6/6 (167,600 states).
  • External Conformance (trusted-ts-checks @ dbc81df3, slices/21/conformance.mjs):
    • Positive (v0.21.0 --release --locked): 39 / 39 PASS (exit 0).
    • Negative control (v0.20.0 --release --locked): 36 / 39 (exit 1 — fails only 6o, 6p, 6q).

Pull Requests

  • robertguss/trusted-ts-checks#43 (dbc81df3) — Box Contract v21 & 39-check Slice 21 conformance
  • robertguss/trusted-ts#72 (06d2f579) — Per-route auth & rateLimit overrides + fail-closed SIGHUP CIDR reload
  • robertguss/trusted-ts#73 (77192fac) — Durable schedule[] triggers, headless serve, "schedule_tick" logs & 23-family /metrics
  • robertguss/trusted-ts#74 (ddd6bd82) — Verbatim Box Contract v21 sync, v0.21.0 bump, benchmarks, CI & docs