cgcardona / muse public
feat code main #76 / 100

feat(code): Phase 2 — query v2 predicate grammar + muse query-history

muse query upgrades to a full v2 predicate grammar: - OR, NOT, and parenthesis grouping via recursive descent parser - New predicate keys: qualified_name, body_hash, signature_id, lineno_gt, lineno_lt (no external dependencies) - All operators: = ~= ^= $= != (>= <= for lineno) - JSON output now includes schema_version:2 wrapper and end_lineno - Backward-compatible: existing "key=value" "key~=value" still work

New module muse/plugins/code/_predicate.py: - Token → Parser → Predicate pipeline - Public API: parse_query(str | list[str]) → Predicate - Drives both muse query and muse query-history

muse query-history PREDICATE... [--from REF] [--to REF]: - Walks a commit range, accumulating per-symbol history - Reports: first seen, last seen, commit count, change count - JSON with schema_version:2 - Answers: "find all Python functions introduced after v1.0"

New store function walk_commits_between() for bounded range walking. mypy: 0 errors · typing_audit: 0 violations · pytest: 797 passed.

G Gabriel Cardona <gabriel@tellurstori.com> · 1d ago Mar 18, 2026 · 0590ede7 · parent 7887bec7
oldest
newest 25%

Snapshot Diff

137 files in tree
+64 ~27 -1
AGENTS.md .md
README.md .md
docs/architecture/supercharge-plan.md .md

Comments

0

No comments yet. Be the first to start the discussion.