| 9 | import type { SparseMatrix } from './types.js'; |
| 10 | |
| 11 | export interface SublinearAdapter { |
| 12 | /** Stable identifier — `"ruflo-federation:trust-mesh"`, etc. */ |
| 13 | readonly graphId: string; |
| 14 | |
| 15 | /** Owning plugin's package name; informational. */ |
| 16 | readonly ownerPlugin: string; |
| 17 | |
| 18 | /** |
| 19 | * Export the current graph state as a SparseMatrix. |
| 20 | * |
| 21 | * `since` is an optional snapshot ISO timestamp — adapters may return |
| 22 | * a frozen snapshot at that moment (for reproducibility) instead of |
| 23 | * the live state. Adapters that don't support history return the live |
| 24 | * state regardless. |
| 25 | * |
| 26 | * `nodeFilter` is an optional allow-list — adapters that can prune |
| 27 | * irrelevant rows should honour it to keep the matrix small. Adapters |
| 28 | * that can't filter return the full matrix. |
| 29 | */ |
| 30 | exportAsSparseMatrix(options?: { |
| 31 | since?: string; |
| 32 | nodeFilter?: ReadonlySet<string>; |
| 33 | }): Promise<SparseMatrix>; |
| 34 | |
| 35 | /** |
| 36 | * Best-effort streaming hook — adapters that can emit deltas (new |
| 37 | * causal events, new federation trust updates, new spans) push |
| 38 | * `SparseDelta`s through this listener. Adapters that can't return |
| 39 | * `noopUnsubscribe`. |
| 40 | */ |
| 41 | onChange?(listener: (delta: import('./types.js').SparseDelta) => void): () => void; |
| 42 | |
| 43 | /** |
| 44 | * Whether this graph is **structurally** non-DD (e.g. asymmetric trust with |
| 45 | * negative weights). Adapters that know they need clamping/renormalisation |
| 46 | * before submission set this flag so the registry can advise callers. |
| 47 | */ |
| 48 | readonly requiresPreprocessing?: boolean; |
| 49 | } |
| 50 | |
| 51 | /** No-op unsubscribe for adapters that don't support streaming. */ |
| 52 | export const noopUnsubscribe = (): void => {}; |
no outgoing calls
no test coverage detected