feat: add filtering support for spaces#66
Conversation
Adds a --filter flag to `show` that accepts a named view (from config) or an inline filter expression. Expressions use a SELECT...WHERE pseudo-DSL where the WHERE clause is a JSONata predicate evaluated per node. Nodes are augmented with pre-computed ancestors[] and descendants[] arrays (flat, deduplicated, nearest-first) so multi-hop traversal queries work without complex JSONata lambda capture. Each entry carries edge metadata (_field, _source, _selfRef) for filtering by relationship type. Named views are defined in config under spaces[].views. SELECT clause parsing is implemented but evaluation is deferred to a future release.
Implements the SELECT clause in filter expressions, allowing matched nodes to be expanded with related nodes via graph traversal. Supports: ancestors[(type)], descendants[(type)], siblings, relationships[(childType | parentType:childType | parentType:field:childType)] Multiple directives can be combined: SELECT ancestors(goal), siblings WHERE ... The SELECT-only form (no WHERE) starts from all nodes and expands from them.
|
Claude finished @mindsocket's task in 1m 27s —— View job Code Review CompleteReviewing PR #66: feat: add filtering support for spaces SummaryThis PR adds comprehensive filtering capabilities to the Overall Assessment ✅Quality: High - Clean architecture, good type safety, comprehensive tests Detailed Findings✅ Strengths
|
… in docs - Remove warn-and-skip in filterNodes; evaluation errors now propagate - README: clarify that bare SELECT (no WHERE) returns all nodes expanded per spec
|
Claude finished @mindsocket's task in 1m 44s —— View job Code Review Complete
|
|
Claude finished @mindsocket's task in 1m 39s —— View job Code Review Complete
|

Summary
--filteroption to theshowcommand for filtering space nodes by expressionINCLUDEfor subtree expansion, andALLfilter/module:parse-expression,filter-nodes,augment-nodes,expand-includedocs/concepts.mdand README with filtering concepts and usageTest plan
bun test tests/filter/— all filter unit tests passost-tools show <space> --filter "opportunity"returns only opportunity nodesost-tools show <space> --filter "INCLUDE opportunity"returns opportunities with their full subtrees