/**
 * FeatureRolloutReconciler — makes the InitiativeTracker self-populating
 * (GRADUATED-FEATURE-ROLLOUT-SPEC §4.1). Runs IN-PROCESS against the tracker
 * (the HTTP create surface drops kind/pipelineStage/parentProjectId), upserting
 * a kind:'task' initiative per spec from artifacts that already exist — approved
 * spec frontmatter, instar-dev trace (specPath/prNumber), and git merge state —
 * and attaching a rollout track for ships-staged features whose stage is DERIVED
 * from observing the config flag.
 *
 * The fs/git scanning is injected (`SpecArtifact[]`) so this reconciliation logic
 * is fully unit-testable without a repo. Every tracker write passes `ifMatch`
 * (OCC). Idempotent: re-running upserts, never duplicates. Bounded backfill:
 * historical merged specs register terminal (provenance); only recently-merged
 * or ships-staged specs become `active` tracks (anti-flood).
 */
import type { InitiativeTracker, PipelineStage } from './InitiativeTracker.js';
import { type RolloutFlagObservation } from './featureRollout.js';
/** One spec's artifact state, as discovered by the (injected) scanner. */
export interface SpecArtifact {
    /** Normalized, ≤63-char, kebab id derived from the spec filename. */
    id: string;
    /** Repo-relative spec path (identity for rename detection). */
    specPath: string;
    title: string;
    /** Frontmatter signals. */
    approved: boolean;
    reviewConverged: boolean;
    shipsStaged: boolean;
    /** flagPath + criteria from the spec's `rollout:` frontmatter (ships-staged). */
    flagPath?: string;
    evidenceSource?: {
        type: 'log-filter' | 'endpoint';
        ref: string;
        filter?: string;
    };
    promotionCriteria?: string;
    /** An instar-dev trace exists referencing this spec (⇒ at least building). */
    traceExists: boolean;
    prNumber?: number;
    /** Merge commit reachable from main for this spec's change. */
    merged: boolean;
    /** Merge within the recent window (⇒ active track; else terminal provenance). */
    mergedRecently: boolean;
    /** Spec file no longer on disk (abandoned) — §4.7. */
    abandoned?: boolean;
}
export interface ReconcilerDeps {
    tracker: Pick<InitiativeTracker, 'list' | 'get' | 'create' | 'update' | 'setPhaseStatus'>;
    /** Discover spec artifacts (fs + git). Injected for testability. */
    listSpecArtifacts: () => SpecArtifact[];
    /** Observe a feature's flag (live config + shipped default). Read-only. */
    observeFlag: (flagPath: string) => RolloutFlagObservation;
    now?: () => number;
}
/** Map artifact state → the dev pipelineStage (no rollout). */
export declare function derivePipelineStage(a: SpecArtifact): PipelineStage;
export interface ReconcileSummary {
    created: string[];
    advanced: string[];
    archived: string[];
    regressed: string[];
    skipped: string[];
    unchanged: string[];
}
export declare class FeatureRolloutReconciler {
    private readonly deps;
    private readonly now;
    constructor(deps: ReconcilerDeps);
    /** One reconciliation pass over all discovered specs. Idempotent. */
    reconcile(): Promise<ReconcileSummary>;
    private reconcileOne;
    /** Apply a rollout stage: sync phase statuses + the rollout block; archive
     *  (reopenable) at default-on rather than completing. */
    private applyRolloutStage;
}
//# sourceMappingURL=FeatureRolloutReconciler.d.ts.map