7. Operational Semantics (Core Atomic Runtime Effects)
7.1 State Model
Per-container state fields:
volume_uLmass_mgcomponents(component amount map)component_quantities(content_id -> {dimension, unit, value})metadata(for exampledensity_g_per_mL,carrier_kind,carrier_id,carrier_position)
Content-oriented interpretation:
componentsentries represent content-composition slices associated with logical content identities.- Content classification fields (
content_kind,content_type,content_code,content_name,attrs) are stored as metadata-linked descriptors. - Container identity and content identity are orthogonal: container says where, content says what.
Container model clarification:
- A logical container identity denotes one distinct container occurrence.
- Identity distinguishes the declaration's definition scope, the invocation occurrence that reaches it, and the declaration name within that scope.
- Repeated or nested invocation of the same declaration creates distinct identities. Distinct iterations that allocate a container also create distinct identities.
- Human-readable labels, external identifiers such as barcodes, and physical carrier metadata describe or map a container; they do not establish its logical identity.
- The representation and encoding of a logical container identity are not language semantics. They must preserve the distinctions above without exposing a particular identifier-generation scheme to authors.
- Runtime compute uses logical container identity (
container_id) as the stable state key. - Physical labware is represented as metadata mapping on that identity.
- Typical mappings are
tubeorplate+well(for plate position). - Material semantics operate on material state through
Mutation,sep, andfrac, while preserving physical mapping metadata unless operation explicitly changes it.
Execution updates these values directly and returns per-step delta.
7.1.1 Content Registry and Association Model
For content-constructor flows, runtime state is extended with:
content_registry:content_id -> {content_kind, content_type, content_code, content_name, attrs}content_bindings: author-facing content names/codes mapped to stablecontent_idcontainer_content_index:container_id -> content composition references
Rules:
DefineContentallocates stablecontent_idand registers content metadata.LoadContentassociates quantity with acontent_idin target container state.AnnotateContentupdates metadata descriptors without implicit quantity mutation.
Runtime contract:
- Content-model runtime state includes first-class
content_registry,content_bindings, andcontainer_content_indexstructures. - Container-level
componentsand metadata summaries remain present alongside those content structures.
7.2 Global Rules
- Runtime-visible material names must resolve to established bindings.
- Runtime material compute must not provision an undeclared source or increase a source quantity to satisfy an operation request.
- Insufficient source volume, mass, or cell count is a material-stage failure.
- Conservation checking is always enforced for material-mutating steps
Mutation,sep, andfrac; failures are commonly reported asMAT_CONSERVATION_VIOLATION. - Optional external inventory reconciliation is a derived result produced after runtime accounting. External stock shortage does not change runtime material state, runtime success, binding, or conservation behavior.
- Procurement, restocking, or reservation is external orchestration. It must not be represented by provisioning or topping up runtime material state.
Content constraints:
- In strict content mode,
content_kindand standardcontent_typevalues must satisfy the Chapter 6 canonical table. - Unknown content identity during load/apply is a material-stage failure, commonly reported as
MAT_CONTENT_NOT_FOUND. - Metadata conflicts on immutable content identity descriptors are material-stage failures, commonly reported as
MAT_CONTENT_METADATA_CONFLICT. - Diagnostic code definitions and stage placement are specified in Chapter 8.
7.2.1 Constructor Built-ins Runtime Semantics
AllocContainer(kind, ...):
- Allocates a logical container identity according to the container model in Section 7.1.
- Initializes empty container state with carrier metadata plus family-appropriate metadata: effective capacity metadata for volume-bearing families (
container/tube/well/chamber), and family/state metadata for non-volumesurface. - Returns container allocation in step
delta; runtime session event emission is handled by executor/session layers rather than dedicated material-compute event records.
DefineContent(kind, type, code, name, attrs):
- Allocates new
content_id. - Writes normalized content descriptors into content registry.
- Preserves
attrs.roleand other attrs as metadata; generic material transfer does not infer a new role or new canonicalkind/type. - Returns content registration in step
delta; it does not introduce a standalone content-event kind at material-compute layer.
LoadContent(container, content, amount, ...):
- Resolves
container_idandcontent_id. - Applies quantity to container content state on an explicit volume, mass, or count axis.
- A
cellsload requires normalizedbio_cellularcontent and does not by itself add bulk volume or mass. - After all constructor load items, runtime finalizes cellular material relationships. It uses explicit eligible carrier volume when present; otherwise a free count-only cellular population uses the configured default concentration to materialize an auditable implicit carrier. Adherent content retains count without an implicit carrier.
- Capacity checks use resulting physical
volume_uL, including any finalized implicit carrier. - Returns axis, amount, relationship, and assumption details in step
delta; session-level runtime events are emitted outsidematerial_compute.
AnnotateContent(content, ...):
- Resolves
content_id. - Patches metadata descriptors without quantity mutation.
- Returns annotation/update information through step
delta; no standalone material-compute event kind is required.
7.3 Mutation
Mutation(target, sources):
- Full-source items move all source material into target.
- Quantified items move the requested volume, mass, or cell count into target.
- If requested axis is unavailable but density exists (
metadata.density_g_per_mL), runtime bridges volume <-> mass. - Quantified
unit_refsources are rejected at runtime. - If a source item resolves to the same container as target, full-transfer and quantified self-transfer are treated as no-op delta rather than error.
- Missing, non-positive, or invalid density is a material-stage failure, commonly reported as
MAT_MISSING_DENSITYorMAT_INVALID_DENSITY. - Unknown bindings are material-stage failures, commonly reported as
MAT_BINDING_NOT_FOUND. - Insufficient source quantity is a material-stage failure, commonly reported as
MAT_INSUFFICIENT_VOLUME,MAT_INSUFFICIENT_MASS, orMAT_INSUFFICIENT_COUNT. - Target capacity checks are enforced after computed delta is known; overflow is commonly reported as
MAT_CONTAINER_OVERFLOW. - Diagnostic code definitions and stage placement are specified in Chapter 8.
- Volume- or mass-quantified transfer carries every component quantity by the transferred bulk ratio.
- Count-quantified transfer requires one resolvable count-bearing cellular population in a homogeneous suspension. Runtime converts the requested count to carrier volume from the recorded concentration and moves that aliquot through the ordinary volume-transfer path.
- Adherent, pellet, precipitate, or otherwise non-homogeneous material is not directly count-aliquotable without a preceding state-changing operation.
- When counted cells physically move between containers, a container-local surface association is released in the moved material. An empty destination therefore records those cells as a suspension; a preloaded destination merges that incoming state with its existing cell state. Cells remaining in the source retain their surface association. This rule does not release pellet, precipitate, bead, membrane, or cell-bound associations.
7.4 sep
sep(sample, program, bind, component_fates?, transitions?):
- Produces a fixed two-slot indexed container group.
- Splits sample material into
bind[0]andbind[1]. - Runtime retains the complete program descriptor through fate resolution; mechanism fields are not reduced to a program name before content routing.
- Dimensioned component quantities, including any compatibility-normalized unattributed detail, are authoritative. Runtime applies one validated decision and projects each output's aggregate
volume_uLandmass_mgfrom routed detail, carrier relations, and declared density. Aggregate fields MUST NOT receive an independent separation ratio. - A validated authored
component_fatesdecision has precedence. Every other scientific fate or state-transition decision is dispatched through the scientific-model extension contract. - The default material capability binding is the official built-in Rulebook provider. An explicit external provider may replace it or wrap it as a composite provider. Runtime MUST NOT append an implicit provider fallback.
- A provider returns only a typed proposal with provenance. Runtime validates request membership, output roles, bounds, allowed effects, state validity, conservation, and capacity before atomic commit.
not_applicable,failed, providerUNRESOLVED, or invalid results MUST NOT mutate material state and MUST NOT become an equal-split guess.keep_sourcealiasing is supported only forcentrifuge_program, and only one slot may alias the original source container (supernatant -> slot 0,pellet -> slot 1).- Non-centrifuge
sepprograms still return two fresh slots and ignore source aliasing at runtime surface. - Rebinding the same group name emits
BINDING_OVERWRITTENevents for changed slots. - Validated decision fractions apply independently to each component entry. Aggregate volume and mass are projected from resulting native-axis quantities. Count does not directly contribute volume; an eligible carrier relation supplies the physical volume of a count-bearing suspension.
- Physical association, accessibility, and preservation state are explicit request facts. Quantity dimension does not determine mobility.
component_fatesmaps a source content identity to both program outputs. Values may be unitless ratios or percentages, must be bounded, and must sum to 1. The referenced content must exist at runtime.- At the material-compute API boundary, compatibility input that supplies aggregate volume or mass without complete detail is converted into provenance-bearing attributed or unattributed component quantity detail. If component quantity detail already exists, supplied aggregate fields are discarded and reprojected from that detail; separation never reads or compares them.
transitionssupplies author-owned Table 3 relationship decisions for live material entries selected by ordered index or exact container-localentry_id, and for positive outputs selected by the concrete program's namespaced output-enum member. Both selector forms resolve against the same normalized, ordered, positive-quantity entry list. Runtime derives each source relation from the selected entry; the source does not repeat a textualfromstate.- Both current and target relations MUST be members of
MaterialRelation; authored targets useMaterialRelation.MEMBER, not a bare identifier. Every author-settable enum member may transition to every other author-settable member; implementations MUST NOT impose a relation-pair whitelist.UNRESOLVEDis not author-settable. - A component-bound target requires a typed component-entry association target present with positive quantity in the same output. A
freetarget clears association. Other target relations use the concrete output container association required by the runtime relationship model. - The authored transition is output-scoped, preserves component identity and quantity, and is applied before complete-candidate invariant and conservation validation. Failure leaves committed material unchanged.
Scientific capability, provider-selection, request/response, and extension rules are defined by the Scientific Model Extension Contract. The official default behavior is defined independently by the Built-in Material Separation Rulebook.
7.5 frac
frac(sample, program, bind):
- Produces an ordered indexed group with arity determined by the fractionation program.
- Order is preserved in
indexed_bindings. - Runtime requires
binsto be a positive integer-like program field. - Material is partitioned by equal-ratio splitting (
1.0 / bins) with the final slot receiving the residual remainder. - Returned partitions remain conservation-checked.
7.6 agit
agit(sample, mode, ...):
- For a single-container sample, agitation applies to that container.
- For a container group, agitation applies independently to every member in group order. Explicit and let-bound groups have identical behavior.
- Group agitation does not merge group members, transfer material between them, or change group membership or member identity.
- Agitation preserves each member's total volume, total mass, and component amounts.
- Agitation invalidates any ordered indexed-contents organization previously established for each agitated member by
seporfrac; the member is thereafter treated as mixed until a later operation establishes a new indexed organization. - Every group member must resolve to a concrete material container before group effects are applied. An unresolved member is a material binding failure as specified in Chapter 8.
7.7 Material Compute Coverage
Material compute applies state updates for:
Mutation,sep,frac, and the indexed-contents state effect ofagitAllocContainer,DefineContent,LoadContent,AnnotateContent
Operations outside this set do not change material state at the material-update layer and do not produce material diagnostics from that path. agit changes contents organization but does not change material quantities.
Observation/runtime boundary:
img/ecp/phyare executed at runtime/executor layer and write observation artifacts/bindings without material deltas.with envestablishes scoped environment context over enclosed executable steps and is not itself a direct material-update step.- An environment layer records its explicit or inferred hold/reporting targets. That target set does not restrict the lexical environment context carried by enclosed executable steps.
7.8 Conformance Boundary
Runtime and material-compute implementations must conform to the material-state semantics in this chapter. Module layout and test file names are not part of the operational semantics.
7.9 Atomic Statement Semantics
Atomic statement semantics align with the statement-first contracts in Chapter 6.
| Atomic unit | Operational effect | Material conservation scope | Return/output |
|---|---|---|---|
MutationStmt (<<) | Moves/merges material across container states | in-scope | container material delta (no required value return) |
agit | Applies agitation to one container or independently to each member of a container group; invalidates prior indexed-contents organization | no quantity transfer; contents organization is in-scope | no required value return |
WithEnvStmt | Applies scoped environment context to target containers for enclosed statements | not a direct material move | scoped environment context lifecycle |
WithConstraintStmt | Applies scoped execution requirements to enclosed statements | not a direct material move | scoped requirement context lifecycle |
stream | Produces an addressable unit-stream handle for later control-flow/readout composition | not handled by material compute | UnitStreamRef |
sep | Performs binary separation and material split into two output containers | in-scope | SepContainerGroup = [group[0], group[1]] |
frac | Performs ordered multi-fraction separation | in-scope | FractionGroup = [f0..fn-1] |
img | Records optical/image data readout | out-of-scope | DataRef |
ecp | Records electrochemical probe data readout | out-of-scope | DataRef |
phy | Records physical-sensor data readout | out-of-scope | DataRef |
Rules:
img/ecp/phyare data-producing operators andMUST NOTchange container material quantities.agitpreserves material quantities and applies its contents-organization effect independently to each grouped sample member.sepalways returns two slots in fixed order:group[0]andgroup[1]; mode-specific slot semantics are defined by the source-level contract.fracreturns an ordered group and orderMUSTbe preserved in downstream indexing.- For
centrifuge_program(..., keep_source=...),keep_sourcecontrols whether one slot aliases original container identity; othersepmechanism programs do not usekeep_source. stream,with env, andwith constraintparticipate in execution/runtime composition but are not direct material-conservation handlers.
7.10 Core Semantic Boundary
Scope: execution semantics of the core atomic statement set.
Workflow-library composition semantics and higher-level authoring templates are outside this scope.
