Fact
An indexed statement about a resource with its provenance, so a client can tell an author's signed title from a peer's computed comment count.
Fetching schema…

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

node

node reference

yes

The resource the fact is about.

key

string

yes

The fact name, such as title, heads, childCount, commentCount.

value

any

yes

The value.

provenance

one of signed, derived

yes

Asserted by an authorized signer, or computed by this peer.

source

CID

no

The blob the fact was read from, when signed.

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" }

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime