/** * Roadmap items merged into a carrier, and filing them once the carrier is done * (merged-items-leave-hold). * * Merging keeps the backlog small: the merged item is parked in `hold/` with a reason saying * "merged into ", and the carrier gains a `## Merged from ` section carrying its * criteria. Nothing moved the merged item when the carrier finished, so `hold/` filled with * delivered work — 27 of 51 holds in fieldmodel-apps, 13 of them for carriers already in `done/`. * * Shared by the `roadmap-done` action and the two doctor migrations so they cannot disagree about * what a merge is (design DD-1). Pure over items and text apart from `carrierDocs`, which reads one * file, and `fileMerged`, whose only write is `moveItem`. * * @module */ import { type RoadmapItem } from './paths.js'; /** * The carrier id a `hold/` item names, or null when it is not merged * (merged-items-leave-hold/AC-1, AC-3, AC-15, AC-16). * * The last `hold` entry's reason decides. Only when it has no reason is the body read, and then * only its first non-blank line: older stubs wrote the merge there and left the entry bare. A * reason that says something else is never overridden by the body (AC-3) — it is a later decision * than whatever the body was first written to say. */ export declare function carrierOf(raw: string): string | null; /** * True when `doc` has a "Merged from " heading at any level (merged-items-leave-hold/AC-4). * * The lookahead stops `item-a` being recorded by a heading for `item-ab`. */ export declare function recordsMerge(doc: string, mergedId: string): boolean; /** * The texts a carrier may record its merges in: its item file, and the `roadmap-item.md` of the * instance it is promoted to (merged-items-leave-hold/AC-4). The instance's copy is where a * carrier's criteria are read during its build, so a section added there counts. */ export declare function carrierDocs(projectRoot: string, carrier: RoadmapItem): string[]; /** One `hold/` item and the carrier it was merged into. */ export interface MergedItem { item: RoadmapItem; carrier: string; } /** Merged items whose carrier is known, split by whether the carrier records them. */ export interface MergedPlan { recorded: MergedItem[]; unrecorded: MergedItem[]; } /** * Split `hold` items merged into one of `carriers` (id → docs) by whether the merge is recorded * (merged-items-leave-hold/AC-4, AC-13). * * An item merged into a carrier not in the map is left out: its carrier is still open, parked, or * gone, and none of those is a reason to touch it. An item with no id cannot be named by a heading, * so it is unrecorded. Input order is kept, and `listStatusAt` sorts by file name. */ export declare function planMerged(hold: RoadmapItem[], carriers: Map): MergedPlan; /** * `carriers` keyed by lowercased id, with their docs; items without an id are left out. Two files * sharing an id pool their docs. */ export declare function carrierMap(projectRoot: string, carriers: RoadmapItem[]): Map; /** Every item in `done/` under `root` as a carrier (merged-items-leave-hold/AC-11, AC-12). */ export declare function doneCarriers(projectRoot: string, root: string): Map; /** * Every distinct `hold/` item across `roadmapRoots(cwd)`, this working tree first — the lookup * `findAllByPromotedTo` makes, deduped by file name for the reason it records: a worktree holds its * own copy of every committed item, and the completing branch's copy is the one about to be committed. */ export declare function holdAcross(cwd: string): RoadmapItem[]; /** The reason on a merged item's `done` entry (merged-items-leave-hold/AC-6). */ export declare function mergedDoneReason(carrier: string): string; /** What `fileMerged` did. */ export interface MergedFiling { moved: MergedItem[]; failed: Array<{ entry: MergedItem; message: string; }>; } /** * Move each item to `done/` with a history entry naming its carrier, trying every one before * reporting (merged-items-leave-hold/AC-6, AC-10) — the rule `roadmap-done` follows for carriers. */ export declare function fileMerged(items: MergedItem[], cwd: string, at: string): MergedFiling; //# sourceMappingURL=merged.d.ts.map