Cotal TypeScript packages
    Preparing search index...

    Class RunHosting

    Index
    • A run's admission and revocation marker, read leader-served as admitted reads them, whether or not this manager hosts the run. The manager reads them before each of the run's spawns, a spawn the run placed on this manager included (SPEC 14.8).

      Parameters

      • runId: string

      Returns Promise<RunAdmissionView>

    • run-answer with amend: file a later answer beside a settled pause's accepted one. The same two credentials an answer rides: a READ that replays the journal to the settled step and reads which answer its settle accepted, then an ANSWERING one minted for that token alone. Nothing is presented, so the pause stays settled. by is decided by the serve layer, as for an answer.

      Parameters

      • args: {
            artifact?: string;
            endpoint?: string;
            runId: string;
            stepKey: string;
            value?: unknown;
        }
      • by: string
      • Optionalauthorize: (accepted: RunHostAcceptedAnswer) => void | Promise<void>
      • Optionalctx: EpServeContext

      Returns Promise<unknown>

    • run-answer: resolve an open checkpoint, or an open ask attempt, through the driver's door. Two credentials: a READ that replays the run's journal to the open pause, then an ANSWERING one minted for that pause's token alone, so the writes reach no other pause on the endpoint. by is the caller as the manager knows them, decided by the serve layer from the authenticated principal (SPEC 14.5), never read from the request.

      Parameters

      • args: {
            artifact?: string;
            endpoint?: string;
            runId: string;
            stepKey: string;
            value?: unknown;
        }
      • by: string
      • Optionalauthorize: (open: RunHostOpenPause) => void | Promise<void>
      • Optionalctx: EpServeContext

      Returns Promise<unknown>

    • Boot: take back every run this endpoint recorded running. A dead predecessor's drive left its status at running; a successor resumes each one under a fresh takeover. A run with no recorded program is left alone and named: nothing can be resumed without its source. Never fatal to the manager; a run that cannot be taken back is logged, not lost (its journal stands). Opens the boot gate after the initial pass, even if the scan failed.

      Returns Promise<void>

    • Renewal: re-mint every live drive's run-driver credential for the SAME nkey and attempt coordinates when it is past its renewal point; the connection presents the fresh one on its next (re)connect. Open mesh: nothing to renew.

      Returns Promise<void>

    • run-resume: take a recorded run over under a fresh takeover and continue it from its journal. The source is the recorded program; a run started before programs were recorded has no hosted resume, and says so. The slot is claimed before the record read, so a second resume arriving during it is a conflict rather than a second attempt.

      Parameters

      • args: { runId: string; timeout?: string }
      • Optionalctx: EpServeContext

      Returns Promise<{ runId: string }>

    • Revoke a hosted run (SPEC 14.8): the marker is create-only and independent of the immutable admission; every later channel effect of the run refuses on reading it, and a drive parked in a wait ends within one poll. Idempotent.

      Parameters

      • runId: string
      • by: string
      • reason: string

      Returns Promise<RunRevocation>

    • run-start: validate, mint the id, ADMIT the run under the caller's issued authority (SPEC 14.8), launch the drive, answer. The drive continues off-handler.

      Admission is what confines the run: the caller's request rode the versioned rail, so the broker pinned its generation; the evidence the issuer recorded for that generation is resolved (active, source live, linearized by a second read) and its ceiling becomes the run's channel ceiling. A legacy arrival carries no binding and is refused by name, never routed through the host's own authority.

      Parameters

      • ctx: EpServeContext
      • args: { file?: string; source: string; timeout?: string }

      Returns Promise<{ runId: string }>

    • Shutdown: ask every drive to stop at its next boundary and drain the connections of those that reach one. A drive parked in a pause reaches no boundary; its connection is closed under it, so nothing it writes on the way out can land and its record stays running, which is what the next incarnation's reconcile takes back. A slot still launching holds no drive yet; its launch sees stopping and closes its own connection.

      Returns Promise<void>