gabriel / muse public
blame.md markdown
90 lines 2.7 KB
Raw
sha256:c0eba5ad689cec79f4a3fcdc4f5da78556cb4b8cb7b330f944634356c10379ed chore: pivot to nightly channel — bump version to 0.2.0.dev… Sonnet 5 patch 12 days ago

muse blame — line-level attribution for text files

muse blame shows which commit last modified each line of a text file tracked in state/. It is the universal, domain-agnostic attribution tool — the core VCS equivalent of git blame.

For domain-specific attribution, see:

  • muse midi note-blame — per-bar attribution in MIDI tracks
  • muse code blame — per-symbol attribution in code files

Usage

muse blame README.md
muse blame --ref v1.0.0 docs/design.md
muse blame --porcelain state/config.toml | jq '.commit_id'
muse blame --short 8 src/main.py

Options

Flag Default Description
--ref, -r HEAD Commit or branch to blame from
--porcelain, -p false Emit JSON objects instead of human-readable output
--short 12 Length of commit SHA prefix to display

Output (human-readable)

cccccccc0000  (Test User       2026-03-19)   1  hello world

Columns:

  • Commit SHA prefix (12 chars by default)
  • Author name (padded)
  • Date (YYYY-MM-DD)
  • Line number (right-aligned)
  • Line content

Output (--porcelain)

One JSON object per line:

{"lineno": 1, "commit_id": "cccccccc…", "author": "Test User", "committed_at": "2026-03-19T14:22:01+00:00", "message": "initial commit", "content": "hello world"}

How attribution works

The blame algorithm walks the commit graph backwards from the requested ref:

  1. Every line in the file at HEAD is initially attributed to HEAD.
  2. For each ancestor commit, a unified diff is computed between the ancestor's version and its child's.
  3. Lines that appear unchanged in both versions are re-attributed to the ancestor — the older commit that first introduced them.
  4. Lines that were added by a commit remain attributed to that commit.

This is equivalent to Git's blame algorithm for linear histories. For merge commits, the algorithm chooses the first parent to keep attribution clean.

Agent workflows

Find who introduced a bug

muse blame --porcelain src/parser.py \
  | jq 'select(.content | test("legacy_mode")) | .commit_id' \
  | sort -u

Audit a configuration file

muse blame config/production.toml

Annotate every line with its commit

muse blame --porcelain README.md > blame-report.jsonl

Limitations

  • Only text files are supported. Binary files (images, MIDI, etc.) should use domain-specific blame commands.
  • The walk follows the first-parent chain for merge commits. To attribute across both parents, use muse midi note-blame or muse code blame which are domain-aware.

Exit codes

Code Meaning
0 Success
1 File not found at the specified ref, or ref not found
File History 10 commits
sha256:c287f599c5429903a139eadf3c5db5d930520e57cb0c3c575d9570e953c3b2d6 chore: bump version to 0.2.0.dev2 — nightly.2 Sonnet 4.6 patch 11 days ago
sha256:8de4334a98c945aace420969d389ad678aa926d4ab4e886b2ac4c4241cb3bf2b revert: keep pyproject.toml in canonical PEP 440 form Sonnet 4.6 patch 14 days ago
sha256:50bb615c573aa4b928fca75b60f82ba2a659910066507cec6a95c412ae22ccb9 docs: add issue docs for push have-negotiation bug (#55) an… Sonnet 4.6 18 days ago
sha256:d90d175cded68aae1d4ffcf4858917854195d0cd8ce1fe73cee4dbc02541cb74 chore: trigger push to surface null-OID paths Sonnet 4.6 23 days ago
sha256:e452ad9a6ace6ccc6d875a35e06caf9da5576a970c1c36133b69a891ce5fefa8 chore: prebuild timing test Sonnet 4.6 33 days ago
sha256:0008ab6695e3e064b3e236b24fd19e538fef6a588eb0d211622f4466d919c0b1 merge: pull staging/dev — advance to 0.2.0rc12 Sonnet 4.6 patch 35 days ago
sha256:9c33d61749fff814c5226d5386aa2af7064c2c02788594a25fdd709358132eea fix: _PROPOSAL_PREFIX_RESOLVE_LIMIT 200 → 100 to match hub … Sonnet 4.6 47 days ago
sha256:36c3cb3e76619d4c30a6d9bf81b5ec4ff148e30dcfed913e3114ca7b43b81c7e fix: rename objects→blobs in push client and all stale test… Sonnet 4.6 patch 49 days ago
sha256:c06a9b9b9fee26c68ea725b44d54b2c0a171301ce9de746d5b656617b4463a9a fix: repair four test failures from post-migration audit Sonnet 4.6 patch 56 days ago
sha256:1900655993c83c4107067375548a7be823e471d2515830842f1a12cba4bd3cdf fix: unified object store migration — idempotent writes, JS… Sonnet 4.6 minor 56 days ago