fix(ci): run only on push to main and PRs targeting main
* fix(code): close 4 architectural gaps — validation, deps, find-symbol, temporal query
Patch syntax validation (gap 1) -------------------------------- - Add validate_source() to TreeSitterAdapter: parse content with the tree-sitter grammar for that language, walk the CST for ERROR/MISSING nodes, return a precise line-level error message. - Add validate_syntax(source, file_path) public function to ast_parser.py: dispatches to ast.parse for Python, validate_source for all tree-sitter languages, no-op for unsupported extensions. - patch.py: replace Python-only ast.parse guard with validate_syntax call. muse patch now validates syntax for all 11 supported languages before writing to disk.
muse deps (gap 2 — no dependency graph) ----------------------------------------- - New command muse/cli/commands/deps.py. - File mode: extract import-kind symbols from the snapshot for a file (what does it import?). --reverse scans all other files' import symbols for references to the target (what imports it?). - Symbol mode (address contains ::): Python-only call extraction via ast.walk on the function node, collecting ast.Call targets as callees. --reverse scans all Python files in the snapshot for callers of the bare function name. - --commit for historical snapshots; --json for pipelines.
muse find-symbol (gaps 3 & 4 — cross-branch, temporal hash search) -------------------------------------------------------------------- - New command muse/cli/commands/find_symbol.py. - Walks ALL CommitRecords in the object store (get_all_commits), sorted oldest-first, scanning InsertOps in each structured_delta. - --hash HASH: re-parses the snapshot blob for each matched InsertOp to obtain the exact content_id and filter by prefix. Finds when a specific function body first entered the repository, across every branch. - --name NAME: matches bare symbol name (exact or prefix with *). - --kind KIND: restricts to a symbol kind. - --all-branches: additionally enumerates every branch tip via .muse/refs/heads/ and checks its HEAD snapshot for current presence. - --first: deduplicate on content_id, keeping only the first appearance.
muse query --all-commits (gap 4 — temporal hash= across history) ----------------------------------------------------------------- - New --all-commits flag on the existing muse query command. - When set, walks all commits ordered oldest-first, applies the full predicate DSL against each snapshot (re-parses blobs). - Deduplicates on content_id, annotating the first commit each unique hash was seen. "hash=a3f2c9 --all-commits" answers: when did this function body first appear, and on which branch? - Mutually exclusive with --commit.
All gates: mypy strict 0 errors, typing_audit --max-any 0, 797 tests green.
* fix(ci): run only on push to main and PRs targeting main
---------
Co-authored-by: Gabriel Cardona <gabriel@tellurstori.com>
Comments
0No comments yet. Be the first to start the discussion.