Events

Events are the ground truth. Everything else in Myria is derived from them.

An event contains:

  • event_id Generated by Myria on ingest.
  • source_event_key Optional caller-supplied idempotency key.
  • event_seq Monotonic append order assigned by PostgreSQL.
  • timestamp Event time supplied by the emitter.
  • channel Where the event came from.
  • participants Immutable visibility scope.
  • context_id Optional emitter hint.
  • payload Opaque JSON body.
  • topic_hints Zero or more weighted hints from the emitter.
  • internal Effective stored visibility flag after ingest policy.

Trusted vs Provisional Fields

Trusted at ingest:

  • participants
  • channel
  • timestamp
  • payload

Provisional at ingest:

  • context_id
  • type
  • topic_hints
  • most semantic labels supplied by the emitter

The emitter does not supply canonical topic IDs.

Visibility Model

Participants are the access model.

Query rule:

  • a node or event is visible only if query.participants ⊆ node.participants

Tree rule:

  • scope can stay the same or narrow as the tree goes downward
  • scope never widens in place

This is what allows immediate subtree pruning during reference walks.

Topics

Topics are the only logical partitions over events.

Important consequences:

  • there is no session-partition abstraction
  • task-like and concept-like material are both represented as topics
  • emitter hints do not define canonical topic identity

TopicIndex Nodes

TopicIndex has two storage node types:

  • internal_topic
  • leaf_topic

Rules:

  • only leaf nodes carry direct event refs
  • internal nodes route and summarize
  • leaves normally contain at least two event refs when the eligible set permits it
  • singleton leaves are allowed only when there is no valid merge alternative

Node Identity

node_id is content-addressed.

It is derived from a canonical SHA-256 identity body that excludes tree pointers and presentation text.

Included in the identity body:

  • node_type
  • sorted participants
  • sorted direct event_ids for leaf nodes
  • sorted descendant leaf node_ids for internal nodes
  • schema version

Excluded from the identity body:

  • parent pointers
  • child pointers
  • edge positions
  • summaries
  • traversal caches

Snapshots

A snapshot captures:

  • one semantic forest
  • one event_seq cutoff
  • one published retrieval surface

Each snapshot has:

  • snapshot_id
  • parent_id
  • event_max_seq
  • status/version fields
  • creation time

The active snapshot is immutable for readers.

Topics Table

The topics table stores exact topic metadata used for observability and exact topic lookup. In the current implementation, topic IDs are derived from leaf node IDs.