What's Changed
Fire-and-forget daemon protocol
- Upload and prefetch requests write to the kernel socket buffer and close immediately — no waiting for a response
- Eliminates read-timeout failures when the daemon's Tokio runtime is saturated during S3 key-cache population at startup
Client-epoch auto-restart
- Upload and BuildStarted requests carry
client_epoch(binary mtime) - Daemon detects when client binary is newer and schedules graceful shutdown for restart
- Replaces the stats-request-based version check that added an extra round-trip prone to timeouts
BFS prefetch ordering
- Wrapper uses
cargo metadatawith full dependency graph, then Kahn's algorithm for topological sort - Crate names emitted in compilation order (leaves first) so daemon prefetches what cargo needs soonest
- S3KeyCache reverse index (crate_name → cache keys) enables prefetch on cold CI runners
- Session timeout increased from 30s to 120s to reduce redundant build-started triggers
Dual-layer logging
- Stderr layer (
KACHE_LOG, default warn) for build output - File layer (
KACHE_LOG_FILE, default info) at~/Library/Logs/kache/kache.log(macOS) or<cache_dir>/kache.log(Linux) kache daemon logandkache daemon statusshow diagnostic log path
Additional hardening
- Structured tracing fields on upload path for observability
- Daemon exits cleanly when another instance is already running (prevents launchd restart loops)
- Prefetch cancellation properly drains all remaining keys from the downloading set