import type { RoadmapDefinition, RoadmapPhase, RoadmapSprint } from './roadmap.js'; export type RoadmapSourceKind = 'phase' | 'backlog' | 'archive'; export interface RoadmapSourceEntry { path: string; kind: RoadmapSourceKind; } export interface RoadmapSourceProject { version: '1'; name: string; description?: string; output: string; sources: RoadmapSourceEntry[]; } export interface RoadmapSourceDocument { version: '1'; phase: RoadmapPhase; sprints: RoadmapSprint[]; scorecards?: Record; } export interface LoadedRoadmapSource { entry: RoadmapSourceEntry; document: RoadmapSourceDocument; absolutePath?: string; } export interface RoadmapSourceValidationIssue { code: string; message: string; source?: string; sprint?: number; ticket?: string; } export interface RoadmapSourceValidationResult { valid: boolean; errors: RoadmapSourceValidationIssue[]; warnings: RoadmapSourceValidationIssue[]; roadmap: RoadmapDefinition; } export declare class RoadmapSourceError extends Error { readonly sourcePath?: string | undefined; /** * True when the failure is a refusal to discard authored content that exists * only in the generated projection. Callers must treat this as fatal rather * than downgrading it to a warning — reporting success while planning work is * destroyed is the whole defect (GH #637). */ projectionContentLoss?: boolean; constructor(message: string, sourcePath?: string | undefined); } export declare function normalizeDiagnosticPath(path: string): string; export declare function normalizeRoadmapSourcePath(path: string, label?: string): string; export declare function parseRoadmapSourceProject(yaml: string, sourcePath?: string): RoadmapSourceProject; export declare function parseRoadmapSourceDocument(yaml: string, sourcePath: string): RoadmapSourceDocument; export declare function sourceProjectToRoadmap(project: RoadmapSourceProject): Pick; /** Compile ordered authoring bundles into the existing roadmap compatibility shape. */ export declare function compileRoadmapSources(project: RoadmapSourceProject, sources: LoadedRoadmapSource[]): RoadmapDefinition; export declare function serializeRoadmapProjection(roadmap: RoadmapDefinition): string; /** * Key of the generated-file marker written into the compiled projection. * * The marker exists only in the bytes on disk. `serializeRoadmapProjection` * stays canonical and marker-free, because projection bytes are compared in four * places — compile write, closeout reconciliation, archive planning, and the * migration planner/applier `expected_projection_sha256` pair. Stamping the * marker into those canonical bytes broke migration receipt binding (seven * tests), so it is applied at the write boundary and stripped again on read * (GH #644, deferred from #637). */ export declare const ROADMAP_PROJECTION_MARKER_KEY = "_generated"; /** Add the generated-file marker to projection bytes about to be written. */ export declare function withRoadmapProjectionMarker(projection: string, sourcePath: string): string; /** * Remove the generated-file marker so on-disk bytes can be compared against * canonical projection bytes. Returns the input unchanged when no marker exists, * so projections written before this change still compare correctly. */ export declare function stripRoadmapProjectionMarker(projection: string): string; export interface RoadmapProjectionDivergence { /** Sprint ids present in the on-disk projection but produced by no source. */ sprints: string[]; /** Phase names present in the on-disk projection but produced by no source. */ phases: string[]; } /** * Find content that exists only in the checked-out projection. * * A projection that merely lags its sources contains nothing the sources do not * produce, so it is safe to overwrite. Content present *only* on disk is * authored planning work that a blind rewrite would destroy — which is exactly * how a phase, six sprints and 26 tickets were lost on a success exit (GH #637). * * Returns null when nothing would be lost. */ export declare function findRoadmapProjectionDivergence(existing: string, compiled: RoadmapDefinition): RoadmapProjectionDivergence | null; /** Validate source federation invariants before any compatibility write. */ export declare function validateRoadmapSourceFederation(project: RoadmapSourceProject, sources: LoadedRoadmapSource[]): RoadmapSourceValidationResult; //# sourceMappingURL=roadmap-sources.d.ts.map