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

feat: add standard JSON envelope to all commands A (age→auth)

- New muse/core/envelope.py: make_envelope() returns muse_version, schema, exit_code, duration_ms, timestamp, warnings for every JSON response - tests/test_envelope.py: 19 tests, all green - age, agent, agent_config, agent_map, annotate, api_surface, apply, apply_patch, archive, attributes, auth: all JSON output paths updated to use make_envelope(); schema_version removed where present - Per-command envelope test files added

sha256:44137ae652e19f181429e3b7e63a62d0d8e96b78b5a499fd51a2259e4ab3cc0c sha
+137 ~33 −3 symbols
sha256:6a477c4b19bc17299ff2365b625e2d844e7ec746b1452e72a6c47800f0cb6b41 snapshot
+137
symbols added
~33
symbols modified
−3
symbols removed
0
dead code introduced
Semantic Changes 173 symbols
~ muse/core/envelope.py .py 6 symbols added
+ Any import import Any L33–33
+ Callable import import Callable L32–32
+ __version__ import import __version__ L35–35 ← moved from muse/cli/commands/agent_map.py
+ annotations import import annotations L29–29
+ datetime import import datetime L31–31
+ make_envelope function function make_envelope L38–69
~ tests/test_age_envelope.py .py 13 symbols added
+ TestAgeEnvelope class class TestAgeEnvelope L12–38
+ test_has_muse_version method method test_has_muse_version L13–16
+ test_has_schema method method test_has_schema L18–20
+ test_has_timestamp method method test_has_timestamp L22–24
+ test_has_warnings method method test_has_warnings L26–28
+ test_j_alias_works method method test_j_alias_works L34–38
+ test_no_schema_version method method test_no_schema_version L30–32
+ _age_json function function _age_json L9–10
+ CliRunner import import CliRunner L5–5
+ annotations import import annotations L2–2
+ json import import json L3–3
+ pytest import import pytest L4–4
+ runner variable variable runner L7–7
~ tests/test_agent_config_envelope.py .py 17 symbols added
+ TestAgentConfigEnvelope class class TestAgentConfigEnvelope L29–55
+ _check method method _check L30–36
+ test_init_envelope method method test_init_envelope L38–39
+ test_inspect_envelope method method test_inspect_envelope L45–47
+ test_read_envelope method method test_read_envelope L53–55
+ test_status_envelope method method test_status_envelope L41–43
+ test_sync_envelope method method test_sync_envelope L49–51
+ _CMDS variable variable _CMDS L27–27
+ _invoke function function _invoke L9–15
+ CliRunner import import CliRunner L5–5
+ annotations import import annotations L2–2
+ json import import json L3–3
+ os import import os L3–3
+ pathlib import import pathlib L3–3
+ pytest import import pytest L4–4
+ repo function function repo L18–25
+ runner variable variable runner L7–7
~ tests/test_agent_envelope.py .py 12 symbols added
+ TestAgentEnvelope class class TestAgentEnvelope L10–30
+ test_list_has_muse_version method method test_list_has_muse_version L11–14
+ test_list_has_schema method method test_list_has_schema L16–18
+ test_list_has_timestamp method method test_list_has_timestamp L20–22
+ test_list_has_warnings method method test_list_has_warnings L24–26
+ test_list_no_schema_version method method test_list_no_schema_version L28–30
+ _HUB variable variable _HUB L8–8
+ CliRunner import import CliRunner L5–5
+ annotations import import annotations L2–2
+ json import import json L3–3
+ pytest import import pytest L4–4
+ runner variable variable runner L7–7
~ tests/test_agent_map_envelope.py .py 7 symbols added
+ TestAgentMapEnvelope class class TestAgentMapEnvelope L9–20
+ test_has_muse_version method method test_has_muse_version L10–20
+ CliRunner import import CliRunner L5–5
+ annotations import import annotations L2–2
+ json import import json L3–3
+ pytest import import pytest L4–4
+ runner variable variable runner L7–7
~ tests/test_annotate_envelope.py .py 7 symbols added
+ TestAnnotateEnvelope class class TestAnnotateEnvelope L9–17
+ test_show_has_envelope method method test_show_has_envelope L10–17
+ CliRunner import import CliRunner L5–5
+ annotations import import annotations L2–2
+ json import import json L3–3
+ pytest import import pytest L4–4
+ runner variable variable runner L7–7
~ tests/test_api_surface_envelope.py .py 6 symbols added
+ TestApiSurfaceEnvelope class class TestApiSurfaceEnvelope L7–14
+ test_has_envelope_fields method method test_has_envelope_fields L8–14
+ CliRunner import import CliRunner L4–4
+ annotations import import annotations L2–2
+ json import import json L3–3
+ runner variable variable runner L5–5
~ tests/test_apply_archive_envelope.py .py 14 symbols added
+ TestApplyEnvelope class class TestApplyEnvelope L15–25
+ test_apply_json method method test_apply_json L16–25
+ TestApplyPatchEnvelope class class TestApplyPatchEnvelope L27–34
+ test_check_has_envelope method method test_check_has_envelope L28–34
+ TestArchiveEnvelope class class TestArchiveEnvelope L36–41
+ test_list_has_envelope method method test_list_has_envelope L37–41
+ _FIELDS variable variable _FIELDS L8–8
+ _has_envelope function function _has_envelope L10–13
+ CliRunner import import CliRunner L5–5
+ annotations import import annotations L2–2
+ json import import json L3–3
+ pathlib import import pathlib L3–3
+ pytest import import pytest L4–4
+ runner variable variable runner L6–6
+ TestAttributesEnvelope class class TestAttributesEnvelope L15–29
+ test_check_has_envelope method method test_check_has_envelope L21–24
+ test_list_has_envelope method method test_list_has_envelope L16–19
+ test_validate_has_envelope method method test_validate_has_envelope L26–29
+ TestAuthEnvelope class class TestAuthEnvelope L31–38
+ test_whoami_has_envelope method method test_whoami_has_envelope L32–38
+ _FIELDS variable variable _FIELDS L8–8
+ _check function function _check L10–13
+ CliRunner import import CliRunner L5–5
+ annotations import import annotations L2–2
+ json import import json L3–3
+ pytest import import pytest L4–4
+ runner variable variable runner L6–6
~ tests/test_envelope.py .py 26 symbols added
+ TestMakeEnvelope class class TestMakeEnvelope L13–89
+ _call method method _call L16–19
+ test_duration_ms_increases_with_time method method test_duration_ms_increases_with_time L80–85
+ test_duration_ms_is_float method method test_duration_ms_is_float L55–56
+ test_duration_ms_nonnegative method method test_duration_ms_nonnegative L58–59
+ test_exit_code_custom method method test_exit_code_custom L52–53
+ test_exit_code_defaults_to_0 method method test_exit_code_defaults_to_0 L49–50
+ test_has_duration_ms method method test_has_duration_ms L30–31
+ test_has_exit_code method method test_has_exit_code L27–28
+ test_has_muse_version method method test_has_muse_version L21–22
+ test_has_schema method method test_has_schema L24–25
+ test_has_timestamp method method test_has_timestamp L33–34
+ test_has_warnings method method test_has_warnings L36–37
+ test_muse_version_is_str method method test_muse_version_is_str L39–41
+ test_no_schema_version_key method method test_no_schema_version_key L87–89
+ test_schema_custom method method test_schema_custom L46–47
+ test_schema_defaults_to_1 method method test_schema_defaults_to_1 L43–44
+ test_timestamp_is_iso8601_z method method test_timestamp_is_iso8601_z L68–72
+ test_timestamp_is_utc method method test_timestamp_is_utc L74–78
+ test_warnings_custom method method test_warnings_custom L64–66
+ test_warnings_defaults_to_empty_list method method test_warnings_defaults_to_empty_list L61–62
+ annotations import import annotations L3–3
+ get_type_hints import import get_type_hints L6–6
+ pytest import import pytest L8–8
+ start_timer import import start_timer L10–10
+ time import import time L5–5
~ muse/cli/commands/age.py .py 1 symbol added, 1 symbol modified
+ make_envelope import import make_envelope L144–144
~ run
~ muse/cli/commands/agent.py .py 1 symbol added, 1 symbol removed, 6 symbols modified
__version__ import import __version__ L96–96
+ make_envelope import import make_envelope L96–96
~ muse/cli/commands/agent_config.py .py 1 symbol added, 1 symbol removed, 6 symbols modified
__version__ import import __version__ L63–63
+ make_envelope import import make_envelope L63–63
~ muse/cli/commands/agent_map.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
__version__ import import __version__ L37–37 → moved to muse/core/envelope.py
+ make_envelope import import make_envelope L38–38
~ run
~ muse/cli/commands/annotate.py .py 2 symbols added, 2 symbols modified
+ make_envelope import import make_envelope L101–101
+ start_timer import import start_timer L104–104
~ _show
~ run
~ muse/cli/commands/api_surface.py .py 1 symbol added, 2 symbols modified
+ make_envelope import import make_envelope L95–95
~ muse/cli/commands/apply.py .py 2 symbols added, 1 symbol modified
+ make_envelope import import make_envelope L45–45
+ start_timer import import start_timer L48–48
~ run
~ muse/cli/commands/apply_patch.py .py 1 symbol added, 1 symbol modified
+ make_envelope import import make_envelope L76–76
~ run
~ muse/cli/commands/archive.py .py 2 symbols added, 1 symbol modified
+ make_envelope import import make_envelope L112–112
+ start_timer import import start_timer L116–116
~ run
~ muse/cli/commands/attributes.py .py 2 symbols added, 3 symbols modified
+ make_envelope import import make_envelope L101–101
+ start_timer import import start_timer L104–104
~ muse/cli/commands/auth.py .py 2 symbols added, 9 symbols modified
+ make_envelope import import make_envelope L89–89
+ start_timer import import start_timer L91–91
← 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:44137ae652e19f181429e3b7e63a62d0d8e96b78b5a499fd51a2259e4ab3cc0c --body "your comment"