This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 11/17/2026.
Realize
import std/realizeKoru Standard Library: realize — the generic correspondence solver.
realize.kz · 2 tors · ~[comptime]
Koru Standard Library: realize — the generic correspondence solver. · 38 more lines
Koru Standard Library: realize — the generic correspondence solver.
The solver over the std/spec harvest (DESIGN-0001 §3.4/§11.1): a program
walks its used interfaces, matches each against a catalog of declared
`row` sites, and admits or refuses each one against the selected
execution arm's bindings. A refusal writes no artifact — loud refusal of
unsupported capabilities is the contract, at every altitude:
interface -> row -> arm binding -> mechanism
Declaration shape (the invariants idiom — data in the AST, [norun],
harvested after the parse by a [comptime|command] consumer):
~std/realize:row {
"iface": "dom/lift[:torprefix]",
"stack": 4096,
"resources": "mechanism: cost",
"evidence": "V: ...",
"binds": [ { "arm": "arm/name", "mechanism": "mech",
"deltas": ["..."] } ] }
~std/realize:arm { "arm": "arm/name" } // a matrix column; an arm with
// no bindings IS the provider gap
This module is policy-free: it owns the row/arm declaration vocabulary,
the catalog merge (duplicate-arm and contradiction refusals), the used-
interface walk, admission verdicts + marks, the arm matrix, rows.json and
the arm manifest writer. What it does NOT own: any concrete arm name, the
meaning of a `mechanism` string, artifact shapes (Kraftfile, Makefile.uk,
link-phase chains), and the waiver policy for system modules — those are
the consumer's (koruos/realize passes its arm table, its builtin rows as
ordinary declared sites, and its mechanism-specific artifact writers).
`row`'s `iface` names the §3.6 demand-side identity — the interface
descriptor the program obliges — not the artifact that serves it. Today
the field carries the identifier (`qual/path[:torprefix]`); the typed
descriptor columns (inputs, branches, effects, authority, revision,
evidence) are the std/spec vocabulary this catalog is meant to grow into.
// A lift declares its own row by invoking
// `~std/realize:row(iface: koruos/ext2) { ...json... }`
// at module top level — norun data in the AST, harvested by the command
// consumer. The `iface` arg is a *name* the resolver can know (bare path or
// member chain; a quoted string stays verbatim — an explicitly conceptual
// iface that opts out of resolution). Everything in the Source block is
// foreign data — stacks, prose, arm names, mechanism deltas — strings by
// nature, JSON by honesty. `arm` declares a coverage-matrix column: a
// prospective arm needs no bindings to appear — its empty column IS the
// provider gap.
~[comptime|norun] pub tor row { iface: Expression, source: Source }~[comptime|norun] pub tor arm { source: Source }