{"record":{"id":"bfc0a6855181a847","repo":"deepseek-ai/deepseek-harness","slug":"surface-replace-start-seq-op-start-not-found-i","errorCode":null,"errorMessage":"surface replace: start seq ${op.start} not found in surface","messagePattern":"surface replace: start seq (.+?) not found in surface","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/session/src/surface.ts","lineNumber":252,"sourceCode":"    }\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) {\n    throw new Error(`surface replace: sourceEventSeqs must include every shadowed surface node; missing ${missing.join(', ')}`)\n  }\n}\n\n/** Locate one replacement range without mutating the current fold state. */\nfunction replacementRange(\n  state: SurfaceFoldState,\n  op: Extract<SurfaceOp, { op: 'replace' }>,\n): Pick<SurfaceReplacePlan, 'startIdx' | 'endIdx' | 'shadowedSeqs'> {\n  const startIdx = state.nodes.indexOf(op.start)\n  if (startIdx === -1) {\n    throw new Error(`surface replace: start seq ${op.start} not found in surface`)\n  }\n  const endIdx = state.nodes.indexOf(op.end)\n  if (endIdx === -1) {\n    throw new Error(`surface replace: end seq ${op.end} not found in surface`)\n  }\n  if (startIdx > endIdx) {\n    throw new Error(`surface replace: start seq ${op.start} (index ${startIdx}) is after end seq ${op.end} (index ${endIdx})`)\n  }\n  return {\n    startIdx,\n    endIdx,\n    shadowedSeqs: state.nodes.slice(startIdx, endIdx + 1),\n  }\n}\n\n/**\n * Deep structural equality over the session-event JSON value domain\n * (null/boolean/number/string, arrays, plain objects). Replaces","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/session/src/surface.ts#L234-L270","documentation":"Error \"surface replace: start seq ${op.start} not found in surface\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/session/src/surface.ts:252 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"}