refactor: migrate timing to start_timer() utility, standardize on duration_ms
- Extract start_timer() in muse/core/timing.py: captures monotonic t0, returns a zero-arg callable yielding ms elapsed (rounded to 3dp) - Sweep all CLI commands and core modules: replace inline t0/monotonic patterns with elapsed = start_timer() / elapsed() - Standardize JSON output key as duration_ms across all commands - Add elapsed_ms and exit_code to verify-commit and verify-object JSON - Delete dead provenance_payload_v1 (unreachable code) - Fix 20 syntax errors introduced by first migration pass (keyword arg corruption, misplaced imports, truncated attribute assignments) - Update all test files: elapsed_seconds -> duration_ms, fix negative- assertion tests whose key names were flipped by the rename
sha256:ca26408165d37e8c4f758f027e7be38aff723217406329d09a232de42e0e3f7d
sha
+334
~594
−217
symbols
sha256:2e0be062e59b29b5a673538a54710c3496f4a57e13ad29869232aa27fdb4827b
snapshot
+334
symbols added
~594
symbols modified
−217
symbols removed
0
dead code introduced
Semantic Changes
1145 symbols
~
run
~
run
~
run
~
run
~
run
~
run
~
run
~
run
~
run
~
run
~
run
~
run
~
run
~
run
~
run
~
run
~
register
~
run
~
run
~
run
~
_run_add
~
run
~
run
~
run
~
run
~
run_gc
−
test_json_elapsed_seconds_present_for_missing_object
method
method test_json_elapsed_seconds_present_for_missing_object L198–204
+
test_json_duration_ms_present_for_missing_object
method
method test_json_duration_ms_present_for_missing_object L198–204
−
test_elapsed_seconds_is_nonnegative_float
method
method test_elapsed_seconds_is_nonnegative_float L296–300
+
test_duration_ms_is_nonnegative_float
method
method test_duration_ms_is_nonnegative_float L296–300
−
test_pull_json_includes_elapsed_seconds
method
method test_pull_json_includes_elapsed_seconds L751–757
−
test_push_json_includes_elapsed_seconds
method
method test_push_json_includes_elapsed_seconds L728–735
−
test_elapsed_seconds_reflects_real_work
method
method test_elapsed_seconds_reflects_real_work L506–523
~
tests/test_cmd_domain_info_hardening.py
.py
9 symbols added, 9 symbols removed, 9 symbols modified
−
test_capabilities_only_has_elapsed_seconds
method
method test_capabilities_only_has_elapsed_seconds L139–141
−
test_elapsed_seconds_is_float_not_int
method
method test_elapsed_seconds_is_float_not_int L256–261
−
test_elapsed_seconds_six_decimal_places
method
method test_elapsed_seconds_six_decimal_places L87–91
+
test_capabilities_only_has_duration_ms
method
method test_capabilities_only_has_duration_ms L139–141
~
tests/test_cmd_for_each_ref_hardening.py
.py
1 symbol added, 1 symbol removed, 11 symbols modified
−
test_elapsed_seconds_six_decimal_places
method
method test_elapsed_seconds_six_decimal_places L176–181
+
test_early_exit_when_all_targets_found
method
method test_early_exit_when_all_targets_found L272–279
+
test_ansi_in_branch_name_sanitized_text
method
method test_ansi_in_branch_name_sanitized_text L581–590
+
test_stdin_empty_with_no_positional_errors
method
method test_stdin_empty_with_no_positional_errors L480–484
−
test_elapsed_seconds_is_non_negative_float
method
method test_elapsed_seconds_is_non_negative_float L631–635
+
test_duration_ms_is_non_negative_float
method
method test_duration_ms_is_non_negative_float L631–635
−
test_restore_50_files_elapsed_ms_reasonable
function
function test_restore_50_files_elapsed_ms_reasonable L475–488
−
test_restore_dry_run_json_has_elapsed_ms
function
function test_restore_dry_run_json_has_elapsed_ms L126–135
−
test_restore_elapsed_ms_is_reasonable
function
function test_restore_elapsed_ms_is_reasonable L114–123
+
test_restore_50_files_duration_ms_reasonable
function
function test_restore_50_files_duration_ms_reasonable L475–488
+
test_restore_dry_run_json_has_duration_ms
function
function test_restore_dry_run_json_has_duration_ms L126–135
+
test_restore_duration_ms_is_reasonable
function
function test_restore_duration_ms_is_reasonable L114–123
−
test_elapsed_ms_on_ref_not_found_error
method
method test_elapsed_ms_on_ref_not_found_error L788–794
+
test_duration_ms_on_ref_not_found_error
method
method test_duration_ms_on_ref_not_found_error L788–794
+
test_duration_ms_on_root_commit_error
method
method test_duration_ms_on_root_commit_error L803–811
−
test_rm_json_dry_run_has_elapsed_ms_and_exit_code
function
function test_rm_json_dry_run_has_elapsed_ms_and_exit_code L542–551
+
test_rm_json_dry_run_has_duration_ms_and_exit_code
function
function test_rm_json_dry_run_has_duration_ms_and_exit_code L542–551
−
test_elapsed_seconds_present_and_non_negative
method
method test_elapsed_seconds_present_and_non_negative L523–528
+
test_duration_ms_present_and_non_negative
method
method test_duration_ms_present_and_non_negative L523–528
−
test_success_json_elapsed_ms_non_negative
method
method test_success_json_elapsed_ms_non_negative L92–95
−
test_commit_not_found_error_json_has_elapsed_ms
method
method test_commit_not_found_error_json_has_elapsed_ms L155–160
+
test_success_json_duration_ms_is_float
method
method test_success_json_duration_ms_is_float L85–90
+
test_success_json_duration_ms_non_negative
method
method test_success_json_duration_ms_non_negative L92–95
+
test_commit_not_found_error_json_has_duration_ms
method
method test_commit_not_found_error_json_has_duration_ms L155–160
−
test_verify_exists_json_has_elapsed_ms
method
method test_verify_exists_json_has_elapsed_ms L129–133
−
test_verify_not_exists_json_has_elapsed_ms
method
method test_verify_not_exists_json_has_elapsed_ms L141–144
+
test_verify_exists_json_has_duration_ms
method
method test_verify_exists_json_has_duration_ms L129–133
+
test_verify_not_exists_json_has_duration_ms
method
method test_verify_not_exists_json_has_duration_ms L141–144
−
test_payment_json_elapsed_ms_is_float
method
method test_payment_json_elapsed_ms_is_float L211–219
−
test_verify_invalid_json_has_elapsed_ms
method
method test_verify_invalid_json_has_elapsed_ms L152–165
−
test_verify_valid_json_elapsed_ms_is_float
method
method test_verify_valid_json_elapsed_ms_is_float L143–150
−
test_verify_valid_json_has_elapsed_ms
method
method test_verify_valid_json_has_elapsed_ms L126–132
+
test_payment_json_duration_ms_is_float
method
method test_payment_json_duration_ms_is_float L211–219
+
test_verify_invalid_json_has_duration_ms
method
method test_verify_invalid_json_has_duration_ms L152–165
+
test_verify_valid_json_duration_ms_is_float
method
method test_verify_valid_json_duration_ms_is_float L143–150
+
test_verify_valid_json_has_duration_ms
method
method test_verify_valid_json_has_duration_ms L126–132
~
tests/test_cmd_snapshot_diff_supercharge.py
.py
2 symbols added, 2 symbols removed, 4 symbols modified
~
tests/test_cmd_sparse_checkout_supercharge.py
.py
6 symbols added, 6 symbols removed, 5 symbols modified
−
test_U1_elapsed_ms_present_code_domain
method
method test_U1_elapsed_ms_present_code_domain L122–125
−
test_U1_elapsed_ms_present_non_code_domain
method
method test_U1_elapsed_ms_present_non_code_domain L127–130
−
test_U2_elapsed_ms_present_in_branch_only
method
method test_U2_elapsed_ms_present_in_branch_only L160–164
−
test_P2_elapsed_ms_present_in_all_rapid_calls
method
method test_P2_elapsed_ms_present_in_all_rapid_calls L491–498
−
test_P3_elapsed_ms_consistent_across_clean_calls
method
method test_P3_elapsed_ms_consistent_across_clean_calls L500–509
+
test_U1_duration_ms_present_code_domain
method
method test_U1_duration_ms_present_code_domain L122–125
+
test_U1_duration_ms_present_non_code_domain
method
method test_U1_duration_ms_present_non_code_domain L127–130
+
test_U2_duration_ms_present_in_branch_only
method
method test_U2_duration_ms_present_in_branch_only L160–164
+
test_P2_duration_ms_present_in_all_rapid_calls
method
method test_P2_duration_ms_present_in_all_rapid_calls L491–498
+
test_P3_duration_ms_consistent_across_clean_calls
method
method test_P3_duration_ms_consistent_across_clean_calls L500–509
−
test_U1_elapsed_ms_force_create_existing
method
method test_U1_elapsed_ms_force_create_existing L145–150
−
test_P3_elapsed_ms_in_all_rapid_json_calls
method
method test_P3_elapsed_ms_in_all_rapid_json_calls L466–474
+
test_U1_duration_ms_force_create_existing
method
method test_U1_duration_ms_force_create_existing L145–150
+
test_P3_duration_ms_in_all_rapid_json_calls
method
method test_P3_duration_ms_in_all_rapid_json_calls L466–474
~
tests/test_cmd_symbolic_ref_supercharge.py
.py
11 symbols added, 11 symbols removed, 10 symbols modified
−
test_P1_100_rapid_reads_all_have_elapsed_ms
method
method test_P1_100_rapid_reads_all_have_elapsed_ms L398–406
−
test_P3_20_branch_writes_all_include_elapsed_ms
method
method test_P3_20_branch_writes_all_include_elapsed_ms L413–424
+
test_P1_100_rapid_reads_all_have_duration_ms
method
method test_P1_100_rapid_reads_all_have_duration_ms L398–406
+
test_P3_20_branch_writes_all_include_duration_ms
method
method test_P3_20_branch_writes_all_include_duration_ms L413–424
−
test_i4_add_already_tagged_has_elapsed_ms
method
method test_i4_add_already_tagged_has_elapsed_ms L166–173
−
test_i8_remove_not_found_has_elapsed_ms
method
method test_i8_remove_not_found_has_elapsed_ms L199–206
+
test_i4_add_already_tagged_has_duration_ms
method
method test_i4_add_already_tagged_has_duration_ms L166–173
+
test_i8_remove_not_found_has_duration_ms
method
method test_i8_remove_not_found_has_duration_ms L199–206
~
TestUnit
~
tests/test_cmd_unpack_objects_supercharge.py
.py
6 symbols added, 6 symbols removed, 8 symbols modified
−
test_p1_elapsed_ms_under_5000ms_for_single_commit
method
method test_p1_elapsed_ms_under_5000ms_for_single_commit L379–389
−
test_p2_elapsed_ms_under_5000ms_for_five_commit_chain
method
method test_p2_elapsed_ms_under_5000ms_for_five_commit_chain L391–405
+
test_p1_duration_ms_under_5000ms_for_single_commit
method
method test_p1_duration_ms_under_5000ms_for_single_commit L379–389
+
test_p2_duration_ms_under_5000ms_for_five_commit_chain
method
method test_p2_duration_ms_under_5000ms_for_five_commit_chain L391–405
~
tests/test_cmd_update_ref_supercharge.py
.py
10 symbols added, 10 symbols removed, 12 symbols modified
−
test_cas1_null_guard_mismatch_has_elapsed_ms
method
method test_cas1_null_guard_mismatch_has_elapsed_ms L496–505
−
test_u9_no_verify_success_has_elapsed_ms
method
method test_u9_no_verify_success_has_elapsed_ms L183–190
−
test_s5_error_elapsed_ms_is_float_non_negative
method
method test_s5_error_elapsed_ms_is_float_non_negative L350–356
−
test_p3_200_sequential_updates_all_have_elapsed_ms
method
method test_p3_200_sequential_updates_all_have_elapsed_ms L569–576
+
test_cas1_null_guard_mismatch_has_duration_ms
method
method test_cas1_null_guard_mismatch_has_duration_ms L496–505
+
test_u9_no_verify_success_has_duration_ms
method
method test_u9_no_verify_success_has_duration_ms L183–190
+
test_s5_error_duration_ms_is_float_non_negative
method
method test_s5_error_duration_ms_is_float_non_negative L350–356
+
test_p3_200_sequential_updates_all_have_duration_ms
method
method test_p3_200_sequential_updates_all_have_duration_ms L569–576
−
test_elapsed_ms_and_exit_code_in_json
method
method test_elapsed_ms_and_exit_code_in_json L661–672
+
test_duration_ms_and_exit_code_in_json
method
method test_duration_ms_and_exit_code_in_json L661–672
−
test_elapsed_ms_and_exit_code_in_json
method
method test_elapsed_ms_and_exit_code_in_json L274–284
+
test_duration_ms_and_exit_code_in_json
method
method test_duration_ms_and_exit_code_in_json L274–284
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:ca26408165d37e8c4f758f027e7be38aff723217406329d09a232de42e0e3f7d --body "your comment"
No comments yet. Be the first to start the discussion.