vigiles API reference
    Preparing search index...

    Interface HarnessTestResult

    The observable record of ONE run — the unified shape produced by BOTH testing tiers: runHarnessTest's result and runEval's measure ctx (eval.ts) both satisfy it. That's what lets the bare predicates in harness-assert.ts (usedTool / skillResolved / toolCount / toolUsedWith / hookFired / outputContains) run over either, with the testing helpers asserting and eval measuring over the same vocabulary.

    interface HarnessTestResult {
        cwd: string;
        exitCode: number;
        hooks: readonly HookFire[];
        modelRequests: readonly ModelRequest[];
        output: string;
        stderr: string;
        stdout: string;
        subagents?: readonly SubagentTrace[];
        toolCalls: readonly ToolCall[];
        turns: number;
        cleanup(): void;
        file(path: string): string | null;
    }

    Hierarchy (View Summary)

    Index

    Properties

    cwd: string

    The temp working dir (inspect or clean it up).

    exitCode: number
    hooks: readonly HookFire[]

    The hooks that fired during the run, each with its decision — parsed from the CLI's hook_response stream events. Same capture requirement as toolCalls (empty without the stream). Lets a test assert hook firing honestly instead of via a marker file.

    modelRequests: readonly ModelRequest[]

    The requests the model received, captured by the scripted mock — each with its system prompt and messages, flattened to text. Lets a test assert what actually reached the model (a SessionStart hook's injected context, a slash command's expansion), not just that a hook fired. Harness tier only: the mock sees the requests, so this is populated by runHarnessTest (with or without transcript); the eval tier drives the real API, so its modelRequests is always empty.

    output: string

    The agent's final answer text (the terminal result event), or "".

    stderr: string

    Hook block messages and diagnostics land here.

    stdout: string
    subagents?: readonly SubagentTrace[]

    Sub-agent (Task) runs as nested traces, keyed by subagent_type. A subagent runs its own session; CC tags its events with parent_tool_use_id (= the Task tool call) so its tool calls are recovered into a sub-trace here, lettng a test assert what the subagent DID (not just that Task fired). Empty unless the stream was captured / the harness emits subagent events.

    toolCalls: readonly ToolCall[]

    The tools the agent invoked, each paired with its result — parsed from the transcript. Empty unless the run captured the stream (transcript: true on the harness tier; always on the eval tier). Lets a test assert on the agent's actions (skills, MCP tools, subagents) instead of grepping stdout.

    turns: number

    Number of model turns the agent took (mock turns served).

    Methods

    • Final contents of a file under the working dir, or null if absent.

      Parameters

      • path: string

      Returns string | null