supercharge(gravity): -j alias, exit_code, duration_ms, TypedDicts, docstring
- Add from muse.core.timing import start_timer - Add exit_code: int and duration_ms: float to _JsonOut TypedDict - Add _GravityExplainJson TypedDict with all explain-mode fields plus exit_code and duration_ms annotations - Add -j alias for --json; add dest='as_json' (idiomatic; was args.json) - Replace args.json with args.as_json in both JSON branches of run() - Add elapsed = start_timer() at top of run() - Emit exit_code=0 and duration_ms=elapsed() in both JSON paths: leaderboard (_JsonOut) and explain (_GravityExplainJson) - Expand run() docstring from one-liner to full JSON envelope section - Add 57-test supercharge suite (first gravity tests ever written)
sha256:47a0555e134d0d74b5b61e5f2e1229451d2643dda36ef47b79679e8c4aa1cfe8
sha
+78
~3
symbols
sha256:fc68075bb6c184db649a1730d04e6425c82ed26c9bf988a07c878b44d030f353
snapshot
+78
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes
81 symbols
+
test_run_docstring_mentions_duration_ms
method
method test_run_docstring_mentions_duration_ms L341–344
+
test_run_docstring_mentions_exit_code
method
method test_run_docstring_mentions_exit_code L336–339
+
test_json_has_duration_ms_leaderboard
method
method test_json_has_duration_ms_leaderboard L195–197
+
test_exit_code_mirrors_process_exit_explain
method
method test_exit_code_mirrors_process_exit_explain L274–278
+
test_json_exit_code_is_int_leaderboard
method
method test_json_exit_code_is_int_leaderboard L248–250
+
test_j_alias_same_top_level_keys_as_json_flag
method
method test_j_alias_same_top_level_keys_as_json_flag L155–164
+
test_j_alias_symbol_count_matches_json_flag
method
method test_j_alias_symbol_count_matches_json_flag L166–173
+
test_has_total_production_symbols_key
method
method test_has_total_production_symbols_key L384–386
+
test_include_tests_is_false_by_default
method
method test_include_tests_is_false_by_default L392–394
+
test_leaderboard_duration_under_5000ms
method
method test_leaderboard_duration_under_5000ms L460–462
+
test_gravity_explain_json_has_address
method
method test_gravity_explain_json_has_address L319–321
+
test_gravity_explain_json_has_duration_ms
method
method test_gravity_explain_json_has_duration_ms L315–317
+
test_gravity_explain_json_has_exit_code
method
method test_gravity_explain_json_has_exit_code L311–313
+
test_gravity_explain_json_has_gravity_pct
method
method test_gravity_explain_json_has_gravity_pct L323–325
+
test_json_out_has_duration_ms_annotation
method
method test_json_out_has_duration_ms_annotation L296–298
+
test_json_out_has_exit_code_annotation
method
method test_json_out_has_exit_code_annotation L292–294
+
test_json_out_retains_filters_annotation
method
method test_json_out_retains_filters_annotation L304–306
+
test_json_out_retains_symbols_annotation
method
method test_json_out_retains_symbols_annotation L300–302
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:47a0555e134d0d74b5b61e5f2e1229451d2643dda36ef47b79679e8c4aa1cfe8 --body "your comment"
No comments yet. Be the first to start the discussion.