cgcardona / muse public
feat code main #71 / 100

feat(code): Phase 1 — lineage, api-surface, codemap, clones, checkout-symbol, semantic-cherry-pick (#62)

Six new code-domain commands, all additive with zero schema changes:

muse lineage ADDRESS Full provenance chain of a symbol through commit history: created, renamed_from, moved_from, copied_from, modified, deleted. Rename/move detected by matching content_id across Insert+Delete pairs.

muse api-surface [--diff REF] Public API surface at a snapshot. With --diff REF shows added/removed/ changed public symbols between two commits. Public = kind in {function,class,method,...} and name not starting with _.

muse codemap [--top N] Semantic topology: modules ranked by size, import in-degree, import cycle detection via DFS, high-centrality symbols, boundary files (high fan-out, zero fan-in). Reveals codebase structure at a glance.

muse clones [--tier exact|near|both] Exact clones: same body_hash at different addresses (copy-paste). Near-clones: same signature_id, different body_hash (same contract, diverged implementation). Cluster output with member addresses.

muse checkout-symbol ADDRESS --commit REF [--dry-run] Restore a single symbol from a historical commit into the working tree. Only the target symbol's lines change; everything else is untouched. --dry-run prints the unified diff without writing.

muse semantic-cherry-pick ADDRESS... --from REF [--dry-run] [--json] Cherry-pick named symbols from a historical commit, not entire files. Applies each symbol patch to the working tree at the symbol's current location; appends at end if symbol is not in the current tree.

All six commands support --json and --commit REF (where applicable). mypy: 0 errors · typing_audit: 0 violations · pytest: 797 passed.

Co-authored-by: Gabriel Cardona <gabriel@tellurstori.com>

G Gabriel Cardona <cgcardona@gmail.com> · 1d ago Mar 18, 2026 · b4e8aaf2 · parent 0590ede7
oldest
newest 30%

Comments

0

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