Expand description
Declarative transcript extraction for flat event streams.
ExtractSpec is the data half of a descriptor’s [transcript.extract]
block: equality filters, field picks, a flat tool-item mapping, a token
reduction, 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§
- Duration
Extract - 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.
- Extract
Spec - The
[transcript.extract]block: which normalized outputs to produce and how. Validation requires at least one sub-table. - Field
Pick - Field pick over matching records; the last match wins.
- Tokens
Extract - Token reduction: over matching records, sum the listed integer fields, then
subtract the optional listed integer fields and clamp each record at zero. A
record where no
sumpath resolves leaves the total untouched (it never turns an absent total into zero). - Tools
Extract - Flat tool-item mapping: each matching record’s item object becomes one
ToolInvocation.