Part of Stem. This page defines the fact record, the shape of everything the index knows about a resource beyond its blobs.
A fact is a key and value about a node, marked as read from a signed blob or computed by the peer.
Fields
field | type | required | meaning |
|---|---|---|---|
| yes | The resource the fact is about. | |
| yes | The fact name, such as | |
| yes | The value. | |
| one of | yes | Asserted by an authorized signer, or computed by this peer. |
| no | The blob the fact was read from, when |
Rules
Signed facts come from the state (document attributes, snapshot fields) and from Node fields (parent, name, heads, version). Derived facts come from counting and joining: child count, comment count, last activity, backlink count, whether a document is a collection. The API returns both but never mixes them: a query may ask for signed facts only, and listings label derived ones. Facts are rebuilt by reindex and are never exchanged between peers as truth; a peer that wants another peer's derived facts treats them as that peer's opinion. The board's question "should indexed metadata be authoritative or peer-derived" is answered: both, kept distinct.
Today (HM24)
document_attributes holds CRDT-resolved attributes, and listings compute counts from other tables with no marker of which is which.
Example
{
"node": {"space": {"/": {"bytes": "7QEE...Starlight"}}, "node": "bafyreiujzdegxdncf32epf3dhodzdocis2jhtlgmxgedn73u55xtplpft7"},
"key": "commentCount",
"value": 12,
"provenance": "derived"
}See also
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime