{"record":{"id":"ac26d766e166bc70","repo":"diegosouzapw/OmniRoute","slug":"invalid-video-transcript-source-or-provenance","errorCode":null,"errorMessage":"Invalid video transcript source or provenance","messagePattern":"Invalid video transcript source or provenance","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/guardrails/videoBridgeHelpers.ts","lineNumber":150,"sourceCode":"    const startSeconds =\n      typeof record.startSeconds === \"number\"\n        ? record.startSeconds\n        : typeof record.start === \"number\"\n          ? record.start\n          : Number.NaN;\n    const endSeconds =\n      typeof record.endSeconds === \"number\"\n        ? record.endSeconds\n        : typeof record.end === \"number\"\n          ? record.end\n          : Number.NaN;\n    const confidence = record.confidence === undefined ? 1 : record.confidence;\n    if (\n      !text ||\n      typeof source !== \"string\" ||\n      !VIDEO_TRANSCRIPT_SOURCES.has(source as VideoTranscriptSource)\n    ) {\n      throw new Error(\"Invalid video transcript source or provenance\");\n    }\n    if (\n      !Number.isFinite(startSeconds) ||\n      !Number.isFinite(endSeconds) ||\n      !Number.isFinite(confidence) ||\n      confidence < 0 ||\n      confidence > 1 ||\n      startSeconds < 0 ||\n      endSeconds > durationSeconds ||\n      endSeconds <= startSeconds\n    ) {\n      throw new Error(\"Invalid video transcript timestamp or confidence range\");\n    }\n    const normalizedCue = {\n      confidence,\n      endSeconds,\n      source: source as VideoTranscriptSource,\n      startSeconds,","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/guardrails/videoBridgeHelpers.ts#L132-L168","documentation":"Provenance guard in normalizeVideoTranscript: a cue has empty text, a non-string source, or a source value outside the allowlist {audio-bridge, client, embedded}. Transcript provenance is security-relevant (it decides how cues are trusted downstream), so cues with unknown origin are refused rather than defaulted.","triggerScenarios":"Thrown at src/lib/guardrails/videoBridgeHelpers.ts:150 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Normalize the source label to one of the three allowed values at ingestion","Reject or quarantine transcripts produced by unknown tooling","Require non-empty cue text before accepting a cue"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}