gabriel / muse public
feat patch commit task/commit-json-schema #1 / 1
gabriel · 159 days ago · Apr 16, 2026 · Diff

feat(commit): add model_id, toolchain_id, files_changed.total + clean-tree JSON

- Add model_id and toolchain_id to commit --json output (both dry-run and success paths) — agents must not need a follow-up muse show to discover which model produced a commit - Add files_changed.total = added + modified + deleted for agent convenience - Fix clean-tree non-dry-run path: now emits {"clean": true} JSON when --json is set instead of silently printing text-only output - Add tests/test_commit_json_schema.py (26 tests): schema invariants, agent provenance, dry-run parity, file accounting, error paths - Fix test_files_changed_structure: accept 'total' in files_changed keys - Fix test_text_shows_branch_and_short_id: expect sha256:-prefixed format (prefix is canonical — never stripped from display)

sha256:dc42ab6616a11368905f97b58f196e1932557d66601c491f906e2f05508f86c1 sha
+47 ~5 symbols
sha256:8efe2dd8d781bba63e136ac0c6824efa1f12e72f6c79a727b46c90d8cc65fcc0 snapshot
+47
symbols added
~5
symbols modified
0
dead code introduced
Semantic Changes 52 symbols
~ tests/test_commit_json_schema.py .py 47 symbols added
+ TestAgentProvenanceII class class TestAgentProvenanceII L211–275
+ test_II1_agent_id_in_output method method test_II1_agent_id_in_output L212–217
+ test_II2_model_id_in_output method method test_II2_model_id_in_output L219–224
+ test_II3_toolchain_id_in_output method method test_II3_toolchain_id_in_output L226–231
+ test_II4_agent_id_empty_string_for_human method method test_II4_agent_id_empty_string_for_human L233–238
+ test_II5_model_id_empty_string_for_human method method test_II5_model_id_empty_string_for_human L240–245
+ test_II6_model_id_from_env method method test_II6_model_id_from_env L247–255
+ test_II7_toolchain_id_from_env method method test_II7_toolchain_id_from_env L257–265
+ test_II8_flag_overrides_env_for_agent_id method method test_II8_flag_overrides_env_for_agent_id L267–275
+ TestDryRunSchemaIII class class TestDryRunSchemaIII L283–347
+ test_III1_dry_run_has_same_required_keys method method test_III1_dry_run_has_same_required_keys L284–290
+ test_III2_dry_run_flag_is_true method method test_III2_dry_run_flag_is_true L292–297
+ test_III3_dry_run_false_on_real_commit method method test_III3_dry_run_false_on_real_commit L299–302
+ test_III4_dry_run_has_model_id_and_toolchain_id method method test_III4_dry_run_has_model_id_and_toolchain_id L304–319
+ test_III5_dry_run_clean_tree_exits_1 method method test_III5_dry_run_clean_tree_exits_1 L321–347
+ TestErrorPathsV class class TestErrorPathsV L416–461
+ test_V1_missing_message_exits_1_with_json_error method method test_V1_missing_message_exits_1_with_json_error L417–431
+ test_V2_clean_tree_json_response method method test_V2_clean_tree_json_response L433–461
+ TestFileChangeAccountingIV class class TestFileChangeAccountingIV L355–408
+ test_IV1_initial_commit_added_gte_1 method method test_IV1_initial_commit_added_gte_1 L356–361
+ test_IV2_modification_increments_modified method method test_IV2_modification_increments_ L363–372
+ test_IV3_deletion_increments_deleted method method test_IV3_deletion_increments_deleted L374–392
+ test_IV4_total_always_matches_sum method method test_IV4_total_always_matches_sum L394–408
+ TestSchemaInvariantsI class class TestSchemaInvariantsI L149–203
+ test_I1_all_required_keys_present method method test_I1_all_required_keys_present L150–154
+ test_I2_commit_id_sha256_prefixed method method test_I2_commit_id_sha256_prefixed L156–161
+ test_I3_committed_at_is_iso8601_with_tz method method test_I3_committed_at_is_iso8601_with_tz L163–170
+ test_I4_sem_ver_bump_valid_enum method method test_I4_sem_ver_bump_valid_enum L172–177
+ test_I5_breaking_changes_always_list method method test_I5_breaking_changes_always_list L179–184
+ test_I6_files_changed_has_all_keys method method test_I6_files_changed_has_all_keys L186–193
+ test_I7_files_changed_total_is_sum method method test_I7_files_changed_total_is_sum L195–203
+ _FILES_CHANGED_KEYS variable variable _FILES_CHANGED_KEYS L101–101
+ _REQUIRED_KEYS variable variable _REQUIRED_KEYS L91–99
+ _VALID_SEM_VER_BUMPS variable variable _VALID_SEM_VER_BUMPS L102–102
+ _commit function function _commit L109–113
+ _commit_raw function function _commit_raw L116–118
+ _env function function _env L105–106
+ cli variable variable cli L88–88
+ committed_repo function function committed_repo L134–141
+ CliRunner import import CliRunner L86–86
+ annotations import import annotations L78–78
+ json import import json L80–80
+ os import import os L81–81
+ pathlib import import pathlib L82–82
+ pytest import import pytest L84–84
+ repo function function repo L122–130
+ runner variable variable runner L89–89
~ muse/cli/commands/commit.py .py 1 symbol modified
~ run
← Older Oldest on task/commit-json-schema
All commits
Newer → Latest on task/commit-json-schema

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