/** * @fileoverview Backfill recovered sources into the skill manifest. * @module @skillsmith/core/provenance/backfill * @see SMI-5407 * * Plans manifest entries from a {@link RecoveryReport} and (when `apply`) * writes them via a single `ManifestManager.updateSafely` merge that ADDs or * fills-missing `source`/`id` but NEVER clobbers a healthy existing entry -- * even when the recovered value differs. Idempotent: a second run is a no-op. * * Backfill keys (load-bearing, per plan-review): * - `id` = registry UUID when a registry tier resolved it, else `owner/skill-name`. * - `source` = `https://github.com//` (the form buildRawUrl accepts). */ import type { SkillManifestEntry } from '../services/skill-installation.types.js'; import type { RecoveryConfidence, RecoveryReport } from './types.js'; /** Options controlling a backfill run. */ export interface BackfillOptions { /** Manifest path. Defaults to `~/.skillsmith/manifest.json`. */ manifestPath?: string; /** Minimum confidence to auto-qualify (default `high`). */ minConfidence?: RecoveryConfidence; /** Write changes. When false (default), the run is a dry-run plan only. */ apply?: boolean; /** Opt-in: write `repository:` into non-git skills' SKILL.md frontmatter. */ writeFrontmatter?: boolean; /** Explicit ` -> 'owner/repo'` overrides (resolved user-specified). */ setOverrides?: Record; /** Injected `lastUpdated` ISO timestamp for deterministic tests. */ now?: string; /** Injected content hasher (defaults to the shared `hashContent`). */ hashContent?: (content: string) => string; } /** Outcome of a backfill run. */ export interface BackfillOutcome { /** Entries planned for write (all that qualify), regardless of `apply`. */ planned: SkillManifestEntry[]; /** Skill names actually written (apply only). */ written: string[]; /** Skill names skipped (unqualified, bad override, or healthy/clobber-protected). */ skipped: string[]; } /** * Plan and (optionally) apply manifest backfill for recovered sources. */ export declare function backfillManifest(report: RecoveryReport, opts?: BackfillOptions): Promise; //# sourceMappingURL=backfill.d.ts.map