{"record":{"id":"d887e64634b2af21","repo":"deepseek-ai/deepseek-harness","slug":"include-must-be-a-positive-glob-filter-negated-pa","errorCode":null,"errorMessage":"include must be a positive glob filter; negated patterns (\"!…\") are not supported","messagePattern":"include must be a positive glob filter; negated patterns \\(\"!…\"\\) are not supported","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-fs-search/src/grep.ts","lineNumber":70,"sourceCode":"  /** Cooperative tool-call budget (ms) attached as `ToolDefinition.timeoutMs`. */\n  timeoutMs: number\n}\n\n/** Validated `grep` arguments. */\nexport interface GrepInput {\n  pattern: string\n  path?: string\n  include?: string\n}\n\n/**\n * Reject an `include` that is not ONE positive glob filter: blank strings,\n * negated patterns (`!…`), and comma-separated lists. A comma inside a brace\n * group is fine — `*.{ts,tsx}` is one glob with alternation, not a list.\n */\nfunction validateInclude(include: string): void {\n  if (include.trim().length === 0) throw new Error('include must be a non-empty glob when given')\n  if (include.startsWith('!')) throw new Error('include must be a positive glob filter; negated patterns (\"!…\") are not supported')\n  let braceDepth = 0\n  for (const char of include) {\n    if (char === '{') braceDepth++\n    else if (char === '}') braceDepth = Math.max(0, braceDepth - 1)\n    else if (char === ',' && braceDepth === 0) {\n      throw new Error('include must be one glob, not a comma-separated list (use {a,b} alternation instead)')\n    }\n  }\n}\n\n/**\n * Validate value constraints the schema DSL can't express: a non-EMPTY\n * `pattern` (whitespace is a legitimate regex), a non-blank `path` when given,\n * and a single positive `include` glob ({@link GrepInput}). Throws a plain\n * `Error` (an ordinary tool argument error) otherwise.\n *\n * @param args - the schema-validated `grep` arguments.\n * @returns the accepted input, unchanged.","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-fs-search/src/grep.ts#L52-L88","documentation":"Error \"include must be a positive glob filter; negated patterns (\"!…\") are not supported\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-fs-search/src/grep.ts:70 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"}