import { type QualityIntelligence as QI } from "@oscharko-dev/keiko-contracts";
type ReviewState = QI.QualityIntelligenceReviewState;
export declare const QI_REVIEW_SCHEMA_VERSION: 1;
export type QiReviewAction = "approve" | "reject" | "request-changes" | "reopen" | "withdraw";
export type QiAuditAction = QiReviewAction | "edit";
export interface QiReviewAuditEntry {
    readonly at: string;
    readonly action: QiAuditAction;
    readonly scope: "run" | "candidate";
    readonly candidateId?: string;
    readonly reviewerLabel: string;
    readonly fromState: ReviewState;
    readonly toState: ReviewState;
}
export interface QiReviewStateArtifact {
    readonly qiReviewSchemaVersion: typeof QI_REVIEW_SCHEMA_VERSION;
    readonly runId: string;
    readonly runState: ReviewState;
    readonly candidateStates: Readonly<Record<string, ReviewState>>;
    readonly auditLog: readonly QiReviewAuditEntry[];
    readonly lastUpdatedAt: string;
}
export declare const loadRunReviewState: (runId: string, evidenceDir: string) => QiReviewStateArtifact | undefined;
export declare const runReviewStateOf: (artifact: QiReviewStateArtifact | undefined) => ReviewState;
export declare const candidateReviewStateOf: (artifact: QiReviewStateArtifact | undefined, candidateId: string) => ReviewState;
export interface ApplyReviewDecisionInput {
    readonly runId: string;
    readonly evidenceDir: string;
    readonly action: QiReviewAction;
    readonly scope: "run" | "candidate";
    readonly candidateId?: string;
    readonly reviewerLabel: string;
    readonly now: string;
}
/**
 * Apply a review decision and persist the updated artifact. Pure transition + append-only audit
 * entry; returns the new artifact. The caller is responsible for authorising the action.
 */
export declare const applyReviewDecision: (input: ApplyReviewDecisionInput) => QiReviewStateArtifact;
export interface AppendEditAuditInput {
    readonly runId: string;
    readonly evidenceDir: string;
    readonly candidateId: string;
    readonly reviewerLabel: string;
    readonly now: string;
}
/**
 * Append an append-only `edit` audit entry for an inline candidate edit. Review state is NOT
 * transitioned — `fromState`/`toState` are the candidate's existing review state. Persists and
 * returns the updated review artifact (created empty on first use).
 */
export declare const appendEditAudit: (input: AppendEditAuditInput) => QiReviewStateArtifact;
export {};
//# sourceMappingURL=reviewStore.d.ts.map