Skip to main content

Module atom

Module atom 

Source
Expand description

Harn Flow Atom primitive.

An Atom is the smallest invertible, CRDT-clean change in Harn Flow. Atoms are content-addressed: their AtomId is the SHA-256 of a canonical binary encoding of every field except the id and signature themselves. Every atom carries signed provenance ((principal, persona, ...)) and may point at the atom it constructively reverses via inverse_of.

Two encodings are supported and round-trip 1:1 with the in-memory struct:

  • JSON, via serde — human-readable interchange / event-log payloads.
  • Canonical binary — deterministic length-prefixed bytes used for hashing, signing, and on-disk storage.

See issue #573 (“[flow] Atom type + signed-provenance schema”) and parent epic #571.

Structs§

Atom
The core flow primitive.
AtomId
32-byte SHA-256 content address of an Atom.
AtomSignature
Detached Ed25519 signatures over the AtomId.
Provenance
Signed provenance of an atom: who emitted it, in what context, and when.

Enums§

AtomError
Errors produced when constructing, encoding, decoding, signing, or verifying an Atom.
TextOp
A single text edit. Atoms hold an ordered list of these.