Skip to content

fix(gsd): fail empty plan-milestone workers loudly#3417

Closed
mastertyko wants to merge 3 commits intogsd-build:mainfrom
mastertyko:fix/3405-plan-milestone-artifact-check
Closed

fix(gsd): fail empty plan-milestone workers loudly#3417
mastertyko wants to merge 3 commits intogsd-build:mainfrom
mastertyko:fix/3405-plan-milestone-artifact-check

Conversation

@mastertyko
Copy link
Copy Markdown
Contributor

@mastertyko mastertyko commented Apr 1, 2026

TL;DR

What: Rejects empty plan-milestone roadmap stubs and turns the resulting stuck headless lane into an explicit error.
Why: A milestone worker could appear to produce its artifact while actually writing an empty roadmap shell, which left downstream workers stuck and the headless lane looking falsely successful.
How: Tighten artifact verification for plan-milestone outputs and mark stuck terminal notifications as error exits in headless mode.

What

This change makes milestone planning fail loudly when the produced roadmap is only an empty scaffold.

Affected areas:

  • src/resources/extensions/gsd/auto-recovery.ts
  • src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts
  • src/headless.ts
  • src/headless-events.ts
  • src/tests/headless-detection.test.ts
  • src/tests/headless-v2-migration.test.ts

Why

Closes #3405.

An empty plan-milestone roadmap stub is not a valid planning artifact, but the current verification path could accept it and let the workflow continue. That produced a stuck loop where downstream workers waited on planning that had not actually happened, and headless mode could hide the failure.

How

verifyExpectedArtifact() now rejects plan-milestone roadmap stubs with zero slices, and the headless pipeline treats terminal Stuck: notifications as explicit error exits instead of a quiet success path. Regression coverage locks both behaviors down.

Change type

  • fix — Bug fix
  • feat — New feature or capability
  • refactor — Code restructuring (no behavior change)
  • test — Adding or updating tests
  • docs — Documentation only
  • chore — Build, CI, or tooling changes

Scope

  • pi-tui — Terminal UI
  • pi-ai — AI/LLM layer
  • pi-agent-core — Agent orchestration
  • pi-coding-agent — Coding agent
  • gsd extension — GSD workflow
  • native — Native bindings
  • ci/build — Workflows, scripts, config

Breaking changes

  • No breaking changes
  • Yes — described above

Test plan

  • CI passes
  • New/updated tests included
  • Manual testing — steps described above
  • No tests needed — explained above

Verified locally with the full CI mirror gate:

  • npm run build
  • npm run typecheck:extensions
  • npm run test:unit
  • npm run test:integration

The final truth phase was re-run in a plain verification clone on the exact branch head after the worktree hit a late verifier-environment stall.

AI disclosure

  • This PR includes AI-assisted code — prepared with Codex and verified as described in the test plan above.

@github-actions github-actions bot added bug Something isn't working High Priority labels Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

🔴 PR Risk Report — CRITICAL

Files changed 8
Systems affected 3
Overall risk 🔴 CRITICAL

Affected Systems

Risk System
🔴 critical Auto Engine
🟡 medium Async Jobs
🟢 low Headless Mode
File Breakdown
Risk File Systems
🟢 src/headless-events.ts Headless Mode
🟢 src/headless.ts Headless Mode
🟡 src/resources/extensions/async-jobs/job-manager.ts Async Jobs
🔴 src/resources/extensions/gsd/auto-recovery.ts Auto Engine
src/resources/extensions/async-jobs/await-tool.test.ts (unclassified)
src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts (unclassified)
src/tests/headless-detection.test.ts (unclassified)
src/tests/headless-v2-migration.test.ts (unclassified)

⚠️ Critical risk — please verify: state persistence, auth token lifecycle, agent loop race conditions, RPC protocol compatibility.

@mastertyko
Copy link
Copy Markdown
Contributor Author

Closing this for now to keep the queue clean. The issue remains tracked in #3405 and can be reopened later as a cleaner standalone fix from current main.

@mastertyko mastertyko closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working High Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plan-milestone artifact verification accepts empty roadmap stub → stuck loop → silent parallel worker death

1 participant