Crate ifc_lite_git

Crate ifc_lite_git 

Source
Expand description

Graph-based version control for IFC: the addressed node layer.

Spec set: docs/architecture/ifc-git/. This crate is the object layer that the delivery → layer adapter is built on. The diff that computes a change lives in ifc-lite-diff; history, refs, merge and review belong to Layer PRs (docs/architecture/layer-prs/, see the scope reversal in #8217), not here.

§The two decisions this module set carries

1. Identity is content and structural position, not GlobalId. A node’s address is the digest of its content plus its children’s addresses, and the entity key lives in the tree that points at the node rather than inside the node. So a from-scratch re-export that regenerates every GlobalId rewrites tree keys and leaves every node address untouched.

This is the one place the crate departs from node-hash-v0 in packages/provenance, which folds the entity key into the element node and therefore cannot deliver that property. See node for the detail, and the spec set’s index §6.1 for the open question of where the canonical encoding should finally live.

2. A change belongs to the node that carries it. Edit one property inside one property set and the property-set node’s address moves; the owning element’s address moves because it encodes that child address; and nothing else moves. The element is marked at pset:<Name>, not blamed. A set shared by many occurrences is therefore one node change plus N markers.

§Evidence, not assertion

tools/ifc-git-corpus (#8129) derives a ten-revision chain from a committed model and measures each step. Its re-export revision regenerates all 116 GlobalIds: paired by key that reads as 39 added and 39 deleted, and under content-derived identity it is nothing at all. That gap is why this layer addresses content rather than keys.

§Scope of this PR

address (the BLAKE3 digest and its canonical writer) and node (the vertices and their components), with tree (the keyed, chunked tree that carries entity keys outside the nodes) and adapter (one entity’s content projection to nodes) on top of them. The commit object is deferred: its no-empty-commit rule hinges on the coincident-duplicate equivalence policy that §2.8 still leaves open. The object store and refs are not coming here at all, because #8217 placed them with Layer PRs.

Re-exports§

pub use adapter::entity_nodes;
pub use adapter::AdapterError;
pub use adapter::EntityNodes;
pub use address::Address;
pub use address::AddressError;
pub use address::ADDRESS_ALGORITHM;
pub use node::Component;
pub use node::Field;
pub use node::FieldValue;
pub use node::Node;
pub use node::NodeKind;
pub use node::Role;
pub use node::SetKind;
pub use tree::build_tree;
pub use tree::Tree;
pub use tree::TreeChunk;
pub use tree::TreeEntry;

Modules§

adapter
From one entity’s content projection to its nodes and tree entry.
address
Content addresses, and the canonical writer every object is hashed through.
node
Nodes: the vertices of the versioned IFC graph.
tree
Trees: the manifest of one version, mapping key -> node address.