/**
 * Promotion gate — the marketing wedge (TS port of the Rust
 * `engine/src/engine/lessons/gate.rs` `check_promotion_gate`, retire-Rust RES-3a).
 *
 * Pure + synchronous: given a lesson's frontmatter + a `PromotionConfig` + `now`,
 * decide whether it is eligible for promotion. Accumulates ALL violations (no
 * first-fail) so callers render the full picture. The wedge against self-grading:
 * promotion refuses to take frontmatter at face value (24h dwell, ≥3 applied,
 * external signal required, no thumbs-down, non-speculative narrative).
 *
 * Block `reasons` carry a stable kebab PREFIX (the wire contract `promote_lesson`
 * surfaces as opaque strings, `src/functions/lessons.ts`); the embedded data
 * (timestamps/counts) is informational + TS-rendered (NOT byte-matched to the
 * Rust chrono Display/Debug). `promote` carries no reasons — the consumer never
 * surfaces pass-reasons.
 *
 * NOTE (the wedge invariant): the Rust gate's `TamperedAge` anti-backdate check
 * relied on filesystem birthtime, which libSQL has no per-row equivalent of. It is
 * DROPPED here; the invariant migrates to the store (RES-3b) as a HARD requirement:
 * `createdAt` MUST be store-owned (the DB insert time, never caller-supplied), or
 * the 24h time-floor below is backdate-bypassable with no backstop.
 *
 * Imports from: nothing (leaf, pure). Imported by: RES-3b lesson store (not yet wired).
 */
export type Confidence = 'observed' | 'inferred' | 'speculative';
export interface CausalNarrative {
    confidence: Confidence;
    evidenceRefs: string[];
}
/**
 * Normalize a raw on-disk / DB `causal_narrative` object to a `CausalNarrative`. The TS writer emits
 * camelCase `evidenceRefs`, but the RES-3d-migrated Rust lessons carry snake_case `evidence_refs`
 * (and a richer field set — `trigger`/`failure_mode`/`correction`); a blind cast left `evidenceRefs`
 * undefined and the gate mis-blocked (or, pre-guard, crashed) on such a lesson. Maps the key
 * (camelCase wins if both present, absent/malformed → []) while PRESERVING every other field so a
 * read→write round-trip is lossless. Shared by both readers (per-file source + the libSQL row).
 */
export declare function normalizeCausalNarrative(raw: Record<string, unknown>): CausalNarrative;
export type LessonStatus = 'pending' | 'active' | 'promoted' | 'superseded' | 'discarded';
export interface LessonFrontmatter {
    status: LessonStatus;
    supersededAt?: string;
    /** ISO 8601. STORE-OWNED in RES-3b (the dropped-TamperedAge invariant). */
    createdAt: string;
    appliedCount: number;
    thumbsDownCount: number;
    externalSignalSources: string[];
    appliedSessionIds: string[];
    causalNarrative?: CausalNarrative;
}
export interface PromotionConfig {
    minAgeMs: number;
    minAppliedCount: number;
    minDistinctOrigins: number;
}
/** gate.rs:75-87 — 24h dwell, ≥3 applied, origin-diversity disabled by default. */
export declare const DEFAULT_PROMOTION_CONFIG: PromotionConfig;
export type GateDecision = {
    kind: 'promote';
} | {
    kind: 'block';
    reasons: string[];
};
/**
 * Faithful port of `check_promotion_gate` (gate.rs:325-454): accumulate ALL
 * violations in the stable 1→8 order; return `block` if any, else `promote`.
 */
export declare function checkPromotionGate(fm: LessonFrontmatter, config?: PromotionConfig, now?: Date): GateDecision;
//# sourceMappingURL=gate.d.ts.map