/** * Choose the commits a revert undoes and say so before anything changes. * * Pure: takes the branch's commits as `branchCommits()` returns them (newest * first) and decides. The plan is the whole safety story the roadmap item * asks for — "it must show the plan and ask first" — so every commit that also * belongs to another task is marked `shared` in words, never by colour alone * (revert-by-task/AC-11). * * Requirements: revert-by-task/AC-2, AC-3, AC-6, AC-8, AC-9, AC-10, AC-11 */ import type { BranchCommit } from './commits.js'; /** `--task T` or `--phase implementation` (every task of the instance). */ export type Selector = { kind: 'task'; task: number; } | { kind: 'phase'; }; export interface PlanCommit { sha: string; short: string; subject: string; /** This instance's tasks the commit names, ascending. */ tasks: number[]; /** Of those, the ones the selector did not ask for (AC-11). */ shared: number[]; } export interface Plan { selector: Selector; /** Newest first — the order they are undone in. */ commits: PlanCommit[]; /** Every task of this instance a selected commit names, ascending. */ resetTasks: number[]; } export type PlanResult = { ok: true; plan: Plan; } | { ok: false; reason: 'no-commits'; } | { ok: false; reason: 'merge-commit'; short: string; subject: string; }; export declare function buildPlan(instance: string, selector: Selector, commits: BranchCommit[]): PlanResult; /** `T3` or `T3, T4`. */ export declare function taskList(ids: number[]): string; /** What the selector names, for the plan heading and the commit subject. */ export declare function describeSelector(selector: Selector): string; /** The plan as printed before the question (AC-10, AC-11). */ export declare function formatPlan(instance: string, plan: Plan, branch: string): string[]; //# sourceMappingURL=plan.d.ts.map