fix: muse code invariants — two bugs found via dog fooding
Bug 1: --commit HEAD~1 crashed with ValueError get_head_commit_id() called validate_branch_name() which rejects '~'. Fix: skip branch-name lookup when ref contains ref-syntax chars (~^@: etc). resolve_commit_ref() handles relative refs directly.
Bug 2: --rule filter no-match path emitted JSON without exit_code/duration_ms Both the no-match-filter and no-rules early-exit paths were missing the envelope fields that every other JSON path carries. Fix: add exit_code=0 and duration_ms=elapsed() to both paths.
Also: - Expand test_invariants_supercharge.py with 8 new tests covering both bugs (TestEarlyExitPaths, TestRelativeRefSyntax)
sha256:b013fd1234af86b3dfb8d852e9e98b10d11483c14f1ad09dc712765caa32078f
sha
+11
~1
symbols
sha256:717320a68ef2d9db9c4cdfe3781944933008c6df8808e3b75a95289915d77241
snapshot
+11
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes
12 symbols
~
run
+
test_no_match_rule_filter_has_duration_ms
method
method test_no_match_rule_filter_has_duration_ms L285–290
+
test_no_match_rule_filter_has_error_field
method
method test_no_match_rule_filter_has_error_field L292–295
+
test_no_match_rule_filter_has_exit_code
method
method test_no_match_rule_filter_has_exit_code L278–283
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:b013fd1234af86b3dfb8d852e9e98b10d11483c14f1ad09dc712765caa32078f --body "your comment"
No comments yet. Be the first to start the discussion.