//#region src/errors.d.ts /** * Structured error for migration tooling operations. * * Follows the NAMESPACE.SUBCODE convention from ADR 027. All codes live under * the MIGRATION namespace. These are tooling-time errors (file I/O, hash * verification, migration history reconstruction), distinct from the runtime * MIGRATION.* codes for apply-time failures (PRECHECK_FAILED, POSTCHECK_FAILED, * etc.). * * Fields: * - code: Stable machine-readable code (MIGRATION.SUBCODE) * - category: Always 'MIGRATION' * - why: Explains the cause in plain language * - fix: Actionable remediation step * - details: Machine-readable structured data for agents */ declare class MigrationToolsError extends Error { readonly code: string; readonly category: "MIGRATION"; readonly why: string; readonly fix: string; readonly details: Record | undefined; constructor(code: string, summary: string, options: { readonly why: string; readonly fix: string; readonly details?: Record; }); static is(error: unknown): error is MigrationToolsError; } declare function errorInvalidJson(filePath: string, parseError: string): MigrationToolsError; declare function errorDescriptorHeadHashMismatch(args: { readonly extensionId: string; readonly recomputedHash: string; readonly headRefHash: string; }): MigrationToolsError; /** * Wire-shape edge surfaced through the JSON envelope's * `meta.structuralPath` of `MIGRATION.NO_INVARIANT_PATH`. Slim by design — * authoring metadata (`createdAt`) lives on `MigrationEdge` but is * intentionally dropped here so the envelope stays stable across * graph-internal refactors. * * Stability: any field added here is part of the public CLI JSON contract. * Callers (CLI consumers, agents) must be able to treat * `(dirName, migrationHash, from, to, invariants)` as the canonical shape. */ interface NoInvariantPathStructuralEdge { readonly dirName: string; readonly migrationHash: string; readonly from: string; readonly to: string; readonly invariants: readonly string[]; } declare function errorNoInvariantPath(args: { readonly refName?: string; readonly required: readonly string[]; readonly missing: readonly string[]; readonly structuralPath: readonly NoInvariantPathStructuralEdge[]; }): MigrationToolsError; declare function errorUnknownInvariant(args: { readonly refName?: string; readonly unknown: readonly string[]; readonly declared: readonly string[]; }): MigrationToolsError; //#endregion export { MigrationToolsError, type NoInvariantPathStructuralEdge, errorDescriptorHeadHashMismatch, errorInvalidJson, errorNoInvariantPath, errorUnknownInvariant }; //# sourceMappingURL=errors.d.mts.map