Files
boxmaker/docs/plans/M5a/files/crates/memoryd/src/main.rs
T
kyleandClaude Opus 5.5 de1032157b Plan M5a: local memory in 15 tasks
memoryd (files, the check, edits, journal, index, recall, serving),
the memory tools and built-in grants in brokerd, the memory block in
loopd, bxctl reindex and memory, and the device checks with memoryd.

Each task was built as a reference and gated. Each was replayed on its
own at its end state (854 to 936 tests) and mutation-checked. Each
skeleton compiles and fails its tests. Every todo comment was read
beside its signature.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 15:32:54 -07:00

34 lines
965 B
Rust

//! `memoryd serve --config <path>`.
use std::ffi::OsString;
use std::path::PathBuf;
use std::process::ExitCode;
const USAGE: &str = "usage: memoryd serve --config <path>";
fn main() -> ExitCode {
let args: Vec<OsString> = std::env::args_os().skip(1).collect();
let Some(config) = parse(&args) else {
eprintln!("{USAGE}");
return ExitCode::from(2);
};
match memoryd::config::Config::load(&config) {
Ok(_) => {
eprintln!("memoryd: not implemented");
ExitCode::from(2)
}
Err(e) => {
eprintln!("memoryd: {e}\nsee docs/runbook.md#memoryd-start-failed");
ExitCode::from(1)
}
}
}
/// The config path of `serve --config <path>`, or `None` for any other list.
fn parse(args: &[OsString]) -> Option<PathBuf> {
match args {
[serve, flag, path] if serve == "serve" && flag == "--config" => Some(PathBuf::from(path)),
_ => None,
}
}