Minimal Protocol
The minimal public example creates a source tube, creates a target tube, and transfers 5uL from source to target.
Source file:
examples/minimal/public_minimal.culsFull Source
protocol PublicMinimal {
let source = tube(
label = "Source",
capacity = 100uL,
load = [buffer(code = "BUF01", type = "water"):10uL]
);
let target = tube(label = "Target", capacity = 100uL);
target << [source:5uL];
}Protocol Declaration
protocol PublicMinimal {
...
}A protocol is the executable unit. The CLI takes a source file, resolves its protocol declarations, and runs the entry protocol through the pipeline.
Container Binding
let source = tube(...);
let target = tube(...);let binds names inside the protocol. Here, source and target are logical container references.
Source Tube
let source = tube(
label = "Source",
capacity = 100uL,
load = [buffer(code = "BUF01", type = "water"):10uL]
);This constructs a tube with:
- a display label:
"Source" - capacity:
100uL - initial material load:
10uLof a buffer content record
The buffer(...) expression identifies the material content. The load=[content:amount] entry puts that content into the tube.
Target Tube
let target = tube(label = "Target", capacity = 100uL);The target tube starts empty but has a declared capacity.
Transfer
target << [source:5uL];The << operator mutates container material state. In this example:
targetis the destination container.sourceis the source container.5uLis the transferred volume.
After execution, the runtime state reflects the transfer:
- source loses
5uLfrom its tracked buffer content. - target gains
5uLof the same tracked buffer content.
Run It
culsma run --input examples/minimal/public_minimal.culs --artifacts-dir tmp/runThe generated plan.json shows the execution plan, and run.json contains the runtime state and events.
