Expand description
KG change-set op-list model and NDJSON-delta codec.
See crates/khive-changeset/docs/api/ndjson-codec.md for the wire format.
Structs§
- Change
Set - Envelope metadata plus an ordered list of staged operations.
- Create
Op - Creates an entity or note with an ID minted and stabilized at stage time.
- Delete
Op - Removes one record with its required, full stage-time preimage.
- Edge
Patch - Edge fields to mutate; weight must be finite and in
[0.0, 1.0]. - Edge
Preimage - Prior edge values for exactly the fields touched by
EdgePatch. - Entity
Create Fields - Fields staged for a new entity.
- Entity
Patch - Entity fields to mutate; absent means unchanged and
Some(None)clears description. - Entity
Preimage - Prior entity values for exactly the fields touched by
EntityPatch. - Envelope
- Change-set-wide producer identity and stage-time provenance.
- LinkOp
- Creates a directed edge whose ID is minted at stage time.
- MergeOp
- Merges two entities with required participant and incident-edge preimages.
- Merge
Preimage - Full prior state required to validate and rewire an entity merge.
- Note
Create Fields - Fields staged for a new note.
- Note
Patch - Note fields to mutate; nested options distinguish unchanged, clear, and set.
- Note
Preimage - Prior note values for exactly the fields touched by
NotePatch. - Update
Op - Patches one record with a stage-time preimage of exactly the touched fields.
Enums§
- Change
SetError - In-memory NDJSON encode/decode errors; no variant represents I/O.
- Create
Target - Substrate-specific create fields, tagged by
kind. - Delete
Preimage - Full prior record state, tagged by
substrateto avoid its embeddedkindfield. - Op
- One staged mutation, internally tagged by the snake-case
opfield. - Update
Patch - Substrate-specific patch tagged by
target. - Update
Preimage - Field-scoped preimage tagged with the same
targetasUpdatePatch.
Constants§
- CURRENT_
SCHEMA_ VERSION - The NDJSON-delta schema version this crate currently emits and accepts.
Functions§
- from_
ndjson - Decodes an envelope header and every following line as one ordered
Op. - to_
ndjson - Encodes the envelope as line one and each op on a following line, in order.