MCPcopy
hub / github.com/ruvnet/ruflo / SublinearAdapter

Interface SublinearAdapter

plugins/ruflo-graph-intelligence/src/domain/adapter.ts:11–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9import type { SparseMatrix } from './types.js';
10
11export 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. */
52export const noopUnsubscribe = (): void => {};

Callers 8

localComputeMethod · 0.65
coldStartMethod · 0.65
handleRequestMethod · 0.65
index.tsFile · 0.65

Implementers 9

KnowledgeGraphAdapterplugins/ruflo-graph-intelligence/src/a
RagMemoryAdapterplugins/ruflo-graph-intelligence/src/a
BrowserCausalAdapterplugins/ruflo-graph-intelligence/src/a
JujutsuBlastRadiusAdapterplugins/ruflo-graph-intelligence/src/a
AIDefenceSuspicionAdapterplugins/ruflo-graph-intelligence/src/a
CostAttributionAdapterplugins/ruflo-graph-intelligence/src/a
PortfolioCovarianceAdapterplugins/ruflo-graph-intelligence/src/a
ObservabilitySpanAdapterplugins/ruflo-graph-intelligence/src/a
FederationTrustAdapterplugins/ruflo-graph-intelligence/src/a

Calls

no outgoing calls

Tested by

no test coverage detected