mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-06-12 01:45:14 +02:00
RFC-005 §D1/§D2: omnigraph-server --cluster <dir> is rule 0 of the mode inference — an exclusive boot source (hard error when combined with a graph URI, --target, or --config) that never opens omnigraph.yaml, not even the implicit current-directory search. The cluster branch reads the applied revision through omnigraph-cluster's serving-snapshot API and feeds the EXISTING multi-graph pipeline: GraphStartupConfig per recorded graph at its derived root, stored queries built via QueryRegistry::from_specs from verified blob content (expose-all — the §D5 bridge until Phase 6 policy-owned exposure), cluster-bound policy bundles as the server-level Cedar engine and graph-bound bundles per graph, straight from the content-addressed blob paths. Multiple bundles binding one scope refuse boot (one-bundle-per-scope is the serving pipeline's shape; stacking is a later slice). Everything downstream — parallel opens, query type-checking, registry, routing, auth, OpenAPI — is reused unchanged; cluster mode is a new source, not a new pipeline. First server->cluster crate dependency: read-only types + one fn; omnigraph-cluster stays HTTP-free. open_multi_graph_state goes pub for integration tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
48 lines
1.4 KiB
Rust
48 lines
1.4 KiB
Rust
use std::path::PathBuf;
|
|
|
|
use clap::Parser;
|
|
use color_eyre::eyre::Result;
|
|
use omnigraph_server::{ServerConfig, init_tracing, load_server_settings, serve};
|
|
|
|
#[derive(Debug, Parser)]
|
|
#[command(name = "omnigraph-server")]
|
|
#[command(about = "HTTP server for the Omnigraph graph database")]
|
|
struct Cli {
|
|
/// Graph URI
|
|
uri: Option<String>,
|
|
#[arg(long)]
|
|
target: Option<String>,
|
|
#[arg(long)]
|
|
config: Option<PathBuf>,
|
|
/// Boot from a cluster directory (the applied revision in
|
|
/// __cluster/state.json + content-addressed catalog blobs) instead of
|
|
/// omnigraph.yaml. Exclusive: cannot combine with <URI>, --target, or
|
|
/// --config.
|
|
#[arg(long)]
|
|
cluster: Option<PathBuf>,
|
|
#[arg(long)]
|
|
bind: Option<String>,
|
|
/// Run without bearer tokens and without a policy file (MR-723).
|
|
/// Required when neither is configured — otherwise the server
|
|
/// refuses to start to prevent shipping the illusion of protection.
|
|
/// Equivalent to setting `OMNIGRAPH_UNAUTHENTICATED=1`.
|
|
#[arg(long)]
|
|
unauthenticated: bool,
|
|
}
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<()> {
|
|
color_eyre::install()?;
|
|
init_tracing();
|
|
|
|
let cli = Cli::parse();
|
|
let settings: ServerConfig = load_server_settings(
|
|
cli.config.as_ref(),
|
|
cli.cluster.as_ref(),
|
|
cli.uri,
|
|
cli.target,
|
|
cli.bind,
|
|
cli.unauthenticated,
|
|
)?;
|
|
serve(settings).await
|
|
}
|