Repository navigation
Stoic 0.2.0
Pre-releaseStoic 0.2.0: the gaps an audit and a first real adopter (Lodestar, a macOS app) found, closed. Pre-1.0 — the API still changes; the changes that can break code are listed last. Requires Swift 6.4 and the 27 releases of Apple's platforms.
New primitives — Debouncer and Throttler (a dropped call is a defined rejection, never a hang); ExpiringCache with TTL, stale-while-revalidate, LRU and single-flighted loads; Broadcast with a bounded buffer per subscriber; tracing spans (withSpan, task-local Span.current, adapters to swift-log and swift-metrics); abandoningAsyncAfter for async work that never checks cancellation.
Persistence — FileLock (cross-process, cancellation and deadline aware) and an opt-in crossProcessLock for Journal and SettingsStore; AtomicFile.replaceItem for a crash-safe swap of a file or directory; the journal resyncs past mid-file damage by checksum and reports it; settings keep fields their schema does not declare and are created 0600; atomic writes keep permissions and write through symlinks; LaunchGuard no longer counts a backgrounded launch, a restart or a new build as a crash.
Schemas for API models — required fields in @Schema, built-in Date/URL/UUID/Data/Decimal, @UnknownCase for enums and tagged unions a server may extend, @Lossy arrays, @Codable for an existing Codable leaf.
HTTP — coalescing keyed on every header; per-call HTTPOverrides; one replay after a 401 through a single-flighted reauthenticate; retry decided on a response; a per-host rate limit; responses up to maxResponseBytes decode without parser limits in the way.
Apple — settled reachability (PathMonitor), BGTask work bounded by the system's expiration (BackgroundJob), Keychain secrets (SecretStore).
Fixes — supervisor heartbeats no longer report a hang after sleep; Pipeline retries timed-out attempts; TaskScope forgets finished forks and bounds forks that ignore cancellation (forkTimeout); SingleFlight escalates priority; TaskSlot clears a stale deadline; abandonment slots are reclaimed; graceful termination's deadline holds against a blocking step; cancellation through a policy is cancellation, not failure, to scopes and services.
Testing — failure-mode coverage gate (one documented row left), Thread Sanitizer in CI, simulations report escaped work, compile-fail tests.
Can break code — HTTPPolicy.varyHeaders is gone (ignoreHeadersForCoalescing replaces it); GracefulTermination's shutdown closure runs off the main actor (hop with MainActor.run); Report.description redacts the root error (debugDescription keeps it); a SchemaSuite that skipped every case now fails; LaunchGuard's state file is v2 (v1 is still read).