Framework

A sealed, contract-first modular runtime for native Apple development.

Forsetti is not a convention or a pattern library. It is a runtime framework that enforces modular architecture boundaries at every layer — from module discovery through activation to UI contribution.

Architecture

How Forsetti Works

The framework operates as a layered runtime pipeline. Each stage enforces specific guarantees before the next stage begins.

1

Discovery

The runtime scans for available modules and reads their manifest declarations. Each module declares its identity, version, platform requirements, dependencies, and capabilities through a structured contract.

2

Validation

Every discovered module undergoes compatibility validation. The runtime checks platform version constraints, dependency resolution, contract conformance, and host compatibility. Modules that fail validation are rejected before any code executes.

3

Entitlement Check

Validated modules are checked against the current entitlement state. Modules declare required entitlements, and the runtime enforces access policy. A module without its required entitlements remains discovered but inactive.

4

Activation

Modules that pass all checks are activated in dependency order. The runtime manages the full activation lifecycle — initialization, dependency injection, service registration, and readiness signaling.

5

UI Contribution

Active modules contribute SwiftUI views to host-defined extension points. The contribution model is structured — modules declare what they contribute, the host defines where contributions appear, and the runtime mediates the connection.

Principles

Design Principles

Native-First

Built entirely on Swift and SwiftUI. No bridging layers, no cross-platform abstractions, no serialization overhead. Forsetti is a native Apple framework that integrates directly with the platform toolchain — Xcode, Swift Package Manager, and Apple developer workflows.

Contract-First

Every module interaction is defined by explicit contracts. Modules declare capabilities, requirements, and contributions through typed protocol conformance. There are no implicit couplings, no service locator patterns, and no runtime type casting.

Boundary-First

Architecture boundaries are enforced by the runtime, not by convention. Modules cannot reach across boundaries without going through defined extension points. The framework is sealed — there are no backdoors, no escape hatches, and no public internals.

Policy-First

Activation is governed by policy, not just availability. The entitlement system provides fine-grained control over what modules can run, when they activate, and what capabilities they receive. This enables licensing, feature gating, and access control at the runtime level.

Validation-First

Compatibility is verified before activation, not discovered through runtime failures. Modules undergo structured validation against host requirements, platform constraints, and dependency contracts. Incompatible modules are cleanly rejected with structured error reporting.

Composition-First

Applications are composed from independent modules, not built as monoliths. Each module is a self-contained unit with its own lifecycle, and the runtime orchestrates their composition into a coherent application experience.

Runtime

Runtime Architecture

The Forsetti runtime is structured as a set of cooperating subsystems, each responsible for a specific phase of the module lifecycle.

Discovery Engine

Scans for module bundles, reads manifest declarations, and builds the module catalog. Supports automatic discovery from configured search paths and explicit registration.

Validation Pipeline

Executes a chain of validators against each discovered module. Checks include platform compatibility, dependency resolution, contract conformance, and host version requirements.

Entitlement Authority

Manages entitlement state and evaluates module access policies. Provides a typed API for querying, granting, and revoking entitlements at runtime.

Activation Orchestrator

Coordinates module activation in dependency order. Manages the full lifecycle — initialization, service registration, readiness signaling, and graceful deactivation.

Contribution Registry

Collects and organizes UI contributions from active modules. Maps contributions to host-defined extension points and manages contribution ordering and priority.

Host Integration Layer

Provides the interface between the runtime and the host application. The host configures the runtime, defines extension points, and receives composed UI contributions through a typed Swift API.

Platform

Platform Support

iOS

Full support for iOS applications. Build modular iPhone and iPad applications with structured UI contribution through SwiftUI and UIKit integration points.

macOS

Native macOS support for desktop applications. Compose multi-window, menu-bar, and sidebar-driven applications from independent modules with AppKit and SwiftUI.

Swift & Xcode

Designed for the Swift ecosystem. Works with Swift Package Manager, integrates with Xcode project workflows, and leverages Swift type system for contract enforcement.

Explore the module system.

Learn how modules are structured, how contracts are defined, and how the runtime manages the full module lifecycle.