Skip to main content

Module transcript_bridge

Module transcript_bridge 

Source
Expand description

The binding-side glue over segment: one implementation of “transcript in, CompileRequest + audit trail out”, relayed by the Node, Python and WASM bindings instead of copied into each. The one place a binding turns a raw transcript into a CompileRequest plus an auditable segmentation report.

compile_transcript is a one-call shortcut over compile_context: it segments a raw agent-session transcript into turns (and, within a turn, into code/log/body sub-segments) before compiling. The segmentation itself lives in [super::segment]; what lives here is the glue around it — the empty-transcript guard the MCP tool applies, the request assembly, and the per-segment audit trail a caller inspects to see how its transcript was cut before trusting the compiled result.

That glue was copied verbatim into velesdb-node and velesdb-wasm, each doc comment pointing at the other as “mirrors the … binding’s own” — two copies kept in step by hand. The Python binding could not be given compile_transcript without becoming a third. It lives here instead, so the three bindings relay one implementation and a fix reaches all of them at once.

fragment_id is rendered as a decimal string, not a u64: it is a 64-bit content hash, routinely past 2^53, and a JS caller reading it as a number would round it. Every binding publishes it that way already, and so does the MCP tool — the string is the wire form, not a JS concession.

No path field: resolving one needs an ingest-roots allowlist, which is MCP-server configuration. A binding caller reads the file itself and passes the text.

Structs§

SegmentInfo
One entry of SegmentationReport::segments: where a fragment came from in the original transcript.
SegmentationReport
How a transcript was cut, returned alongside the compiled context so a caller can audit the cut before trusting the result.
TranscriptCompileInput
A binding’s compile_transcript request: the MCP tool’s own fields minus path (see the module docs).

Functions§

build_transcript_compile_request
Segment input.transcript and assemble the CompileRequest a binding then hands to compile_context, plus the SegmentationReport it returns next to the compiled context.