/** * `knowledge sync` — post-pull index rebuild plus suspicious-merge report. * * Compares the freshly parsed YAML against the previous index contents and * flags semantically suspicious outcomes: descriptions that diverged sharply * (>50% Levenshtein distance) and relationships pointing at entities that no * longer exist. * * Requirements: KG 12.4 * * @module */ import type { Entity } from './types.js'; import type { KnowledgeIndex } from './index/knowledge-index.js'; import type { YamlSourceStore } from './yaml-source.js'; export interface SyncWarning { entityId: string; type: 'description-divergence' | 'orphan-relationship' | 'parse-warning'; message: string; } export interface SyncResult { entitiesTotal: number; added: number; updated: number; removed: number; relationshipsTotal: number; warnings: SyncWarning[]; } /** * @param priorEntities - The index contents from before the engine's open-time rebuild * replaced them (`engine.replaced`). **Pass this whenever the engine was opened * through `openKnowledge`**, which is every command path: that open rebuilds a stale * index, so by the time this function runs the index already holds the post-pull * YAML, and reading "before" out of it would diff the merge against itself — every * count zero and no divergence detectable, which is the whole report. `null` or * omitted falls back to the index, which is correct only when nothing rebuilt * (knowledge-index-misses-merged-yaml/AC-8). */ export declare function syncKnowledge(source: YamlSourceStore, index: KnowledgeIndex, priorEntities?: Entity[] | null): SyncResult; /** Iterative two-row Levenshtein — fine for description-sized strings. */ export declare function levenshtein(a: string, b: string): number; //# sourceMappingURL=sync.d.ts.map