/**
 * Gate telemetry — structured event logger for production_gate / task_no_progress
 * / tool_loop / write_scope_block fire sites.
 *
 * Provides observability data for v3 calibration decisions:
 *   - Is the confidence threshold (high/medium/low) correctly classifying prompts?
 *   - What is the ALLOW regex false-positive rate?
 *   - Are hard-stop thresholds appropriate?
 *
 * Events are appended as newline-delimited JSON to
 *   ~/.owlcoda/telemetry/gate-events-YYYY-MM-DD.jsonl
 *
 * fs writes are synchronous and fire-and-forget: any I/O error is silently
 * swallowed so telemetry can never interfere with the main conversation loop.
 *
 * 0.14.18
 */
import type { DeliverableMode, DeliverableConfidence, DeliverableSignalSummary } from './deliverable-contract.js';
import type { ProvenanceKind } from './protocol/write-provenance-types.js';
export declare const FIDELITY_ANCHOR_TYPES: readonly ["path", "filename", "command", "number", "commit_hash", "tool_target", "line_ref"];
export type FidelityAnchorType = (typeof FIDELITY_ANCHOR_TYPES)[number];
export declare const FIDELITY_EVIDENCE_ORIGINS: readonly ["tool_call", "project_map", "instructions", "compaction_summary", "retained_turn", "unknown"];
export type FidelityEvidenceOrigin = (typeof FIDELITY_EVIDENCE_ORIGINS)[number];
export declare const FIDELITY_FACT_TYPES: readonly ["path", "number", "command", "commit_hash", "decision"];
export type FidelityFactType = (typeof FIDELITY_FACT_TYPES)[number];
export declare const FIDELITY_COMPACTION_FACT_REASONS: readonly ["dropped", "rephrased", "kept", "uncertain"];
export type FidelityCompactionFactReason = (typeof FIDELITY_COMPACTION_FACT_REASONS)[number];
export type GateEventKind = 'production_gate' | 'task_no_progress_hard' | 'task_no_progress_suppressed' | 'tool_loop' | 'write_scope_block' | 'gate_predicate_agreement' | 'gate_predicate_disagreement' | 'abandoned_grant_hard_stop' | 'edit_now_nudge_injected' | 'phase_derived' | 'completion_claim_accepted' | 'completion_claim_blocked' | 'path_provenance_admit_evidence' | 'path_provenance_parent_admit' | 'path_provenance_block' | 'path_provenance_would_block' | 'path_provenance_bash_unparseable' | 'path_provenance_probe_override' | 'path_provenance_deny_observed' | 'path_provenance_deny_block' | 'path_provenance_deny_revoked' | 'path_provenance_deny_pattern_skipped' | 'path_provenance_rule_warning' | 'agent_invocation' | 'mode_gate_block' | 'mode_analysis_hint' | 'mode_auto_approve' | 'fidelity_claim_observed' | 'fidelity_compaction_fact_observed' | 'project_map_boundary_block';
export interface GateEvent {
    ts: number;
    kind: GateEventKind;
    conversationId: string;
    iteration: number;
    contract?: {
        cwd: string;
        scopeMode: string;
        confidence: 'high' | 'medium' | 'low';
        allowedWritePathsByOrigin: Record<string, number>;
        touchedPathsCount: number;
        scratchArtifactPathsCount: number;
    };
    lastToolSignatures: string[];
    reason?: string;
    deliverableMode?: DeliverableMode;
    deliverableConfidence?: DeliverableConfidence;
    requiresDurableArtifact?: boolean;
    allowsChatFinal?: boolean;
    hardStopOnNoTouchedPaths?: boolean;
    deliverableReasons?: string[];
    matchedModes?: DeliverableMode[];
    signalSummary?: DeliverableSignalSummary;
    disagreementKind?: 'old_fires_new_silent' | 'new_fires_old_silent';
    offendingTool?: string;
    itersSinceGrant?: number;
    phase?: string;
    phaseConfidence?: string;
    phaseReasons?: string[];
    phaseEvidenceCount?: number;
    artifactEvidenceCount?: number;
    verificationEvidenceCount?: number;
    pendingRiskyGrantCount?: number;
    oldGateVerdict?: boolean;
    phaseGateVerdict?: boolean;
    phaseGateReason?: string;
    phaseRuntimeEnabled?: boolean;
    turnId?: string;
    runId?: string;
    toolName?: string;
    attemptedPath?: string;
    canonicalPath?: string;
    isNewFile?: boolean;
    ledgerSize?: number;
    via?: ProvenanceKind;
    authorizingKind?: ProvenanceKind;
    pathRecordCount?: number;
    availableRecordKinds?: Partial<Record<ProvenanceKind, number>>;
    parentPath?: string;
    failedCount?: number;
    targetCount?: number;
    failedToolName?: string;
    failedPath?: string;
    denyMarker?: string;
    denyOriginIteration?: number;
    denyOriginalString?: string;
    revokeMarker?: string;
    revokeOriginalString?: string;
    ruleWarningReason?: string;
    ruleWarningRaw?: string;
    ruleWarningSource?: string;
    agentId?: string;
    agentType?: string;
    agentStatus?: 'success' | 'failed' | 'partial' | 'inferred' | 'cancelled';
    agentFailureCategory?: string;
    agentStopReason?: string;
    agentIterations?: number;
    agentDurationMs?: number;
    agentInputTokens?: number;
    agentOutputTokens?: number;
    agentTouchedPathCount?: number;
    /** Small capped path samples for dogfood collision triage; not exhaustive. */
    agentTouchedPaths?: string[];
    agentExpectedArtifactCount?: number;
    agentExpectedArtifactPaths?: string[];
    agentParentTaskId?: string | null;
    agentParentStepId?: string | null;
    operatingMode?: 'plan' | 'normal' | 'auto';
    modeRiskClass?: 'safe' | 'internal_state' | 'mutating' | 'destructive' | 'external_effect';
    modeWouldBlockLegacy?: boolean;
    claimId?: string;
    surface?: string;
    anchorType?: FidelityAnchorType;
    target?: string;
    evidenceOrigin?: FidelityEvidenceOrigin;
    matched?: boolean;
    ageTurns?: number;
    model?: string;
    factType?: FidelityFactType;
    sourceTurnId?: string;
    beforeHash?: string;
    afterMatch?: boolean;
    preserved?: boolean;
    compactionFactReason?: FidelityCompactionFactReason;
}
export declare function recordGateEvent(event: GateEvent): void;
