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

feat: add agent_id + model_id to log --json; fix truncated flag

- _CommitJson TypedDict now includes agent_id and model_id (both always present, empty string for non-agent commits). - _commit_to_json serialises c.agent_id and c.model_id from CommitRecord. - truncated flag now correctly fires when -n limit is hit: fetch limit+1 commits, check length, slice to limit — probe pattern avoids false negatives when walk_limit == len(history). - Module docstring example updated: sha256: prefixes, agent_id/model_id fields, files_added populated, stale '--stat required' note removed. - _CommitJson docstring updated: files are always populated in --json mode. - TDD: new tests/test_log_json_schema.py with 20 tests covering schema invariants, file list population, agent provenance fields, filters, and edge cases (initial commit, merge commit two-parent).

sha256:48ffbe325ef0c814485063ac6b560f78f40bd8ab18d5c1f9652bc526a473332e sha
+38 ~3 symbols
sha256:64eb38fe2ba2a4b614318bf9ad653be3119218ca6582e9c57a8fdf4985dc967c snapshot
+38
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 41 symbols
~ tests/test_log_json_schema.py .py 38 symbols added
+ TestAgentProvenanceIII class class TestAgentProvenanceIII L242–301
+ test_III1_agent_id_present_empty_for_non_agent_commit method method test_III1_agent_id_present_empty_for_non_agent_commit L243–250
+ test_III2_model_id_present_empty_for_non_agent_commit method method test_III2_model_id_present_empty_for_non_agent_commit L252–259
+ test_III3_agent_id_populated_when_passed_to_commit method method test_III3_agent_id_populated_when_passed_to_commit L261–280
+ test_III4_model_id_populated_when_passed_to_commit method method test_III4_model_id_populated_when_passed_to_commit L282–301
+ TestEdgeCasesV class class TestEdgeCasesV L367–401
+ test_V1_initial_commit_parent_is_null method method test_V1_initial_commit_parent_is_null L368–373
+ test_V2_merge_commit_has_two_parents method method test_V2_merge_commit_has_two_parents L375–401
+ TestFileListsII class class TestFileListsII L196–234
+ test_II1_files_added_populated_no_stat_flag method method test_II1_files_added_populated_no_stat_flag L197–206
+ test_II2_files_modified_populated method method test_II2_files_modified_populated L208–216
+ test_II3_files_removed_populated method method test_II3_files_removed_populated L218–225
+ test_II4_initial_commit_files_removed_and_modified_empty method method test_II4_initial_commit_files_removed_and_modified_empty L227–234
+ TestFiltersIV class class TestFiltersIV L309–359
+ test_IV1_author_filter_matches_commits method method test_IV1_author_filter_matches_commits L310–329
+ test_IV2_author_filter_is_case_insensitive method method test_IV2_author_filter_is_case_insensitive L331–344
+ test_IV3_limit_caps_commits method method test_IV3_limit_caps_commits L346–349
+ test_IV4_truncated_true_when_limit_hit method method test_IV4_truncated_true_when_limit_hit L351–354
+ test_IV5_truncated_false_when_all_fit method method test_IV5_truncated_false_when_all_fit L356–359
+ TestSchemaInvariantsI class class TestSchemaInvariantsI L139–188
+ test_I1_top_level_keys method method test_I1_top_level_keys L140–147
+ test_I2_each_commit_has_all_required_keys method method test_I2_each_commit_has_all_required_keys L149–155
+ test_I3_commit_id_is_sha256_prefixed method method test_I3_commit_id_is_sha256_prefixed L157–163
+ test_I4_parent_commit_id_is_sha256_prefixed_or_null method method test_I4_parent_commit_id_is_sha256_prefixed_or_null L165–179
+ test_I5_snapshot_id_is_sha256_prefixed method method test_I5_snapshot_id_is_sha256_prefixed L181–188
+ _REQUIRED_COMMIT_KEYS variable variable _REQUIRED_COMMIT_KEYS L80–86
+ _REQUIRED_TOP_KEYS variable variable _REQUIRED_TOP_KEYS L88–88
+ _env function function _env L91–92
+ _log_json function function _log_json L95–98
+ cli variable variable cli L77–77
+ CliRunner import import CliRunner L75–75
+ annotations import import annotations L68–68
+ json import import json L70–70
+ pathlib import import pathlib L71–71
+ pytest import import pytest L73–73
+ multi_commit_repo function function multi_commit_repo L115–131
+ runner variable variable runner L78–78
+ single_commit_repo function function single_commit_repo L102–111
~ muse/cli/commands/log.py .py 3 symbols modified
← Older Oldest on task/log-json-schema
All commits
Newer → Latest on task/log-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:48ffbe325ef0c814485063ac6b560f78f40bd8ab18d5c1f9652bc526a473332e --body "your comment"