import { type DecisionJob, type DecisionJobItem } from './job-contract.js'; import type { DecisionTelemetryHook } from './telemetry/types.js'; import { type JobAccountingReport } from './job-accounting.js'; import type { DecisionReceiptStore } from './types.js'; import type { BatchReceiptStore } from './batch-receipts/types.js'; import { type JobScope, type JobSnapshot, type JobStore } from './job-store.js'; /** * D16 opt-in resolver (#2722). Given an `execution-unknown` item and its * latest attempt, it may return a verified resolution. It must only read: * it never dispatches or replays the provider. Returning anything but a * `digest-match` resolution leaves the item `execution-unknown`. */ export interface ExecutionUnknownResolution { state: 'succeeded' | 'abstained' | 'review'; effectId: string; reason: 'digest-match'; receiptDigest: `sha256:${string}`; resultDigest: `sha256:${string}`; } export type ExecutionUnknownResolver = (input: { job: Readonly; item: Readonly; attempt: Readonly; }) => Promise; export interface JobReconcileOptions { /** Off by default. When set, `execution-unknown` items are offered to the resolver after reconciliation. */ resolveUnknown?: ExecutionUnknownResolver; } /** Offline lifecycle only: no provider calls or action execution. Scope comes from trusted authentication. */ type JobOperation = 'submit' | 'transition' | 'retry' | 'cancel' | 'reconcile' | 'expire' | 'delete' | 'hold' | 'release-hold'; export declare class DecisionJobRuntime { private readonly store; private readonly now; private readonly telemetry?; constructor(store: JobStore, now?: () => number, telemetry?: DecisionTelemetryHook | undefined); private trace; submit(job: DecisionJob, actor: JobScope): Promise; poll(actor: JobScope, id: string): Promise; accounting(actor: JobScope, id: string, receipts: DecisionReceiptStore, batches?: BatchReceiptStore): Promise; items(actor: JobScope, id: string, offset?: number, limit?: number): Promise; advance(actor: JobScope, id: string, expected: JobSnapshot, next: DecisionJob, operation?: JobOperation): Promise; /** Requeue one eligible failure only; no dispatch occurs here. Previous attempts remain immutable. */ retry(actor: JobScope, id: string, itemId: string): Promise; cancel(actor: JobScope, id: string): Promise; /** * Explicit offline restart reconciliation. Never re-dispatch an attempt whose transport may have started. * With `resolveUnknown` (opt-in, D16), the reconciled `execution-unknown` items are then offered to the * resolver; without it the result is exactly the default reconciliation. */ reconcile(actor: JobScope, id: string, options?: JobReconcileOptions): Promise; /** * D16 opt-in resolver (#2722): promote `execution-unknown` items whose resolver returns a verified * `digest-match` resolution, through the one gated contract transition out of `execution-unknown`. * The job state is kept; absent, unknown, `state-match` or a failing resolver leave the item as it is. * Never dispatches. */ resolveUnknown(actor: JobScope, id: string, resolver: ExecutionUnknownResolver): Promise; private reconcileDispatches; expire(actor: JobScope, id: string): Promise; setLegalHold(actor: JobScope, id: string, enabled: boolean): Promise; remove(actor: JobScope, id: string): Promise; private authorize; } export declare function recount(job: DecisionJob): void; export {}; //# sourceMappingURL=job-runtime.d.ts.map