"""Envelope tests for ``muse agent-map --json``.""" from __future__ import annotations import json import pytest from tests.cli_test_helper import CliRunner runner = CliRunner() class TestAgentMapEnvelope: def test_has_muse_version(self) -> None: r = runner.invoke(None, ["agent-map", "tracks/fake.mid", "-j"]) # May succeed with empty attributions or fail with repo/track error; # either way, JSON mode must emit valid JSON with envelope fields. if r.exit_code == 0: d = json.loads(r.output) assert "muse_version" in d assert "schema" in d assert "timestamp" in d assert "warnings" in d assert "schema_version" not in d