Marmot-TS
    Preparing search index...

    Interface IngestContext<TEnvelope>

    The engine-facing surface the ingest pipeline drives. State and lifecycle mutation stay owned by the engine; the pipeline only reads/advances through these hooks so the convergence rewind and Unrecoverable transition remain the engine's responsibility.

    interface IngestContext<TEnvelope> {
        appPayloadPastEpochLimit?: number;
        ciphersuite: CiphersuiteImpl;
        dedup: {
            classify(message: MlsMessage): "duplicate" | "own-echo" | undefined;
            remember(message: MlsMessage): void;
        };
        isDisbanded?: () => boolean;
        log: Debugger;
        maxRewindCommits: number;
        peeler: {
            peelGroupMessages(
                envelopes: TEnvelope[],
                state: ClientState,
            ): Promise<
                { read: PeeledMessagePair<TEnvelope>[]; unreadable: TEnvelope[] },
            >;
        };
        retained: RetainedHistoryStore;
        admitDisbandCandidate(
            parentState: ClientState,
            message: MlsMessage,
            resultingState: ClientState,
            evidence: DisbandCandidateEvidence,
        ): void;
        createAdminCallback(state: ClientState): IncomingMessageCallback;
        getState(): ClientState;
        recordCommit(
            parentState: ClientState,
            message: MlsMessage,
            newState: ClientState,
        ): void;
        recordDeliveredAppPayload(
            epoch: number,
            stateTag: string,
            envelope: TEnvelope,
            message: MlsMessage,
            payload: Uint8Array,
        ): void;
        recordProposalStaged(state: ClientState): void;
        recordStateNotifications(
            digest: Uint8Array,
            epoch: number,
            notifications: StateNotification[],
        ): void;
        resolveFork(
            forkEpoch: number,
            pool: MlsMessage[],
            encrypted: TEnvelope[],
            witnessEnvelopes: TEnvelope[],
        ): Promise<AppliedForkResolution<TEnvelope>>;
        setState(state: ClientState): void;
        toUnrecoverable(): void;
    }

    Type Parameters

    • TEnvelope
    Index
    appPayloadPastEpochLimit?: number

    Application expiry is independent of retained recovery material.

    ciphersuite: CiphersuiteImpl
    dedup: {
        classify(message: MlsMessage): "duplicate" | "own-echo" | undefined;
        remember(message: MlsMessage): void;
    }

    Content-derived inbound dedup (inbound-processing.md; reference seen_message_ids / sent_message_ids). Keyed on the internal contentDedupId so the same MLS message re-wrapped in a fresh transport envelope is recognized across sources and restarts-within-process.

    Type Declaration

    • classify: function
      • Classifies a peeled message against prior history: duplicate (this content was already terminally processed), own-echo (our own send replayed back), or undefined (fresh — process it).

        Parameters

        Returns "duplicate" | "own-echo" | undefined

    • remember: function
    isDisbanded?: () => boolean

    True only for canonical protocol disband; Unrecoverable is not terminal.

    log: Debugger
    maxRewindCommits: number

    The rollback horizon (maxRewindCommits) from the active convergence policy.

    peeler: {
        peelGroupMessages(
            envelopes: TEnvelope[],
            state: ClientState,
        ): Promise<
            { read: PeeledMessagePair<TEnvelope>[]; unreadable: TEnvelope[] },
        >;
    }
    • Builds the admin-verification callback against state — the exact parent the message is about to be processed on (CR-01). Never build it once and reuse it across messages: a commit earlier in the batch can change the admin set or the ratchet tree the next one must be authorized against.

      Parameters

      Returns IncomingMessageCallback

    • Records an applied commit on the canonical branch: updates retained history and the full-fork history tree. Replaces a direct retained.record so both stay in lockstep, with the freshly-produced child captured pristine.

      Parameters

      Returns void

    • Remembers an application payload delivered as accepted on the current branch state, so a later rewind that abandons that branch can retract it as invalidated (M7).

      Parameters

      Returns void

    • Records that a proposal was staged onto the current state (its epoch and confirmation tag are unchanged), so the history tree's node snapshot picks up the new unappliedProposals.

      Parameters

      Returns void

    • Records the StateNotifications derived from an accepted commit, keyed by its commitDigest (D-10/D-11), so a later rewind that supersedes this commit can withdraw exactly these notifications.

      Parameters

      Returns void

    • Drives the group to the terminal Unrecoverable lifecycle state.

      Returns void