query: unify PEG and engine parsers

PEG parser now handles both expression syntax (degree > 5 | sort degree)
and pipeline syntax (all | type:episodic | sort:timestamp). Deleted
Stage::parse() and helpers from engine.rs — it's now pure execution.

All callers use parse_stages() from parser.rs as the single entry point.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
ProofOfConcept 2026-04-11 20:42:58 -04:00
parent bc991c3521
commit aad227e487
8 changed files with 562 additions and 253 deletions

View file

@ -25,7 +25,7 @@ pub fn cmd_run_agent(agent: &str, count: usize, target: &[String], query: Option
target.to_vec()
} else if let Some(q) = query {
let graph = store.build_graph();
let stages = crate::search::Stage::parse_pipeline(q)?;
let stages = crate::query_parser::parse_stages(q)?;
let results = crate::search::run_query(&stages, vec![], &graph, &store, false, count);
if results.is_empty() {
return Err(format!("query returned no results: {}", q));