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

    Function createSupervisor

    • Builds the supervisor from its injected ports. Each tick runs the twelve incident passes once: tier-3 signatures report or escalate with an advisory and touch nothing, while the three tier-1 signatures (stuck-saga, outbox-backlog, inbox-dead-letter) call their lever under the shared guardrails — the cooldown spaces actions out, the attempt cap converts further action into a permanent escalation, and any integrity episode sets a containment latch that silences every lever until the supervisor is restarted. The integrity pass itself never fixes: it proves once, escalates, pauses the worker, and latches. All dedupe state is in-memory; a restart starts clean.

      Parameters

      Returns Supervisor

      The supervisor for the tier model and the per-signature runbooks.

      const ops = createOpsRuntime({ meter, logger, clock });
      // compose the economy and worker over ops.meter / ops.logger, then:
      const supervisor = createSupervisor({
      clock,
      signals: ops.signals,
      sagas: ports.store.sagas,
      runSweep: (now) => worker.sweep({ now, limit: 10 }),
      audit: jsonlAuditSink((line) => trail.write(`${line}\n`)),
      });
      const records = await supervisor.tick();