{"record":{"id":"f5f72b46bbb537fc","repo":"deepseek-ai/deepseek-harness","slug":"sourceeventseqs-must-not-be-empty-except-on-assist","errorCode":null,"errorMessage":"sourceEventSeqs must not be empty except on assistant/message","messagePattern":"sourceEventSeqs must not be empty except on assistant/message","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/session/src/surface.ts","lineNumber":222,"sourceCode":"  if (!isReplaceOp(op)) {\n    throw new Error(`session event \"${event.type}\" carries an invalid replace surfaceOp`)\n  }\n  return op\n}\n\n/** Validate cited source-event seqs against prior log entries and the replacement range. */\nfunction assertProvenance(\n  event: SessionEvent,\n  shadowedSeqs: readonly number[],\n): void {\n  const raw = (event as SessionEvent & { sourceEventSeqs?: unknown }).sourceEventSeqs\n  const sources = new Set<number>()\n  if (raw !== undefined) {\n    if (!Array.isArray(raw)) {\n      throw new Error(`sourceEventSeqs on event at seq ${event.seq} must be an array when present`)\n    }\n    if (raw.length === 0 && event.type !== 'assistant/message') {\n      throw new Error('sourceEventSeqs must not be empty except on assistant/message')\n    }\n    let nonEarlierSource: number | undefined\n    for (const source of raw) {\n      if (!isEventSeq(source)) {\n        throw new Error(`session event \"${event.type}\" sourceEventSeqs must densely contain non-negative safe integers`)\n      }\n      sources.add(source)\n      if (nonEarlierSource === undefined && source >= event.seq) nonEarlierSource = source\n    }\n    if (sources.size !== raw.length) {\n      throw new Error('sourceEventSeqs must not contain duplicates')\n    }\n    if (nonEarlierSource !== undefined) {\n      throw new Error(`sourceEventSeqs must reference earlier events: ${nonEarlierSource} >= current seq ${event.seq}`)\n    }\n  }\n  const missing = shadowedSeqs.filter(seq => !sources.has(seq))\n  if (missing.length > 0) {","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/session/src/surface.ts#L204-L240","documentation":"Error \"sourceEventSeqs must not be empty except on assistant/message\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/session/src/surface.ts:222 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":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}