Marmot-TS
    Preparing search index...

    Type Alias MarmotGroupEngineOptions<TEnvelope>

    type MarmotGroupEngineOptions<TEnvelope> = {
        audit?: AuditSink;
        auditContext?: AuditContextOptions;
        ciphersuite: CiphersuiteImpl;
        convergencePolicy?: ConvergencePolicy;
        historyTree?: GroupHistoryTree;
        ingestionPool?: IngestionPoolOptions;
        now?: () => number;
        onSettleCheck?: () => void | Promise<void>;
        onStateChanged?: (state: ClientState) => void;
        peeler: GroupPeeler<TEnvelope>;
        retained?: RetainedHistoryStore;
        scheduler?: ConvergenceScheduler;
        settlementQuiescenceMs?: number;
        state: ClientState;
    }

    Type Parameters

    • TEnvelope
    Index

    Engine

    audit?: AuditSink

    Optional forensic audit sink. Omitted by default; audit logging is app opt-in.

    auditContext?: AuditContextOptions

    Required when audit is set; contains stable engine/account/session metadata.

    ciphersuite: CiphersuiteImpl
    convergencePolicy?: ConvergencePolicy

    The signed convergence policy governing branch selection and the rollback horizon (maxRewindCommits). Defaults to DEFAULT_CONVERGENCE_POLICY. Set maxRewindCommits to Infinity to never expire old forks (the full history tree retains everything regardless). Validated on construction.

    historyTree?: GroupHistoryTree

    A pre-populated full-fork history tree, rehydrated from persistence. When omitted the tree is seeded with the current tip as its root and grows as commits arrive.

    ingestionPool?: IngestionPoolOptions

    Tuning for the persistent ingestion pool — undecryptable events held and retried as the history tree grows, instead of being dropped. Defaults to a size- and epoch-age-bounded pool.

    now?: () => number

    Injectable wall-clock (ms) for the convergence-status quiescence window (B5). Defaults to Date.now; tests pass a fake clock for determinism.

    onSettleCheck?: () => void | Promise<void>

    Called once the quiescence window elapses after convergence-relevant input, so the owner can re-check convergenceStatus and release any queued outbound work (B5). The engine itself holds no outbound queue.

    onStateChanged?: (state: ClientState) => void
    retained?: RetainedHistoryStore

    The bounded convergence window (canonical states + applied commits within the rollback horizon), derived from the history tree on load. When omitted it is seeded with only the current tip (no past-epoch rewind until new commits accrue). Never persisted separately — the tree is the source.

    scheduler?: ConvergenceScheduler

    Injectable timer for the settle-check; defaults to setTimeout (B5).

    settlementQuiescenceMs?: number

    Quiescence window (ms) before a convergence pass may be treated as settled (convergence.md settlementQuiescenceMs). Defaults to the profile-1 value.