Problem
The high-trust plan conversion in the orchestrator parses markdown ### Task N: sections (or reads a JSON companion) to produce orchestration-plan.json. If the resolved plan has zero steps — whether from an unexpected markdown structure or a malformed JSON companion — the empty steps: [] array is silently registered as a valid plan and forwarded to the coder.
Context
Found during review of #263 (plan provenance and trust-tiered orchestration). Classified as T1 (deferred TODO) since high-trust plans from known skills are very likely to have the expected structure, but the guard prevents silent failure in edge cases.
- File:
packages/agents/content/skills/orchestrate/SKILL.md, "High-trust plan conversion" section
- The guard covers both resolution paths: JSON companion (step 1) and markdown parsing (step 2)
Solution
Add a zero-steps guard after plan content resolution in the "High-trust plan conversion" section. When steps is empty:
- Emit a corrective
phase_decision event for planning with run: true and reason explaining the fallback
- Downgrade
{planTrust} from "high" to "medium"
- Abort the conversion — skip artifact writing and registration (steps 3-5)
- Let Phase 2 (Planning) run with the medium-trust adoption-mode hint
This reuses existing medium-trust machinery rather than introducing new recovery logic.
Acceptance criteria
Problem
The high-trust plan conversion in the orchestrator parses markdown
### Task N:sections (or reads a JSON companion) to produceorchestration-plan.json. If the resolved plan has zero steps — whether from an unexpected markdown structure or a malformed JSON companion — the emptysteps: []array is silently registered as a valid plan and forwarded to the coder.Context
Found during review of #263 (plan provenance and trust-tiered orchestration). Classified as T1 (deferred TODO) since high-trust plans from known skills are very likely to have the expected structure, but the guard prevents silent failure in edge cases.
packages/agents/content/skills/orchestrate/SKILL.md, "High-trust plan conversion" sectionSolution
Add a zero-steps guard after plan content resolution in the "High-trust plan conversion" section. When
stepsis empty:phase_decisionevent for planning withrun: trueand reason explaining the fallback{planTrust}from"high"to"medium"This reuses existing medium-trust machinery rather than introducing new recovery logic.
Acceptance criteria
phase_decisionevent for planning{planTrust}to"medium"and aborts artifact writing