gabriel / muse public
feat patch ls-tree dev
AI Agent gabriel · 163 days ago · Apr 17, 2026 · Diff

feat(ls-tree): agent-ready supercharge — envelope, sha256: OIDs, _emit_error

- Add _LsTreeJson / _LsTreeErrorJson TypedDicts for stable wire format - Add _emit_error(output_json, msg, code): JSON errors to stdout in --json mode - Expand JSON envelope: status, error, path_prefix, recursive, entry_count, duration_ms, exit_code - Fix _synthetic_tree_id to return sha256:-prefixed ID (was bare hex) - Propagate output_json flag into _resolve_manifest and _validate_path_prefix - Update docstring with full JSON schema and error schema - Fix test_cmd_ls_tree.py: sha256:-prefix _sha(), fix synthetic tree ID length assertion - Add test_ls_tree_supercharge.py: 40 tests across envelope/error/OID/TypedDict/docstring/prose-pollution

sha256:3bde27f0c3f4077617ce1e5b128767b8e6779bf2ae0e0fad8a07b2da442a0714 sha
+76 ~6 symbols
sha256:5e9cc4673e341f959e0af09a28776dd3a3da0b443ce0129a8fa28f4d028e80c7 snapshot
+76
symbols added
~6
symbols modified
0
dead code introduced
Semantic Changes 82 symbols
~ tests/test_ls_tree_supercharge.py .py 71 symbols added
+ TestDocstring class class TestDocstring L375–400
+ _doc method method _doc L376–378
+ test_docstring_documents_duration_ms method method test_docstring_documents_duration_ms L392–393
+ test_docstring_documents_entry_count method method test_docstring_documents_entry_count L386–387
+ test_docstring_documents_error method method test_docstring_documents_error L383–384
+ test_docstring_documents_error_schema method method test_docstring_documents_error_schema L398–400
+ test_docstring_documents_exit_code method method test_docstring_documents_exit_code L395–396
+ test_docstring_documents_path_prefix method method test_docstring_documents_path_prefix L389–390
+ test_docstring_documents_status method method test_docstring_documents_status L380–381
+ TestErrorPayloadShape class class TestErrorPayloadShape L189–240
+ test_ansi_in_ref_error_is_json method method test_ansi_in_ref_error_is_json L218–224
+ test_bad_ref_error_is_json method method test_bad_ref_error_is_json L226–232
+ test_error_message_nonempty method method test_error_message_nonempty L205–209
+ test_error_on_empty_repo_is_json method method test_error_on_empty_repo_is_json L192–197
+ test_error_payload_has_exactly_three_keys method method test_error_payload_has_exactly_three_keys L199–203
+ test_exit_code_nonzero_on_error method method test_exit_code_nonzero_on_error L211–216
+ test_path_traversal_error_is_json method method test_path_traversal_error_is_json L234–240
+ TestJsonEnvelopeSchema class class TestJsonEnvelopeSchema L91–182
+ test_all_required_keys_present method method test_all_required_keys_present L100–107
+ test_commit_id_sha256_prefixed method method test_commit_id_sha256_prefixed L177–182
+ test_duration_ms_is_nonneg_float method method test_duration_ms_is_nonneg_float L127–133
+ test_entry_count_matches_entries_length method method test_entry_count_matches_entries_length L135–140
+ test_error_empty_on_success method method test_error_empty_on_success L115–119
+ test_exit_code_zero_on_success method method test_exit_code_zero_on_success L121–125
+ test_path_prefix_echoed_when_given method method test_path_prefix_echoed_when_given L149–154
+ test_path_prefix_null_when_not_given method method test_path_prefix_null_when_not_given L142–147
+ test_recursive_false_by_default method method test_recursive_false_by_default L156–161
+ test_recursive_true_when_flag_given method method test_recursive_true_when_flag_given L163–168
+ test_status_ok_on_success method method test_status_ok_on_success L109–113
+ test_treeish_echoed method method test_treeish_echoed L170–175
+ TestNoProsePollution class class TestNoProsePollution L310–342
+ test_ansi_in_output_encoded_in_json method method test_ansi_in_output_encoded_in_json L335–342
+ test_error_stdout_valid_json method method test_error_stdout_valid_json L323–326
+ test_no_emoji_in_json_stdout method method test_no_emoji_in_json_stdout L317–321
+ test_no_traceback_on_bad_ref method method test_no_traceback_on_bad_ref L328–333
+ test_stdout_valid_json_on_success method method test_stdout_valid_json_on_success L311–315
+ TestOidIntegrity class class TestOidIntegrity L247–303
+ test_blob_object_ids_sha256_prefixed method method test_blob_object_ids_sha256_prefixed L250–259
+ test_blob_oid_hex_part_is_64_chars method method test_blob_oid_hex_part_is_64_chars L272–281
+ test_synthetic_tree_object_ids_sha256_prefixed method method test_synthetic_tree_object_ids_sha256_prefixed L261–270
+ test_text_format_blob_oid_sha256_prefixed method method test_text_format_blob_oid_sha256_prefixed L294–303
+ test_tree_oid_hex_part_is_64_chars method method test_tree_oid_hex_part_is_64_chars L283–292
+ TestTypedDicts class class TestTypedDicts L349–368
+ test_ls_tree_error_json_typeddict_exists method method test_ls_tree_error_json_typeddict_exists L354–356
+ test_ls_tree_json_has_all_new_fields method method test_ls_tree_json_has_all_new_fields L363–368
+ test_ls_tree_json_has_status_annotation method method test_ls_tree_json_has_status_annotation L358–361
+ test_ls_tree_json_typeddict_exists method method test_ls_tree_json_typeddict_exists L350–352
+ _REPO_ID variable variable _REPO_ID L32–32
+ _commit_files function function _commit_files L55–79
+ _counter variable variable _counter L33–33
+ _init_repo function function _init_repo L44–52
+ _invoke function function _invoke L82–84
+ _sha function function _sha L40–41
+ CliRunner import import CliRunner L28–28
+ CommitRecord import import CommitRecord L26–26
+ ExitCode import import ExitCode L23–23
+ Manifest import import Manifest L27–27
+ SnapshotRecord import import SnapshotRecord L26–26
+ annotations import import annotations L13–13
+ compute_commit_id import import compute_commit_id L25–25
+ compute_snapshot_id import import compute_snapshot_id L25–25
+ datetime import import datetime L15–15
+ get_type_hints import import get_type_hints L19–19
+ hashlib import import hashlib L16–16
+ json import import json L17–17
+ pathlib import import pathlib L18–18
+ pytest import import pytest L21–21
+ write_commit import import write_commit L26–26
+ write_object import import write_object L24–24
+ write_snapshot import import write_snapshot L26–26
+ runner variable variable runner L30–30
~ muse/cli/commands/ls_tree.py .py 5 symbols added, 4 symbols modified
+ _LsTreeErrorJson class class _LsTreeErrorJson L144–148
+ _LsTreeJson class class _LsTreeJson L126–141
+ _emit_error function function _emit_error L156–170
+ TypedDict import import TypedDict L101–101
+ time import import time L100–100
~ run
← 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:3bde27f0c3f4077617ce1e5b128767b8e6779bf2ae0e0fad8a07b2da442a0714 --body "your comment"