MAI-58: honour --dry-run in commits-only mode (no add/commit/push)#20
Merged
Conversation
added 2 commits
May 25, 2026 07:58
- thread dryRun through runMaiassPipeline to handleCommitWorkflow, commitThis, handleStagedCommit - guard git add/commit/push so dry-run previews instead of mutating - add commit-dryrun regression test (temp repo + bare origin)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In commits-only mode (
-c/-ac),--dry-run(-d) was silently ignored: it performed a REALgit add+git commit, and with-aca REALgit push.dryRunwas parsed and threaded only into version management, never into the commit phase.Fix
dryRunfromrunMaiassPipeline→handleCommitWorkflow→commitThis→handleStagedCommit(lib/maiass-pipeline.js,lib/commit.js).git add -A,git commit -F,git push --set-upstream) so that whendryRunis true the command is NOT executed and a clear preview line is printed instead.handleStagedCommitpreviews the working-tree diff (git diff HEAD --name-status) and labels it "Changes that would be committed:".console.log(colors.BBlue(...))to match the existing version-management dry-run UX (always visible, not filtered by brief verbosity).Preview wording
Dry run - would stage all changes (git add -A)Dry run - would commit with message: "<first line>"Dry run - would push to origin <branch> (git push --set-upstream origin <branch>)Verification (isolated sandbox: file:// bare origin, throwaway identity)
-ac --dry-run(AI off): HEAD unchanged, index empty, origin branch not created; all three previews printed.-ac(no--dry-run): still really commits and pushes — happy path intact.Tests
test/unit/commit-dryrun.test.js: builds a real temp repo with a bare origin, asserts dry-run does NOT move HEAD / stage / push, and that a normal run does commit + push.npm run test:unit(60 tests) andnpm test(10 e2e) both pass.Parity note
This changes the commit-phase behaviour only on the
--dry-runpath; the normal commit/push flow is unchanged. Flagging for bash-cli-specialist to confirmbashmaiasshonours--dry-runin commits-only mode equivalently.Jira: https://velvary.atlassian.net/browse/MAI-58