/** * roadmap-layout migration (roadmap-revamp/AC-23..AC-27, AC-38, confirm tier): * move a legacy `.aidlc/ideas/` backlog into `.aidlc/roadmap//` and * rewrite each item's frontmatter to the new schema. * * This is the first migration in this project that moves the *user's own* * content rather than regenerating a framework artifact, which is why it is * confirm tier and why every move goes through `git mv` when the file is * tracked: a mistake stays one `git checkout` away from undone. * * `check` and `apply` both derive everything from `planRoadmapMoves` and nothing * else computes pending-ness — the rule stated in `../types.ts`, so a dry run and * a real run cannot disagree about what will happen. * * Old status maps to new directory: `raw` → `inbox`, `dropped` → `hold`, * `promoted` → `done` or `in-progress` depending on whether the named instance * actually finished. Raw items land in `inbox` rather than `backlog` because the * old format has no field recording whether anything was ever triaged, and * mapping to `backlog` would manufacture that signal (DD-8). * * Whether an instance finished is answered by `completionInfo` from the metrics * module, not by a local "is the last phase complete?" test — that naive form is * wrong for maintenance-terminal templates, which complete on maintenance entry. */ import type { Migration } from '../types.js'; import type { DoctorContext } from '../types.js'; import { type ItemFieldDecl } from '../../roadmap/item-fields.js'; import { type RoadmapStatus } from '../../roadmap/paths.js'; /** One planned relocation, with everything `apply` needs to carry it out. */ export interface RoadmapMove { /** Absolute source path. */ from: string; /** Absolute target path. */ to: string; /** Repo-relative source, for the printed command list. */ fromRel: string; /** Repo-relative target, for the printed command list. */ toRel: string; status: RoadmapStatus; /** Rewritten file contents. */ contents: string; /** Tracked by git, so the move can preserve history. */ tracked: boolean; } export interface RoadmapPlan { moves: RoadmapMove[]; /** Repo-relative paths the planner could not classify; left in place. */ unclassified: string[]; } /** * Rewrite a legacy idea's frontmatter to the roadmap schema. * * Key order is fixed by AC-4, so the block is rebuilt rather than edited: the * legacy shape shares only `promoted_to` and `depends_on` with the new one. * The body below the frontmatter is copied through untouched apart from being * read for its title. * * `author` is deliberately omitted rather than guessed. The legacy format never * recorded one, and `created_by` from an unrelated instance is not the author of * an idea. * * Project-declared fields (item-extension-fields/AC-14) are appended with their * declared defaults. Legacy ideas predate extension fields by definition, so * without this a project that has declared a field and then migrates its old inbox * ends up with a directory of items its own check rejects — the migration * manufacturing the very failure the feature exists to remove. */ export declare function rewriteFrontmatter(raw: string, filename: string, status: RoadmapStatus, fields?: readonly ItemFieldDecl[]): { contents: string; id: string; } | null; /** * Everything the migration would do, computed without writing. * * The single source of pending-ness. Sorted by source path so the plan never * depends on directory read order. */ export declare function planRoadmapMoves(ctx: DoctorContext): RoadmapPlan; export declare const roadmapLayout: Migration; //# sourceMappingURL=roadmap-layout.d.ts.map