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
| Case | Result |
|---|---|
| Unknown process, empty roots, undeclared root module | Structured error naming application and process |
| Missing, excluded or ambiguous required provider | Projection fails with consumer, capability and qualifier |
| Equal-precedence defaults | Ambiguity error; explicit selection overrides defaults |
| Optional requirement with no selected provider | Nothing is activated |
| Provider replaced by one with different dependencies | Only the replacement's reachable subtree is included |
| Invalid requirement in a process you are not running | Does not fail the projection you are running |
| Worker configuration absent or malformed | The 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/04-process/Cargo.toml --example 04-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