rea-agents - v2.0.0
    Preparing search index...
    • Execute repeatability-first authority/candidate captures under one contract.

      Parameters

      • experiment: {
            approved: true;
            authority: {
                arguments?: string[];
                environment: Record<string, string>;
                executable: string;
                id: string;
            };
            candidate: {
                arguments?: string[];
                environment: Record<string, string>;
                executable: string;
                id: string;
            };
            freshness_policy: { max_capture_age_ms: number };
            reconstruction_claims: { id: string; predicate: string }[];
            repeat_count: number;
            required_dimensions: (
                | "protocol"
                | "terminal"
                | "exit"
                | "interaction"
                | "filesystem"
                | "replay_transition"
                | "process"
                | "shim"
            )[];
            shared_scenario: {
                approved: true;
                arguments: string[];
                checkpoints: {
                    name: string;
                    trigger: | { at_ms: number; type: "time" }
                    | { occurrence: number; type: "terminal_literal"; value: string }
                    | { type: "root_exit" }
                    | { type: "settled" };
                }[];
                command_shims: {
                    name: string;
                    routes: {
                        arguments: string[];
                        max_calls: number;
                        outputs: { at_ms: number; data: string; stream: "stdout"
                        | "stderr" }[];
                        termination:
                            | { code: number; type: "exit" }
                            | { signal: "SIGINT" | "SIGTERM" | "SIGKILL"; type: "signal" };
                    }[];
                }[];
                environment: Record<string, string>;
                events: (
                    | { at_ms: number; data: string; sensitive: boolean; type: "input" }
                    | { at_ms: number; columns: number; rows: number; type: "resize" }
                    | {
                        at_ms: number;
                        signal: "SIGINT" | "SIGTERM" | "SIGKILL";
                        type: "signal";
                    }
                )[];
                executable: string;
                filesystem_roots: string[];
                idle_timeout_ms: number;
                inherit_environment: string[];
                limits: {
                    connections: number;
                    file_bytes: number;
                    files: number;
                    filesystem_depth: number;
                    frames: number;
                    output_bytes: number;
                    processes: number;
                    protocol_body_bytes: number;
                    protocol_events: number;
                };
                network_access: "host";
                normalization: {
                    paths: boolean;
                    patterns: { pattern: string; replacement: string }[];
                    pids: boolean;
                    ports: boolean;
                    time_bucket_ms: number;
                };
                replay: {
                    http: {
                        body: string;
                        delay_ms: number;
                        disconnect: boolean;
                        max_calls: number;
                        method: string;
                        path: string;
                        request_body?: string;
                        request_headers: Record<string, string>;
                        response_headers: Record<string, string>;
                        status: number;
                    }[];
                    machine: | {
                        initial_state: string;
                        limits: {
                            bytes: number;
                            connections: number;
                            duration_ms: number;
                            messages: number;
                        };
                        max_transitions: number;
                        states: { max_visits: number; name: string; terminal: boolean }[];
                        transitions: {
                            actions: (
                                | {
                                    body: string;
                                    headers: Record<(...), (...)>;
                                    status: number;
                                    type: "http_response";
                                }
                                | { data: string; type: "websocket_send" }
                                | { type: "disconnect" }
                                | { duration_ms: number; type: "delay" }
                            )[];
                            captures: {
                                sensitive: boolean;
                                value:
                                    | { name: ...; source: ... }
                                    | { path: ...; source: ... }
                                    | { path: ...; source: ... }
                                    | { path: ...; source: ... };
                                variable: string;
                            }[];
                            from: string;
                            guards: {
                                value: | { name: ...; source: ... }
                                | { path: ...; source: ... }
                                | { path: ...; source: ... }
                                | { path: ...; source: ... };
                                variable: string;
                            }[];
                            id: string;
                            max_uses: number;
                            priority: number;
                            to: string;
                            trigger: | {
                                body: string
                                | null;
                                headers: { [k: string]: string };
                                method: string;
                                path: string;
                                protocol: "http";
                            }
                            | {
                                headers: { [k: string]: string };
                                path: string;
                                protocol: "websocket_connect";
                            }
                            | { body: string
                            | null; path: string; protocol: "websocket_message" };
                        }[];
                    }
                    | null;
                    websocket_connections: {
                        disconnect_after: boolean;
                        messages: { data: string; delay_ms: number }[];
                    }[];
                    websocket_messages: string[];
                };
                secret_aliases: string[];
                settle_ms: number;
                terminal: { columns: number; rows: number; scrollback: number };
                timeout_ms: number;
                unknown_registry_approved?: true;
                working_directory: string;
            };
        }
      • policy: ProcessExecutionPolicy
      • options: { capturePort?: ProcessCapturePort; now?: () => number; signal?: AbortSignal } = {}

      Returns Promise<Result<PairedProcessExperimentResult, ProcessCaptureError>>