Skip to content

[bug-fix] Fix missing-plan-template: reject empty plan setup - #4962

Merged
KSchlobohm merged 2 commits into
mainfrom
fix/4961-missing-plan-template-29ea36cfc4b7f02d
Oct 14, 2026
Merged

KSchlobohm merged 2 commits into
mainfrom
fix/4961-missing-plan-template-29ea36cfc4b7f02d

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

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.md or reporting success. Bash, PowerShell, and Python prerequisite checks reject zero-byte plans while preserving nonempty user-authored plans.

Changes

File Change Notes
scripts/bash/setup-plan.sh modified Fail on missing plan template without creating an artifact.
scripts/powershell/setup-plan.ps1 modified Match the cross-port failure behavior and stderr diagnostic.
scripts/python/setup_plan.py modified Match the cross-port failure behavior and stderr diagnostic.
scripts/bash/check-prerequisites.sh modified Reject zero-byte plan.md files.
scripts/powershell/check-prerequisites.ps1 modified Reject zero-byte plan.md files.
scripts/python/check_prerequisites.py modified Reject zero-byte plan.md files.
tests/test_setup_plan_python_parity.py modified Cover failure without artifact and successful retry after template restoration.
tests/test_setup_plan_no_overwrite.py modified Update PowerShell missing-template regression.
tests/test_check_prerequisites_python_parity.py added test Cover empty-plan rejection across available ports.

Tests Added or Updated

  • test_python_missing_template_matches_bash — missing templates fail without creating plan.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

  • Commands run: bash -n scripts/bash/setup-plan.sh && bash -n scripts/bash/check-prerequisites.sh → passed.
  • Commands run: git diff --check → passed.
  • Commands run: 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 because pwsh is unavailable.

Deviations from Assessment

None.

Risks & Review Notes

  • This intentionally changes the established success-shaped fallback and rejects zero-byte plans, so projects relying on empty placeholders must populate or recreate the plan.
  • Whitespace-only plans remain accepted because the assessment's clarification about whitespace handling was unresolved; this change targets the reported zero-byte artifact.

Refs #4961 · cc @KSchlobohm

Generated by 🛠️ Fix Bug from Labeled Issue for #4961 · copilot · gpt52codex · 6.33 AIC · ⌖ 0.719 AIC · ⊞ 24.4K · ◷

Apply the remediation from the bug assessment on issue #4961.

Refs #4961

Assisted-by: GitHub Copilot (model: gpt-5.2-codex, autonomous)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.md when 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.

@KSchlobohm
KSchlobohm marked this pull request as ready for review October 14, 2026 18:55
@KSchlobohm
KSchlobohm requested a review from mnriem as a code owner October 14, 2026 18:55
@KSchlobohm
KSchlobohm merged commit 3238fa9 into main Oct 14, 2026
18 checks passed
@mnriem
mnriem deleted the fix/4961-missing-plan-template-29ea36cfc4b7f02d branch October 16, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated bug-fix Trigger the bug-fix agentic workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Missing plan template creates a zero-byte plan.md and reports success

3 participants