/**
 * Codex hook-contract canary.
 *
 * The Codex enforcement layer (installCodexHooks → .codex/hooks.json) rests on
 * a handful of load-bearing, empirically-won assumptions about Codex's hook
 * contract. Two of them were silent-failure bugs we already paid for live
 * (see docs/specs/codex-enforcement-hook-layer.md §P5c):
 *   1. The PreToolUse `matcher` is a REGEX against the tool name — a bare `*`
 *      matches NOTHING, so the guard silently never fires. It must be `.*`.
 *   2. Codex's shell tool is `exec_command` and carries the command in
 *      `tool_input.cmd` (not Claude's `tool_input.command`); the guard shim
 *      reads both.
 * If a future Codex version renames the hook events, drops PreToolUse, or
 * changes the deny mechanism, the gates would silently no-op again — "looks
 * installed, blocks nothing." This canary fails loudly instead.
 *
 * Two layers:
 *   (A) DETERMINISTIC invariant lock (always runs, env-independent): asserts
 *       buildInstarCodexHookGroups still emits the load-bearing shape — `.*`
 *       matcher, dangerous-command-guard on PreToolUse, the full Stop review
 *       trio. A refactor that regresses any of these fails the canary in CI.
 *   (B) BEST-EFFORT live-binary contract check: if a codex binary is
 *       resolvable on this host, read its embedded hook-event schema and
 *       assert the events instar depends on (PreToolUse, PermissionRequest,
 *       Stop, SessionStart, UserPromptSubmit) are still present. No binary →
 *       status 'skip' for layer B (NOT fail — most hosts/CI have no codex).
 *
 * RULE 3.1 RATIONALE
 *   Criticality: critical — a silent no-op guard is a false sense of safety on
 *                Codex's main destructive surface (shell/exec).
 *   Frequency:   startup/CI canary (deterministic layer is a unit-test drift lock;
 *                binary layer is best-effort per host).
 *   Stability:   semi-stable — Codex changes hook vocabulary across minor versions.
 *   Fallback:    none — failure is a code-fix surface, surfaced via DegradationReporter.
 *   Verdict:     deterministic structural assertion (A) + version-tolerant
 *                binary-schema probe (B); no LLM fallback needed.
 */
/** Hook events instar's enforcement layer registers and depends on. */
export declare const REQUIRED_CODEX_HOOK_EVENTS: readonly ["PreToolUse", "PermissionRequest", "Stop", "SessionStart", "UserPromptSubmit"];
export interface CodexHookContractCanaryResult {
    status: 'pass' | 'fail' | 'skip';
    message: string;
    details: {
        /** Layer A — deterministic invariant lock. */
        matcherIsRegex: boolean;
        dangerousGuardOnPreToolUse: boolean;
        deferralOnPreToolUse: boolean;
        stopReviewTrioWired: boolean;
        /** Layer B — live-binary probe. */
        binaryProbed: boolean;
        binaryPath?: string;
        missingEventsInBinary: string[];
        failures: string[];
    };
}
/**
 * Resolve a codex binary path, best-effort. Returns null if none found —
 * the binary layer is then skipped, not failed.
 */
export declare function resolveCodexBinaryForCanary(): string | null;
/**
 * Run the canary. Layer A is synchronous and always meaningful. Layer B
 * probes a codex binary if one resolves; otherwise that layer is skipped.
 */
export declare function runCodexHookContractCanary(): CodexHookContractCanaryResult;
/**
 * Layer C — installed-config drift check (C4). Unlike Layer A (which asserts the BUILDER
 * output) this reads what is ACTUALLY on disk for a specific agent and confirms the gates are
 * present AND trusted: the project `.codex/hooks.json` carries instar's Stop review trio
 * (response-review + claim-intercept-response + scope-coherence) AND every instar hook slot has
 * a `trusted_hash` (and isn't `enabled = false`) in `$CODEX_HOME/config.toml [hooks.state]`.
 * Catches reality drifting from the blueprint — a hand-edited/clobbered hooks.json, an untrusted
 * (dark) agent, or a user-disabled guard — which Layer A cannot see. Runtime/health use
 * (per-agent), not a CI invariant: returns 'skip' when no hooks.json exists.
 */
export interface InstalledCodexHookTrustCheck {
    status: 'ok' | 'drift' | 'skip';
    hooksJsonPresent: boolean;
    stopTrioInstalled: boolean;
    allArmed: boolean;
    untrusted: string[];
    disabled: string[];
    issues: string[];
}
export declare function checkInstalledCodexHookTrust(projectDir: string, codexHome?: string): InstalledCodexHookTrustCheck;
//# sourceMappingURL=codexHookContractCanary.d.ts.map