Refactor Pull-SDLC.ai.ps1 output to intent-appropriate streams (#194)#195
Merged
Conversation
added 2 commits
June 7, 2026 12:03
Behavior-first tests: fatal messages land on the error stream (rc 2/3/5 preserved), advisories on the warning stream, and status flows through Write-Information (non-PSHOST records) rather than Write-Host.
Map Write-Host calls to Write-Error/Write-Warning/Write-Information per the Output & Streams guidance, preserving every exit/return code (Write-Error -ErrorAction Continue keeps non-terminating under \Continue='Stop'). Set \SilentlyContinue='Continue' to keep status visible by default. Keep the decorative dry-run preview, Next-steps banner, and SSH-setup transcript on Write-Host, extracted/annotated with narrow PSAvoidUsingWriteHost suppressions.
Contributor
Author
|
Dry-run smoke test (this project's dry run is the script's own |
This was referenced Jun 7, 2026
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
Refactors
Pull-SDLC.ai.ps1so every message lands on the intent-appropriate stream, complying with the "Output & Streams" guidance added in 65b12a0 to.github/instructions/powershell.instructions.md. Previously all output (data, status, advisories, errors) funnelled throughWrite-Host -ForegroundColor, so nothing could be captured, redirected, or detected by callers/CI.Closes #194
What changed (by intent)
Write-Error -ErrorAction ContinueWrite-Warning-Forceoverwrite, push failed, manual-PR hints, bootstrap declined, bootstrap-overwrite preambleWrite-InformationWrite-Host(narrowly suppressed)Write-PlannedOpsPreview), Next-steps banner, SSH-setup transcriptKey risk control: exit codes are byte-for-byte unchanged
$ErrorActionPreference = 'Stop'is script-scoped, so a bareWrite-Errorwould terminate before thereturn <rc>. Every fatal site usesWrite-Error -ErrorAction Continue, so the record lands on stream 2 and the original return code is preserved. New behavior-first tests assert both the rc and the stream for each category.$InformationPreference = 'Continue'is set at script scope to keep status visible by default.PSAvoidUsingWriteHostfindings: 108 -> 0 (remaining decorativeWrite-Hostcarry justifiedSuppressMessageAttributescoped to the three sanctioned helpers). No new analyzer findings introduced.Tests
199 passed, 0 failed(193 existing + 6 new stream-assignment tests). Analyzer clean aside from pre-existing, unrelated findings.Evidence (inline)
Fatal path now capturable on the error stream, rc preserved, stdout clean:
-WhatIfvisible output preserved: