{"record":{"id":"88ea78024629b493","repo":"deepseek-ai/deepseek-harness","slug":"fs-not-regular-file-88ea78","errorCode":"FS_NOT_REGULAR_FILE","errorMessage":"cannot ${verb} \"${target.displayPath}\": not a regular file","messagePattern":"cannot (.+?) \"(.+?)\": not a regular file","errorType":"exception","errorClass":"FsError","httpStatus":null,"severity":"error","filePath":"packages/fs/fs-local/src/fsio.ts","lineNumber":364,"sourceCode":"    return chunk ? decoder.decode(chunk, { stream: true }) : decoder.decode()\n  } catch (error: unknown) {\n    /* v8 ignore next 2 -- TextDecoder({fatal}) only throws TypeError on invalid bytes; any other throw is an unreachable runtime fault. */\n    if (!(error instanceof TypeError)) throw error\n    throw notTextError(verb, displayPath)\n  }\n}\n\nasync function statRegularFile(target: LocalTarget, verb: 'read', signal?: AbortSignal): Promise<Stats> {\n  throwIfAborted(signal, verb)\n  let info: Stats\n  try {\n    info = await stat(target.targetKey)\n  } catch (error: unknown) {\n    /* v8 ignore next 2 -- a non-ENOENT stat failure needs a permission/IO fault; only the not-found path is reachable in tests. */\n    if (!isENOENT(error)) throw error\n    throw new FsError(`cannot ${verb} \"${target.displayPath}\": not found`, 'FS_NOT_FOUND')\n  }\n  if (!info.isFile()) throw new FsError(`cannot ${verb} \"${target.displayPath}\": not a regular file`, 'FS_NOT_REGULAR_FILE')\n  return info\n}\n\n/**\n * Read a whole regular UTF-8 text file into a single decoded string. Rejects\n * non-regular files, invalid UTF-8, and NUL-byte binary samples.\n * @param target - the resolved file to read.\n * @param signal - aborts the read (`FS_ABORTED`).\n * @returns the full decoded text, byte-for-byte (no normalization).\n */\nexport async function readWholeText(target: LocalTarget, signal?: AbortSignal): Promise<string> {\n  await statRegularFile(target, 'read', signal)\n  const raw = await readFileAbortable(target.targetKey, 'read', signal)\n  throwIfAborted(signal, 'read')\n  if (raw.subarray(0, BINARY_SAMPLE_BYTES).includes(0)) {\n    throw new FsError(`cannot read \"${target.displayPath}\": binary file`, 'FS_NOT_TEXT')\n  }\n  return decodeUtf8(raw, 'read', target.displayPath)","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/fs-local/src/fsio.ts#L346-L382","documentation":"Error \"cannot ${verb} \"${target.displayPath}\": not a regular file\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/fs-local/src/fsio.ts:364 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"}