gabriel / muse public
feat plumbing main #57 / 100

feat(plumbing): add symbolic-ref, for-each-ref, name-rev, check-ref-format, verify-pack; enhance commit-graph

Completes the remaining identified plumbing gaps from the Git comparison table, implementing every applicable absent command.

New commands: - symbolic-ref: read or write HEAD's symbolic branch reference. --set to update HEAD; --short to emit bare branch name; JSON and text output formats; validates target branch exists before writing. - for-each-ref: iterate all refs with full commit metadata. Supports --sort by any commit field, --desc for descending order, --count to limit output, and --pattern for fnmatch glob filtering. Designed for agent pipelines that need to slice the ref list. - name-rev: multi-source BFS from all branch tips simultaneously (O(total- commits)). Maps commit IDs to <branch>~N names; --name-only, --undefined to customise output; reports unreachable commits as undefined. - check-ref-format: validates branch/ref names against the full Muse naming ruleset (same as muse branch and update-ref). --quiet for shell conditionals; exits 0 only when ALL names are valid. - verify-pack: three-tier integrity check for PackBundle JSON. (1) re-hashes every object payload; (2) validates snapshot manifest references; (3) validates commit→snapshot references. Reads from stdin or --file; --no-local verifies bundle in isolation; --quiet for pipelines.

Enhanced command: - commit-graph: --count (-c) emits only the integer count, suppressing the full node list. --first-parent (-1) follows only first-parent links for linear history. --ancestry-path (-a) restricts output to commits on the direct path between tip and --stop-at (requires --stop-at).

Tests: 6 new test files (62 tests), one per command / enhancement group. All tests use direct store primitives for setup, consistent with the established plumbing test pattern.

Docs: docs/reference/plumbing.md extended with full reference entries for all 6 additions, including flag tables, JSON/text output examples, exit code tables, and pipeline examples.

Verification: mypy 0 errors (230 files), typing_audit 0 violations, pytest 2743/2743 passed.

G Gabriel Cardona <gabriel@tellurstori.com> · 2d ago Mar 21, 2026 · 96dd15b1 · parent e88283c9
14
files changed
373
files in snapshot

0 comments

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