{"record":{"id":"3cbeed856625d501","repo":"deepseek-ai/deepseek-harness","slug":"session-event-event-type-is-not-surface-eligi-3cbeed","errorCode":null,"errorMessage":"session event \"${event.type}\" is not surface-eligible and cannot carry sourceEventSeqs","messagePattern":"session event \"(.+?)\" is not surface-eligible and cannot carry sourceEventSeqs","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/session/src/surface.ts","lineNumber":192,"sourceCode":"  const op = value as Record<string, unknown>\n  return Object.keys(op).length === 3\n    && Object.hasOwn(op, 'op')\n    && Object.hasOwn(op, 'start')\n    && Object.hasOwn(op, 'end')\n    && op['op'] === 'replace'\n    && isEventSeq(op['start'])\n    && isEventSeq(op['end'])\n}\n\n/** Validate event-local surface eligibility and return its operation. */\nfunction surfaceOpOf(event: SessionEvent): SurfaceOp | undefined {\n  const raw = event as SessionEvent & { surfaceOp?: unknown; sourceEventSeqs?: unknown }\n  if (!isSurfaceEligibleType(event.type)) {\n    if (raw.surfaceOp !== undefined) {\n      throw new Error(`session event \"${event.type}\" is not surface-eligible and cannot carry surfaceOp`)\n    }\n    if (raw.sourceEventSeqs !== undefined) {\n      throw new Error(`session event \"${event.type}\" is not surface-eligible and cannot carry sourceEventSeqs`)\n    }\n    return\n  }\n  const op = raw.surfaceOp\n  if (op === undefined) {\n    throw new Error(`session event \"${event.type}\" is surface-eligible and requires a surfaceOp marker`)\n  }\n  if (op === 'append') return op\n  if (op === null || typeof op !== 'object' || Array.isArray(op)) {\n    throw new Error(`session event \"${event.type}\" carries an invalid surfaceOp`)\n  }\n  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. */","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/session/src/surface.ts#L174-L210","documentation":"Invariant guard in surfaceOpOf: an event whose type is not surface-eligible carries a sourceEventSeqs field. Provenance citations are only valid on surface-eligible events; carrying them elsewhere indicates a misconstructed event reaching the surface fold.","triggerScenarios":"Thrown at packages/core/session/src/surface.ts:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove sourceEventSeqs from the non-eligible event","Attach provenance citations only to surface-eligible event types","Use the typed event constructors rather than raw object literals"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}