Skip to content
1 min read · 98 words

Type Alias: RipgrepFailure

ts
type RipgrepFailure =
  | {
      diagnostics: readonly string[];
      kind: "denied-by-policy";
    }
  | {
      kind: "invalid-pattern";
      message: string;
    }
  | {
      kind: "no-matches";
    }
  | {
      exitCode: number;
      kind: "io-failure";
      message: string;
    };

Defined in: src/batteries/sandbox/node/search_ripgrep.ts:17

A classified ripgrep outcome.

Remarks

CLASSIFICATION ORDER IS LOAD-BEARING: diagnostics are checked BEFORE the exit status, because rg runs under the sandbox and a denied path surfaces as a non-zero exit plus a violation record. Triage generically first and a policy refusal is permanently mislabelled io-failure — the model is told "search broke" when the truth is "you may not read there", and denied-by-policy becomes unreachable despite being in the tool's outcome list.

no-matches is a RESULT, not an error: rg exits 1 when it ran correctly and matched nothing.