fix(scripts): emit 'Copied plan template' status in setup-plan.ps1 (parity with bash)#3198
Open
jawwad-ali wants to merge 1 commit into
Open
fix(scripts): emit 'Copied plan template' status in setup-plan.ps1 (parity with bash)#3198jawwad-ali wants to merge 1 commit into
jawwad-ali wants to merge 1 commit into
Conversation
…arity with bash) setup-plan.sh prints 'Copied plan template to $IMPL_PLAN' after copying the template (to stderr in --json mode, stdout otherwise), but the PowerShell twin emitted nothing on the successful-copy path -- only the 'Plan already exists' skip message and the 'Plan template not found' warning existed. So the two scripts had a divergent status-output contract on a fresh run. Emit the same message after WriteAllText, routed like the sibling skip message ([Console]::Error.WriteLine in -Json so stdout stays pure JSON, Write-Output in text mode). Mirrors the bash wording and stream routing exactly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Description
setup-plan.shprints a status message after copying the plan template on a fresh run:The PowerShell twin
setup-plan.ps1emitted nothing on the successful-copy path — only thePlan already existsskip message and thePlan template not foundwarning had equivalents. So on a first run the two scripts had a divergent status-output contract (the bash behavior is even covered by a test,test_setup_plan_json_parseable_on_first_run, which assertsCopied plan templateon stderr).Fix
Emit the same message after
WriteAllText, routed exactly like the siblingPlan already existsmessage —[Console]::Error.WriteLinein-Jsonmode so stdout stays pure JSON,Write-Outputin text mode. Mirrors the bash wording and stream routing. One source file.Testing
uvx ruff checkclean;tests/test_ps1_encoding.pygreen (edited.ps1stays ASCII / PowerShell 5.1-safe).test_ps_setup_plan_copied_message_on_stderr_in_json_modemirrors the existing bashtest_setup_plan_json_parseable_on_first_run: asserts-Jsonfirst-run stdout is parseable JSON andCopied plan templateis on stderr.{...,"BRANCH":""}). Existing setup-plan tests still pass.AI Disclosure
Found and fixed with Claude Code (Claude Opus 4.8) under my direction. AI located the missing status message across the bash/PowerShell twins and drafted the fix plus a mirroring regression test; I confirmed the bash wording/stream routing, verified fail-before/pass-after under Windows PowerShell 5.1 (stdout stays pure JSON), and reviewed the diff before submitting.