/** * runtime-store — build and read the runtime.json index snapshot (G-026 M1). * * runtime.json is a DERIVED index (ADR-0004 #10): its truth comes from * events.jsonl + attempt dirs on disk. After a crash, reconciliation rebuilds * the index from those sources rather than trusting the snapshot blindly. */ import { type AttemptMeta, type AttemptResultStatus, type CleanupIncident, type ResourceLease, type RuntimeSnapshot, type TaskRuntimeLayout } from "./file-layout.js"; /** * Rebuild the full runtime snapshot from events + attempt dirs + incidents. * This is what reconciliation produces after a crash (source of truth wins). */ export declare function rebuildSnapshot(layout: TaskRuntimeLayout): Promise; /** Read attempt.json (static meta) if present. */ export declare function readAttemptMeta(layout: TaskRuntimeLayout, taskId: string, attemptId: string): Promise; /** Read lease.json (immutable resource lease) if present. */ export declare function readLease(layout: TaskRuntimeLayout, taskId: string, attemptId: string): Promise; /** Read incident.json for an incident dir. */ export declare function readIncident(layout: TaskRuntimeLayout, incidentId: string): Promise; /** Ensure attempt dir with stub metadata exists (idempotent). */ export declare function ensureAttemptDir(layout: TaskRuntimeLayout, meta: AttemptMeta): Promise; /** Persist a resource lease under the attempt dir (immutable: refuse overwrite). */ export declare function writeLease(layout: TaskRuntimeLayout, taskId: string, attemptId: string, lease: ResourceLease, opts?: { overwrite?: boolean; }): Promise; /** Persist an incident under incidents// (first-class entity). */ export declare function writeIncident(layout: TaskRuntimeLayout, incident: CleanupIncident): Promise; /** Resolve a task's latest attempt id from its attempts dir. */ export declare function latestAttemptId(layout: TaskRuntimeLayout, taskId: string): Promise; export type { AttemptResultStatus as RuntimeResultStatus };