PtcRunner.Kernel.RuntimeTools (PtcRunner v0.14.0)

Copy Markdown View Source

Internal construction of reserved runtime capabilities.

Both environments receive read-only usage and local capability discovery. Only the workflow receives the annotation route. Annotation data uses a finite type/key vocabulary with closed enumerations, plus a bounded mission identifier on phased agent-action records — not arbitrary JSON payloads. Every route is instrumented with the same canonical capability start/stop events.

Summary

Functions

Wraps an internal runtime callback with canonical capability events.

Builds the workflow-only mission-aware source-check callback.

Builds the workflow-only subordinate-evaluation callback.

Builds the workflow-only frozen mission-inventory callback.

Builds the workflow-only frozen compact mission-model-context callback.

Builds the workflow-only application-result contract callback.

Builds the reserved runtime-tool map for one environment.

Functions

instrument(state, event_sink, environment, name, callback, attributes \\ %{})

Wraps an internal runtime callback with canonical capability events.

An error capability-stopped event carries the closed envelope kind and reason when those atoms belong to the Kernel vocabulary. An unrecognized atom is retained only as a one-way fingerprint. Arguments, details, and messages stay off the event.

kernel_check_source(state, missions, limits, event_sink)

Builds the workflow-only mission-aware source-check callback.

kernel_eval(state, missions, limits, event_sink, inspection_sink \\ nil, opts \\ [])

Builds the workflow-only subordinate-evaluation callback.

opts accepts admission: :block | :fail_fast (default :fail_fast) and an optional parent_evaluation_id for the enclosing workflow evaluation. The Runner's workflow route blocks, so concurrent agent loops queue behind the single evaluation lease instead of failing. The REPL keeps fail-fast: a REPL expression evaluates under the session's own lease, so a blocking nested kernel-eval would park behind itself until the sandbox timeout.

mission_inventory(state, rendered_by_mission, event_sink)

Builds the workflow-only frozen mission-inventory callback.

mission_model_context(state, rendered_by_mission, event_sink)

Builds the workflow-only frozen compact mission-model-context callback.

result_contract(contract)

Builds the workflow-only application-result contract callback.

tools(state, environment, event_sink, kind, opts \\ [])

Builds the reserved runtime-tool map for one environment.

Mission grants carry the constructing evaluation's lease via opts[:lease]: a stale call fails closed before instrumentation (no events, no state read), and malformed-call accounting authenticates the lease atomically so a dead evaluation cannot spend the next one's protocol-error budget through a runtime route.