CLI/hippocampus: rename core memory functions to memory_*

Aligns function names with tool names for consistency:
- hippocampus: render → memory_render, write → memory_write, etc.
- tools/memory.rs: macro no longer prepends memory_ prefix
- CLI files: use typed async API throughout (graph.rs, journal.rs, admin.rs)

This eliminates the "memory_graph_topology" tool name bug where
graph_* and journal_* tools were incorrectly prefixed.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-13 13:26:22 -04:00
parent fa50f1c826
commit 5b07a81aa7
7 changed files with 106 additions and 130 deletions

View file

@ -397,7 +397,7 @@ impl Run for Command {
Self::History { full, key } => cli::node::cmd_history(&key, full).await,
Self::Tail { n, full, provenance, all_versions }
=> cli::journal::cmd_tail(n, full, provenance.as_deref(), !all_versions),
Self::Status => cli::admin::cmd_status(),
Self::Status => cli::admin::cmd_status().await,
Self::Query { expr } => cli::node::cmd_query(&expr).await,
Self::WeightSet { key, weight } => cli::node::cmd_weight_set(&key, weight).await,
Self::Node(sub) => sub.run().await,
@ -422,8 +422,8 @@ impl Run for NodeCmd {
impl Run for JournalCmd {
async fn run(self) -> Result<(), String> {
match self {
Self::Write { name, text } => cli::journal::cmd_journal_write(&name, &text),
Self::Tail { n, full, level } => cli::journal::cmd_journal_tail(n, full, level),
Self::Write { name, text } => cli::journal::cmd_journal_write(&name, &text).await,
Self::Tail { n, full, level } => cli::journal::cmd_journal_tail(n, full, level).await,
}
}
}
@ -431,16 +431,16 @@ impl Run for JournalCmd {
impl Run for GraphCmd {
async fn run(self) -> Result<(), String> {
match self {
Self::Link { key } => cli::graph::cmd_link(&key),
Self::Link { key } => cli::graph::cmd_link(&key).await,
Self::LinkAdd { source, target, reason }
=> cli::graph::cmd_link_add(&source, &target, &reason),
=> cli::graph::cmd_link_add(&source, &target, &reason).await,
Self::LinkSet { source, target, strength }
=> cli::graph::cmd_link_set(&source, &target, strength),
Self::LinkImpact { source, target } => cli::graph::cmd_link_impact(&source, &target),
=> cli::graph::cmd_link_set(&source, &target, strength).await,
Self::LinkImpact { source, target } => cli::graph::cmd_link_impact(&source, &target).await,
Self::CapDegree { max_degree } => cli::graph::cmd_cap_degree(max_degree),
Self::NormalizeStrengths { apply } => cli::graph::cmd_normalize_strengths(apply),
Self::Trace { key } => cli::graph::cmd_trace(&key),
Self::Communities { top_n, min_size } => cli::graph::cmd_communities(top_n, min_size),
Self::NormalizeStrengths { apply } => cli::graph::cmd_normalize_strengths(apply).await,
Self::Trace { key } => cli::graph::cmd_trace(&key).await,
Self::Communities { top_n, min_size } => cli::graph::cmd_communities(top_n, min_size).await,
}
}
}
@ -458,8 +458,8 @@ impl Run for AdminCmd {
async fn run(self) -> Result<(), String> {
match self {
Self::Init => cli::admin::cmd_init(),
Self::Health => cli::admin::cmd_health(),
Self::Topology => cli::admin::cmd_topology(),
Self::Health => cli::admin::cmd_health().await,
Self::Topology => cli::admin::cmd_topology().await,
Self::Fsck => cli::admin::cmd_fsck(),
Self::Dedup { apply } => cli::admin::cmd_dedup(apply),
Self::DailyCheck => cli::admin::cmd_daily_check(),