/**
 * greenPrAutomergeWiring — builds the real gh / fs / lease / latch dependencies
 * for the GreenPrAutoMerger (green-pr-automerge-enforcement). Extracted from
 * server.ts so the dependency construction is itself unit-testable (Testing
 * Integrity: wiring-integrity tests prove deps are real, not nulls/no-ops).
 *
 * Repo-gated: the watcher only runs in the dev/maintainer environment where an
 * analyzable instar git repo AND scripts/safe-merge.mjs are present. On a plain
 * npm install both are absent → the server constructs nothing → routes 503.
 *
 * All gh goes through `execFile` (no shell). The list query is pinned oldest-first
 * server-side. Identity (R4) is `gh api user`. Audit is one JSONL line per
 * transition. State is per-machine (machine-local BY DESIGN).
 *
 * RULE 3.1 RATIONALE
 *   Criticality: high — these adapters surface the PR/identity/protected-paths
 *                state the merge watcher acts on.
 *   Frequency:   per-tick (≤ once per ~10-minute interval).
 *   Stability:   stable — every read uses `gh ... --json`/`gh api --jq`
 *                STRUCTURED output, never regex over human gh text.
 *   Fallback:    a failing/unparseable list call THROWS (→ the watcher's
 *                tick-failed canary feeds the breaker); protectedPaths failure →
 *                `unverifiable:true` (→ skip, never merge); identity unresolved →
 *                skip. Every path fails toward NOT merging.
 *   Verdict:     deterministic; safe-merge re-verifies at act time, so a misread
 *                here can only cause a refusal, never an unintended merge.
 */
import { GuardLatchStore, type GuardLatchEntry } from './GuardLatchStore.js';
import { type GreenPrAutoMergerDeps } from './GreenPrAutoMerger.js';
/** Protected globs (round-4/6): a PR touching these never auto-merges. */
export declare const PROTECTED_PATH_PREFIXES: string[];
/** Gate scripts the floor contexts execute (extend, never shrink). */
export declare const PROTECTED_GATE_SCRIPTS: string[];
export declare function isAnalyzableGreenPrRepo(repoPath: string, safeMergePath: string): boolean;
/** Does any changed file touch a protected path? */
export declare function diffTouchesProtected(files: string[]): boolean;
export interface GreenPrWiringOpts {
    repoPath: string;
    safeMergePath: string;
    stateDir: string;
    machineId: string;
    repo: string;
    agentNamespace: string;
    mergeTimeoutMs: number;
    mergeKillGraceMs: number;
    /**
     * mergerunner-auto-arm-handoff. The two runner-path fields threaded into
     * MergeRunnerConfig: `mergeStrategy` ('auto' default | 'admin') selects
     * --auto vs --admin; `armTimeoutMs` is the --auto spawn deadline (60s).
     */
    mergeStrategy?: 'auto' | 'admin';
    armTimeoutMs?: number;
    /** Lease accessors (single-machine: () => true / () => 0). */
    holdsLease: () => boolean;
    leaseEpoch: () => number;
    /** Merged peer guard-latch view (single-machine: () => []). */
    readPeerLatches?: () => GuardLatchEntry[];
    /** Replication writer (optional). */
    journal?: {
        emitGuardLatch: (d: Record<string, unknown>) => void;
    };
    /** Attention sink — raise/refresh the ONE aggregated item. */
    postAttentionAggregate: (lines: string[]) => Promise<void>;
    auditPath: string;
    now?: () => number;
    logger?: (msg: string) => void;
    /** Test seam: override the gh exec. */
    ghExec?: (args: string[]) => Promise<{
        stdout: string;
        stderr: string;
        code: number;
    }>;
}
/** Build the GuardLatchStore for this install. */
export declare function buildGuardLatchStore(opts: GreenPrWiringOpts): GuardLatchStore;
/** Build the full GreenPrAutoMerger deps (real gh adapters). */
export declare function buildGreenPrDeps(opts: GreenPrWiringOpts, latches: GuardLatchStore): GreenPrAutoMergerDeps;
/** Derive a single SUCCESS|PENDING|FAILURE from the statusCheckRollup array. */
export declare function deriveRollup(rollup: unknown): string | null;
//# sourceMappingURL=greenPrAutomergeWiring.d.ts.map