{"record":{"id":"d6a73bd4cba08969","repo":"diegosouzapw/OmniRoute","slug":"video-frame-count-must-be-between-1-and-16","errorCode":null,"errorMessage":"Video frame count must be between 1 and 16","messagePattern":"Video frame count must be between 1 and 16","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/guardrails/videoBridgeRuntime.ts","lineNumber":226,"sourceCode":"    expiresAt: now + (options.cacheTtlMs ?? 30_000),\n    value,\n  };\n  return structuredClone(value);\n}\n\nexport function calculateFrameTimestamps(\n  durationSeconds: number,\n  requestedFrameCount: number\n): number[] {\n  if (!Number.isFinite(durationSeconds) || durationSeconds <= 0) {\n    throw new Error(\"Video duration must be positive\");\n  }\n  if (\n    !Number.isInteger(requestedFrameCount) ||\n    requestedFrameCount < 1 ||\n    requestedFrameCount > 16\n  ) {\n    throw new Error(\"Video frame count must be between 1 and 16\");\n  }\n  const frameCount = Math.min(requestedFrameCount, Math.max(1, Math.floor(durationSeconds)));\n  return Array.from(\n    { length: frameCount },\n    (_unused, index) => ((index + 0.5) * durationSeconds) / frameCount\n  );\n}\n\nfunction normalizeSceneCandidates(\n  durationSeconds: number,\n  candidates: readonly number[]\n): number[] {\n  const unique = new Set<number>();\n  for (const candidate of candidates) {\n    if (!Number.isFinite(candidate) || candidate <= 0 || candidate >= durationSeconds) continue;\n    unique.add(Number(candidate.toFixed(3)));\n  }\n  return [...unique].sort((left, right) => left - right);","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/guardrails/videoBridgeRuntime.ts#L208-L244","documentation":"Error \"Video frame count must be between 1 and 16\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/guardrails/videoBridgeRuntime.ts:226 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}