# dont-rely-on-nulls/rnt architecture

> Architecture diagram of the GitHub repository dont-rely-on-nulls/rnt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dont-rely-on-nulls/rnt
- Repository: https://github.com/dont-rely-on-nulls/rnt

## Overview

RNT is an experimental OCaml database kernel, not a query-language product. Its documented access model is object paths and explicit handles; its shipped query capability is a first-order-logic evaluator for retrieval. The graph follows documented object, relation, versioning, evaluator, and storage responsibilities. Source excerpts were unavailable, so edges are limited to relationships stated in the README; the FOL evaluator’s internal call sequence is not inferred.

Main entry points: [`lib/kernel/SubstantialRelation.ml`](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/SubstantialRelation.ml) (Relations), [`lib/kernel/Path.ml`](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Path.ml) (Path lookup), [`lib/kernel/Branch.ml`](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Branch.ml) (Branches), [`lib/kernel/Session.ml`](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Session.ml) (Snapshot sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Object access"]
  node_namespace["Object namespace<br/>[Namespace.ml]"]
  node_path["Path lookup<br/>[Path.ml]"]
  node_prototype["Object prototypes<br/>[Prototype.ml]"]
  node_handle["Explicit handles<br/>[Handle.ml]"]
  node_protocols["Object protocols"]
end

subgraph group_relations["Relational runtime"]
  node_branch["Branches<br/>[Branch.ml]"]
  node_session["Snapshot sessions<br/>[Session.ml]"]
  node_relation["Relations"]
  node_ephemeral["Ephemeral relations"]
  node_tuple["Tuples<br/>[Tuple.ml]"]
  node_identity["Content identity<br/>[Identity.ml]"]
  node_merkle["Prolly-tree indexes<br/>[Merkle.ml]"]
  node_enumeration["Enumeration and cursors<br/>[Enumerable.ml]"]
  node_cursor["Cursor protocol<br/>[Cursor.ml]"]
end

subgraph group_query["Query subsystem"]
  node_evaluator["Evaluator protocol<br/>[Evaluator.ml]"]
  node_fol["FOL evaluator<br/>[FOL.ml]"]
end

subgraph group_storage["Storage"]
  node_storage["Storage interface<br/>[Storage.ml]"]
  node_lmdb[("LMDB backend<br/>[LMDB.ml]")]
end

node_client(("Client"))

node_client -->|"looks up"| node_path
node_path -->|"traverses"| node_namespace
node_client -->|"accesses through"| node_handle
node_prototype -->|"implements"| node_protocols
node_branch -->|"snapshot pinned by"| node_session
node_session -->|"pins snapshot"| node_branch
node_relation -->|"contains"| node_tuple
node_tuple -->|"hashed as"| node_identity
node_relation -->|"indexed by"| node_merkle
node_relation -->|"exposes enumeration"| node_enumeration
node_enumeration -->|"provides cursor"| node_cursor
node_fol -->|"implements"| node_evaluator
node_storage -->|"dispatches to"| node_lmdb

click node_namespace "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Namespace.ml"
click node_path "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Path.ml"
click node_prototype "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Prototype.ml"
click node_handle "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/protocols/Handle.ml"
click node_protocols "https://github.com/dont-rely-on-nulls/rnt/tree/master/lib/protocols"
click node_branch "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Branch.ml"
click node_session "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Session.ml"
click node_relation "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/SubstantialRelation.ml"
click node_ephemeral "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/EphemeralRelation.ml"
click node_tuple "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Tuple.ml"
click node_identity "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Identity.ml"
click node_merkle "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Merkle.ml"
click node_enumeration "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/protocols/Enumerable.ml"
click node_cursor "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/protocols/Cursor.ml"
click node_evaluator "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/protocols/Evaluator.ml"
click node_fol "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/evaluators/FOL.ml"
click node_storage "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Storage.ml"
click node_lmdb "https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/backend/storage/LMDB.ml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_namespace,node_path,node_prototype,node_handle,node_protocols,node_client toneBlue
class node_branch,node_session,node_relation,node_ephemeral,node_tuple,node_identity,node_merkle,node_enumeration,node_cursor toneAmber
class node_evaluator,node_fol toneMint
class node_storage,node_lmdb toneRose
```

## Components

### Object access

- [Object namespace](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Namespace.ml): `lib/kernel/Namespace.ml`
- [Path lookup](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Path.ml): `lib/kernel/Path.ml`
- [Object prototypes](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Prototype.ml): `lib/kernel/Prototype.ml`
- [Explicit handles](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/protocols/Handle.ml): `lib/protocols/Handle.ml`
- [Object protocols](https://github.com/dont-rely-on-nulls/rnt/tree/master/lib/protocols): `lib/protocols`

### Relational runtime

- [Branches](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Branch.ml): `lib/kernel/Branch.ml`
- [Snapshot sessions](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Session.ml): `lib/kernel/Session.ml`
- [Relations](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/SubstantialRelation.ml): `lib/kernel/SubstantialRelation.ml`
- [Ephemeral relations](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/EphemeralRelation.ml): `lib/kernel/EphemeralRelation.ml`
- [Tuples](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Tuple.ml): `lib/kernel/Tuple.ml`
- [Content identity](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Identity.ml): `lib/kernel/Identity.ml`
- [Prolly-tree indexes](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Merkle.ml): `lib/kernel/Merkle.ml`
- [Enumeration and cursors](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/protocols/Enumerable.ml): `lib/protocols/Enumerable.ml`
- [Cursor protocol](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/protocols/Cursor.ml): `lib/protocols/Cursor.ml`

### Query subsystem

- [Evaluator protocol](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/protocols/Evaluator.ml): `lib/protocols/Evaluator.ml`
- [FOL evaluator](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/evaluators/FOL.ml): `lib/evaluators/FOL.ml`

### Storage

- [Storage interface](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/kernel/Storage.ml): `lib/kernel/Storage.ml`
- [LMDB backend](https://github.com/dont-rely-on-nulls/rnt/blob/master/lib/backend/storage/LMDB.ml): `lib/backend/storage/LMDB.ml`

### Other components

- **Client**

## Connections

- Client → Path lookup: looks up (evidence: `README.org`)
- Path lookup → Object namespace: traverses (evidence: `README.org`)
- Client → Explicit handles: accesses through (evidence: `README.org`)
- Object prototypes → Object protocols: implements (evidence: `README.org`)
- Branches → Snapshot sessions: snapshot pinned by (evidence: `README.org`)
- Snapshot sessions → Branches: pins snapshot (evidence: `README.org`)
- Relations → Tuples: contains (evidence: `README.org`)
- Tuples → Content identity: hashed as (evidence: `README.org`)
- Relations → Prolly-tree indexes: indexed by (evidence: `README.org`)
- Relations → Enumeration and cursors: exposes enumeration (evidence: `README.org`)
- Enumeration and cursors → Cursor protocol: provides cursor (evidence: `README.org`)
- FOL evaluator → Evaluator protocol: implements (evidence: `README.org`)
- Storage interface → LMDB backend: dispatches to (evidence: `README.org`)
