Concepts

Processes Prototype

One application often runs as several programs: a CLI, a worker, an API. In Clamp these are processes — projections of the same blueprint, each with only what it needs.

Projection#

A process is defined by its roots, the executions it runs. Kernel walks the requirements and contributions reachable from those roots and ignores everything else.

Application blueprint
 ├── process cli     root: cli-root
 │     cli-root → greeting-command → clock → epoch
 ├── process worker  root: worker-root
 │     worker-root → clock → epoch
 │     worker-root → queue
 └── dormant         reached by no root: never validated or built

Reachability comes before initialization. A module that only the CLI uses is never validated, configured or started by the Worker.

What example 04 proves#

CaseResult
Unknown process, empty roots, undeclared root moduleStructured error naming application and process
Missing, excluded or ambiguous required providerProjection fails with consumer, capability and qualifier
Equal-precedence defaultsAmbiguity error; explicit selection overrides defaults
Optional requirement with no selected providerNothing is activated
Provider replaced by one with different dependenciesOnly the replacement's reachable subtree is included
Invalid requirement in a process you are not runningDoes not fail the projection you are running
Worker configuration absent or malformedThe CLI never reads it

Freeze#

Composition is mutable. Execution is structurally immutable.

Once a projection resolves, it is frozen into two views of the same result: a compact runtime plan and structured inspection metadata. A compile-fail doc test proves the frozen plan cannot be changed structurally.

Inspection#

cargo run --offline --locked --manifest-path examples/a4-process/Cargo.toml --example a4-process -- inspect cli

One recorded run showed the Clock path as example.process.cli-root -> example.process.greeting-command -> example.process.clock, the resolved capability and qualifier, the command-target contribution, and the Worker-only modules as unreachable. What you inspect and what runs come from the same frozen resolution.

What “process” does not mean here#

ProcessId is a logical projection, not a claim about operating-system processes. The prototype runs CLI and Worker in one in-memory host with independent state; sharing across real OS processes is not demonstrated. Crossing a process boundary will always be explicit in Clamp. Design principle