/**
 * threadDigest — the FROZEN, byte-precise v1 wire encoding for Threadline
 * canonical-history symmetry (Robustness Phase 2, D-D / FD-5 / LD1).
 *
 * These bytes cross to an INDEPENDENTLY-implemented peer (Dawn), so the encoding
 * is a published cross-agent interface and is frozen for `digestVersion: 1`. The
 * "Wire encoding (normative)" section of
 * docs/specs/THREADLINE-CANONICAL-HISTORY-SPEC.md pins every byte; this module is
 * the reference implementation of that section and the unit test pins reference
 * vectors a reimplementer must reproduce.
 *
 * Two values are defined here:
 *
 *  1. `contentDigest` — sha256 over an IDENTITY-FREE canonical projection of a
 *     message: `{ body, createdAt, messageId, threadId }`, RFC 8785 (JCS)
 *     serialized. Identity-free because name↔fingerprint is asymmetric across the
 *     two ends (Phase 1 grounding §5); hashing identity would manufacture false
 *     `diverged` on healthy threads. Both ends compute the SAME digest from the
 *     SAME bytes. The digest is ALWAYS recomputed locally on receive — a
 *     wire-supplied digest is a cross-check only, never trusted into the chain.
 *
 *  2. `setAccum` — an ORDER-INDEPENDENT, O(1)-maintained 256-bit modular-sum
 *     accumulator over the multiset of per-message digests. Order-independent
 *     because the two ends append in different local orders (inbound/outbound
 *     interleave; relay vs local-fastpath race), so an order-dependent fold would
 *     report permanent false `diverged`. Modular sum is commutative (two ends
 *     agree regardless of arrival order) and incremental (O(1) per append).
 *
 * HONEST STRENGTH BOUND (SA3): `(count, setAccum)` equality is a reliable
 * CONSISTENCY signal against a NON-adversarial peer — it is NOT a
 * collision-resistant proof against a *malicious* verified peer (a modular sum is
 * not collision-resistant). This is acceptable in Phase 2 ONLY because symmetry is
 * advisory-only (it never blocks a send, never binds, never gates an irreversible
 * action — Signal vs. Authority). An LtHash-style collision-resistant commitment
 * is the named Phase-3 hardening; the frozen v1 combiner lets a future
 * `digestVersion: 2` introduce it without breaking v1 chains.
 */
/** The frozen content-digest projection version carried per-entry and on threadSync. */
export declare const DIGEST_VERSION = 1;
/**
 * The identity-FREE message core the content digest is computed over. Every field
 * is a value BOTH ends provably hold byte-identically: the message's own id, its
 * body text, the sender-stamped `createdAt`, and the threadId — NO sender
 * fingerprint / name / trust field (the asymmetry that would cause false
 * `diverged`).
 */
export interface MessageCore {
    threadId: string;
    messageId: string;
    /** The EXACT received UTF-8 body string. */
    body: string;
    /** The verbatim wire `createdAt` string — hashed AS RECEIVED, never re-parsed. */
    createdAt: string;
}
/** The additive wire field a peer sends so both ends can cross-verify a thread. */
export interface ThreadSync {
    digestVersion: number;
    /** Count of NON-backfilled entries of this digestVersion. */
    count: number;
    /** 64-hex lowercase, zero-padded — the modular-sum accumulator. */
    setAccum: string;
}
/**
 * Compute the v1 content digest over the identity-free projection
 * `{ body, createdAt, messageId, threadId }`. Lowercase-hex sha256 of the
 * UTF-8 JCS serialization.
 */
export declare function contentDigest(core: MessageCore): string;
/** The accumulator value for an EMPTY set (zero), as 64-hex. */
export declare const EMPTY_SET_ACCUM: string;
/**
 * Fold one content digest into a running accumulator (O(1) incremental append).
 * `(accum + H_acc(contentDigest)) mod 2^256`. Commutative, so the order of folds
 * does not matter — the two ends converge regardless of local arrival order.
 */
export declare function setAccumAdd(accumHex: string, contentDigestHex: string): string;
/**
 * Compute the accumulator over a whole multiset of content digests (the
 * rebuild-from-log path). Order-independent by construction.
 */
export declare function computeSetAccum(contentDigests: string[]): string;
/**
 * Equality test for two thread sync reports. Equality requires BOTH `count` and
 * `setAccum` (and the same `digestVersion`) — the count guards the (astronomically
 * unlikely, non-adversarial) case of a colliding sum at a different cardinality.
 * Returns false on any digestVersion mismatch (that is `version-skew`, handled by
 * the caller, never a benign equal).
 */
export declare function threadSyncEqual(a: ThreadSync, b: ThreadSync): boolean;
//# sourceMappingURL=threadDigest.d.ts.map