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

feat(ls-remote): agent-ready supercharge — envelope, OID normalization, _emit_error

- Add _LsRemoteJson / _LsRemoteErrorJson TypedDicts for stable wire format - Add _emit_error() helper: JSON errors to stdout in --json mode, prose to stderr in text mode - Add status, error, remote, url, duration_ms, exit_code to JSON envelope - Track remote name (null when URL passed directly) and resolved url always - Add _normalize_oid(): defense-in-depth sha256: prefix on all remote-provided OIDs - Update docstring with full JSON schema and error schema - Update test_cmd_ls_remote.py: sha256:-prefix _FAKE_OID, fix format-error assertion - Add test_ls_remote_supercharge.py: 39 tests across envelope/error/OID/TypedDict/docstring/prose-pollution

sha256:206b7321d9d49434569eb1890ee37e923fe109f998dd60b9c7412ff4b1bccf12 sha
+72 ~5 symbols
sha256:fcb459a41eb85b79260c4745f35154bc6206060f87f752416cdfef92dee92e35 snapshot
+72
symbols added
~5
symbols modified
0
dead code introduced
Semantic Changes 77 symbols
~ tests/test_ls_remote_supercharge.py .py 64 symbols added
+ TestDataIntegrity class class TestDataIntegrity L218–257
+ test_already_prefixed_oid_unchanged method method test_already_prefixed_oid_unchanged L230–235
+ test_bare_hex_oid_normalized_in_json method method test_bare_hex_oid_normalized_in_json L221–228
+ test_bare_hex_oid_normalized_in_text method method test_bare_hex_oid_normalized_in_text L237–242
+ test_branch_values_are_strings method method test_branch_values_are_strings L253–257
+ test_multiple_branches_all_normalized method method test_multiple_branches_all_normalized L244–251
+ TestDocstring class class TestDocstring L323–347
+ _doc method method _doc L324–326
+ test_docstring_documents_duration_ms method method test_docstring_documents_duration_ms L340–341
+ test_docstring_documents_error method method test_docstring_documents_error L331–332
+ test_docstring_documents_error_schema method method test_docstring_documents_error_schema L346–347
+ test_docstring_documents_exit_code method method test_docstring_documents_exit_code L343–344
+ test_docstring_documents_remote method method test_docstring_documents_remote L334–335
+ test_docstring_documents_status method method test_docstring_documents_status L328–329
+ test_docstring_documents_url method method test_docstring_documents_url L337–338
+ TestErrorPayloadShape class class TestErrorPayloadShape L169–211
+ test_error_message_nonempty method method test_error_message_nonempty L182–185
+ test_error_payload_has_exactly_three_keys method method test_error_payload_has_exactly_three_keys L172–175
+ test_error_status_on_failure method method test_error_status_on_failure L177–180
+ test_exit_code_nonzero_on_error method method test_exit_code_nonzero_on_error L187–189
+ test_transport_error_is_json_in_json_mode method method test_transport_error_is_json_in_json_mode L206–211
+ test_unknown_remote_error_is_json_in_json_mode method method test_unknown_remote_error_is_json_in_json_mode L191–204
+ TestJsonEnvelopeSchema class class TestJsonEnvelopeSchema L95–162
+ test_all_required_keys_present method method test_all_required_keys_present L103–108
+ test_branches_is_dict method method test_branches_is_dict L159–162
+ test_domain_matches_remote method method test_domain_matches_remote L154–157
+ test_duration_ms_is_nonneg_float method method test_duration_ms_is_nonneg_float L122–126
+ test_error_empty_on_success method method test_error_empty_on_success L114–116
+ test_exit_code_zero_on_success method method test_exit_code_zero_on_success L118–120
+ test_remote_field_reflects_name method method test_remote_field_reflects_name L128–131
+ test_remote_null_when_url_passed_directly method method test_remote_null_when_url_passed_directly L138–142
+ test_repo_id_matches_remote method method test_repo_id_matches_remote L149–152
+ test_status_ok_on_success method method test_status_ok_on_success L110–112
+ test_url_field_reflects_resolved_url method method test_url_field_reflects_resolved_url L133–136
+ test_url_present_when_url_passed_directly method method test_url_present_when_url_passed_directly L144–147
+ TestNoProsePollution class class TestNoProsePollution L264–291
+ test_ansi_in_json_output_is_encoded method method test_ansi_in_json_output_is_encoded L283–291
+ test_error_stdout_is_valid_json method method test_error_stdout_is_valid_json L274–276
+ test_no_emoji_in_json_stdout method method test_no_emoji_in_json_stdout L269–272
+ test_no_traceback_in_json_mode method method test_no_traceback_in_json_mode L278–281
+ test_stdout_is_valid_json_in_json_mode method method test_stdout_is_valid_json_in_json_mode L265–267
+ TestTypedDicts class class TestTypedDicts L298–316
+ test_ls_remote_error_json_typeddict_exists method method test_ls_remote_error_json_typeddict_exists L303–305
+ test_ls_remote_json_has_all_new_fields method method test_ls_remote_json_has_all_new_fields L312–316
+ test_ls_remote_json_has_status_annotation method method test_ls_remote_json_has_status_annotation L307–310
+ test_ls_remote_json_typeddict_exists method method test_ls_remote_json_typeddict_exists L299–301
+ _FAKE_BARE_OID variable variable _FAKE_BARE_OID L32–32
+ _FAKE_OID variable variable _FAKE_OID L33–33
+ _FAKE_URL variable variable _FAKE_URL L34–34
+ _REMOTE_NAME variable variable _REMOTE_NAME L35–35
+ _init_repo function function _init_repo L38–51
+ _lr function function _lr L67–88
+ _make_remote_info function function _make_remote_info L54–64
+ CliRunner import import CliRunner L24–24
+ ExitCode import import ExitCode L21–21
+ InvokeResult import import InvokeResult L24–24
+ RemoteInfo import import RemoteInfo L22–22
+ TransportError import import TransportError L23–23
+ annotations import import annotations L14–14
+ get_type_hints import import get_type_hints L18–18
+ json import import json L16–16
+ patch import import patch L19–19
+ pathlib import import pathlib L17–17
+ runner variable variable runner L26–26
~ muse/cli/commands/ls_remote.py .py 8 symbols added, 2 symbols modified
+ _HEX_CHARS variable variable _HEX_CHARS L86–86
+ _LsRemoteErrorJson class class _LsRemoteErrorJson L107–111
+ _LsRemoteJson class class _LsRemoteJson L89–104
+ _SHA256_PREFIX variable variable _SHA256_PREFIX L85–85
+ _emit_error function function _emit_error L128–142
+ _normalize_oid function function _normalize_oid L114–125
+ TypedDict import import TypedDict L74–74
+ time import import time L73–73
~ 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:206b7321d9d49434569eb1890ee37e923fe109f998dd60b9c7412ff4b1bccf12 --body "your comment"