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

feat(content-grep): add elapsed_seconds/exit_code to JSON, fix sha256: prefix in tests

- Add `import time` and `t0` timing to `run()` - Pass `elapsed_seconds` into `_emit()` as an explicit parameter - Add `elapsed_seconds` and `exit_code` to `_ContentGrepJson` TypedDict and JSON output - Update module docstring with correct sha256: prefix format and new fields - Fix `_sha()` helpers in both test files: prepend 'sha256:' prefix to satisfy `validate_object_id` - Fix pre-existing `len==64` assertions to `len==71` + `startswith('sha256:')` - Update `_GrepOut` TypedDict with `source`, `elapsed_seconds`, `exit_code` - Add TestJsonSchemaComplete (8 tests), TestElapsedSeconds (6 tests), TestExitCode (5 tests) - 56/56 hardening tests + 18/18 base tests pass

sha256:3bb890fb4c6062b95f305fd8e05827da2d82aac981630221cb1c2b48a74efc41 sha
+25 ~7 symbols
sha256:63810e1c710a8fc4bc6ac1e9dbef4e484f4e3c7647b55d1e158f41a30e2d4821 snapshot
+25
symbols added
~7
symbols modified
0
dead code introduced
Semantic Changes 32 symbols
~ muse/cli/commands/content_grep.py .py 1 symbol added, 3 symbols modified
+ time import import time L89–89
~ _emit
~ run
~ tests/test_cmd_content_grep.py .py 1 symbol modified
~ _sha
~ tests/test_cmd_content_grep_hardening.py .py 24 symbols added, 3 symbols modified
+ TestElapsedSeconds class class TestElapsedSeconds L765–821
+ _assert_elapsed method method _assert_elapsed L768–771
+ test_elapsed_is_float_not_int method method test_elapsed_is_float_not_int L789–794
+ test_elapsed_present_commit_mode method method test_elapsed_present_commit_mode L773–777
+ test_elapsed_present_stress_mode method method test_elapsed_present_stress_mode L804–811
+ test_elapsed_present_working_tree_mode method method test_elapsed_present_working_tree_mode L779–787
+ test_elapsed_reasonable_upper_bound method method test_elapsed_reasonable_upper_bound L796–802
+ test_elapsed_six_decimal_places method method test_elapsed_six_decimal_places L813–821
+ TestExitCode class class TestExitCode L829–870
+ test_exit_code_in_json_matches_process_exit method method test_exit_code_in_json_matches_process_exit L857–863
+ test_exit_code_is_integer method method test_exit_code_is_integer L850–855
+ test_exit_code_multiple_files method method test_exit_code_multiple_files L865–870
+ test_exit_code_zero_on_match method method test_exit_code_zero_on_match L832–837
+ test_exit_code_zero_working_tree_match method method test_exit_code_zero_working_tree_match L839–848
+ TestJsonSchemaComplete class class TestJsonSchemaComplete L678–757
+ test_all_required_keys_present_commit_mode method method test_all_required_keys_present_commit_mode L681–688
+ test_all_required_keys_present_working_tree_mode method method test_all_required_keys_present_working_tree_mode L690–702
+ test_commit_id_null_in_working_tree_mode method method test_commit_id_null_in_working_tree_mode L722–731
+ test_exit_code_field_zero_on_match method method test_exit_code_field_zero_on_match L744–749
+ test_json_is_compact method method test_json_is_compact L751–757
+ test_snapshot_id_null_in_working_tree_mode method method test_snapshot_id_null_in_working_tree_mode L733–742
+ test_source_field_is_commit method method test_source_field_is_commit L704–709
+ test_source_field_is_working_tree method method test_source_field_is_working_tree L711–720
+ _REQUIRED_KEYS variable variable _REQUIRED_KEYS L665–675
~ _sha
← Older Oldest on task/supercharge-content-grep
All commits
Newer → Latest on task/supercharge-content-grep

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