/**
 * RCASD-INDEX.json population and querying.
 *
 * Scans .cleo/rcasd/ and legacy .cleo/rcsd/ directories to build a master index of all RCASD
 * pipeline artifacts. Provides lookup functions for task-anchored artifacts,
 * specs, reports, and pipeline state.
 *
 * @task T4801
 * @epic T4798
 * @ref schemas/rcasd-index.schema.json (compat: rcsd-index.schema.json)
 */
/** RCASD-INDEX.json top-level structure. */
export interface RcasdIndex {
    $schema: string;
    _meta: IndexMeta;
    authorities: Record<string, string>;
    taskAnchored: Record<string, TaskAnchor>;
    specs: SpecEntry[];
    reports: ReportEntry[];
    pipeline?: PipelineState;
    recentChanges?: ChangeEntry[];
}
/** Index metadata. */
export interface IndexMeta {
    version: string;
    lastUpdated: string;
    totals: IndexTotals;
    checksum?: string;
}
/** Aggregate counts. */
export interface IndexTotals {
    tasks: number;
    specs: number;
    reports: number;
    activeResearch: number;
    pendingConsensus: number;
}
/** Task-anchored RCASD artifact reference. */
export interface TaskAnchor {
    shortName: string;
    directory: string;
    spec?: string;
    report?: string;
    status?: 'active' | 'paused' | 'completed' | 'failed' | 'archived';
    pipelineStage: string;
    createdAt?: string;
    updatedAt?: string;
}
/** Specification entry. */
export interface SpecEntry {
    file: string;
    version: string;
    status: 'DRAFT' | 'APPROVED' | 'ACTIVE' | 'IMMUTABLE' | 'DEPRECATED';
    domain: string;
    taskId: string;
    lastUpdated: string;
    category?: string;
    shortName?: string;
    synopsis?: string;
}
/** Report entry. */
export interface ReportEntry {
    file: string;
    relatedSpec: string;
    taskId: string;
    progress: string;
    lastUpdated: string;
    phase?: string;
    notes?: string;
}
/** Pipeline state. */
export interface PipelineState {
    activeOperations: PipelineOperation[];
    queuedTasks: string[];
    lastCompleted?: {
        taskId: string;
        stage: string;
        completedAt: string;
    };
}
/** Active pipeline operation. */
export interface PipelineOperation {
    operationId: string;
    taskId: string;
    stage: string;
    startedAt: string;
    progress?: number;
    message?: string;
}
/** Change entry. */
export interface ChangeEntry {
    timestamp: string;
    taskId: string;
    changeType: string;
    stage?: string;
    description: string;
}
/**
 * Scan .cleo/rcasd/ and legacy .cleo/rcsd/ directories and build the RCASD index.
 *
 * Reads all _manifest.json files and any spec/report markdown files to
 * produce a complete index.
 *
 * @param cwd - Working directory
 * @returns Populated RcasdIndex
 * @task T4801
 */
export declare function buildIndex(cwd?: string): RcasdIndex;
/**
 * Write RCASD-INDEX.json to disk.
 *
 * @param index - The index to write
 * @param cwd - Working directory
 * @task T4801
 */
export declare function writeIndex(index: RcasdIndex, cwd?: string): void;
/**
 * Read RCASD-INDEX.json from disk.
 *
 * @param cwd - Working directory
 * @returns The index or null if not found
 * @task T4801
 */
export declare function readIndex(cwd?: string): RcasdIndex | null;
/**
 * Rebuild and write the index from current disk state.
 *
 * @param cwd - Working directory
 * @returns The rebuilt index
 * @task T4801
 */
export declare function rebuildIndex(cwd?: string): RcasdIndex;
/**
 * Get task anchor by task ID.
 *
 * @param taskId - The task ID to look up
 * @param cwd - Working directory
 * @returns TaskAnchor or null
 * @task T4801
 */
export declare function getTaskAnchor(taskId: string, cwd?: string): TaskAnchor | null;
/**
 * Find tasks by pipeline stage.
 *
 * @param stage - The pipeline stage to filter by
 * @param cwd - Working directory
 * @returns Array of [taskId, anchor] pairs
 * @task T4801
 */
export declare function findByStage(stage: string, cwd?: string): Array<[string, TaskAnchor]>;
/**
 * Find tasks by status.
 *
 * @param status - The status to filter by
 * @param cwd - Working directory
 * @returns Array of [taskId, anchor] pairs
 * @task T4801
 */
export declare function findByStatus(status: 'active' | 'paused' | 'completed' | 'failed' | 'archived', cwd?: string): Array<[string, TaskAnchor]>;
/**
 * Get index summary statistics.
 *
 * @param cwd - Working directory
 * @returns Index totals or null
 * @task T4801
 */
export declare function getIndexTotals(cwd?: string): IndexTotals | null;
//# sourceMappingURL=rcasd-index.d.ts.map