Releases: peterfriese/system-one-foundation-models
Releases · peterfriese/system-one-foundation-models
Release list
v0.2.0 - System One Decision Models & Swift 6.1 Traits
Added
-
Repository and Package Rename (
SystemOneFoundationModels):- Renamed the repository from
jev-foundation-modelstosystem-one-foundation-modelsand the core SPM package and umbrella library product toSystemOneFoundationModels. - Reflects multi-model decision support across Laya on-device Core ML (Apple Neural Engine), Laya self-hosted HTTP (
laya-serve), and hosted TypeSafe Jev cloud endpoints. - Modularized targets into focused libraries:
SystemOneCore,LayaOnDevice,LayaFoundationModels,JevFoundationModels, and the umbrellaSystemOneFoundationModels. - Updated all package dependency manifests, documentation, and Swift Package Index links.
- Renamed the repository from
-
NutritionLabelScannerReference iOS Application (Examples/NutritionLabelScannerApp/):- Added native iOS reference application showcasing real-time camera scanning and multi-backend decision modeling for nutrition safety.
- Implemented live Vision OCR text recognition with spatial 2D row-clustering tolerance (
NutritionLabelParser) to accurately reconstruct horizontal lines across multi-column tables. - Supports multilingual label parsing for European / DACH (
Nährwertdeklaration,Brennwert,Zutaten), French, and FDA / US (Nutrition Facts,Serving Size,Ingredients) standards. - Strongly-typed dietary safety evaluation via
@GenerableDietarySafetyDecisionandDietaryFlagmodels, computing allergen risk (0–3) and NOVA food processing classification (0–3). - Configurable dietary restriction profiles (vegan, gluten-free, lactose-free, seed-oil-free, low sodium, sugar limits).
- Features OpenFoodFacts barcode fallback resolution, dynamic bounding box viewfinder overlays, and accessible haptic/audio feedback.
-
Ergonomic Decision Shortcuts on
LanguageModelSession(SystemOneCore/Ergonomics):- Implemented high-level ergonomic extensions on Apple's
LanguageModelSessionenabling ad-hoc queries without declaring boilerplate@Generableschema types:-
session.probability(of:state:criteria:): Direct truth probability evaluation ($0.0 \dots 1.0$ ) for statements against state with optional criteria guidance. -
session.choice(_:from:state:): Strongly-typed categorical selection across cases of any Swift enum conforming toChoosable. -
session.choice(_:options:state:): Categorical selection among dynamic runtime string arrays. -
session.score(_:levels:state:): Ordinal rubric scoring returning discrete winner indices and continuous probability-weighted mean scores.
-
- Introduced the
Choosableprotocol (CaseIterable & Hashable & Sendable) with automatic default identifiers and optional natural-language option descriptions. - Introduced
Choice<Option>container encapsulating winning value, calibrated confidence score, and candidate probability distribution. - Introduced
ScoreResultcontainer encapsulating continuous expected value, winning level index, level label, and complete rubric probability distribution. - Implemented
DynamicDecisionSchemafor runtime generation ofGenerationSchemainstances, ensuring ad-hoc queries undergo standard schema translation and retain backend parity acrossLayaCoreMLEngine,LayaHTTPBackend,JevBackend, andMockSystemOneBackend.
- Implemented high-level ergonomic extensions on Apple's
-
Swift 6.1 Package Traits Partitioned by Model Boundaries (SE-0402 / SE-0450):
- Upgraded
Package.swifttoswift-tools-version: 6.1and adopted package traits. - Partitioned traits strictly along model boundaries matching developer intent:
-
Jev: Enables hosted TypeSafe Jev cloud decision API client (JevFoundationModels). -
Laya: Enables on-device Core ML and Apple Neural Engine execution (LayaOnDevice). -
LayaServe: Enables HTTP client for self-hosted privatelaya-serveinstances (LayaFoundationModels).
-
- Added convenient persona shorthands:
-
OnDevice: Activates["Laya"]for zero-network, zero-secret local edge deployments. -
Remote: Activates["Jev", "LayaServe"]for networked clients without Core ML neural binaries. -
All: Activates["Jev", "Laya", "LayaServe"]for multi-backend showcase applications.
-
- Configured
.default(enabledTraits: ["Jev"])for seamless backwards compatibility.
- Upgraded
-
Zero-Dependency
ProxyTransportfor Mobile Reverse Proxies (JevFoundationModels):- Added
ProxyTransportconforming toJevTransportandSendableinSources/JevFoundationModels/Transport/ProxyTransport.swift. - Supports zero-trust mobile architectures routing through reverse proxies (e.g., Firebase Cloud Functions, Cloudflare Workers, AWS API Gateway) without embedding API keys in Mach-O binaries.
- Provides dynamic closure-based
Credentialresolution:-
.bearer: Dynamic OAuth 2.0 / OIDC / Firebase Auth token injection. -
.header: Named header injection (e.g.,X-Firebase-AppCheckwith Apple App Attest / DeviceCheck). -
.custom: In-place request mutations for dynamic HMAC signatures and replay nonces.
-
- Evaluates credential resolution per attempt inside the retry loop, guaranteeing fresh tokens on retries for consumable single-use or rotating credentials.
- Features jittered exponential backoff respecting RFC 9110
Retry-Afterheaders and latency telemetry viax-envoy-upstream-service-time.
- Added
-
Standalone Trait Sample Applications (
Examples/TraitSamples/):-
01-OfflineLayaApp: 100% offline document classifier usingLayaOnDeviceandChoosableenum categories (traits: ["Laya"]). -
02-CloudJevWorker: Lean ticket triage worker querying hosted Jev API with zero ML linkage (traits: ["Jev"]). -
03-PrivateLayaServer: Internal VPC cluster ordinal vulnerability scoring (ScoreResult) over private HTTP (traits: ["LayaServe"]). -
04-HybridRouter: Local-first edge execution escalating to cloud Jev when confidence falls below 0.80 (traits: ["All"]). -
05-SecureAppCheckApp: SwiftUI and CLI application utilizingProxyTransportwith hardware-backed Firebase App Check (Apple App Attest). Includes production Cloud Function reference, automated deployment wizardsetup-firebase-project.sh, andSETUP-PRODUCTION.md.
-
-
Technical Notes Expansion (0003 through 0011):
- Documented deep SDK findings, architectural designs, and platform nuances in
tech-notes/:-
Tech Note 0003 (
tech-notes/0003-foundationmodels-dynamic-profiles.md): Declarative dynamic profiles and session adaptation in Apple Foundation Models (LanguageModelSession.DynamicProfile,DynamicProfileBuilder,@SessionPropertyEntry, turn isolation). -
Tech Note 0004 (
tech-notes/0004-secure-mobile-transport-appcheck.md): Production mobile architecture securing TypeSafe credentials using Apple App Attest / DeviceCheck hardware attestation, Firebase Cloud Functions proxy, andJevTransport. -
Tech Note 0005 (
tech-notes/0005-spm-dependency-isolation-and-vendor-transports.md): SPM dependency isolation and decoupling vendor-specific transports from core targets to prevent dependency creep. -
Tech Note 0006 (
tech-notes/0006-http-resilience-and-confidence-routing.md): HTTP resilience, RFC 9110Retry-Afterparsing, exponential backoff, cooperative cancellation safety, and calibrated confidence routing for the undecided band (0.35...0.65). -
Tech Note 0007 (
tech-notes/0007-pluggable-system-one-backends-and-laya-serve.md): PluggableSystemOneBackendprotocol architecture, wire protocol parity between TypeSafe Jev/v1/systemoneand self-hostedlaya-serve, and dynamic header injection. -
Tech Note 0008 (
tech-notes/0008-on-device-coreml-decision-engine.md): On-device decision models via Core ML and Apple Neural Engine (ANE), ModernBERT/mmBERT compilation, option marker gathering, 8-bit quantization, and zero-dependency Swift tokenization. -
Tech Note 0009 (
tech-notes/0009-package-traits-and-ergonomic-shortcuts.md): Architectural analysis ofAnyDecisionModel, runtime dynamic schema synthesis (DynamicDecisionSchema), ergonomic shortcuts (.probability(),.choice(),.score()),Choosableprotocol, and model-bounded package traits. -
Tech Note 0010 (
tech-notes/0010-proxy-transport-and-dynamic-attestation.md): Zero-dependency reverse proxy transport architecture, dynamicCredentialenum (.bearer,.header,.custom), per-attempt token acquisition inside retry loops, and secret-free mobile binaries. -
Tech Note 0011 (
tech-notes/0011-xcode-27-2-json-xcproj-format.md): Adoption of Xcode 27.2+ native JSON project format (project.xcproj) replacing legacy OpenStep.pbxprojfor human and AI agent ergonomics.
-
Tech Note 0003 (
- Documented deep SDK findings, architectural designs, and platform nuances in
Fixed
- macOS Keychain Password Prompts in
KeychainService.swift:- Eliminated legacy macOS keychain queries (
SecItemCopyMatching/SecItemAddwithoutkSecUseDataProtectionKeychain). - Prevents system password authorization dialogs when running un-entitled environments (CLI runners, test runners, Xcode previews, un-provisioned dev builds).
- Adopted shared in-memory fallback store with thread-safe access and reset facilities for clean, isolated test runs.
- Eliminated legacy macOS keychain queries (
v0.1.0 - Initial Preview Release
Initial Release (v0.1.0)
A lightweight, native Swift 6 bridge integrating TypeSafe AI's Jev System One decision model into Apple's Foundation Models framework.
Highlights
- Native Apple Foundation Models conformance (
LanguageModel,LanguageModelExecutor). - Automatic schema translation from
@Generablestructs/enums to Jev System One questions (noul,choice,score). - 40–150ms structured evaluations with zero hallucinations.
- First-class calibrated probabilities and confidence metrics via
response.metadata. - Offline mock transport (
MockJevTransport) for deterministic testing. - Includes sample applications:
ticket-triage-demoandduplicate-article-demo. - Hosted DocC documentation configuration via
.spi.yml.