/** * loadIssue turns a ticket into an executable Issue. It is resume-aware: * * - If the frozen plan already exists, it is reused (honoring the master-plan * skill's "frozen, never edited" rule) — no planner run. * - Otherwise a architect step runs with the master-plan skill and the * ticket(s) injected, which writes the frozen plan file; that file is then * parsed and mapped into the issue pipeline. * * The pure parts (parse, map) are tested directly; this use-case sequences the * I/O around them and is tested against in-memory fakes. */ import type { AgentPort } from "../ports/agent.ts"; import type { GitPort } from "../ports/git.ts"; import type { FsPort } from "../ports/fs.ts"; import type { GateMode } from "../ports/gate.ts"; import type { Issue } from "./run-issue.ts"; export interface LoadIssueConfig { issue: string; worktree: string; /** Ticket file(s) under .scratch, injected as inputs to the planner. */ ticketPaths: string[]; /** Absolute path where the frozen plan lives / will be written. */ planPath: string; skills: { planner: string[]; designer: string[]; worker: string[]; verifier: string[]; }; /** * The instruction handed to the architect step. Defaults to the master-plan * flow; `diablo refactor` swaps it for an improve-codebase-architecture flow. * The planner SKILL itself is set via skills.planner — this is the prose that * tells the planner what to produce and where to write it. */ plannerInstruction?: string; /** * The human-checkpoint mode, passed through to the mapped pipeline steps. * "approval" gates each verifying step; "none"/omitted runs AFK. */ gate?: GateMode; } export interface LoadIssueDeps { agent: AgentPort; git: GitPort; fs: FsPort; } export declare function loadIssue(deps: LoadIssueDeps, config: LoadIssueConfig): Promise;