Architecture

Kernel Prototype

Kernel is the coordination layer. It is composed from the minimum mechanisms the selected process needs — not a monolith every application pays for.

What Kernel does today#

JobProved by
Resolve a typed capability requirement to exactly one providerexamples/a2-module, Phase 2 tests
Report missing, ambiguous, unavailable and cyclic compositions as structured errorsPhase 2 and 4 tests
Assemble contributions into domain-owned targets and report orphansexamples/a3-contribution
Project a process from its roots, including only reachable modulesexamples/a4-process
Freeze the projection into a runtime plan plus inspection metadataexamples/a4-process, compile-fail doc test

Resolution#

use rustclamp_kernel::{CapabilityRequirement, Provision, Resolver};

let provisions = [Provision::<ClockCapability>::from_module(&clock)];
let requirement = CapabilityRequirement::<ClockCapability>::from_module::<GreeterModule>();
let clock = Resolver::resolve::<ClockCapability>(
    requirement.required_by(),
    &provisions,
    requirement.selected_provider(),
)?;

Two independent composition snapshots stay independent: replacing a provider in one preserves the other. Resolution is typed end to end; there is no string-keyed or Any-based lookup.

What Kernel does not do#

  • It does not run your code. Executing work is the Runtime's job; Kernel coordinates.
  • It does not own global state. No registry, no singleton, no ambient context.
  • It does not interpret domain rules. A CLI target decides what a valid command tree is; Kernel returns the target's errors as they are.
  • It is not an entry tax. Pico applications do not depend on Kernel at all.

Honest limits#

Process projection and freeze are prototypes. There is no automatic construction of production modules yet, and a “process” is a logical projection, not an OS process. Later stages of Kernel remain experimental and their APIs will change.