import { type BaselineRecord, type PerfBaselineKey } from '../types/sparkContracts';
import { type KnowledgeScope } from './scopedKnowledgeStore';
/** Minimum sample count enforced for `status='published'`. */
export declare const BASELINE_PUBLISH_MIN_SAMPLES = 3;
/** Whether the key looks like it carries raw identifiable info. */
export declare function keyHasIdentifiableInfo(key: PerfBaselineKey): boolean;
/** Derive the canonical baselineId from a key. */
export declare function deriveBaselineId(key: PerfBaselineKey): string;
export interface BaselineStoreListOptions {
    /** Restrict to a single status (e.g. 'published' for read-only consumers). */
    status?: BaselineRecord['status'];
    /** Restrict to a key prefix, e.g. `${appId}/${deviceId}` for cross-build trends. */
    keyPrefix?: string;
}
/**
 * BaselineStore — local file-backed baseline storage. Single instance
 * per storage path is enough for M0; cross-process writers are not
 * supported (caller's responsibility).
 */
export declare class BaselineStore {
    private readonly storagePath;
    private readonly baselines;
    private loaded;
    constructor(storagePath: string);
    /** Idempotently load the on-disk store into memory. */
    load(): void;
    /**
     * Add or replace a baseline record. Validates the publish invariants
     * before writing — invalid records throw rather than silently
     * downgrading status, so the operator sees the failure.
     */
    addBaseline(record: BaselineRecord, scope?: KnowledgeScope): void;
    /** Get a baseline by id. */
    getBaseline(baselineId: string, scope?: KnowledgeScope): BaselineRecord | undefined;
    /** Remove a baseline. Returns whether anything was actually removed. */
    removeBaseline(baselineId: string, scope?: KnowledgeScope): boolean;
    /**
     * List baselines with optional filters. Results are stable-ordered
     * by baselineId for deterministic consumers.
     */
    listBaselines(opts?: BaselineStoreListOptions, scope?: KnowledgeScope): BaselineRecord[];
    /**
     * Validate the §4.1 publish invariants. Throws when violated so the
     * caller surfaces the cause to the operator instead of silently
     * downgrading the record's status.
     */
    private assertPublishInvariants;
    /** Atomic write: temp file + rename so a crashed process leaves the
     * existing on-disk file intact. */
    private persist;
}
//# sourceMappingURL=baselineStore.d.ts.map