Skip to main content

Crate keel_record

Crate keel_record 

Source
Expand description

Record: ground-truth events for a Keel space.

Distinct from agent framework logs: these describe FS / net / exec / lifecycle as observed or enacted by Keel, always tagged with policy and space ids.

Optional hash chain integrity: see HashChainSink and verify_chain.

Structs§

HashChainSink
Wraps an inner sink and seals each event into a SHA-256 hash chain.
JsonlSink
Append-only JSONL file sink.
MemorySink
In-memory sink for tests and demos.
MultiSink
Fan-out sink.
RecordEvent

Enums§

ChainVerifyError
Result of verifying a sequence of chained events.
EventKind

Constants§

GENESIS_PREV
Genesis previous-hash for the first event in a chain.

Traits§

RecordSink

Functions§

compute_event_hash
Compute SHA-256 hex of the canonical hash body for an event.
content_sha256
SHA-256 hex of arbitrary bytes (e.g. file contents written via SpaceFs).
default_space_sink
Create the default on-disk JSONL sink for a space (~/.keel/spaces/<id>/events.jsonl).
keel_home
Keel state directory ($KEEL_HOME or ~/.keel).
keel_tmp_dir
Ephemeral dir for spawn-time policy files.
seal_event
Attach prev_hash + event_hash using the previous hash in the chain.
space_dir
Directory for one space: ~/.keel/spaces/<id>/.
space_events_path
Default event log path: ~/.keel/spaces/<id>/events.jsonl.
space_policy_path
Optional persisted policy snapshot path.
verify_chain
Verify an ordered event list forms a valid hash chain.
verify_jsonl
Load JSONL from a string and verify the chain.