feat(revert): supercharge for agents — elapsed_ms, exit_code, file diff, staging, empty-snapshot
Agent-facing additions: - elapsed_ms + exit_code on ALL JSON paths (success and error) — consistent schema agents can parse without inspecting shell exit status - files_added / files_modified / files_removed on all success paths — agents get full file-level intel without a separate diff call - --no-commit now stages changes (write_stage) so muse commit picks them up without a manual muse code add step - Reverting to an empty parent snapshot no longer crashes — _apply_manifest_safe handles the empty-manifest case by deleting tracked files directly - Consistent error JSON envelope on every error path (format, ref-not-found, root-commit, parent-missing, snapshot-missing)
Docstring: full JSON schema section, file-diff field docs, agent recipe, HEAD/ HEAD~N ref docs, exit code 2 for not-a-repo.
Tests (29 new): - elapsed_ms / exit_code on normal, dry-run, no-commit, and all error paths - files_added / files_modified / files_removed: added, modified, deleted cases - full schema across all three paths - data integrity: content verified after revert - HEAD ref resolution - empty-snapshot revert (both normal and --no-commit) - --no-commit stages → muse commit succeeds without extra muse code add
Removed 4 slow stress tests: broken (env not propagated correctly across commits), hollow (CliRunner serializes threads so concurrency was fake), and no discriminating power over the existing integration tests.
0 comments
muse hub commit comment sha256:afb1508ebf68ffe0cf90bd66abe4631a5aba3d723134a6dad2059bd45b874ba3 --body "your comment"
No comments yet. Be the first to start the discussion.