/** * v1.0 community-adapter conformance suite (architecture-revised.md §AC-A-11). * * `assertIGraphStoreConformance(name, factory)` registers a pre-baked set * of `node:test` blocks that exercise the v1.0 {@link IGraphStore} contract * end-to-end. A community AGE / Memgraph / Neo4j / Neptune adapter author * imports this from `@opencodehub/storage/test-utils` and runs it against * their own implementation: * * ```ts * import { test } from "node:test"; * import { assertIGraphStoreConformance } from "@opencodehub/storage/test-utils"; * import { AgeGraphStore } from "../src/age-store.js"; * * assertIGraphStoreConformance("Apache AGE", async () => { * const store = new AgeGraphStore({ pgUrl: "postgresql://..." }); * await store.open(); * await store.createSchema(); * return store; * }); * ``` * * Pass = the adapter has byte-identical {@link graphHash} output AND the * typed-finder semantics required by every in-tree caller (skeleton/xref * packs, MCP tools, analysis pipelines). * * The suite owns its own minimal fixtures so a community fork does NOT * inherit a moving target every time the in-tree adapter test files change. * * ## Registered tests * * 1. `lifecycle: bulkLoad fills counts + healthCheck=ok` — sanity that * `open` + `createSchema` + `bulkLoad` each return without throwing * and the resulting store reports `{ok: true}`. * 2. `parity: rebuildFromStore graphHash byte-identical to fixture` — * the Liskov contract from {@link rebuildFromStore}. Any adapter that * passes here is byte-equivalent on the wire to DuckDb + GraphDb. * 3. `listEdgesByType("CALLS") ≡ listEdges({types:["CALLS"]})` — typed * shorthand must match the general filter. Catches adapter bugs * where the two paths diverge on ordering or projection. * 4. `traverseAncestors invariants` — the result of * `traverseAncestors({maxDepth: N})` must be a subset of the BFS over * `listEdges({types})` truncated at depth N, plus the start node is * excluded and depth/path fields are well-formed. * 5. `listNodes ordering + paging` — `id ASC` order across two writes, * and `limit + offset` pages line up with the full-list slice. * 6. `vectorSearch (optional)` — if the adapter implements vector search, * assert ordered results; cleanly skipped via `t.skip()` when the * adapter throws "vectorSearch not implemented", returns an empty * array for a known-non-empty input, or the in-tree HNSW extension * is unavailable. See {@link assertIGraphStoreConformance} JSDoc on * skip semantics. * * Every block opens a fresh adapter via `factory()`. The factory is * expected to return an `IGraphStore` that has already had `open()` and * `createSchema()` called — the suite only owns the bulk-load → assert → * close sequence so adapters with bespoke open requirements (custom * connection strings, auth tokens, schema namespaces) stay decoupled * from this file. */ import type { IGraphStore } from "../interface.js"; /** * v1.0 community-adapter conformance suite (architecture-revised.md * §AC-A-11). Registers `node:test` blocks that prove a third-party * `IGraphStore` adapter satisfies the v1.0 contract under a shared * fixture set. * * The suite calls `factory()` per test block so each block owns a fresh * adapter and there is no test-ordering coupling. The factory is expected * to return an adapter that has already had `open() + createSchema()` * called — the suite owns the bulk-load → assert → close sequence only. * * ## Skip semantics (vector search) * * The optional vector-search test cleanly skips when the adapter: * * - throws an error whose message contains "not implemented"; OR * - returns an empty array for a known-non-empty query (matches the * in-tree DuckDb behaviour when the optional HNSW extension binaries * are unavailable — see `DuckDbStore.getExtensionWarning`). * * Adapter authors with no vector capability at all can throw * `new Error("vectorSearch not implemented")` from their stub and the * suite passes without intervention. * * @param name - Human-readable adapter name (used as test prefix). * @param factory - Async factory returning a fresh, opened adapter * (post `open() + createSchema()`). */ export declare function assertIGraphStoreConformance(name: string, factory: () => Promise): void; //# sourceMappingURL=conformance.d.ts.map