Optionalclock: Clock
Verification reference (C3); defaults to the system clock.
Optionalopts: VerifyOptions
{ skewCheck: 'all' | 'none' } — see VerifyOptions.
Number of applied events.
evHash of the last applied event; ZERO32 when empty.
Full verification + application of one event (PACTS §7.7 order: chain → envelope/skew → signatures → semantics/quorum).
The event to verify and apply; sq must equal the
current height and ph — the current head.
PactError on the first violation: FORK_DETECTED
(chain), MALFORMED / UNKNOWN_EVENT_TYPE / PAYLOAD_TOO_LARGE
(envelope/payload), SKEW, SIGNATURE_INVALID, INVALID_QUORUM
(semantics). The state is left unchanged on failure.
RC3-D2: the cheap integrity pass over the caller's array
[0..height) — pid/sq/ph chain plus the hash-commitment
re-derived from the actual content (JCS + SHA-256, no signatures,
no state machine) — then the full check of [height..len).
A no-op suffix applies nothing and still re-checks the prefix.
The journal array to verify: the committed prefix
[0..height) plus the suffix [height..len) to apply in order.
Success view of the committed state (same fields as a clean verifyJournal run over the applied events).
The VerifyResult: ok: true, the sorted roster,
rosterDigest, pactRoot, journalHead, seq, warnings: [].
Incremental journal verifier (RC3-D4): the streaming face of the same replay verifyJournal runs — there is no second, "fast" verification path; the only skip is the re-check of an already committed prefix (RC3-D2). Each
applyruns the full PACTS §7.7 order on its event (chain → envelope/skew/signatures → semantics/quorum); the committed prefix is protected by a hash-commitment (RC3-D1) thatapplySuffixre-derives from the caller's actual array on every call — a diverged journal rejects withFORK_DETECTED(RC3-D3, fail-closed, no silent recompute; run verifyJournal for a from-scratch diagnosis of the exact cause).The state is opaque and in-memory only (RC3-D6): it is not a wire format and never crosses
JournalStore/Channel; suffix verification against a foreign head is verifyPrefix's contract. Failedapply*calls leave the state unchanged — this is the atomicity invariant of the verifier, and it is normative, not incidental: every check precedes every mutation, both inapplyitself (chain → envelope → skew → signatures; even the pid latch commits with the event) and insideapplyEvent(each event type validates its semantics — quorum, grammar, membership — before its firststate.*write; PACTS §7.7 order). The review tests (test/verify.spec.ts, "atomicity") pin this by simulating a failure insideapplyEventand a failed first apply, asserting the whole committed state via_debugState()— a future event type that mutates before it validates will fail them.Skew (RC3-D5): the Clock is read per applied event; pin the clock (or set
skewCheck: 'none') for era-consistent streaming replays.Example