/** * Milestones → GitHub milestones. Pure, like the planner that calls it. * * `milestones.yaml` is the source and a GitHub milestone is a rendering of one entry. The * durable link is a plain line in the description, `aidlc-milestone: `, as the * `aidlc-item` marker is for an issue: the title is the entry's to change, so matching by * title would read a rename as a new milestone. Nothing a GitHub milestone says is read back, * apart from that marker and what is needed to decide whether it already matches. * * The marker is visible text rather than an HTML comment: some GitHub views show a milestone * description unrendered, and a raw `` there reads as noise. * * Requirements: github-milestones/AC-1, github-milestones/AC-2, github-milestones/AC-3, * github-milestones/AC-11, github-milestones/AC-13, github-milestones/AC-14 * * @module */ import type { MilestoneRef, PlanLine } from './types.js'; export declare const MILESTONE_MARKER_PREFIX = "aidlc-milestone:"; /** One `milestones.yaml` entry, with its derived status reduced to what GitHub shows. */ export interface ProjectedMilestone { id: string; title: string; exit: string; done: boolean; } /** A GitHub milestone as the planner needs it. `description` is `''` when GitHub has none. */ export interface RemoteMilestone { number: number; title: string; description: string; state: 'OPEN' | 'CLOSED'; } /** The exit test, a blank line, then the marker (AC-1). */ export declare function milestoneDescription(m: Pick): string; /** Every id a description's marker lines name, in order. */ export declare function milestoneMarkerIds(description: string): string[]; /** * GitHub may hand a description back with `\r\n` or a trailing newline; comparing raw bytes * would plan an update on every run and the projection would never converge (AC-2). */ export declare function normaliseDescription(text: string): string; export type MilestonePlan = { kind: 'ok'; lines: PlanLine[]; /** Every listed milestone as wanted, by id — what an issue's milestone is set to. */ refs: ReadonlyMap; } | { kind: 'refused'; error: string; }; /** * The milestone lines, in file order, then orphans by number. Refusals first, in a fixed * order, so a tree with two problems always gives the same message. */ export declare function planMilestones(wanted: readonly ProjectedMilestone[], remote: readonly RemoteMilestone[]): MilestonePlan; //# sourceMappingURL=milestone-projection.d.ts.map