vigiles API reference
    Preparing search index...

    Type Alias SweptHookOutcome

    SweptHookOutcome:
        | {
            allowed: readonly string[];
            blocked: readonly string[];
            hook: SweptHook;
            notRun: readonly string[];
            results: readonly GuardrailResult[];
            status: "measured";
        }
        | { hook: SweptHook; reason: string; status: "not-applicable" }
        | { hook: SweptHook; reason: string; status: "unresolved" }

    What happened to one hook. A DISCRIMINATED UNION, not a result list plus three nullable fields: results exists on exactly the outcome that has them, so "read the score of a hook that was never run" is a type error rather than a 0/7 someone quotes.

    Type Declaration

    • {
          allowed: readonly string[];
          blocked: readonly string[];
          hook: SweptHook;
          notRun: readonly string[];
          results: readonly GuardrailResult[];
          status: "measured";
      }
      • Readonlyallowed: readonly string[]

        Ids it ran on and let through.

      • Readonlyblocked: readonly string[]

        Ids of the events it denied.

      • Readonlyhook: SweptHook
      • ReadonlynotRun: readonly string[]

        Ids the harness would never have handed it (condition did not match).

      • Readonlyresults: readonly GuardrailResult[]

        One result per battery event, in catalog order.

      • Readonlystatus: "measured"

        The battery reached this hook; results holds one entry per event.

    • { hook: SweptHook; reason: string; status: "not-applicable" }
      • Readonlyhook: SweptHook
      • Readonlyreason: string

        One line naming which of the two it is, and against what.

      • Readonlystatus: "not-applicable"

        The battery does not apply to this hook — a different event, or a matcher that selects none of the battery's tools. NOT a score of zero.

    • { hook: SweptHook; reason: string; status: "unresolved" }
      • Readonlyhook: SweptHook
      • Readonlyreason: string

        One line naming the unset variables.

      • Readonlystatus: "unresolved"

        The command names a variable nothing has set, so the program we would run is not the program the harness runs. Refusing is the honest answer; the fix is in the caller's hands (pass env).