/** * Scheduler Foundation — domain-facing persistence port (2.12.0). * * Pure types + validation only. No filesystem, process, provider, worker-daemon, * or remote-RPC machinery. The concrete file store writes one small record per * scheduling intent and keys it deterministically by mission (`intent_`), * so there is at most one durable queue entry per mission. * * Authority model: * - This store records pending scheduling intent and the deterministic * decision outcome (ASSIGNED / UNSCHEDULABLE). It never fabricates a * mission result, an executor runtime, or an assignment. */ import type { MissionRequirements } from "../assignment/assignment-types.js"; import { type SchedulingIntentRecord } from "./scheduler-types.js"; export declare const SCHEDULER_SCHEMA_VERSION: 1; export type SchedulingIntentCreateResult = { status: "created"; } | { status: "conflict"; error: string; }; export type SchedulingIntentLoadResult = { status: "ok"; record: SchedulingIntentRecord; } | { status: "missing"; } | { status: "corrupt"; intentId: string; diagnostic: string; }; /** A store-level atomic read-modify-write mutation (sync callback). */ export type SchedulingIntentMutation = { kind: "write"; next: SchedulingIntentRecord; value: T; } | { kind: "noop"; value: T; }; export type SchedulingIntentMutateResult = { status: "ok"; value: T; } | { status: "missing"; } | { status: "corrupt"; intentId: string; diagnostic: string; }; export interface SchedulingIntentListRecordsResult { records: SchedulingIntentRecord[]; corrupt: { intentId: string; diagnostic: string; }[]; } /** * Canonical scheduling-intent persistence port. Implementations must be * crash-conscious (atomic record replacement, schema validation on load, * deterministic corrupt handling) and must never fabricate a scheduled intent. */ export interface SchedulingIntentStore { readonly storeId: string; /** Create a record at a previously-absent intentId. Existing → conflict. */ create(record: SchedulingIntentRecord): Promise; load(intentId: string): Promise; listIntents(): Promise; listRecords(): Promise; mutate(intentId: string, mutation: (current: SchedulingIntentRecord) => SchedulingIntentMutation): Promise>; } export type SchedulingIntentParseResult = { ok: true; record: SchedulingIntentRecord; } | { ok: false; diagnostic: string; }; /** * Validate an untrusted persisted value into a SchedulingIntentRecord. * Corruption is surfaced structurally (`ok: false`), never silently dropped or * fabricated. */ export declare function parseSchedulingIntentRecord(value: unknown): SchedulingIntentParseResult; export interface CreateSchedulingIntentRecordInput { intentId: string; missionId: string; requirements?: MissionRequirements; priority?: number; now?: number; } /** Build an initial PENDING intent record. */ export declare function createSchedulingIntentRecord(input: CreateSchedulingIntentRecordInput): SchedulingIntentRecord; //# sourceMappingURL=scheduler-store.d.ts.map