gabriel / muse public
feat patch dev
AI Agent gabriel · 159 days ago · Apr 19, 2026 · Diff

feat: supercharge muse code lineage — -j alias, exit_code, duration_ms, context fields

- Add -j alias for --json - Add exit_code=0 and duration_ms to JSON output - Add filter/since/until context fields to JSON (agents can verify constraints applied) - Add _LineageJson TypedDict documenting all output keys - Expand run() docstring with JSON envelope section - Fix _classify_replace() docstring (two return values, not three — impl_only was never returned) - Fix module docstring (remove wrong impl_only claim) - Add tests/test_lineage_supercharge.py — 35 tests across 8 classes - Fix pre-existing test_lineage.py failures: commit_id format is sha256:<hex> (71 chars)

sha256:cc395a1951162620c53ae5d8cd7a1f11216da81410707ccee48832f0b244f801 sha
+76 ~7 symbols
sha256:7026f12de977c4c16e59944443241f11b5d98658a917912f069ffcc7b414cebf snapshot
+76
symbols added
~7
symbols modified
0
dead code introduced
Semantic Changes 83 symbols
~ tests/test_lineage_supercharge.py .py 73 symbols added
+ TestClassifyReplaceDocstringAccuracy class class TestClassifyReplaceDocstringAccuracy L546–570
+ test_full_rewrite_is_default method method test_full_rewrite_is_default L552–556
+ test_return_value_is_a_known_kind method method test_return_value_is_a_known_kind L558–570
+ test_signature_change_on_signature_keyword method method test_signature_change_on_signature_keyword L549–550
+ TestCommitIdFormat class class TestCommitIdFormat L302–320
+ test_commit_id_full_length method method test_commit_id_full_length L312–320
+ test_commit_id_uses_sha256_prefix method method test_commit_id_uses_sha256_prefix L303–310
+ TestCountFlag class class TestCountFlag L491–518
+ test_count_filter_combination method method test_count_filter_combination L510–518
+ test_count_only_outputs_integer method method test_count_only_outputs_integer L492–497
+ test_count_with_json_emits_structured_total method method test_count_with_json_emits_structured_total L499–508
+ TestEventDetailFields class class TestEventDetailFields L328–363
+ test_created_event_has_new_content_id method method test_created_event_has_new_content_id L342–350
+ test_modified_event_has_old_and_new_content_id method method test_modified_event_has_old_and_new_content_id L329–340
+ test_renamed_event_has_detail_in_json method method test_renamed_event_has_detail_in_json L352–363
+ TestJsonContextFields class class TestJsonContextFields L244–294
+ test_filter_field_none_when_not_applied method method test_filter_field_none_when_not_applied L255–260
+ test_filter_field_present_when_applied method method test_filter_field_present_when_applied L245–253
+ test_since_field_in_json_when_applied method method test_since_field_in_json_when_applied L262–270
+ test_since_field_none_when_not_applied method method test_since_field_none_when_not_applied L282–287
+ test_until_field_in_json_when_applied method method test_until_field_in_json_when_applied L272–280
+ test_until_field_none_when_not_applied method method test_until_field_none_when_not_applied L289–294
+ TestJsonEnvelope class class TestJsonEnvelope L189–236
+ test_address_echoed_in_json method method test_address_echoed_in_json L223–227
+ test_duration_ms_non_negative_float method method test_duration_ms_non_negative_float L197–203
+ test_exit_code_zero_in_json method method test_exit_code_zero_in_json L190–195
+ test_j_alias_output_matches_json_flag method method test_j_alias_output_matches_json_flag L212–221
+ test_j_alias_works method method test_j_alias_works L205–210
+ test_json_schema_all_required_keys method method test_json_schema_all_required_keys L229–236
+ TestKindFilters class class TestKindFilters L371–437
+ test_filter_created_only method method test_filter_created_only L372–380
+ test_filter_deleted_only method method test_filter_deleted_only L392–409
+ test_filter_modified_only method method test_filter_modified_only L382–390
+ test_filter_renamed_from_only method method test_filter_renamed_from_only L411–419
+ test_filter_returns_empty_for_unmatched_kind method method test_filter_returns_empty_for_unmatched_kind L421–430
+ test_invalid_filter_rejected_by_argparse method method test_invalid_filter_rejected_by_argparse L432–437
+ TestStabilityInJson class class TestStabilityInJson L445–483
+ test_modified_count_matches_filtered_events method method test_modified_count_matches_filtered_events L476–483
+ test_stability_pct_100_when_no_modifications method method test_stability_pct_100_when_no_modifications L454–462
+ test_stability_pct_always_in_json method method test_stability_pct_always_in_json L446–452
+ test_stability_pct_zero_when_all_filtered_to_modified method method test_stability_pct_zero_when_all_filtered_to_ L464–474
+ TestTypedDictExport class class TestTypedDictExport L526–538
+ test_lineage_json_typeddict_importable method method test_lineage_json_typeddict_importable L527–530
+ test_typeddict_has_required_fields method method test_typeddict_has_required_fields L532–538
+ _REPO_ID variable variable _REPO_ID L62–62
+ _SEQ variable variable _SEQ L63–63
+ _cid function function _cid L66–67
+ _commit function function _commit L75–92
+ _delete function function _delete L105–112
+ _insert function function _insert L95–102
+ _replace function function _replace L115–130
+ _ts function function _ts L70–72
+ cli variable variable cli L55–55
+ code_repo function function code_repo L143–164
+ CliRunner import import CliRunner L45–45
+ CommitRecord import import CommitRecord L52–52
+ DeleteOp import import DeleteOp L53–53
+ DomainOp import import DomainOp L53–53
+ InsertOp import import InsertOp L53–53
+ ReplaceOp import import ReplaceOp L53–53
+ _LineageEvent import import _LineageEvent L46–46
+ _classify_replace class import _classify_replace L46–46
+ _stability import import _stability L46–46
+ annotations import import annotations L36–36
+ build_lineage import import build_lineage L46–46
+ datetime import import datetime L38–38
+ json import import json L39–39
+ pathlib import import pathlib L40–40
+ pytest import import pytest L43–43
+ textwrap import import textwrap L41–41
+ modified_repo function function modified_repo L168–181
+ repo function function repo L134–139
+ runner variable variable runner L56–56
~ muse/cli/commands/lineage.py .py 3 symbols added, 4 symbols modified
+ _LineageJson class class _LineageJson L108–134
+ TypedDict import import TypedDict L82–82
+ start_timer import import start_timer L87–87
~ run
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

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

To add a comment, use the Muse CLI: muse hub commit comment sha256:cc395a1951162620c53ae5d8cd7a1f11216da81410707ccee48832f0b244f801 --body "your comment"