Module node

Module node 

Source
Expand description

Nodes: the vertices of the versioned IFC graph.

A node exists where a change should be attributable on its own; everything else is a field of its owner. See docs/architecture/ifc-git/02-graph-object-model.md §2.2.

§The one thing this does differently from node-hash v0

v0 encodes the element node as “header, key (string — the entity’s stable identity, typically GlobalId), ifcType, componentCount, then components sorted by componentKey”. The key is inside the hashed byte stream, so a from-scratch re-export that regenerates every GlobalId changes every element address, and therefore every tree and commit — the exact case GUID-agnostic identity exists to prevent.

Here the key is not hashed. A node address is its content; the key lives in the tree that points at it (a later PR on #8262). That is git’s arrangement — a blob is content, a tree maps names to blobs, two identical files share one blob — and it makes a re-GUID a change of tree keys and no change of node addresses. Measured end to end by tools/ifc-git-corpus: 116 regenerated GlobalIds, 39 added and 39 deleted when paired by key, nothing at all once identity is content-derived.

Structs§

Component
One component of an element: a key and the address of the node carrying it.
Field
One scalar field of a node, as a name/value pair.
Role
One relationship role and the nodes it points at.

Enums§

FieldValue
What one field of a node holds.
Node
A node, before it is addressed.
NodeKind
What a node is.
SetKind
Which set kind a Node::Set is.

Constants§

NODE_FORMAT_VERSION
Format version within NODE_MAGIC.
NODE_MAGIC
Magic announcing this node format. A wire-format change mints a new one.