You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Foundation Lab currently organizes most behavior around SwiftUI screens, view-local state, and a small number of executors. That works for the app UI, but it breaks down when we want the same functionality to be reusable from:
SwiftUI views
App Intents and App Shortcuts
a CLI
future automation or agent entry points
The earlier CLI draft and the earlier extra-package proposal showed both the need and the risk clearly:
shared task logic needs to live outside SwiftUI
thin adapters are good
extra runtime packages are overhead until reuse pressure is real
Goal
Refactor the codebase toward a capability-first architecture where each user task has one shared implementation in FoundationLabCore and multiple thin adapters:
app UI adapter
App Intents adapter
CLI adapter
Architectural rules
The core layer asks: what task is being performed?
FoundationLabCore owns shared request/result models, use cases, domain models, provider seams, and reusable Foundation Models-backed providers.
SwiftUI, App Intents, and CLI layers own navigation, presentation, command parsing, dialog handling, and output formatting.
perform() in App Intents stays thin and never owns business logic.
CLI commands stay thin and never reimplement feature logic.
No separate FoundationLabIntelligence or FoundationLabAppIntents package for now.
Multi-turn chat is explicitly second phase after bounded single-shot capabilities are stable.
Future runtime or platform changes should land behind provider boundaries rather than leak through the whole app.
Planning assumptions
As of March 15, 2026, the codebase should align with the currently public App Intents, App Shortcuts, Spotlight, and Apple Intelligence surfaces.
The shared core should stay reusable enough that later platform changes do not force whole-app rewrites.
FoundationLabCore/ROADMAP.md is the living in-repo checklist for the remaining extraction work.
Context
Foundation Lab currently organizes most behavior around SwiftUI screens, view-local state, and a small number of executors. That works for the app UI, but it breaks down when we want the same functionality to be reusable from:
The earlier CLI draft and the earlier extra-package proposal showed both the need and the risk clearly:
Goal
Refactor the codebase toward a capability-first architecture where each user task has one shared implementation in
FoundationLabCoreand multiple thin adapters:Architectural rules
FoundationLabCoreowns shared request/result models, use cases, domain models, provider seams, and reusable Foundation Models-backed providers.perform()in App Intents stays thin and never owns business logic.FoundationLabIntelligenceorFoundationLabAppIntentspackage for now.Planning assumptions
FoundationLabCore/ROADMAP.mdis the living in-repo checklist for the remaining extraction work.Issue stack
[Stack 1/9] Create FoundationLabCore package and define dependency rulesFoundationLabCoreuntil a split is justified by real dependency pressure.[Stack 3/9] Extract GenerateBookRecommendation as the first shared capability[Stack 4/9] Add the first task-oriented App Intent backed by GenerateBookRecommendation[Stack 5/9] Add a thin CLI adapter for the first shared capability[Stack 6/9] Extract AnalyzeNutrition as the second shared capability[Stack 7/9] Extract first tool capabilities and provider seams for weather and web search[Stack 8/9] Expand task-oriented App Intents with App Entities, shortcuts, and Spotlight foundations[Stack 9/9] Extract shared conversation/session core for multi-turn chat and streamingExecution guidance