gabriel / muse public
feat patch task/format-patch-supercharge #1 / 1
AI Agent gabriel · 163 days ago · Apr 17, 2026 · Diff

feat: supercharge format-patch with agent provenance, --no-blobs, and rename detection

- Add --agent-id, --model-id, --intent flags to format-patch Agent provenance fields are embedded in the patch record and included in patch_id computation (different agents produce different IDs). - Add --no-blobs flag to omit base64 blob content from patch files required_objects still lists needed objects; blobs must be fetched separately. Produces significantly smaller output for large repos. - Add rename detection to _build_file_level_ops Same-oid delete+insert is detected as a rename: emits a single 'move' op (action_label='moved'), populates files_renamed, and removes the paths from files_added/files_deleted. Returns 5-tuple including renamed dict. - Add comprehensive TDD test suite (118 tests, all GREEN) Unit, integration, CLI, stress, security, performance, and data integrity coverage across all new and existing format-patch behavior.

sha256:c1eb5a255dce60f8c830b588d317f17663fbeff335184e7e5c45a6340bc4282f sha
+167 ~3 symbols
sha256:d3acb137ebb9e9bcedf7d15d654000a0dab29c0194c8f17f0d543881e7b0a566 snapshot
+167
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 170 symbols
~ tests/test_format_patch_supercharge.py .py 167 symbols added
+ TestActionLabel class class TestActionLabel L339–364
+ test_delete_is_deleted method method test_delete_is_deleted L343–344
+ test_directory_rename_is_renamed method method test_directory_rename_is_renamed L358–359
+ test_insert_is_inserted method method test_insert_is_inserted L340–341
+ test_move_is_moved method method test_move_is_moved L355–356
+ test_mutate_is_modified method method test_mutate_is_ L349–350
+ test_patch_is_modified method method test_patch_is_ L352–353
+ test_replace_is_modified method method test_replace_is_ L346–347
+ test_unknown_defaults_to_modified method method test_unknown_defaults_to_ L361–364
+ TestAgentProvenance class class TestAgentProvenance L675–737
+ test_agent_id_affects_patch_id method method test_agent_id_affects_patch_id L709–716
+ test_agent_id_in_mpatch_file method method test_agent_id_in_mpatch_file L697–707
+ test_agent_id_set_in_output method method test_agent_id_set_in_output L676–681
+ test_all_provenance_flags_together method method test_all_provenance_flags_together L727–737
+ test_intent_set_in_output method method test_intent_set_in_output L690–695
+ test_model_id_set_in_output method method test_model_id_set_in_output L683–688
+ test_no_agent_flags_leaves_fields_empty method method test_no_agent_flags_leaves_fields_empty L718–725
+ TestBlobEmbedding class class TestBlobEmbedding L471–524
+ test_blob_decodes_to_original_content method method test_blob_decodes_to_original_content L494–502
+ test_blob_key_matches_required_object method method test_blob_key_matches_required_object L486–492
+ test_blobs_field_present method method test_blobs_field_present L472–477
+ test_blobs_is_base64_valid_string method method test_blobs_is_base64_valid_string L504–512
+ test_blobs_is_dict method method test_blobs_is_dict L479–484
+ test_unmodified_objects_not_in_blobs method method test_unmodified_objects_not_in_blobs L514–524
+ TestBreakingChanges class class TestBreakingChanges L244–276
+ test_empty_message_returns_empty method method test_empty_message_returns_empty L245–246
+ test_leading_trailing_whitespace_stripped method method test_leading_trailing_whitespace_stripped L261–264
+ test_multiple_breaking_changes method method test_multiple_breaking_changes L256–259
+ test_no_breaking_change_returns_empty method method test_no_breaking_change_returns_empty L248–249
+ test_not_at_start_of_line_ignored method method test_not_at_start_of_line_ignored L266–273
+ test_returns_list method method test_returns_list L275–276
+ test_single_breaking_change method method test_single_breaking_change L251–254
+ TestBuildFileOps class class TestBuildFileOps L372–463
+ test_added_file_in_ops method method test_added_file_in_ops L373–377
+ test_added_list_sorted method method test_added_list_sorted L393–397
+ test_deleted_file_in_ops method method test_deleted_file_in_ops L379–383
+ test_deleted_list_sorted method method test_deleted_list_sorted L399–402
+ test_different_oid_not_a_rename method method test_different_oid_not_a_rename L449–457
+ test_empty_renamed_dict_when_no_renames method method test_empty_renamed_dict_when_no_renames L459–463
+ test_modified_file_in_ops method method test_modified_file_in_ops L385–391
+ test_modified_list_sorted method method test_modified_list_sorted L404–410
+ test_rename_detected method method test_rename_detected L419–425
+ test_rename_not_in_files_added method method test_rename_not_in_files_ L427–430
+ test_rename_not_in_files_deleted method method test_rename_not_in_files_deleted L432–435
+ test_rename_op_action_label_is_moved method method test_rename_op_action_label_is_moved L443–447
+ test_rename_op_present_in_ops method method test_rename_op_present_in_ops L437–441
+ test_unchanged_file_not_in_ops method method test_unchanged_file_not_in_ops L412–416
+ TestDefaultOutput class class TestDefaultOutput L839–855
+ test_default_output_has_patch_id method method test_default_output_has_patch_id L849–855
+ test_default_output_is_valid_json method method test_default_output_is_valid_json L840–847
+ TestInitialCommit class class TestInitialCommit L632–667
+ test_all_files_in_files_added_for_initial method method test_all_files_in_files_added_for_initial L648–657
+ test_from_commit_id_empty_for_initial method method test_from_commit_id_empty_for_initial L641–646
+ test_from_snapshot_id_is_sentinel_for_initial method method test_from_snapshot_id_is_sentinel_for_initial L633–639
+ test_from_snapshot_id_set_for_second_commit method method test_from_snapshot_id_set_for_second_commit L659–667
+ TestMakePatchFilename class class TestMakePatchFilename L284–331
+ test_backslash_replaced method method test_backslash_replaced L299–301
+ test_basic_subject method method test_basic_subject L285–286
+ test_dot_replaced method method test_dot_replaced L303–307
+ test_empty_subject_returns_patch method method test_empty_subject_returns_patch L292–293
+ test_ends_with_mpatch method method test_ends_with_mpatch L288–290
+ test_long_subject_truncated method method test_long_subject_truncated L309–313
+ test_no_consecutive_dashes_in_slug method method test_no_consecutive_dashes_in_slug L329–331
+ test_no_leading_trailing_dashes_in_slug method method test_no_leading_trailing_dashes_in_slug L324–327
+ test_slash_replaced method method test_slash_replaced L295–297
+ test_unicode_stripped method method test_unicode_stripped L315–318
+ test_whitespace_replaced_with_dash method method test_whitespace_replaced_with_dash L320–322
+ TestManifestDelta class class TestManifestDelta L573–624
+ test_added_path_in_to_manifest method method test_added_path_in_to_manifest L574–579
+ test_added_path_not_in_from_manifest method method test_added_path_not_in_from_manifest L581–586
+ test_deleted_path_in_from_manifest method method test_deleted_path_in_from_manifest L588–594
+ test_deleted_path_not_in_to_manifest method method test_deleted_path_not_in_to_manifest L596–602
+ test_modified_path_in_both_manifests method method test_modified_path_in_both_manifests L604–613
+ test_unchanged_path_not_in_either_manifest method method test_unchanged_path_not_in_either_manifest L615–624
+ TestNoBlobs class class TestNoBlobs L745–788
+ test_default_has_blobs method method test_default_has_blobs L772–778
+ test_no_blobs_empties_blobs_dict method method test_no_blobs_empties_blobs_dict L746–751
+ test_no_blobs_in_mpatch_file method method test_no_blobs_in_mpatch_file L761–770
+ test_no_blobs_output_smaller_than_with_blobs method method test_no_blobs_output_smaller_than_with_blobs L780–788
+ test_no_blobs_preserves_required_objects method method test_no_blobs_preserves_required_objects L753–759
+ TestOpsCompleteness class class TestOpsCompleteness L863–894
+ test_each_op_has_required_fields method method test_each_op_has_required_fields L883–894
+ test_ops_count_equals_sum_of_file_lists method method test_ops_count_equals_sum_of_file_lists L864–881
+ TestPerformance class class TestPerformance L999–1015
+ test_elapsed_seconds_non_negative method method test_elapsed_seconds_non_negative L1010–1015
+ test_elapsed_seconds_under_two_seconds method method test_elapsed_seconds_under_two_seconds L1000–1008
+ TestRegisterFlags class class TestRegisterFlags L119–187
+ _parse method method _parse L122–126
+ test_agent_id_default_empty method method test_agent_id_default_empty L161–163
+ test_agent_id_flag method method test_agent_id_flag L157–159
+ test_intent_default_empty method method test_intent_default_empty L177–179
+ test_intent_flag method method test_intent_flag L173–175
+ test_json_default_false method method test_json_default_false L148–150
+ test_json_flag method method test_json_flag L144–146
+ test_model_id_default_empty method method test_model_id_default_empty L169–171
+ test_model_id_flag method method test_model_id_flag L165–167
+ test_no_blobs_default_false method method test_no_blobs_default_false L185–187
+ test_no_blobs_flag method method test_no_blobs_flag L181–183
+ test_output_dir_default_none method method test_output_dir_default_none L152–154
+ test_output_dir_flag method method test_output_dir_flag L136–138
+ test_output_dir_short_flag method method test_output_dir_short_flag L140–142
+ test_treeish_defaults_to_head method method test_treeish_defaults_to_head L128–130
+ test_treeish_positional method method test_treeish_positional L132–134
+ TestRenameDetectionCLI class class TestRenameDetectionCLI L796–831
+ test_genuine_add_and_delete_not_confused_for_rename method method test_genuine_add_and_delete_not_confused_for_rename L822–831
+ test_rename_in_files_renamed method method test_rename_in_files_renamed L797–804
+ test_rename_not_in_files_added method method test_rename_not_in_files_ L806–812
+ test_rename_not_in_files_deleted method method test_rename_not_in_files_deleted L814–820
+ TestRequiredObjects class class TestRequiredObjects L532–565
+ test_all_sha256_prefixed method method test_all_sha256_prefixed L533–539
+ test_required_objects_empty_for_no_change method method test_required_objects_empty_for_no_change L559–565
+ test_required_objects_is_sorted method method test_required_objects_is_sorted L541–548
+ test_required_objects_subset_of_to_manifest method method test_required_objects_subset_of_to_manifest L550–557
+ TestSecurity class class TestSecurity L950–991
+ test_ansi_escape_in_treeish_rejected method method test_ansi_escape_in_treeish_rejected L958–963
+ test_error_goes_to_stderr_not_stdout method method test_error_goes_to_stderr_not_stdout L979–983
+ test_no_traceback_on_bad_ref method method test_no_traceback_on_bad_ref L985–991
+ test_null_byte_in_treeish_rejected method method test_null_byte_in_treeish_rejected L972–977
+ test_path_traversal_in_treeish_rejected method method test_path_traversal_in_treeish_rejected L951–956
+ test_very_long_treeish_rejected method method test_very_long_treeish_rejected L965–970
+ TestSemVerBump class class TestSemVerBump L195–236
+ test_break_prefix_beats_files_added method method test_break_prefix_beats_files_ L230–231
+ test_break_prefix_is_major method method test_break_prefix_is_major L196–197
+ test_breaking_change_body_is_major method method test_breaking_change_body_is_major L202–203
+ test_breaking_change_case_insensitive method method test_breaking_change_case_insensitive L205–206
+ test_chore_no_additions_is_patch method method test_chore_no_additions_is_patch L217–218
+ test_empty_message_is_patch method method test_empty_message_is_patch L220–221
+ test_feat_bang_is_major method method test_feat_bang_is_major L199–200
+ test_feat_prefix_beats_files_added method method test_feat_prefix_beats_files_ L226–228
+ test_feat_prefix_is_minor method method test_feat_prefix_is_minor L208–209
+ test_files_added_is_minor method method test_files_added_is_minor L211–212
+ test_files_deleted_alone_is_patch method method test_files_deleted_alone_is_patch L223–224
+ test_fix_prefix_is_patch method method test_fix_prefix_is_patch L214–215
+ test_result_is_one_of_three_values method method test_result_is_one_of_three_values L233–236
+ TestStress class class TestStress L902–942
+ test_50_files_added method method test_50_files_ L903–915
+ test_mixed_50_file_commit method method test_mixed_50_file_commit L917–942
+ _TS variable variable _TS L76–76
+ _commit function function _commit L79–99
+ _fp function function _fp L102–103
+ _init_repo function function _init_repo L60–66
+ _json_out function function _json_out L106–111
+ _write_obj function function _write_obj L69–73
+ CliRunner import import CliRunner L50–50
+ CommitRecord import import CommitRecord L49–49
+ InvokeResult import import InvokeResult L50–50
+ SnapshotRecord import import SnapshotRecord L49–49
+ _action_label import import _action_label L39–39
+ _breaking_changes import import _breaking_changes L39–39
+ _build_file_level_ops import import _build_file_level_ops L39–39
+ _make_patch_filename import import _make_patch_filename L39–39
+ _sem_ver_bump import import _sem_ver_bump L39–39
+ annotations import import annotations L28–28
+ argparse import import argparse L30–30
+ compute_commit_id import import compute_commit_id L48–48
+ compute_snapshot_id import import compute_snapshot_id L48–48
+ datetime import import datetime L31–31
+ hashlib import import hashlib L32–32
+ json import import json L33–33
+ pathlib import import pathlib L34–34
+ pytest import import pytest L37–37
+ register import import register L39–39
+ time import import time L35–35
+ write_commit import import write_commit L49–49
+ write_object import import write_object L47–47
+ write_snapshot import import write_snapshot L49–49
+ runner variable variable runner L52–52
← Older Oldest on task/format-patch-supercharge
All commits
Newer → Latest on task/format-patch-supercharge

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:c1eb5a255dce60f8c830b588d317f17663fbeff335184e7e5c45a6340bc4282f --body "your comment"