SMOODEV-2389: Mobile SDK parity — Swift sync publicValue, step clamp, typed errors#123
Merged
Merged
Conversation
…s other machines The root SPM manifest change (SMOODEV-2382, #120) committed 2302 files of .build/ module cache because .gitignore only covered swift/.build/. pcm files bake absolute module-cache paths, so any other checkout fails 'swift test' at the root manifest with 'precompiled file ... was compiled with module cache path ...' fatalError. Untrack and ignore. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LE7V35vzRiHyxBFE8wAxb4
… typed errors, Closeable The parity audit against docs/Mobile-Runtime-Mode-Spec.md and the TS/Rust SDKs found four gaps: - Swift SmooConfig was an actor, so publicValue(forKey:) required await — violating spec row 2 (boot config resolves synchronously, offline). Now a lock-guarded final class, the structural twin of Kotlin's @Volatile/@synchronized. Async evaluate paths are unchanged for callers. - evaluateLimit in both SDKs clamped to [min,max] but skipped step snapping, so a step-defined limit resolved differently on mobile than TS clampLimit / Rust clamp_limit (ADR-066). step now snaps to the nearest multiple BEFORE the clamp, same order as the references. - Evaluate failures collapsed to a bare status int. Both SDKs now throw the typed hierarchy (flag/limit × notFound/context/evaluation) carrying the key, mirroring TS FeatureFlagEvaluationError et al. - Kotlin's Ktor HttpClient leaked; SmooConfig is now Closeable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LE7V35vzRiHyxBFE8wAxb4
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Swift/Kotlin mobile SDKs (ADR-074,
docs/Mobile-Runtime-Mode-Spec.md) shipped as twins, but a parity audit against the spec and the TS/Rust SDKs found four gaps:publicValue(forKey:)requiredawait—SmooConfigwas an actor, so the boot-config read was actor-isolated, violating spec row 2 (resolves synchronously, offline). The Kotlin twin was correctly synchronous.stepsnapping missing from limit clamping in both SDKs — a step-defined limit resolved differently on mobile than TSclampLimit/ Rustclamp_limit(ADR-066).HttpClient— never closed.Solution
SmooConfig: actor → lock-guardedfinal class(the structural twin of Kotlin's@Volatile/@Synchronized).publicValueis now synchronous; async evaluate paths unchanged for callers.evaluateLimitin both SDKs gainsstep— snaps to the nearest multiple before the[min, max]clamp, same order as the TS/Rust references.featureFlagNotFound/featureFlagContext/featureFlagEvaluation+limit*), Kotlin exception hierarchy (FeatureFlagNotFoundExceptionet al. extendingSmooConfigException).SmooConfigimplementsCloseable..build/SPM module cache (.gitignoreonly coveredswift/.build/). pcm files bake absolute module-cache paths, soswift testat the root manifest fatal-errors on any other machine. Untracked + ignored.Verification
swift test— 9/9 green at both the root manifest (CI's entry point) andswift/kotlin && ./gradlew test— 10/10 greenawaitonpublicValue), step-snaps-before-clamp (both), typed 404/400/5xx errors with key (both), Kotlinclose()Jira: SMOODEV-2389 · Pearl th-7e81f2 · Follow-up: bump the SPM
revision+ JitPack coordinate pins in theSMOODEV-2382-mobile-config-wiringbranch (apps/mobile) once this lands.🤖 Generated with Claude Code
https://claude.ai/code/session_01LE7V35vzRiHyxBFE8wAxb4