Cotal TypeScript packages
    Preparing search index...

    Interface DriveRequest

    interface DriveRequest {
        cancellation?: RootCancellationSource;
        cancellationObserved?: () => string | undefined;
        ceilings?: Readonly<
            Partial<
                Record<
                    | "spawn"
                    | "participant"
                    | "turn"
                    | "ask"
                    | "checkpoint"
                    | "sleep"
                    | "wait"
                    | "waitUntil"
                    | "notify"
                    | "monitor"
                    | "conclave",
                    number,
                >,
            >,
        >;
        effectCeiling?: number;
        endpoint: string;
        file?: string;
        handler: EffectHandler;
        kv: KV;
        lease: RunLease;
        onActivated?: (entries: readonly JournalEntry[]) => Promise<void>;
        onLog?: (line: { scope: string; values: readonly unknown[] }) => void;
        pause?: PauseToken;
        resultBytes?: number;
        runId: string;
        seed?: string;
        source: string;
        space: string;
        statusConnection?: Pick<NatsConnection, "isClosed">;
        stepBudget?: number;
        workExpiry?: number;
    }
    Index
    cancellation?: RootCancellationSource

    Root cancellation established by the hosting manager after observing its durable marker.

    cancellationObserved?: () => string | undefined

    Shared host observation for classifying a revoked channel effect before root signalling.

    ceilings?: Readonly<
        Partial<
            Record<
                | "spawn"
                | "participant"
                | "turn"
                | "ask"
                | "checkpoint"
                | "sleep"
                | "wait"
                | "waitUntil"
                | "notify"
                | "monitor"
                | "conclave",
                number,
            >,
        >,
    >
    effectCeiling?: number
    endpoint: string

    The endpoint HOSTING this driver — the manager daemon. It leads the run record's key, so a retirement drain and a per-endpoint enumeration both work by prefix.

    file?: string
    handler: EffectHandler
    kv: KV

    The records bucket. NOT optional, and deliberately so: the run record holds the pins a resume must read back and the high-water ordinal that is the only thing able to see a truncated journal tail. A driver that could run without it would skip both silently, which is the failure mode both exist to prevent.

    lease: RunLease
    onActivated?: (entries: readonly JournalEntry[]) => Promise<void>

    Repair external state bound to the PREVIOUS holder, once this driver holds the run and before the program is resumed.

    The case that exists is timers: a checkpoint's armed schedule fires onto a subject derived from the instance and epoch that armed it, so a run adopted by another host has live timers firing where nobody is listening, and resuming the program does not repair that — the pause replays as pending and goes straight back to waiting. What to re-arm is the mesh handler's business, not the driver's, so the driver only says WHEN: after the activation, because arming timers for a run this process turned out not to hold would point another driver's fires at this one.

    A failure here is a failure to take the run over, and is not swallowed: a driver that resumed a program whose pauses it could not re-arm would look like it was holding a run it cannot advance.

    OPTIONAL BECAUSE IT IS AN OVERRIDE, NOT BECAUSE THE REPAIR IS. A handler that knows how to repair its own external state says so with an adopted method, and the driver calls that when no callback is supplied — found by review, which noticed that this hook had NO caller anywhere in the tree, so every adopted run left its timers armed at the predecessor's coordinates. A seam that every future host must remember to wire is a defect waiting on its first host.

    onLog?: (line: { scope: string; values: readonly unknown[] }) => void

    Where the program's log(...) lines go. They are not journalled.

    pause?: PauseToken

    An operator's pause, honoured at the next effect boundary.

    resultBytes?: number

    The most bytes a settled ok result may canonicalize to, checked by the journal AHEAD of the append (L5006). The host that opens the broker connection knows its max_payload and passes the bound here; omitted, the journal enforces none and an oversized entry fails at the store (L5010) after the append was attempted.

    runId: string
    seed?: string
    source: string

    The program. A resume MUST be handed the same source: a different one is a fork, not a resume.

    space: string
    statusConnection?: Pick<NatsConnection, "isClosed">

    Keep a hosted attempt's terminal status pending across transport failures until its connection closes. The host keeps this connection and its credential alive until drive ends.

    stepBudget?: number
    workExpiry?: number

    The ABSOLUTE work horizon this driver accepted the item under (WorkLease.workExpiry).

    Past it the pool has already reconciled the item, so a driver still appending is writing into a run the authority considers finished with. Nothing needs to be read to know this: the horizon is fixed at acceptance and never re-set (SPEC 13.8), which is exactly what makes it safe to check locally — unlike a lease deadline, whose current value is a fact on another machine and whose check would be a read-then-publish with a gap that cannot be closed.