server/lib/src/storage/mod.rs
//! Storage endpoints: the backing-store side of the wiring graph.
//!
//! A [`StorageEndpoint`] is a RON-configured store a repository reads from and
//! writes to — sibling node type to `exposed::ExposedEndpoint`, addressed by
//! `ron_name` and resolved by `wire_holger`. `ron_storage_type` selects the
//! backend (`"znippy"` = immutable content-addressed archive at `ron_path`,
//! `"rocksdb"` = mutable KV) and `ron_path` is where it lives on disk.
//!
//! It opens NO store, by decision (stinky 25, 2026-10-22). The bytes are opened
//! by the one factory, `Repository::backend_from_config_with`, from the
//! repository's own `ron_writable_archive` / `ron_archive_path` / `ron_data_dir`,
//! and where they are on disk is answered by `Repository::storage_places`. A
//! storage endpoint is a NAME in the wiring graph: `wire_holger` refuses a
//! repository whose `ron_in`/`ron_out` names one that is not declared. The no-op
//! `backend_from_config` that stood here claimed a seam that did not exist.
//!
//! Unlike the exposed side (whose `wired_out_repositories` FastRoute table is read
//! on every request), a storage endpoint keeps no back-refs to its repositories:
//! the wiring graph flows repo → storage (forward), and nothing here reads a
//! reverse link. Reverse `storage → repos` edges lived here once as write-only
//! `*const Repository` vectors that no consumer ever read — a dead unsafe pointer
//! set — and were removed. If the UI lineage graph ever needs symmetric
//! storage→repo edges, derive them from the repositories' `ron_in`/`ron_out`
//! rather than reintroducing raw back-ref pointers.
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
pub struct StorageEndpoint {
pub ron_name: String,
pub ron_storage_type: String, // "znippy" | "rocksdb"
pub ron_path: String,
}
#[cfg(test)]
mod tests {
/// stinky 25: a storage endpoint opens no store. The bytes are opened by the
/// ONE factory, `Repository::backend_from_config_with`, and where they live
/// is answered by `Repository::storage_places`. A no-op `backend_from_config`
/// here only claimed a seam that does not exist, and the write-only raw
/// `wired_storage`/`wired_exposed` pointers were a dead unsafe set nobody read.
#[test]
fn the_storage_endpoint_claims_no_store_and_keeps_no_dead_pointer() {
let storage = include_str!("mod.rs");
let repository = include_str!("../repository.rs");
let wiring = include_str!("../lib.rs");
let stub = ["fn backend", "_from_config(&mut self)"].concat();
assert!(
!storage.contains(&stub),
"storage/mod.rs still carries the no-op store opener"
);
for dead in [
["wired", "_storage"].concat(),
["wired", "_exposed"].concat(),
] {
assert!(
!repository.contains(&dead),
"repository.rs still declares `{dead}`"
);
assert!(!wiring.contains(&dead), "lib.rs still writes `{dead}`");
}
let call = ["se.backend", "_from_config()"].concat();
assert!(
!wiring.contains(&call),
"boot still calls the no-op store opener"
);
}
}