Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

The lifecycle of captured knowledge after its node.add: what an agent does to a fact later reaches the vault, so other engines never keep receiving knowledge its author has withdrawn.

Capture (step 6, super::emit) records for every node it adds which local fact it came from (own_sources: project, category, key, value digest). Each sync compares those own nodes with the project’s knowledge store and queues, through the existing event builders:

  • superseded: the fact’s value is no longer current and a current fact of the same category and key has its own node → edge.add supersedes from that node to the old one. The server derives the old node outdated (superseded); it is not retracted (one or the other).
  • withdrawn: no fact of the store carries the node’s value any more and no successor has a node → retract with the fixed reason withdrawn by author (no content).
  • re-pinned: the vault marked the claim to_verify/gone, while the local fact with the same value is current, not under review and its anchors match the code here (an agent re-pinned it) → the claim is re-anchored at HEAD and anchor_state fresh, the event cloud maintain --confirm writes.

The comparison reads the raw store, not a policy view: a fact a view withholds still exists and is never retracted for that. A store that cannot be read, or holds no facts while own nodes exist, plans nothing. Only fact sources of this checkout count; another checkout of the same vault owns its nodes. The server’s retraction limits apply unchanged: a held retraction stays pending, the engine sets no threshold of its own.

Every action is idempotent: an edge or retraction already in the folded place or still pending is not queued again, so a sync that ran before changes nothing.

Structs§

NodeView
What the vault shows of a node.
OwnNode
An own node and the fact it was captured from.
Present
What is already in the place or pending, so nothing is queued twice.
Queued
What queue queued.
StoreFact
A fact of the raw store, as far as the lifecycle needs it.

Enums§

Action
One lifecycle action, in the order it is queued.

Constants§

WITHDRAWN_REASON
The reason of a lifecycle retraction: stable, and no fact content.

Functions§

node_view
The vault’s view of node_id in graph.
own_nodes
The own fact nodes of the checkout project_hash, from own_sources.
plan
The actions that bring the vault in line with the store, in node id order (deterministic).
present
What the folded place and the pending queue already hold.
queue
Queue the signed events of actions as pending (the sync push sends them), continuing clock. A confirm whose anchored code is gone is skipped: a gone claim is withdrawn, not re-anchored.
removed_identities
The (category, key) of every fact the knowledge journal of the checkout at root records as removed.
store_facts
The raw store’s facts of project_root for plan, with value digests keyed like own_sources (replica.value_digest). None when the store cannot be read.