Skip to content

Release 0.0.3 - #2

Merged
JakubMrozek merged 2 commits into
mainfrom
release/0.0.3
May 16, 2026
Merged

JakubMrozek merged 2 commits into
mainfrom
release/0.0.3

Conversation

@JakubMrozek

Copy link
Copy Markdown
Member

Summary

Cuts KontextKit 0.0.3 with one new provider.

InstallIdProvider (new)

Per-app-install identifier returned as a UUID v7 string. Persisted in UserDefaults under "kontextso.installId":

  • Generated on first getOrCreate() call. SecRandomCopyBytes for the random bits; arc4random_buf fallback for the documented-never-fail-but-still-belt-and-braces case.
  • Stored value is validated against the canonical UUID shape (8-4-4-4-12 hex) on read. Malformed values — accidental corruption, partial UserDefaults migration, a future SDK changing the format — are overwritten with a fresh ID so the SDK never ships garbage upstream.
  • Validator is intentionally version-agnostic so a future generator change (e.g. v8) doesn't invalidate IDs already on disk.
  • defaults: UserDefaults = .standard is dependency-injected purely for tests — production calls use the default.

Stable across app launches and conversations; resets only when the user uninstalls / clears app data.

Why?

Sibling iOS SDKs (sdk-swift, sdk-react-native, sdk-flutter) attach this on every /init, /preload, /error, and /debug request so the ad server can key pacing, frequency caps, and per-install diagnostics to a stable identity independent of conversationId or userId. Web SDKs (sdk-js, sdk-react, sdk-vue) use the same kontextso:installId key shape under localStorage so wire shape is consistent cross-platform.

Test plan

  • xcodebuild test -scheme KontextKit -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=latest,arch=arm64' -skipPackagePluginValidation — green
  • Hand-test against sdk-swift Example (Package.swift swapped to local path) — installId appears on every preload body and is stable across app relaunches
  • pod lib lint KontextKit.podspec --allow-warnings --use-libraries
  • After merge: tag 0.0.3, GitHub release, pod trunk push KontextKit.podspec --allow-warnings --use-libraries

🤖 Generated with Claude Code

JakubMrozek and others added 2 commits May 16, 2026 18:36
- Add InstallIdProvider: per-app-install UUID v7 persisted in UserDefaults
  ("kontextso.installId"). Generated on first call, validated against the
  canonical UUID shape on read (overwrites on corruption), stable across
  launches and conversations until uninstall / app-data clear.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sion

`#/.../#` Swift Regex literal requires iOS 16 at runtime; KontextKit's
deployment target is iOS 14, so CI's strict availability check failed.
`String.range(of:options:.regularExpression)` is iOS-4-vintage and
produces the same match check.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JakubMrozek
JakubMrozek merged commit c048cc1 into main May 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant