Stdlib Portals
Version: v0.1
Last Updated: 2026-05-10
Distribution and resolution rules:
- The stdlib is distributed as bundled Culsma source.
- Frontend resolution injects the bundled stdlib before component expansion unless the caller explicitly disables bundled stdlib loading.
- Stdlib workflow truth is expressed by bundled Culsma source, not by portal-specific compiler/runtime expansion rules.
Boundary:
- Core language execution truth remains:
<<with envwith constraintrepeat / if / break / continuesep / frac / img / ecp / phy / stream- constructor/init path
- Stdlib portals are upper-layer workflow APIs that lower to the core forms above.
- The bundled stdlib defines runnable workflow skeletons; it is not a complete biological simulation library.
- Legacy portals may remain documented for continuity, but they are not part of the stdlib target set.
SP.1 Stdlib Set
| Portal | Availability | Source shape | Return policy | Lowering summary |
|---|---|---|---|---|
Incubate | supported | Incubate(sample=..., temp=..., duration=...) | returns sample; statement-form may discard | with env(...) { hold(sample); } |
Lyse | supported | Lyse(sample=..., buffer=..., duration=..., temp=...) | returns sample; statement-form may discard | with env + << [buffer] + sep(program=disrupt_program(...)) + << [lysate] |
ExtractDNAPrecipitation | supported | ExtractDNAPrecipitation(sample=..., precip_buffer=..., wash_inputs=[...], dissolve_buffer=..., output=..., cleanup_temp=..., cleanup_duration=...) | returns output; statement-form may discard | precipitation skeleton over << + sep(program=centrifuge_program(...)) + with env |
ExtractDNAColumn | supported | ExtractDNAColumn(sample=..., bind_buffer=..., wash_inputs=[...], elution_buffer=..., column=..., waste=..., output=..., cleanup_temp=..., cleanup_duration=...) | returns output; statement-form may discard | column skeleton over << + sep(program=filtration_program(...)) + with env |
PCR | supported | PCR(sample=..., primers=..., cycles=..., annealing_temp=...) | returns sample; statement-form may discard | reaction workflow template over repeat + schedule + with env(thermal_program) |
Electrophoresis | supported | Electrophoresis(sample=..., gel_type=..., stain=..., voltage=..., duration=..., readout_schema=...) | returns final data_ref; statement-form may discard | sep(program=field_program(voltage=...)) + << [stain] + img(quantity=customized, schema_ref=...) |
Global rules:
- Stdlib authoring supports both let-bound and statement-form component calls.
- statement-form stdlib call discards the component return value.
- Stdlib portals MUST lower to core language contracts; they MUST NOT introduce a second execution semantics.
SP.2 Portal Contracts
SP.2.1 Incubate
Signature:
culs
Incubate(sample = tube_a, temp = 37C, duration = 30min);Contract:
sample: target container.temp: scalar temperature orthermal_program(...).duration: required for the scalar-thermalIncubateportal because it lowers to a pure environment hold; forbidden whentempis athermal_program(...).- Canonical lowering target is
with env(...) { hold(sample); }; baresampleis content-facing inHoldTargetposition. Incubate(...)returns the target sample/container reference.
SP.2.2 Lyse
Signature:
culs
Lyse(sample = sample_tube, buffer = lysis_input, duration = 10min, temp = 4C);Contract:
sample: input sample container.buffer: single-use actual lysis input container/aliquot for this step; default semantics add the whole provided input.duration: lysis duration; the lysis workflow also passes this value todisrupt_program(...).temp: lysis temperature.- Lowering target:
with env(thermal=temp, duration=duration) {sample << [buffer]let lyse_group = sep(sample=sample, program=disrupt_program(...));sample << [lyse_group[0]]}
- The stdlib workflow does not materialize implicit alias names such as
Lysate. Lyse(...)returns the lysis target/sample reference.
SP.2.3 ExtractDNAPrecipitation
Signature:
culs
ExtractDNAPrecipitation(
sample = lysate,
precip_buffer = precip_input,
wash_inputs = [wash_1, wash_2],
dissolve_buffer = dissolve_input,
output = dna_out,
cleanup_temp = 25C,
cleanup_duration = 3min
);Contract:
sample: lysate/sample container to extract from.precip_buffer: single-use precipitation reagent input.wash_inputs: ordered list of single-use wash inputs; list length determines wash rounds.dissolve_buffer: single-use dissolve/resuspension input.output: target output container.cleanup_temp/cleanup_duration: cleanup incubation before re-clarification.- Lowering target is precipitation-specific
<< + sep(program=centrifuge_program(...)) + with env. ExtractDNAPrecipitation(...)returnsoutput.
SP.2.4 ExtractDNAColumn
Signature:
culs
ExtractDNAColumn(
sample = lysate,
bind_buffer = bind_input,
wash_inputs = [wash_1, wash_2],
elution_buffer = elution_input,
column = spin_column,
waste = waste_tube,
output = dna_out,
cleanup_temp = 25C,
cleanup_duration = 2min
);Contract:
sample: lysate/sample container.bind_buffer: single-use binding input.wash_inputs: ordered list of single-use wash inputs; list length determines wash rounds.elution_buffer: single-use elution input.column: work container used as column/stage carrier.waste: waste collection container.output: final eluate container.cleanup_temp/cleanup_duration: elution incubation before final filtration.- Lowering target is column-specific
<< + sep(program=filtration_program(...)) + with env. ExtractDNAColumn(...)returnsoutput.
SP.2.5 PCR
Signature:
culs
PCR(sample = pcr_well, primers = "Panel_12Plex", cycles = 35, annealing_temp = 60C);Contract:
sample: reaction container.primers: stdlib workflow contract field; it is not interpreted as a natural-result simulation input.cycles: cycle count used to build repeated thermal workflow.annealing_temp: annealing segment temperature.- Lowering target:
repeat cycle in schedule(start=1, end=cycles, step=1) { ... }- repeated single-segment
thermal_program(from=..., duration=...) with env(thermal=thermal_program(...)) { hold(sample); }
PCRsemantics are workflow-only. They do not imply natural amplification simulation, hidden product objects, or implicit material multiplication.PCR(...)returns the reaction/sample container reference.
SP.2.6 Electrophoresis
Signature:
culs
let gel_obs = Electrophoresis(
sample = gel_lane,
gel_type = "Agarose_1.5pct",
stain = stain_input,
voltage = 100V,
duration = 30min,
readout_schema = gel_obs_schema
);Contract:
sample: already-loaded gel lane/container.gel_type: gel chemistry/type descriptor retained for workflow audit.stain: single-use actual stain input for this run.voltage: electrophoresis voltage setpoint (Q[ElectricPotential]).duration: run duration.readout_schema: explicit structure declaration used for final image/data readout.- let-bound stdlib
Electrophoresis(...)returns the finaldata_reffrom loweredimg(...). - statement-form stdlib
Electrophoresis(...)is also allowed; it performs the same workflow and discards the final observation binding. - Lowering target:
let run_group = sep(sample = sample, program = field_program(voltage=..., duration=...));run_group[0] << [stain];let obs = img(sample = run_group[0], quantity = customized, schema_ref = readout_schema, save_raw = true);
- Legacy continuity signature
Electrophoresis(sample, gel_type, staining_method)is not the stdlib execution contract.
SP.3 Stdlib Set Summary
Stdlib set:
IncubateLyseExtractDNAPrecipitationExtractDNAColumnPCRElectrophoresis
SP.4 Legacy / Non-Stdlib Portals
SP.4.1 Measure
Classification: legacy continuity only
Rule:
Measure(...)is not part of the bundled stdlib target.- Statement-form
Measure(...)is rejected as an unknown step. - let-bound
Measure(...)is rejected through the semantic diagnostic contract, commonly asSEM_UNKNOWN_STEP. - Diagnostic code definitions and stage placement are specified in Chapter 8.
- Authoring SHOULD directly use
img(...),ecp(...),phy(...), or decomposition paths.
SP.4.2 Generic ExtractDNA
Classification: legacy continuity only
Rule:
- Generic
ExtractDNA(sample, method)is not a stdlib portal. - Authoring SHOULD use:
ExtractDNAPrecipitation(...)ExtractDNAColumn(...)
SP.5 Conformance Boundary
Bundled stdlib sources, portal injection, portal expansion, and portal lowering must conform to the portal contracts in this document and the cross-links below. File names and test file names are not part of the stdlib portal contract.
