cmd_search: thin wrapper around memory_search RPC

Remove term matching, pipeline stages, mmap/store paths. Just
pass keys to memory_search and print result. For anything fancy,
use memory_query.

-165 lines.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
ProofOfConcept 2026-04-12 22:44:59 -04:00
parent 8b59becbab
commit aff872e101
2 changed files with 12 additions and 165 deletions

View file

@ -35,31 +35,10 @@ struct Cli {
enum Command {
// ── Core (daily use) ──────────────────────────────────────────────
/// Search memory (AND logic across terms)
///
/// Pipeline: -p spread -p spectral,k=20
/// Default pipeline: spread
/// Search memory via spreading activation from seed keys
Search {
/// Search terms
query: Vec<String>,
/// Algorithm pipeline stages (repeatable)
#[arg(short, long = "pipeline")]
pipeline: Vec<String>,
/// Show more results
#[arg(long)]
expand: bool,
/// Show node content, not just keys
#[arg(long)]
full: bool,
/// Show debug output for each pipeline stage
#[arg(long)]
debug: bool,
/// Also match key components (e.g. "irc" matches "irc-access")
#[arg(long)]
fuzzy: bool,
/// Also search node content (slow, use when graph search misses)
#[arg(long)]
content: bool,
/// Seed node keys
keys: Vec<String>,
},
/// Output a node's content to stdout
Render {
@ -462,8 +441,7 @@ trait Run {
impl Run for Command {
fn run(self) -> Result<(), String> {
match self {
Self::Search { query, pipeline, expand, full, debug, fuzzy, content }
=> cli::misc::cmd_search(&query, &pipeline, expand, full, debug, fuzzy, content),
Self::Search { keys } => cli::misc::cmd_search(&keys),
Self::Render { key } => cli::node::cmd_render(&key),
Self::Write { key } => cli::node::cmd_write(&key),
Self::Edit { key } => cli::node::cmd_edit(&key),