@me2em/pact
    Preparing search index...

    Function verifyPrefix

    • Prefix verification — SYNC, Tier 1+2 on [0..k−1] (B-7): the subscriber must validate the whole prefix before accepting the head. After replay, journalHead must equal head — divergence is FORK_DETECTED (the prefix itself stays valid — D27).

      Parameters

      • events: Event[]

        The prefix events [0..k−1].

      • head: string

        The JournalHead this prefix is claimed to end at.

      • Optionalclock: Clock

        Optional verification reference (additive convenience; defaults to the system clock, same skew rule as verifyJournal).

      Returns VerifyResult

      The VerifyResult of the prefix replay; ok: true only when the prefix is valid AND its head equals head.

      const result = verifyPrefix(prefix, head);
      if (!result.ok) throw result.error;