/** * Maps a parsed Plan into an executable Issue. This is where diablo's step * topology is defined. * * An implementation stage runs three steps, handing off through the worktree: * 1. design (planner) — reads the ACTUAL code committed by prior stages * plus this stage's tasks, and writes a short design note naming * the functions/types/files (with signatures) this stage will * create or touch. Advisory: it does not commit. * 2. worker (worker tier) — implements the stage against the plan AND the * design note (injected as an input), committing the result. * 3. verifier (verifier tier) — checks the committed work and returns a verdict. * * A final "Verification" stage (the master-plan skill's declarative last gate) * produces no new artifacts; it maps to a SINGLE verification step on the * PLANNER tier (a holistic, whole-feature judgment), not the cheap per-stage * verifier tier — and it commits nothing. * * Pure (Plan -> Issue) so it is unit-tested directly. The frozen plan file is * injected as an @input to every step so each fresh agent reads the same spec. */ import type { Plan } from "../domain/plan.ts"; import type { Issue } from "./run-issue.ts"; import type { GateMode } from "../ports/gate.ts"; export interface PlanToIssueConfig { issue: string; worktree: string; /** Absolute path to the frozen plan file, injected as an input to every step. */ planPath: string; /** Ticket file paths under .scratch, injected into the final verification step * so the verifier checks against the issue's acceptance criteria (not the * plan's task-level criteria, which the done gate does not compare against). */ ticketPaths: string[]; skills: { /** Skills for the per-stage design step (planner). */ designer: string[]; worker: string[]; verifier: string[]; }; /** * The human-checkpoint mode for the run. "approval" attaches a gate to every * VERIFYING step (each per-stage verifier and the final whole-feature * verification) — run-step consults it AFTER the verdict is enforced, so the * human approves work that has already passed verification. "none" (the * default) leaves every step AFK. The design and worker steps are never * gated: the worker runs unattended, and approving a stage means approving its * VERIFIED result, not its raw mid-flight diff. */ gate?: GateMode; } export declare function planToIssue(plan: Plan, config: PlanToIssueConfig): Issue;