gabriel / muse public
feat BREAKING task/supercharge-verify-commit #1 / 1
AI Agent gabriel · 160 days ago · Apr 18, 2026 · Diff

feat: supercharge verify-commit tests; delete dead provenance_payload_v1

- Delete provenance_payload_v1 (dead code — never called anywhere) - Delete PROVENANCE_PAYLOAD_VERSION constant (redundant with the payload prefix) - Clean up provenance_payload docstring (remove v1/v2 comparison language) - Expand test_cmd_verify_commit: 25 → 65 tests across 9 classes * Unit: _resolve_ref (HEAD, sha256: passthrough, branch name, missing) * Unit: _verify_one (format_version<7 skip, committed_at tamper, model_id tamper, wrong keypair, unknown pubkey algo, signed_at field, error=None) * Unit: _fetch_key_status (active, revoked, unknown, network error, timeout, bad JSON) * Integration: text OK/BAD/ERR lines, unsigned signer, key= present/absent, short_id in output, error field stripped from JSON, signed_at non-empty, batch ordering preserved, branch name ref, nonexistent ref → USER_ERROR * Security: null byte, path traversal, bare hex (with sha256: hint to stderr) * Data integrity: committed_at/model_id tamper via CLI, wrong keypair via CLI * Stress: 50-commit batch, 10 different keys, key_status_cache N→1 call

sha256:51640b33b9dfc7bcf2d151f3663737dbb6486d56e6201f064884fc5a82106be0 sha
+72 ~17 −24 symbols
sha256:4ae0b946abaca8e58b2ec341580808c7bd74b2194bc3a05ce2945a47ac0ebece snapshot
+72
symbols added
~17
symbols modified
−24
symbols removed
0
dead code introduced
Semantic Changes 113 symbols
~ muse/core/provenance.py .py 2 symbols removed, 1 symbol modified
− PROVENANCE_PAYLOAD_VERSION variable variable PROVENANCE_PAYLOAD_VERSION L81–81
− provenance_payload_v1 function function provenance_payload_v1 L149–168
~ tests/test_cmd_verify_commit.py .py 72 symbols added, 20 symbols removed, 11 symbols modified
− test_ed25519_prefix_survives_store_roundtrip function function test_ed25519_prefix_survives_store_roundtrip L490–503
− test_force_write_commit_path_matches_read_commit function function test_force_write_commit_path_matches_read_commit L461–487
− test_verify_commit_100_signed_commits function function test_verify_commit_100_signed_commits L421–431
− test_verify_commit_ansi_in_ref_rejected function function test_verify_commit_ansi_in_ref_rejected L386–390
− test_verify_commit_batch_all_valid function function test_verify_commit_batch_all_valid L350–359
− test_verify_commit_check_key_status_unknown_no_hub function function test_verify_commit_check_key_status_unknown_no_hub L371–378
− test_verify_commit_head_shorthand function function test_verify_commit_head_shorthand L324–331
− test_verify_commit_invalid_exits_nonzero function function test_verify_commit_invalid_exits_nonzero L285–304
− test_verify_commit_json_output function function test_verify_commit_json_output L271–282
− test_verify_commit_key_status_cache_deduplicates function function test_verify_commit_key_status_cache_deduplicates L434–453
− test_verify_commit_nonexistent_ref_exits_nonzero function function test_verify_commit_nonexistent_ref_exits_nonzero L334–337
− test_verify_commit_text_output_format function function test_verify_commit_text_output_format L340–347
− test_verify_commit_unsigned_no_strict_exits_zero function function test_verify_commit_unsigned_no_strict_exits_zero L307–314
− test_verify_commit_valid_exits_zero function function test_verify_commit_valid_exits_zero L263–268
− test_verify_one_json_schema_keys function function test_verify_one_json_schema_keys L244–255
− test_verify_one_key_status_unknown_without_hub function function test_verify_one_key_status_unknown_without_hub L234–241
− test_verify_one_missing_public_key function function test_verify_one_missing_public_key L178–201
− test_verify_one_tampered_commit_id function function test_verify_one_tampered_commit_id L169–175
− test_verify_one_unknown_algo_prefix_returns_invalid function function test_verify_one_unknown_algo_prefix_returns_invalid L506–528
− test_verify_one_unsigned_commit function function test_verify_one_unsigned_commit L160–166
+ TestCheckKeyStatus class class TestCheckKeyStatus L789–796
+ test_unknown_without_hub method method test_unknown_without_hub L790–796
+ TestDataIntegrity class class TestDataIntegrity L844–928
+ test_committed_at_tamper_fails_cli method method test_committed_at_tamper_fails_cli L845–862
+ test_ed25519_prefix_survives_store_roundtrip method method test_ed25519_prefix_survives_store_roundtrip L902–911
+ test_force_write_commit_path_matches_read_commit method method test_force_write_commit_path_matches_read_commit L913–928
+ test_model_id_tamper_fails_cli method method test_model_id_tamper_fails_cli L864–881
+ test_wrong_keypair_fails_cli method method test_wrong_keypair_fails_cli L883–900
+ TestFetchKeyStatus class class TestFetchKeyStatus L500–546
+ test_returns_active method method test_returns_active L501–508
+ test_returns_revoked method method test_returns_revoked L510–517
+ test_returns_unknown_for_unrecognised_status method method test_returns_unknown_for_unrecognised_status L519–526
+ test_returns_unknown_on_invalid_json method method test_returns_unknown_on_invalid_json L539–546
+ test_returns_unknown_on_network_error method method test_returns_unknown_on_network_error L528–531
+ test_returns_unknown_on_timeout method method test_returns_unknown_on_timeout L533–537
+ TestJsonOutput class class TestJsonOutput L627–704
+ test_batch_each_line_is_valid_json method method test_batch_each_line_is_valid_json L671–683
+ test_batch_results_in_submission_order method method test_batch_results_in_submission_order L685–695
+ test_error_field_stripped_from_json_output method method test_error_field_stripped_from_json_output L652–659
+ test_json_flag_alias method method test_json_flag_alias L697–704
+ test_signed_at_non_empty_for_signed_commit method method test_signed_at_non_empty_for_signed_commit L643–650
+ test_unsigned_commit_json method method test_unsigned_commit_json L661–669
+ test_valid_commit_all_fields method method test_valid_commit_all_fields L628–641
+ TestRefResolution class class TestRefResolution L712–746
+ test_branch_name_ref method method test_branch_name_ref L721–729
+ test_head_shorthand method method test_head_shorthand L713–719
+ test_nonexistent_branch_exits_user_error method method test_nonexistent_branch_exits_user_error L742–746
+ test_nonexistent_sha256_ref_exits_user_error method method test_nonexistent_sha256_ref_exits_user_error L731–740
+ TestResolveRef class class TestResolveRef L179–226
+ test_bare_hex_normalised_to_sha256_prefix method method test_bare_hex_normalised_to_sha256_prefix L204–212
+ test_branch_name_resolves_via_ref_file method method test_branch_name_resolves_via_ref_file L214–220
+ test_head_resolves_to_branch_tip method method test_head_resolves_to_branch_tip L180–186
+ test_head_returns_none_when_branch_has_no_commits method method test_head_returns_none_when_branch_has_no_commits L188–193
+ test_missing_branch_ref_returns_none method method test_missing_branch_ref_returns_none L222–226
+ test_sha256_prefixed_id_passthrough method method test_sha256_prefixed_id_passthrough L195–202
+ TestSecurity class class TestSecurity L805–836
+ test_ansi_in_ref_rejected method method test_ansi_in_ref_rejected L806–810
+ test_bare_hex_ref_rejected_with_message method method test_bare_hex_ref_rejected_with_message L823–830
+ test_no_traceback_on_bad_ref method method test_no_traceback_on_bad_ref L832–836
+ test_null_byte_in_ref_rejected method method test_null_byte_in_ref_rejected L812–815
+ test_path_traversal_in_ref_rejected method method test_path_traversal_in_ref_rejected L817–821
+ TestStress class class TestStress L936–995
+ test_100_signed_commits_all_valid method method test_100_signed_commits_all_valid L937–947
+ test_10_different_keys_all_valid method method test_10_different_keys_all_valid L963–973
+ test_batch_50_commits_all_results_emitted method method test_batch_50_commits_all_results_emitted L949–961
+ test_key_status_cache_n_commits_same_key_one_call method method test_key_status_cache_n_commits_same_key_one_call L975–995
+ TestStrictMode class class TestStrictMode L754–781
+ test_signed_strict_exits_0 method method test_signed_strict_exits_0 L768–773
+ test_unsigned_no_strict_exits_0 method method test_unsigned_no_strict_exits_0 L755–760
+ TestTextOutput class class TestTextOutput L554–619
+ test_bad_line_for_invalid_signature method method test_bad_line_for_invalid_signature L568–584
+ test_err_line_for_missing_commit method method test_err_line_for_missing_commit L586–595
+ test_key_absent_from_text_output_for_unsigned method method test_key_absent_from_text_output_for_unsigned L605–610
+ test_ok_line_format method method test_ok_line_format L555–566
+ test_short_commit_id_in_text_output method method test_short_commit_id_in_text_output L612–619
+ test_unsigned_shows_unsigned_signer method method test_unsigned_shows_unsigned_signer L597–603
+ TestVerifyOne class class TestVerifyOne L234–492
+ test_committed_at_tamper_invalidates_signature method method test_committed_at_tamper_invalidates_signature L356–375
+ test_error_none_for_valid_commit method method test_error_none_for_valid_commit L449–456
+ test_format_version_lt_7_skipped_silently method method test_format_version_lt_7_skipped_silently L298–313
+ test_json_schema_all_keys_present method method test_json_schema_all_keys_present L486–492
+ test_key_status_cache_hit_skips_network method method test_key_status_cache_hit_skips_network L466–484
+ test_key_status_unknown_without_hub method method test_key_status_unknown_without_hub L458–464
+ test_missing_commit_returns_error method method test_missing_commit_returns_error L254–259
+ test_missing_public_key_valid_false method method test_missing_public_key_valid_false L261–276
+ test_model_id_tamper_invalidates_signature method method test_model_id_tamper_invalidates_signature L397–415
+ test_signed_at_populated_for_signed_commit method method test_signed_at_populated_for_signed_commit L439–447
+ test_unknown_public_key_algorithm method method test_unknown_public_key_algorithm L335–354
+ test_unknown_signature_algorithm method method test_unknown_signature_algorithm L315–333
+ test_unsigned_commit_valid_false_no_error method method test_unsigned_commit_valid_false_no_error L245–252
+ test_wrong_keypair_invalid method method test_wrong_keypair_invalid L417–437
+ MagicMock import import MagicMock L49–49
~ patch
~ tests/test_core_provenance.py .py 2 symbols removed, 5 symbols modified
− PROVENANCE_PAYLOAD_VERSION import import PROVENANCE_PAYLOAD_VERSION L16–16
− test_provenance_payload_version_is_2 function function test_provenance_payload_version_is_2 L39–41
← Older Oldest on task/supercharge-verify-commit
All commits
Newer → Latest on task/supercharge-verify-commit

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