From c5ea4875d565c13658b3188f6bad29f69237e2ee Mon Sep 17 00:00:00 2001 From: Ragnor Comerford Date: Tue, 2 Jun 2026 23:49:40 +0200 Subject: [PATCH] refactor: extract omnigraph-config crate from omnigraph-server Move config.rs (schema + loader + resolvers) into a new clean-leaf crate (serde/serde_yaml/clap/color-eyre). The server aliases it via `pub use omnigraph_config as config;` so every internal `config::` path and the `pub use config::{...}` re-exports resolve unchanged. No behavior change; the 12 config tests move verbatim and pass. First step of RFC-002 V0. --- Cargo.lock | 12 ++++++++++++ Cargo.toml | 1 + crates/omnigraph-config/Cargo.toml | 18 ++++++++++++++++++ .../config.rs => omnigraph-config/src/lib.rs} | 0 crates/omnigraph-server/Cargo.toml | 1 + crates/omnigraph-server/src/lib.rs | 2 +- 6 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 crates/omnigraph-config/Cargo.toml rename crates/{omnigraph-server/src/config.rs => omnigraph-config/src/lib.rs} (100%) diff --git a/Cargo.lock b/Cargo.lock index 3223b9c..458078f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4584,6 +4584,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "omnigraph-config" +version = "0.6.1" +dependencies = [ + "clap", + "color-eyre", + "serde", + "serde_yaml", + "tempfile", +] + [[package]] name = "omnigraph-engine" version = "0.6.1" @@ -4654,6 +4665,7 @@ dependencies = [ "lance", "lance-index", "omnigraph-compiler", + "omnigraph-config", "omnigraph-engine", "omnigraph-policy", "regex", diff --git a/Cargo.toml b/Cargo.toml index 66bfc01..043e67d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ members = [ "crates/omnigraph-cli", "crates/omnigraph-policy", "crates/omnigraph-server", + "crates/omnigraph-config", ] default-members = [ "crates/omnigraph", diff --git a/crates/omnigraph-config/Cargo.toml b/crates/omnigraph-config/Cargo.toml new file mode 100644 index 0000000..3f9b0ec --- /dev/null +++ b/crates/omnigraph-config/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "omnigraph-config" +version = "0.6.1" +edition = "2024" +description = "Configuration schema and loader for the Omnigraph graph database." +license = "MIT" +repository = "https://github.com/ModernRelay/omnigraph" +homepage = "https://github.com/ModernRelay/omnigraph" +documentation = "https://docs.rs/omnigraph-config" + +[dependencies] +serde = { workspace = true } +serde_yaml = { workspace = true } +clap = { workspace = true } +color-eyre = { workspace = true } + +[dev-dependencies] +tempfile = { workspace = true } diff --git a/crates/omnigraph-server/src/config.rs b/crates/omnigraph-config/src/lib.rs similarity index 100% rename from crates/omnigraph-server/src/config.rs rename to crates/omnigraph-config/src/lib.rs diff --git a/crates/omnigraph-server/Cargo.toml b/crates/omnigraph-server/Cargo.toml index 5994aa1..931e76d 100644 --- a/crates/omnigraph-server/Cargo.toml +++ b/crates/omnigraph-server/Cargo.toml @@ -22,6 +22,7 @@ aws = ["dep:aws-config", "dep:aws-sdk-secretsmanager"] omnigraph = { package = "omnigraph-engine", path = "../omnigraph", version = "0.6.1" } omnigraph-compiler = { path = "../omnigraph-compiler", version = "0.6.1" } omnigraph-policy = { path = "../omnigraph-policy", version = "0.6.1" } +omnigraph-config = { path = "../omnigraph-config", version = "0.6.1" } axum = { workspace = true } clap = { workspace = true } color-eyre = { workspace = true } diff --git a/crates/omnigraph-server/src/lib.rs b/crates/omnigraph-server/src/lib.rs index 60ebef3..f448471 100644 --- a/crates/omnigraph-server/src/lib.rs +++ b/crates/omnigraph-server/src/lib.rs @@ -1,6 +1,6 @@ pub mod api; pub mod auth; -pub mod config; +pub use omnigraph_config as config; pub mod graph_id; pub mod identity; pub mod policy;