pub async fn cmd_draft(
repo: PathBuf,
slug: &str,
yes: bool,
from_mission: Option<&str>,
dangerously_allow_all: bool,
) -> Result<i32>Expand description
kranz draft <slug> [--yes] [--from-mission m-xxxx]: non-interactive plan
drafting.
Sets the ticket Drafting, creates a mission seeded with the whole ticket,
requests the plan, and resolves via draft_decision:
- Ready →
approve_plan(commits plan.md on the mission branch), then set Review (parked) or, with--yes, enqueue + set Queued. - NotReady → append the orchestrator’s questions to the ticket and set NeedsContext.
- WrongPlan → append the planner’s escalation reason to the ticket and set WrongPlan (parked for the operator; never queued).
--from-mission first seeds the ticket’s traced-from-mission
frontmatter (drafting a defect ticket traced back to the mission that
shipped it — the flight-surgeon false-green join).
Only the orchestrator runs (no workers); spend is bounded by the orchestrator budget cap (per-ticket override applied).