@pwngh/economy-lab
    Preparing search index...

    Type Alias SupervisorPorts

    What the host injects into createSupervisor. The required ports cover observation (clock, signals, sagas), the one mandatory lever (runSweep), and the audit sink; the optional ones add levers and hooks the matching passes use when present and quietly skip when absent.

    type SupervisorPorts = {
        audit: AuditSink;
        clock: Clock;
        config?: Partial<SupervisorConfig>;
        escalate?: (record: AuditRecord) => void;
        pauseWorker?: () => void;
        prove?: () => Promise<unknown>;
        reviveInbox?: (limit: number) => Promise<ReadonlyArray<{ id: string }>>;
        runRelay?: (now: number) => Promise<unknown>;
        runSweep: (now: number) => Promise<unknown>;
        sagas: SagaSource;
        signals: SignalFeed;
    }
    Index
    audit: AuditSink

    Receives every audit record synchronously as the tick emits it, before the record is also returned from tick(). A throwing sink aborts the tick.

    clock: Clock
    config?: Partial<SupervisorConfig>

    Per-field overrides merged over defaultSupervisorConfig.

    escalate?: (record: AuditRecord) => void

    Called once per escalation with the same record already sent to audit — the pager hook. Absent, escalations still reach the audit trail.

    pauseWorker?: () => void

    Pauses the host worker's scheduled loop — the integrity pass's containment lever. Deliberately a one-way switch: the supervisor never resumes; a human does, after the evidence is reviewed.

    prove?: () => Promise<unknown>

    Runs the integrity prover once when a mismatch episode is detected; its resolved value (or { proverFailed } when it throws) rides the escalation record as evidence. Absent, the escalation carries a null proof.

    reviveInbox?: (limit: number) => Promise<ReadonlyArray<{ id: string }>>

    Flips up to limit dead inbox rows back to pending, typically store.inbox.reviveDead.

    runRelay?: (now: number) => Promise<unknown>

    A targeted relay run for the outbox-backlog remediation, typically worker.sweep({ ...input, only: ['relay'] }). Falls back to runSweep when absent.

    runSweep: (now: number) => Promise<unknown>

    The stuck-saga lever: one guarded worker sweep, typically (now) => worker.sweep({ now, limit }). One sweep serves every actionable saga; the pass verifies by re-loading each saga afterward. Also the outbox fallback when runRelay is absent.

    sagas: SagaSource

    The saga store slice the stuck-saga pass polls and re-reads.

    signals: SignalFeed

    The detector's input, normally an OpsRuntime's signals.