fix(powershell): stop Out-Null swallowing the AVAILABLE_DOCS status lines - #3891
Merged
Merged
Conversation
…ines
Test-FileExists / Test-DirHasFiles report their line with Write-Output and
ALSO return $true/$false — both on the Success stream. The callers piped
the whole call to `| Out-Null` to discard the boolean, which discarded the
report line with it, so text mode printed the header and nothing under it:
BEFORE (measured, powershell.exe -NoProfile -File ... -IncludeTasks):
FEATURE_DIR:...\specs\001-f
AVAILABLE_DOCS:
(2 lines)
AFTER:
FEATURE_DIR:...\specs\001-f
AVAILABLE_DOCS:
[OK] research.md
[FAIL] data-model.md
[FAIL] contracts/
[FAIL] quickstart.md
[FAIL] tasks.md
(7 lines)
The bash and Python twins both list every document under that header, so
the PowerShell variant silently returned less information for the same
inputs.
Filter out only the boolean, keeping the report lines. Adds the first
PowerShell text-mode test in this file (every existing PS test is -Json).
File stays ASCII-only (verified 0 non-ASCII bytes).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jawwad-ali
force-pushed
the
fix/ps-checkprereq-outnull
branch
from
July 31, 2026 08:20
59f5e38 to
6e52eb5
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes PowerShell text-mode prerequisite reporting so document status lines reach stdout while boolean helper results remain discarded.
Changes:
- Filters only boolean helper output instead of suppressing the entire Success stream.
- Adds a PowerShell regression test covering available-document status lines.
Show a summary per file
| File | Description |
|---|---|
scripts/powershell/check-prerequisites.ps1 |
Preserves document status output in text mode. |
tests/test_check_prerequisites_python_parity.py |
Tests PowerShell document reporting. |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
Collaborator
|
Thank you! |
ira-at-work
added a commit
to ira-at-work/spec-kit
that referenced
this pull request
Aug 17, 2026
* main: (27 commits) Add SpecAssay bundle to community catalog (github#4125) chore: release 0.16.4, begin 0.16.5.dev0 development (github#4124) Add SpecAssay preset to community catalog (github#4123) Update Intake Authoring Governance preset to v0.3.1 (github#4121) Update Superspec extension to v1.0.2 (github#4120) fix(taskstoissues): widen task-ID regex to match IDs longer than 3 digits (github#4101) Add Architecture Governance extension to community catalog (github#4122) fix(workflows): validate non-string step types (github#4111) Harden community submission workflow output allowlists (github#4103) chore(deps): bump github/codeql-action (init + analyze) from 4.37.5 to 4.37.6 (github#4114) Add SpecAssay Check extension to community catalog (github#4113) fix(integrations): dispatch goose commands via `goose run` (github#2416) (github#3781) fix(powershell): stop Out-Null swallowing the AVAILABLE_DOCS status lines (github#3891) fix: remove TOCTOU race in RunState.load (github#3839) fix: decode the zipped manifest as UTF-8 before parsing (github#3958) Update Agent Parity Governance preset to v0.4.2 (github#4110) fix: log progress tracker refresh errors instead of silently swallowing (github#3975) [extension] Add SpecJudge extension to community catalog (github#4079) fix(bundler): read the authoritative `default_integration` field, not only its legacy aliases (github#3880) fix(auth): treat exact host patterns literally (github#4108) ...
4 tasks
mnriem
pushed a commit
that referenced
this pull request
Aug 19, 2026
…lines (#4188) Test-FileExists / Test-DirHasFiles report their line with Write-Output and ALSO return $true/$false -- both on the Success stream. setup-tasks.ps1's text-mode branch piped each call to `| Out-Null` to discard the boolean, which discarded the report line with it, so AVAILABLE_DOCS: printed with nothing under it: BEFORE (measured, powershell.exe -NoProfile -File ...): FEATURE_DIR:...\specs\001-my-feature TASKS_TEMPLATE:...\tasks-template.md AVAILABLE_DOCS: (3 lines) AFTER: FEATURE_DIR:...\specs\001-my-feature TASKS_TEMPLATE:...\tasks-template.md AVAILABLE_DOCS: [OK] research.md [FAIL] data-model.md [FAIL] contracts/ [FAIL] quickstart.md (7 lines) The bash twin (scripts/bash/setup-tasks.sh) lists every document under that header, so the PowerShell variant silently returned less information for the same inputs. Same bug, same fix shape (filter out only the boolean with Where-Object) as the sibling that was just fixed in check-prerequisites.ps1 (upstream commit 2b36f0c, PR #3891) -- this is the unfixed twin call site sharing the same Test-FileExists/Test-DirHasFiles helpers in common.ps1. Co-authored-by: Claude Sonnet 5 <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.
Problem
Test-FileExistsandTest-DirHasFilesinscripts/powershell/common.ps1do two things on the Success stream — they write the report line and return a bool:check-prerequisites.ps1piped the whole call to| Out-Nullto throw away the boolean — which threw away the report line too.Reproduction on current
main(81bf741)powershell.exe -NoProfile -File .specify/scripts/powershell/check-prerequisites.ps1 -IncludeTasks, in a project withspecs/001-f/plan.mdandspecs/001-f/contracts/:AVAILABLE_DOCS:is emitted with nothing under it. The bash and Python twins list all five documents for the same inputs, so the PowerShell variant silently returns less information — and any agent parsing the doc list sees none.Fix
Drop only the boolean:
Measured after the fix, same project plus
research.md:No breaking change. JSON mode does not go through this path and is untouched. The booleans were already being discarded and are still discarded; the only difference is that the lines the helpers were writing now actually reach stdout. Exit codes unchanged.
The file stays ASCII-only — verified 0 non-ASCII bytes after the edit.
Verification
-Json, which is why the gap was never caught. It is gated on the file's existingHAS_PWSH or _WINDOWS_POWERSHELLguard.mainbaseline captured on81bf741(0 pre-existing in scope).uvx ruff@0.15.0 check src tests→ cleanNote this test file is also touched by my open #3785 and #3890, so expect a trivial append conflict depending on merge order — happy to rebase.
Written with assistance from Claude Code. Bug found, reproduced, and verified by me on current
mainwith realpowershell.exe.