Skip to main content

Module extract

Module extract 

Source
Expand description

Declarative transcript extraction for flat event streams.

ExtractSpec is the data half of a descriptor’s [transcript.extract] block: five primitives — an equality event filter, a final-text field pick, a flat tool-item mapping, a token sum, and a duration rule — interpreted by this one generic engine. A stream that needs more (keyed cross-event joins, content coercion) is a named code capability (super::capabilities::TranscriptParser), not a bigger spec.

Fixed rules the spec cannot change: final_text and duration.field take the last match; timestamp_spread needs at least two parseable RFC 3339 timestamps; result_coalesce takes the first present field (present-but-null counts), strings verbatim and everything else as compact JSON; args preserve the item’s key order; dotted paths descend objects only, so keys containing literal dots are unaddressable.

Structs§

DurationExtract
Duration: either a direct millisecond field pick (last match wins) or the spread between the first and last RFC 3339 timestamps. Validation requires exactly one variant.
ExtractSpec
The [transcript.extract] block: which of the four outputs to produce and how. Validation requires at least one sub-table.
FieldPick
Field pick over matching records; the last match wins.
TokensExtract
Token reduction: over matching records, sum the listed integer fields. A record where no listed path resolves leaves the total untouched (it never turns an absent total into zero).
ToolsExtract
Flat tool-item mapping: each matching record’s item object becomes one ToolInvocation.