/** * Public-interface parity harness. * * One backend-agnostic rebuilder that uses ONLY public {@link IGraphStore} * methods: {@link IGraphStore.listNodes} and {@link IGraphStore.listEdges}. * Replaces a pair of hand-written per-backend rebuild helpers — each * issuing raw SQL or Cypher — with a single dialect-free path. * * A community AGE / Memgraph / Neo4j / Neptune adapter can prove * conformance by importing {@link assertGraphParity} and running it * against its own `IGraphStore` implementation — no per-backend SQL * dialect required, no escape hatch into `query()` or `execCypher()`. * * The four sentinel rules described in `interface.ts` (step-zero drop, * empty-`languageStats` coercion, Repo nullable preservation, deadness * normalization) are enforced by the in-tree adapters at the public * boundary — `listNodes` / `listEdges` already return rehydrated objects * that match the original `GraphNode` / `CodeRelation` shape on every * adapter today. This harness therefore performs no extra coercion: the * symmetric round-trip is "list everything back, hand it to a fresh * KnowledgeGraph". Any conformance-failing adapter has a bug, not a * harness mismatch. */ import { KnowledgeGraph } from "@opencodehub/core-types"; import type { IGraphStore } from "../interface.js"; export { applyRepoNullables, coerceLanguageStats, stepZeroSentinel, } from "../column-encode.js"; /** * Rebuild a `KnowledgeGraph` from any `IGraphStore` using only public * methods. Calls `listNodes({})` + `listEdges({})` and packages the * results into a fresh `KnowledgeGraph` — no raw SQL, no Cypher, no * dialect coupling. * * Conformance contract: any `IGraphStore` adapter whose `bulkLoad` is * round-trip stable produces byte-identical `graphHash` output via this * rebuilder. Use {@link assertGraphParity} to verify a third-party * adapter conforms. */ export declare function rebuildFromStore(graph: IGraphStore): Promise; /** * Assert that bulkLoading a fixture into N graph adapters and rebuilding * each via {@link rebuildFromStore} produces byte-identical `graphHash` * output across all of them — and against the original fixture. * * Each store is expected to be already opened and schema-initialised * (i.e. `open()` + `createSchema()` already called by the caller). The * harness only owns the bulk-load → rebuild → hash sequence. * * The assertions run in two passes: * * 1. For every store, `graphHash(rebuilt) === graphHash(fixture)`. * Surfaces a per-store regression with a precise error message. * 2. Pairwise across every store pair, the rebuilt hashes also match. * Catches the failure mode where two different stores silently * coincide on a different hash than the source fixture (which * would otherwise mask one bug behind the other). */ export declare function assertGraphParity(fixture: KnowledgeGraph, opts: { readonly stores: readonly IGraphStore[]; readonly label?: string; }): Promise; //# sourceMappingURL=parity-harness.d.ts.map