feat: supercharge patch-id with duration_ms, exit_code, files_changed, stable
- Add duration_ms (ms, 3dp), exit_code, files_changed, and stable to --json output. Agents now have the complete picture in one call: content identity, how many files changed, whether whitespace was normalised, and how long it took. - Update module docstring schema to reflect new fields. - Delete test_cmd_patch_id.py (14/15 tests were broken — raw hex object IDs used without required sha256: prefix). - Add test_patch_id_supercharge.py (54 tests, all GREEN): _compute_patch_id unit, JSON schema, text output, files_changed correctness, stable flag round-trip, cherry-pick detection, error paths, security (ANSI, null byte, path traversal, long ref), data integrity, performance, and stress (10 distinct commits).
sha256:7619040af537c856820b780fe64693daafcea745181a89b58eaa0e2b905241df
sha
+91
~1
−39
symbols
sha256:ad66d60c9ca8654894ae313665861f594681f2f1df87249e71434bfea43fc7dd
snapshot
+91
symbols added
~1
symbol modified
−39
symbols removed
0
dead code introduced
Semantic Changes
131 symbols
+
test_stable_normalizes_trailing_whitespace
method
method test_stable_normalizes_trailing_whitespace L154–162
+
test_unstable_sensitive_to_whitespace
method
method test_unstable_sensitive_to_whitespace L164–172
+
test_patch_id_changes_when_content_changes
method
method test_patch_id_changes_when_content_changes L556–570
+
test_patch_id_stable_vs_unstable_differ_for_ws
method
method test_patch_id_stable_vs_unstable_differ_for_ws L582–590
+
test_initial_commit_all_files_counted
method
method test_initial_commit_all_files_counted L436–443
+
test_different_diff_different_patch_id
method
method test_different_diff_different_patch_id L367–382
+
test_json_files_changed_correct_count
method
method test_json_files_changed_correct_count L257–263
+
test_stable_flag_produces_different_patch_id_for_ws_diff
method
method test_stable_flag_produces_different_patch_id_for_ws_diff L293–304
+
test_10_distinct_commits_10_distinct_patch_ids
method
method test_10_distinct_commits_10_distinct_patch_ids L622–633
+
compute_snapshot_id
import
import compute_snapshot_id L43–43 ← moved from tests/test_cmd_patch_id.py
−
compute_snapshot_id
import
import compute_snapshot_id L25–25 → moved to tests/test_patch_id_supercharge.py
−
test_compute_patch_id_different_diff_different_id
function
function test_compute_patch_id_different_diff_different_id L120–131
−
test_compute_patch_id_empty_diff_is_deterministic
function
function test_compute_patch_id_empty_diff_is_deterministic L134–142
−
test_compute_patch_id_same_diff_same_id
function
function test_compute_patch_id_same_diff_same_id L109–117
−
test_compute_patch_id_stable_normalizes_whitespace
function
function test_compute_patch_id_stable_normalizes_whitespace L145–160
−
test_compute_patch_id_without_stable_is_sensitive_to_whitespace
function
function test_compute_patch_id_without_stable_is_sensitive_to_whitespace L163–177
−
test_patch_id_different_commits_have_different_ids
function
function test_patch_id_different_commits_have_different_ids L315–330
−
test_patch_id_empty_repo_exits_nonzero
function
function test_patch_id_empty_repo_exits_nonzero L292–295
−
test_patch_id_json_commit_id_matches_head
function
function test_patch_id_json_commit_id_matches_head L207–214
−
test_patch_id_json_subject_is_commit_message
function
function test_patch_id_json_subject_is_commit_message L198–204
−
test_patch_id_nonexistent_ref_exits_nonzero
function
function test_patch_id_nonexistent_ref_exits_nonzero L285–289
−
test_patch_id_same_diff_same_id_across_commits
function
function test_patch_id_same_diff_same_id_across_commits L241–253
−
test_patch_id_text_output_has_two_parts
function
function test_patch_id_text_output_has_two_parts L222–233
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:7619040af537c856820b780fe64693daafcea745181a89b58eaa0e2b905241df --body "your comment"
No comments yet. Be the first to start the discussion.