{"record":{"id":"e26ccb3808b2379a","repo":"deepseek-ai/deepseek-harness","slug":"invalid-boundary","errorCode":"INVALID_BOUNDARY","errorMessage":"fork boundary for session \"${session.id}\" must be a non-negative safe integer, got ${String(boundary)}","messagePattern":"fork boundary for session \"(.+?)\" must be a non-negative safe integer, got (.+?)","errorType":"validation","errorClass":"SessionForkError","httpStatus":null,"severity":"error","filePath":"packages/core/session/src/index.ts","lineNumber":1108,"sourceCode":"        ...liveSource.header.cwd !== undefined ? { cwd: liveSource.header.cwd } : {},\n        parentSession: liveSource.id,\n        seedLength: seed.length,\n      },\n    })\n  }\n\n  private _forkSeed(session: Session, requestedBoundary: number | undefined): SessionEvent[] {\n    const events = session.events\n    const lastEvent = events.at(-1)\n    let boundary: number\n    if (requestedBoundary !== undefined) {\n      boundary = requestedBoundary\n    } else {\n      if (lastEvent === undefined) return []\n      boundary = lastEvent.seq\n    }\n    if (!Number.isSafeInteger(boundary) || boundary < 0) {\n      throw new SessionForkError(\n        `fork boundary for session \"${session.id}\" must be a non-negative safe integer, got ${String(boundary)}`,\n        'INVALID_BOUNDARY',\n      )\n    }\n    if (boundary >= events.length) {\n      const lastSeq = events.at(-1)?.seq\n      throw new SessionForkError(\n        `fork boundary ${boundary} does not exist in session \"${session.id}\" (last seq: ${lastSeq ?? 'none'})`,\n        'INVALID_BOUNDARY',\n      )\n    }\n\n    const boundaryEvent = events[boundary]\n    if (boundaryEvent === undefined || boundaryEvent.seq !== boundary) {\n      throw new SessionForkError(\n        `fork boundary ${boundary} does not match a contiguous event seq in session \"${session.id}\"`,\n        'INVALID_BOUNDARY',\n      )","sourceCodeStart":1090,"sourceCodeEnd":1126,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/session/src/index.ts#L1090-L1126","documentation":"Input validation in _forkSeed: the requested fork boundary is not a non-negative safe integer. The boundary is an inclusive source event seq; NaN, negatives, non-integers, or values beyond Number.MAX_SAFE_INTEGER cannot name an event and are rejected before any slicing.","triggerScenarios":"Thrown at packages/core/session/src/index.ts:1108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid event seq from the source session (0 to last event seq)","Omit the boundary to fork through the source's current last event","If the seq comes from external input, validate it before calling fork"],"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"}