/**
 * LiveTestHarness — the user-role live-test runner (spec
 * docs/specs/live-user-channel-proof-standard.md §5). It drives a feature
 * end-to-end AS THE USER through the real surface (Telegram AND Slack for a channel
 * feature), recording a signed PASS/FAIL scenario matrix as the artifact the
 * completion gate reads.
 *
 * This module is the harness CORE: it runs a scenario matrix over an INJECTED
 * `ChannelDriver` (send / awaitReply / isDemoChannel), so it is unit-testable with a
 * fake driver. The REAL Telegram + Slack drivers (real-account drive, §5.4, demo
 * channels) and the Playwright dashboard driver wire into this same interface.
 *
 * Structural safety (§5.3): a volatile/permission scenario is REFUSED before any
 * send unless its target channel is a demo channel — a structural throw, not a
 * convention, so a destructive scenario can never touch the live operator channel.
 *
 * Determinism (§5.6/§4.4): the PASS/FAIL verdict rests on DETERMINISTIC protocol
 * evidence (the reply text + the responder machine id captured from the real
 * platform), not a fuzzy judgment. (An optional Tier-1 semantic supervisor for
 * natural-language expectations is a follow-on; the core encodes exact checks.)
 */
import type { LiveTestArtifact, LiveTestArtifactStore, RiskCategory, Surface } from './LiveTestArtifactStore.js';
export interface SendResult {
    messageId: string;
}
export interface ReplyResult {
    text: string;
    messageId: string;
    responderMachineId?: string;
}
/** The injected channel transport — a real adapter (Telegram/Slack) OR a fake. */
export interface ChannelDriver {
    /** Whether (surface, channelId) is a registered demo channel (§5.3 isolation). */
    isDemoChannel(surface: Surface, channelId: string): boolean;
    /** Send a user message on the real surface. */
    send(surface: Surface, channelId: string, text: string): Promise<SendResult>;
    /** Await the agent's reply (resolves null on timeout). */
    awaitReply(surface: Surface, channelId: string, opts: {
        timeoutMs: number;
        afterMessageId?: string;
    }): Promise<ReplyResult | null>;
}
export type Volatility = 'safe' | 'volatile' | 'permission';
export interface HarnessScenario {
    id: string;
    description: string;
    surface: Surface;
    riskCategory: RiskCategory;
    volatility: Volatility;
    channelId: string;
    /** The user message to send. */
    input: string;
    /** Deterministic expectations checked against the captured reply. */
    expect: {
        replyContains?: string;
        replyNotEmpty?: boolean;
        responderMachine?: string;
    };
    timeoutMs?: number;
}
export interface HarnessMatrix {
    featureId: string;
    surfaces: Surface[];
    riskCategories: RiskCategory[];
    scenarios: HarnessScenario[];
}
export interface LiveTestHarnessDeps {
    store: LiveTestArtifactStore;
    driver: ChannelDriver;
    runnerFingerprint: string;
    /** Bounded retries on a reply timeout before recording FAIL (§5.5 flake mgmt). */
    maxReplyRetries?: number;
    defaultTimeoutMs?: number;
    now?: () => number;
    logger?: (m: string) => void;
}
export declare class HarnessVolatileChannelError extends Error {
    constructor(scenarioId: string, surface: Surface, channelId: string);
}
export declare class LiveTestHarness {
    private readonly d;
    constructor(deps: LiveTestHarnessDeps);
    private now;
    private log;
    /**
     * Run the scenario matrix and write the signed artifact. `runId` lets the caller
     * pin a stable id (defaults to a now-stamped id). THROWS HarnessVolatileChannelError
     * if any volatile/permission scenario targets a non-demo channel (fail-fast, before
     * any send) — the §5.3 structural guard.
     */
    run(matrix: HarnessMatrix, opts?: {
        runId?: string;
    }): Promise<{
        artifact: LiveTestArtifact;
        entry: ReturnType<LiveTestArtifactStore['write']>;
    }>;
    private runScenario;
}
//# sourceMappingURL=LiveTestHarness.d.ts.map