Skip to content

Telo v0.104.0

Choose a tag to compare

@github-actions github-actions released this 28 Sep 15:15
4641afc

Packages

Package Version
@telorun/cli 0.104.0
@telorun/analyzer 0.104.0
@telorun/ide-support 0.104.0
@telorun/k8s-runner 0.17.0
@telorun/kernel 0.104.0
@telorun/language-server 0.104.0
@telorun/runner-core 0.16.0
@telorun/sdk 0.104.0
@telorun/templating 0.104.0

Minor

Added: trace export. A root Application's tracing: { sinks: [...] } turns tracing on as soon as one trace sink is attached, and every finished span — each invoke / run dispatch, the application's boot run, and every span a controller opens — reaches the attached sinks with its traceId, spanId, parentSpanId, name, start and end, outcome (ok | rejected | failed | cancelled | parked), error.type on a failure, telo.cancellation.reason on a cancellation, and its declared attributes; never its inputs, outputs or scope. tracing: is evaluated at load like logging:, and on a Telo.Library it is refused. — analyzer, kernel, sdk

Sink lists: an entry of tracing.sinks and of logging.sinks is a sink (!ref or inline) or { sink, when }, when a boolean (default true) evaluated once at load; false leaves the sink created and unattached. The kernel attaches exactly the sinks the lists name, right after creating each (an import's exported instance once the graph is up), and the undo flushes, detaches and closes it. A listed instance that does not expose the sink contract (sinkId, write, flush, flushSync, close) is refused with ERR_SINK_CONTRACT_MISSING. Breaking: a sink no longer attaches itself, so a sink declared but not listed — at the top level or in an imported library — receives nothing, and telo check warns SINK_UNATTACHED at it. When no listed log sink is attached, the zero-config console sink is added, as if sinks: were omitted.

New built-in kinds: Telo.TraceSink, the abstract every trace sink extends, and Telo.LogTraceSink, which writes each finished span as one telo.span record through the logging pipeline at its level (default info), carrying the span's own trace and span ids.

New annotation: x-telo-span-attribute: "<name>" on a scalar property of an inputType / outputType puts that value on the resource's dispatch span under that name. A mark is read wherever the contract reaches it through properties, following $ref into $defs entries and named shapes; telo check runs the kernel's own walk over the same contract. It reports a malformed or runtime-reserved name as SPAN_ATTRIBUTE_INVALID, and as SPAN_ATTRIBUTE_MISPLACED a non-scalar mark or one beside x-telo-sensitive: true (at the mark), a mark reached at the contract root or through an array item or map value (at the property that reaches it), and a mark no contract reaches; the kernel refuses such a contract at first dispatch with ERR_SPAN_ATTRIBUTE_INVALID. x-telo-sensitive follows the same reachability: a mark in a $defs entry or named shape a contract reaches is now read and redacted, and only an unreached one is SENSITIVE_ANNOTATION_MISPLACED.

SDK: the SpanRecord / TraceSinkInstance contract for trace sinks; ctx.logging.attach / detach are removed (a sink controller returns the sink as its instance and attaches nothing); openSpan now parents a span under the span its base context carries (a span opened inside a dispatch is its child), and settle accepts attributes merged over the ones the span was opened with; RecordBuffer is generic over its record type. @telorun/sdk exports errorTypeOf, the one rule for a span's error.type (an error's structured code, else its class name), which the kernel's dispatch spans and a module's own spans both use.

The Rust kernel refuses a module doc's tracing: with ERR_UNSUPPORTED_MANIFEST_FEATURE.

Breaking: predicates are booleans. A step's when (an invoke step's and a try: step's), if, elseif[].if and while, and a boot target's when (gated { ref, when } or inline { invoke, when }), must evaluate to true or false; anything else is refused with the new ambient code ERR_PREDICATE_NOT_BOOLEAN (data: { site, produced }; catchable, never retried, never counted toward throws:) instead of being read by truthiness — a string "false" used to run the branch. InvokeStep.when and a gated target's when are now type: boolean, and a try: step declares its when (type: boolean). telo check now types every !cel value inside a union-typed slot against the one branch the value selects, and where several branches fit the written value, against every one of them (reported only when none accepts the expression's type), so a predicate, a sink entry's when or any other union-held field whose expression is typed wrong is CEL_TYPE_ERROR at its own path (tracing.sinks[0].when, targets[0].when, steps[0].if); selectUnionBranch also selects over a union beside a shared base. At runtime every compile-eval result is held to its slot's schema once expanded: the root Application's logging: / tracing: at load (ERR_MANIFEST_VALIDATION_FAILED, before any sink is created — a sink when of "false" no longer attaches it) and a resource's compile-eval fields at creation (ERR_RESOURCE_SCHEMA_VALIDATION_FAILED, after the host-path and format refusals). Where the written value does not decide a union's branch, the evaluated subtree is held to the whole union rather than to a guessed branch. Validation fills no schema defaults: the controller receives exactly what the expression produced, and an object an expression returned (variables.x, a published resource) is never modified. The SDK exports predicateResult and ERR_PREDICATE_NOT_BOOLEAN; the analyzer exports compiledResultSlots / formatSlotPath.

Added: per-session workload tokens. A RUNNER_APPS catalog entry may declare tokenEnv, an environment variable name. For every session started from that entry — an app session (POST /v1/apps/:name/sessions) or a watch session's co-resident agent — the runner mints a random 32-character token, injects it into that workload's env under tokenEnv through the operator-env channel (so an agent's token reaches the agent container and no application container), and reports it as the new RunnerEndpoint.token on every endpoint of that workload: status.agent for an agent, every status.endpoints[] entry for an app session. A suspended session resumes with the same token; a runner restart starts new sessions and so new tokens. A tokenEnv the entry's own env also sets, or one that is not an environment variable name, is a RunnerConfigError at catalog load, and a client-supplied env var of that name is dropped. The k8s runner's chart documents the field in apps.catalog. — k8s-runner, runner-core

Breaking: OpenSpanOptions.inbound is the W3C Trace Context carrier, { traceparent, tracestate? }, exactly as a transport received it (it was { traceId, parentSpanId? }). The kernel's openSpan parses it: a valid traceparent makes the span a child of the upstream span, in the upstream trace, and the upstream parent id is exported verbatim as the span's parentSpanId (also Telo.LogTraceSink's telo.span.parent_span_id); an invalid or all-zero one is ignored in full and the span roots a new trace. The step engine's TryStep.when is typed as the predicate it is, a boolean or a compiled !cel expression. A templated kind's mount: now forwards every argument of the transport's register call to its mount child, not only app and prefix, so a templated mount receives Http.Server's request scope. — kernel, sdk


Changelogs: cli · analyzer · ide-support · k8s-runner · kernel · language-server · runner-core · sdk · templating