This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 11/17/2026.
Spec
import std/specKoru Standard Library: spec — the contract vocabulary a declared
spec.kz · 2 tors · ~[comptime]· ~[runtime]
Koru Standard Library: spec — the contract vocabulary a declared · 18 more lines
Koru Standard Library: spec — the contract vocabulary a declared
interface speaks, plus the generic `[comptime|norun] spec` declaration
carrier and the `sites()` harvester shared by spec consumers.
These types were uplifted from runtime.specs / interpreter.contracts /
the interpreter's value-transport block: an interface descriptor
(ScopeEvent) names inputs, branches, obligation create/discharge and the
dispatcher contract — none of that is runtime-specific, it is the *spec
of a surface*. std/runtime, std/interpreter and every consumer re-alias
these names so emitted code (`koru_std.koru_runtime.ScopeEvent` in
generated dispatchers, `koru_std.koru_interpreter.CreateSpec` in shape
checking) keeps resolving to this single definition.
`spec` is the generic declaration carrier: data attached to the AST as a
[norun] site, harvested by a [comptime|command] consumer through
`spec.sites(program, qualifier, tor)`. A domain that wants its own
spelling declares its own [norun] tor and harvests it under its own
qualifier — std/realize's `row`/`arm` are that, one level down.
~[comptime|norun] pub tor spec { source: Source }// The module's runtime presence: the vocabulary's revision, served as data —
// the §3.6 contract-revision column made real, and the retained event that
// keeps this host-type library in the emitted namespace (runtime_only emits
// a module only when an event/proc/flow survives; spec's surface is types +
// a norun tor, so without this there is no koru_std.koru_spec to resolve).
~[retain] pub tor spec.revision {} -> string