Repository navigation
[bug-fix] Fix missing-plan-template: reject empty plan setup - #4962
Merged
KSchlobohm merged 2 commits intoOct 14, 2026
Merged
Conversation
Preserve existing plans and distinguish missing plans from zero-byte plans across Bash, PowerShell, and Python. Add text and JSON regression coverage for template failures, retry, and plan preservation. Assisted-by: GitHub Copilot (model: GPT-6.1 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1e12bb4c-662b-4247-a0d0-83a16254948f
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused cross-port fix matches the issue remediation and includes positive, negative, retry, and preservation coverage.
0 open findings
What changed in this PR
Fixes missing or empty plan templates across all script ports and prevents zero-byte plans from passing prerequisite checks.
Changes:
- Fail setup without creating
plan.mdwhen templates are missing or empty. - Reject zero-byte plans with actionable diagnostics.
- Add cross-port regression, retry, preservation, and parity coverage.
| File | Description |
|---|---|
scripts/bash/setup-plan.sh |
Safely resolves templates before creating plans. |
scripts/bash/check-prerequisites.sh |
Rejects zero-byte plans. |
scripts/powershell/setup-plan.ps1 |
Adds matching setup failure behavior. |
scripts/powershell/check-prerequisites.ps1 |
Rejects zero-byte plans. |
scripts/python/setup_plan.py |
Adds matching setup failure behavior. |
scripts/python/check_prerequisites.py |
Rejects zero-byte plans. |
tests/test_setup_plan_python_parity.py |
Adds comprehensive cross-port setup coverage. |
tests/test_setup_plan_no_overwrite.py |
Updates the PowerShell regression test. |
tests/test_check_prerequisites_python_parity.py |
Verifies empty-plan rejection across ports. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Bug fix — missing-plan-template
Proposed fix for issue #4961, applying the
remediation from the bug assessment.
Verdict: valid · Severity: medium
Summary
Setup now fails when the required plan template cannot be resolved instead of creating a zero-byte
plan.mdor reporting success. Bash, PowerShell, and Python prerequisite checks reject zero-byte plans while preserving nonempty user-authored plans.Changes
scripts/bash/setup-plan.shscripts/powershell/setup-plan.ps1scripts/python/setup_plan.pyscripts/bash/check-prerequisites.shplan.mdfiles.scripts/powershell/check-prerequisites.ps1plan.mdfiles.scripts/python/check_prerequisites.pyplan.mdfiles.tests/test_setup_plan_python_parity.pytests/test_setup_plan_no_overwrite.pytests/test_check_prerequisites_python_parity.pyTests Added or Updated
test_python_missing_template_matches_bash— missing templates fail without creatingplan.md, then succeed after restoration.test_ps_setup_plan_template_not_found_warning_matches_bash— PowerShell emits the actionable stderr error and creates no artifact.test_all_variants_reject_empty_plan— prerequisite checks reject zero-byte plans.Local Verification
bash -n scripts/bash/setup-plan.sh && bash -n scripts/bash/check-prerequisites.sh→ passed.git diff --check→ passed.python3 -m pytest tests/test_setup_plan_python_parity.py tests/test_setup_plan_no_overwrite.py tests/test_check_prerequisites_python_parity.py -q→ not run because pytest is unavailable (No module named pytest). PowerShell-specific tests were not executable becausepwshis unavailable.Deviations from Assessment
None.
Risks & Review Notes
Refs #4961 · cc
@KSchlobohm