{"record":{"id":"407f0824ac298fe3","repo":"deepseek-ai/deepseek-harness","slug":"fs-local-diffbasismaxbytes-must-be-a-positive-saf","errorCode":null,"errorMessage":"fs-local: diffBasisMaxBytes must be a positive safe integer no greater than ${MAX_DIFF_BASIS_BYTES}","messagePattern":"fs-local: diffBasisMaxBytes must be a positive safe integer no greater than (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/fs-local/src/index.ts","lineNumber":85,"sourceCode":"    diffBasisMaxBytes: z.number().default(DEFAULT_DIFF_BASIS_MAX_BYTES),\n  })\n\n  /** Validated config (schemastery applied the defaults before construction). */\n  readonly config: ResolvedConfig\n  /** Test hook forwarded to fsio for atomic-publication boundaries. */\n  internals: FsIoInternals = {}\n  /** Per-targetKey tail promise: serializes mutating ops so the read→guard→write\n   * window can't interleave, making concurrent writes/edits deterministically\n   * ordered (one wins, the rest see the new version and reject as stale). */\n  private locks = new Map<string, Promise<unknown>>()\n\n  constructor(ctx: Context, config: Config) {\n    super(ctx)\n    const resolved = config as ResolvedConfig\n    if (!Number.isSafeInteger(resolved.diffBasisMaxBytes)\n      || resolved.diffBasisMaxBytes <= 0\n      || resolved.diffBasisMaxBytes > MAX_DIFF_BASIS_BYTES) {\n      throw new Error(`fs-local: diffBasisMaxBytes must be a positive safe integer no greater than ${MAX_DIFF_BASIS_BYTES}`)\n    }\n    this.config = resolved\n  }\n\n  /** Run `op` with exclusive access to `targetKey` (FIFO per key). */\n  private async withLock<T>(targetKey: string, op: () => Promise<T>): Promise<T> {\n    const prior = this.locks.get(targetKey) ?? Promise.resolve()\n    const run = prior.then(op, op)\n    // Keep the chain alive but swallow this op's result/throw for the *next* waiter.\n    const tail = run.then(() => undefined, () => undefined)\n    this.locks.set(targetKey, tail)\n    try {\n      return await run\n    } finally {\n      if (this.locks.get(targetKey) === tail) {\n        this.locks.delete(targetKey)\n      }\n    }","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/fs-local/src/index.ts#L67-L103","documentation":"Error \"fs-local: diffBasisMaxBytes must be a positive safe integer no greater than ${MAX_DIFF_BASIS_BYTES}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/fs-local/src/index.ts:85 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"}