Appearance
14. Capture Model
capture is a common KAL binding syntax used at operator boundaries.
capture is not a general KDL operator.
It binds values from an operator's capture domain into writable caller destinations.
The universal execution outcome is distinct from the operator's capture domain. capture reads capture-domain source names, not status or message.
Within capture, _ means the whole capture-domain object for that operator invocation.
Named sources should be used when only a specific value is needed.
14.1 Capture Mapping
Current mapping form:
text
source -> destinationRules:
- the left side must be either a named capture source or
_ - the right side must be an explicit writable destination reference
- writable destinations include
locals.*,outputs.*, and declared writableglobals.*, subject to normal scope rules loop.result.*is also a writable capture destination inside acore.eachdobodyinputs.*is not writable- capture does not create a new reference namespace
- uncaptured results are discarded unless operator semantics say otherwise
Example:
kdl
capture {
result -> locals.result
_ -> locals.full_result
}14.2 Local Declaration Shorthand
The current draft allows capture-only local declaration shorthand:
text
local nameRules:
local foointroduces a newlocals.fooslot- after introduction, later references use
locals.foo - if
locals.fooalready exists,local foofails validation - if the destination already exists, use
locals.foo - body-level local introduction is limited to
capturedestinations local foois not a general write syntax- if a local needs header-style
typeordefaultsemantics, it must be declared in the component header
Example:
kdl
capture {
result -> local normalized_name
}14.3 Failure Behavior
Capture writes occur only when the enclosing operator invocation completes with status=ok.
If an operator invocation is skipped or failed:
- its
captureblock performs no destination writes - partial implementation-local values are not exposed
- a failed child component does not expose partial outputs to its caller