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

feat(docs): supercharge for agent usability

- Fix test_cmd_docs.py: replace raw hashlib.sha256().hexdigest() with blob_id() from muse.core._types — canonical sha256: prefix throughout - Change --json dest from json_output → as_json; add -j alias - Add from muse.core.timing import start_timer - Add elapsed = start_timer() at top of run() - Expand _SymbolHistoryJson, _ChangelogJson, _DocCiJson TypedDicts with exit_code: int and duration_ms: float + docstrings on each - Add exit_code=0, duration_ms=elapsed() to all three json.dumps() paths (--history, --diff, --ci modes) - Expand run() docstring with JSON envelope section (exit_code, duration_ms) - Add tests/test_docs_supercharge.py: 43 tests across 7 classes (TestJsonAlias, TestDurationMs, TestExitCode, TestTypedDicts, TestDocstrings, TestAnsiSanitization, TestPerformance)

sha256:8e74451fba52841f54e471d0e3b62d6871d470136c0b0bc225676bbd1c822d36 sha
+62 ~8 −1 symbols
sha256:46f48fcb4a908bf2d84c75159a4ef8cd86b18e4d2d51a91001bc434511979fd7 snapshot
+62
symbols added
~8
symbols modified
−1
symbol removed
0
dead code introduced
Semantic Changes 71 symbols
~ tests/test_docs_supercharge.py .py 60 symbols added
+ TestAnsiSanitization class class TestAnsiSanitization L332–345
+ test_json_output_no_ansi_ci method method test_json_output_no_ansi_ci L343–345
+ test_json_output_no_ansi_diff method method test_json_output_no_ansi_diff L339–341
+ test_json_output_no_ansi_history method method test_json_output_no_ansi_history L335–337
+ TestDocstrings class class TestDocstrings L313–324
+ test_run_docstring_mentions_duration_ms method method test_run_docstring_mentions_duration_ms L321–324
+ test_run_docstring_mentions_exit_code method method test_run_docstring_mentions_exit_code L316–319
+ TestDurationMs class class TestDurationMs L159–195
+ test_duration_ms_ci_mode method method test_duration_ms_ci_mode L176–181
+ test_duration_ms_diff_mode method method test_duration_ms_diff_mode L169–174
+ test_duration_ms_history_mode method method test_duration_ms_history_mode L162–167
+ test_duration_ms_with_missing_filter method method test_duration_ms_with_missing_filter L191–195
+ test_j_alias_duration_ms_ci method method test_j_alias_duration_ms_ci L187–189
+ test_j_alias_duration_ms_history method method test_j_alias_duration_ms_history L183–185
+ TestExitCode class class TestExitCode L203–251
+ test_exit_code_ci_is_int method method test_exit_code_ci_is_int L225–227
+ test_exit_code_ci_mode_present method method test_exit_code_ci_mode_present L220–223
+ test_exit_code_diff_mode method method test_exit_code_diff_mode L213–218
+ test_exit_code_history_mode method method test_exit_code_history_mode L206–211
+ test_exit_code_is_int_history method method test_exit_code_is_int_history L229–231
+ test_exit_code_mirrors_process_exit_diff method method test_exit_code_mirrors_process_exit_diff L239–243
+ test_exit_code_mirrors_process_exit_history method method test_exit_code_mirrors_process_exit_history L233–237
+ test_j_alias_exit_code_diff method method test_j_alias_exit_code_diff L249–251
+ test_j_alias_exit_code_history method method test_j_alias_exit_code_history L245–247
+ TestJsonAlias class class TestJsonAlias L101–151
+ test_j_alias_ci_has_exit_code method method test_j_alias_ci_has_exit_code L148–151
+ test_j_alias_exits_zero method method test_j_alias_exits_zero L104–106
+ test_j_alias_has_symbols_key method method test_j_alias_has_symbols_key L112–114
+ test_j_alias_same_top_level_keys_as_json_flag method method test_j_alias_same_top_level_keys_as_json_flag L116–125
+ test_j_alias_symbol_count_matches_json_flag method method test_j_alias_symbol_count_matches_json_flag L127–134
+ test_j_alias_valid_json method method test_j_alias_valid_json L108–110
+ test_j_alias_with_ci_flag method method test_j_alias_with_ci_flag L142–146
+ test_j_alias_with_missing_filter method method test_j_alias_with_missing_filter L136–140
+ TestPerformance class class TestPerformance L353–366
+ test_duration_ms_is_float_not_int method method test_duration_ms_is_float_not_int L364–366
+ test_duration_under_2000ms_diff method method test_duration_under_2000ms_diff L360–362
+ test_duration_under_2000ms_history method method test_duration_under_2000ms_history L356–358
+ TestTypedDicts class class TestTypedDicts L259–305
+ test_changelog_json_exists method method test_changelog_json_exists L265–266
+ test_changelog_json_has_duration_ms method method test_changelog_json_has_duration_ms L283–285
+ test_changelog_json_has_exit_code method method test_changelog_json_has_exit_code L279–281
+ test_changelog_json_retains_from_ref method method test_changelog_json_retains_from_ref L299–301
+ test_doc_ci_json_exists method method test_doc_ci_json_exists L268–269
+ test_doc_ci_json_has_duration_ms method method test_doc_ci_json_has_duration_ms L291–293
+ test_doc_ci_json_has_exit_code method method test_doc_ci_json_has_exit_code L287–289
+ test_doc_ci_json_retains_passed method method test_doc_ci_json_retains_passed L303–305
+ test_history_json_has_duration_ms method method test_history_json_has_duration_ms L275–277
+ test_history_json_has_exit_code method method test_history_json_has_exit_code L271–273
+ test_history_json_retains_address method method test_history_json_retains_address L295–297
+ test_symbol_history_json_exists method method test_symbol_history_json_exists L262–263
+ _env function function _env L45–46
+ _run function function _run L49–50
+ docs_repo function function docs_repo L59–93
+ CliRunner import import CliRunner L35–35
+ annotations import import annotations L27–27
+ blob_id import import blob_id L34–34
+ json import import json L29–29
+ pathlib import import pathlib L30–30
+ pytest import import pytest L32–32
+ runner variable variable runner L37–37
~ muse/cli/commands/docs_cmd.py .py 1 symbol added, 5 symbols modified
+ start_timer import import start_timer L129–129
~ run
~ tests/test_cmd_docs.py .py 1 symbol added, 1 symbol removed, 3 symbols modified
− hashlib import import hashlib L23–23
+ blob_id import import blob_id L26–26
← 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:8e74451fba52841f54e471d0e3b62d6871d470136c0b0bc225676bbd1c822d36 --body "your comment"