Skip to main content

Crate nmp_threading

Crate nmp_threading 

Source
Expand description

nmp-threading — reply-convention-agnostic timeline grouping.

Owns the kind-agnostic Grouper that collapses reply chains into Twitter-style stacked-module blocks, plus the trait surface (ParentResolver) and value types (ThreadPointer, ModulePolicy, TimelineBlock, GroupDelta) consumed by per-NIP wrapper view modules. It also owns the generic e-tag threading projection family (nmp.threading.graph.*) for consumers that need a reactive read model over a caller-supplied event scope. Depends only on substrate crates — no kind numbers, no app nouns.

  • nmp-nip01::Nip10ModularTimelineView wraps this for NIP-10 kind:1.

See docs/decisions/0072-runtime-capability-and-shell-boundary.md and docs/architecture/crate-boundaries.md for the sibling-crate packaging rule.

Re-exports§

pub use block::TimelineBlock;
pub use etag::EtagThreadResolver;
pub use grouper::GroupDelta;
pub use grouper::Grouper;
pub use pointer::ThreadPointer;
pub use policy::ModulePolicy;
pub use projection::ThreadEdge;
pub use projection::ThreadingProjection;
pub use projection::ThreadingSnapshot;
pub use resolver::ParentResolver;
pub use runtime::close_threading_read_model;
pub use runtime::open_threading_read_model;
pub use runtime::threading_projection_key;
pub use runtime::ThreadingReadModelHandle;
pub use runtime::ThreadingReadModelParams;
pub use runtime::ThreadingScope;
pub use runtime::THREADING_GRAPH_PROJECTION_FAMILY_CLAIM;
pub use runtime::THREADING_GRAPH_PROJECTION_KEY_PREFIX;
pub use runtime::THREADING_GRAPH_SCHEMA_ID;
pub use runtime::THREADING_GRAPH_SESSION_ID_MAX_LEN;
pub use wire::decode_threading_snapshot;
pub use wire::encode_threading_snapshot;
pub use wire::THREADING_GRAPH_FILE_IDENTIFIER;
pub use wire::THREADING_GRAPH_SCHEMA_VERSION;

Modules§

block
TimelineBlock — the grouper’s output unit. A timeline payload is a Vec<TimelineBlock>; each block renders either as one standalone event card or as a Twitter-style stacked module with a connecting vertical line.
etag
Kind-blind resolver for marked/positional e tag reply/root grammar.
grouper
Grouper<R> — kind-agnostic timeline grouping. Given a stream of KernelEvents and a ParentResolver, emits a Vec<TimelineBlock> where reply chains collapse into Twitter-style modules.
ownership
Compiled ownership descriptor for crate-ownership reports.
pointer
ThreadPointer — what a reply / comment is anchored to.
policy
ModulePolicy — knobs for the grouping algorithm. Spec carries one per view instance so the same crate can serve different threading styles (tight modules vs. longer ancestor chains) without an algorithmic fork.
projection
Reactive threading graph projection.
resolver
ParentResolver — per-NIP plug for the kind-agnostic crate::Grouper.
runtime
Host wiring for the nmp.threading.graph.* read model family.
wire
Typed FlatBuffers wire codec for threading graph snapshots.