3.4 KiB
Seriatim Transcript JSON
This document is the external input contract for the implemented seriatim
input adapter.
Adapter
- Module key:
seriatim - Document kind:
transcript - Unit kind:
transcript_segment - Source format:
application/vnd.seriatim+json
The adapter parses raw Seriatim JSON into a generic source document. It owns transcript-specific JSON parsing and metadata mapping; core source and pipeline code stay source-format agnostic.
Accepted Shape
The input must be one JSON object with top-level metadata and segments
fields. This covers the maintained minimal fixture and Seriatim intermediate
output that provides the same required segment fields.
{
"metadata": {
"id": "session-alpha",
"title": "Synthetic D&D spell session"
},
"segments": [
{
"id": "seg-001",
"start": 0,
"end": 4,
"speaker": "Aria",
"text": "Aria raises her holy symbol and casts Cure Wounds."
}
]
}
The maintained example is examples/seriatim-minimal-transcript.json.
Top-level metadata entries are preserved. Other segment fields, such as
categories, are ignored.
Multiple top-level JSON values are rejected.
Validation
The adapter rejects:
- empty raw input;
- malformed JSON;
- top-level JSON that is not an object;
- missing, null, or non-object
metadata; - missing, null, non-array, or empty
segments; - segment values that are not objects;
- segment
idvalues that are neither strings nor numbers; - non-string
speakerortext; - empty segment IDs;
- segment IDs with leading or trailing whitespace;
- duplicate segment IDs;
- missing or empty
speaker; - missing, empty, invalid, non-finite, or negative
start; - missing, empty, invalid, non-finite, or negative
end; endvalues beforestart;- missing or empty
text.
Segment text is preserved as provided, but it must not be empty after trimming.
Source Mapping
The adapter maps input to SourceDocument:
metadatabecomesSourceDocument.Metadata;SourceDocument.Kindistranscript;SourceDocument.Formatisapplication/vnd.seriatim+json;SourceDocument.Digestissha256:<hex>of the exact raw input bytes.
SourceDocument.ID is selected in this order:
- the parse request source ID, after trimming;
metadata.id, when it is a non-empty string after trimming;metadata.source_id, when it is a non-empty string after trimming;seriatim:<first-16-hex-chars-of-raw-sha256>.
Each segment becomes one SourceUnit:
segment.idbecomesSourceUnit.ID; numeric IDs are converted to their JSON number text, so1becomes"1";segment.textbecomesSourceUnit.Text;SourceUnit.Kindistranscript_segment;speaker,start, andendare stored in source-unit metadata.
Metadata Keys
Seriatim unit metadata uses these keys:
speaker: string speaker label;start:json.Numberstart value;end:json.Numberend value.
The internal/modules/input/seriatim package exposes typed accessors for these
values.
Capabilities
The module declares these provided capabilities:
source.transcripttranscript.speakertranscript.timestamps
Compatibility Limit
This contract covers only Seriatim transcript JSON with the top-level
metadata object and segments array described here. Broader Seriatim output
schemas are compatible only when they provide these required fields with the
accepted types.