## Crates Each subdirectory is a Cargo package with its own `Cargo.toml`. Layout: ```text crates/ app-name/ Cargo.toml src/ main.rs ``` ### Responsibilities and Dependencies | Crate | Kind | Responsibility | Depends On | |------------------|-----------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------| | `storage` | library | Backend-agnostic `Storage` and `Transaction` traits, plus adapters: `MemoryStorage`, `LmdbStorage`, `RedbStorage`, `FjallStorage`, `SqliteStorage`, `GeomergeStorage` (feature-gated). Owns `Value`, `Table`, `RowId`, `StorageError`, `CodecError`. | external `geomerge` (only with the `geomerge` feature) | | `query-ops` | library | Snapshot query operators: `scan_atom`, `semijoin`, `natural_join`. Owns `Relation`, `AtomPattern`, `Term`. | `storage` | | `plan-runner` | library + `plan-run` CLI | Executes JSON plan IR against a chosen `Storage` backend via `--backend {memory \| memory-storage \| lmdb \| redb \| fjall \| sqlite \| geomerge}`. Walks the DAG using `query-ops` operators and verifies against `expected_bindings`. | `query-ops`, `storage` (all adapter features) | | `geomerge-demo` | binary | End-to-end example exercising `GeomergeStorage`: theory loading, transactional inserts, scan, persistence round trip, law validation. | `storage` (with `geomerge`), external `geomerge` | The dependency edges form a strict DAG: ```text storage ◄── query-ops ◄── plan-runner ▲ │ └── geomerge-demo │ (also depends on │ external geomerge) │ ▼ (all storage features on) ``` No cycles, no upward dependencies. `query-ops` and `plan-runner` are layered above `storage`; `geomerge-demo` sits beside them as a runnable example.