@modernrelay/orbit-core 0.2.0 → 0.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-FG6TQANI.js +378 -0
- package/dist/chunk-FG6TQANI.js.map +1 -0
- package/dist/engine.d.ts +1 -1
- package/dist/{index-BPjuELfY.d.ts → index-BoQfS8jd.d.ts} +201 -4
- package/dist/index.d.ts +364 -4
- package/dist/index.js +1735 -51
- package/dist/index.js.map +1 -1
- package/dist/{clusters-ExqnvobT.d.ts → lane-SZYhcrXT.d.ts} +95 -2
- package/dist/testing.d.ts +54 -3
- package/dist/testing.js +198 -7
- package/dist/testing.js.map +1 -1
- package/dist/worker/entry.js +269 -0
- package/dist/worker/entry.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-Z7FOEASL.js +0 -141
- package/dist/chunk-Z7FOEASL.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { G as GraphSnapshot, A as AcceptedGraph, R as ResolvedGroup, a as GraphDiagnostic, b as GraphNode, c as AcceptedEdge, N as NodeId, M as MetaEdge, S as SceneFold, d as GroupSpec, e as GroupBySpec, f as SceneGroups, g as RenderScene, h as SceneLinkRef, i as ScenePointRef, j as Accessor, k as RevisionAwareService, l as RequestContext, m as SearchResult, V as ViewportState, n as SelectionState, o as SubgraphSpec, J as JsonValue, E as EngineFactory, p as ExpansionService, P as PathService, q as
|
|
2
|
-
export {
|
|
3
|
-
|
|
1
|
+
import { G as GraphSnapshot, A as AcceptedGraph, R as ResolvedGroup, a as GraphDiagnostic, b as GraphNode, c as AcceptedEdge, N as NodeId, M as MetaEdge, S as SceneFold, d as GroupSpec, e as GroupBySpec, f as SceneGroups, g as RenderScene, h as SceneLinkRef, i as ScenePointRef, j as Accessor, k as RevisionAwareService, l as RequestContext, m as SearchResult, V as ViewportState, n as SelectionState, o as SubgraphSpec, J as JsonValue, E as EngineFactory, p as ExpansionService, P as PathService, q as ScaleLimits, r as GraphTheme, s as GraphStoreState, L as LabelPlacement, t as GraphHostUpdate, B as BeginIngestOptions, I as IngestSession, u as GraphEventName, v as GraphEventMap, w as GraphListenerControl, x as EdgeId, y as GraphPerfSnapshot, z as ResolvedCluster, C as PathOptions, D as PathResult, F as SearchActivation, H as CrossfilterSession, T as TimelinePlayback, K as Scale, O as MetricName, Q as Revisions, U as AccessibilityConfig, W as ThemeInput, X as LabelConfig, Y as IngestBatch, Z as RevisionDimension, _ as FilterSpec, $ as FilterExpr, a0 as DimensionSpec, a1 as BrushState, a2 as DimensionSummary, a3 as DomainPolicy, a4 as EngineBufferChannel, a5 as GraphEngine, a6 as EngineCommit, a7 as EngineCapabilities, a8 as MetricColumn, a9 as ColumnarGraphSnapshot, aa as GraphSnapshotInput } from './index-BoQfS8jd.js';
|
|
2
|
+
export { ab as AppendReceipt, ac as CategoryBin, ad as ClusterSpec, ae as Column, af as ColumnChange, ag as DIAGNOSTIC_SAMPLE_CAP, ah as DegradeEvent, ai as DegradeStep, aj as DiagnosticCode, ak as DiagnosticSeverity, al as DimensionKind, am as ErrorPhase, an as ExpansionBatch, ao as ExpansionResponse, ap as FilterMode, aq as FilterValue, ar as GraphEdge, as as GraphError, at as GraphOperationError, au as HistogramBin, av as IngestCommitReceipt, aw as IngestSessionState, ax as InstanceStatus, ay as LayoutKind, az as NodeEventPayload, aA as OrbitOperationError, aB as ResourceAdmissionReport, aC as ResourceDegradeStep, aD as SearchUnavailableReason, aE as SimulationConfig, aF as StringColumn, aG as graphErrorToError, aH as isFatalGraphError, aI as resourceLimitFatal } from './index-BoQfS8jd.js';
|
|
3
|
+
import { W as WorkerFactoryOption } from './lane-SZYhcrXT.js';
|
|
4
|
+
export { C as ClusterDerivation, D as DEFAULT_CLUSTER_CENTER_RADIUS, a as DEFAULT_LAYOUT_SEED, E as EncodedStringTable, R as RequestClass, b as WorkerEntity, c as WorkerEnvelope, d as WorkerTransport, e as clusterCentroids, f as collectTransfers, g as decodeStringTable, h as deriveClusters, i as encodeStringTable, j as generateClusterCenters, k as judgeEpoch, r as resolveClusterCenters } from './lane-SZYhcrXT.js';
|
|
4
5
|
import { StoreApi } from 'zustand/vanilla';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -794,12 +795,33 @@ interface CreateGraphInstanceOptions<N = Record<string, unknown>, E = Record<str
|
|
|
794
795
|
history?: boolean | {
|
|
795
796
|
limit?: number;
|
|
796
797
|
};
|
|
798
|
+
/**
|
|
799
|
+
* §17/§6.1 degradation-ladder thresholds (S13-T08). CONSTRUCTION-ONLY
|
|
800
|
+
* (D7): read once; invalid fields fall back to the spec defaults with ONE
|
|
801
|
+
* config warning diagnostic. A runtime change requires a keyed remount.
|
|
802
|
+
*/
|
|
803
|
+
limits?: Partial<ScaleLimits>;
|
|
797
804
|
/**
|
|
798
805
|
* §8 image-atlas resolver seam (S10): owns authenticated fetch/caching for
|
|
799
806
|
* one `nodeImage` ref. Default: plain `fetch(ref)` for public URLs.
|
|
800
807
|
* Injectable for tests and authenticated hosts.
|
|
801
808
|
*/
|
|
802
809
|
imageResolver?: ImageResolver;
|
|
810
|
+
/**
|
|
811
|
+
* §6.1/§17 execution mode (ADR-006 D1; CONSTRUCTION-ONLY, D7). Current
|
|
812
|
+
* worker cargo: columnar ACCEPTANCE (validate + dedupe + link resolution
|
|
813
|
+
* off-thread; §7.5-style async admission). 'main' (default) keeps every
|
|
814
|
+
* columnar ingest synchronous; 'auto' and 'worker' route columnar data
|
|
815
|
+
* through the worker lane when it boots — an unavailable lane degrades
|
|
816
|
+
* to 'main' with one `worker-unavailable` info diagnostic under 'auto'
|
|
817
|
+
* and an ERROR diagnostic under 'worker' (which never silently falls
|
|
818
|
+
* back on channel work, but acceptance has no worker-REQUIRED semantics
|
|
819
|
+
* yet — channel projection cargo is the registered follow-up).
|
|
820
|
+
*/
|
|
821
|
+
execution?: 'auto' | 'main' | 'worker';
|
|
822
|
+
/** ADR-006 D5 worker construction tri-option (URL / factory / inline
|
|
823
|
+
* default). Testing seam: `transport` on the lane via this factory. */
|
|
824
|
+
workerFactory?: WorkerFactoryOption;
|
|
803
825
|
}
|
|
804
826
|
/**
|
|
805
827
|
* `expandNode` outcome (§9.2/§16.3):
|
|
@@ -911,6 +933,17 @@ interface GraphInstance<N = Record<string, unknown>, E = Record<string, unknown>
|
|
|
911
933
|
highlightNeighbors?: boolean;
|
|
912
934
|
hops?: 1;
|
|
913
935
|
}): readonly NodeId[];
|
|
936
|
+
/**
|
|
937
|
+
* §13 emphasis ring WITHOUT the camera: ring `id` (null clears). The light
|
|
938
|
+
* op keyboard navigation needs — arrowing a list must not fly the camera on
|
|
939
|
+
* every keystroke (`focusNode` stays ring + zoom + neighbors). Unknown ids
|
|
940
|
+
* are a silent no-op (a stale row racing a model swap is data, not an
|
|
941
|
+
* error); `emphasisRing: false` suppresses it entirely. The target is
|
|
942
|
+
* STICKY: it survives structural commits and context recovery until it is
|
|
943
|
+
* cleared, its id departs the model, or pointer hover supersedes it
|
|
944
|
+
* (emphasis belongs to the latest action — the §16.2 rule).
|
|
945
|
+
*/
|
|
946
|
+
emphasizeNode(id: NodeId | null): void;
|
|
914
947
|
/**
|
|
915
948
|
* §14/§15 typed context-menu channel, opened from a DOM presenter. Label
|
|
916
949
|
* divs are `pointerEvents: 'auto'` by design (click-to-focus), so a
|
|
@@ -958,6 +991,37 @@ interface GraphInstance<N = Record<string, unknown>, E = Record<string, unknown>
|
|
|
958
991
|
/** Fallback-route click resolution: emits 'edgeClick' when a link is within
|
|
959
992
|
* tolerance. No-op (null) on the native route. */
|
|
960
993
|
sampleEdgeClick(screen: readonly [number, number]): AcceptedEdge<E> | null;
|
|
994
|
+
/**
|
|
995
|
+
* @internal §15/§17 shared hit-test/overlay cadence: the count of engine
|
|
996
|
+
* onFrame ticks this session. THE one clock every sampling route throttles
|
|
997
|
+
* against (node hover and link picking share it by construction — there is
|
|
998
|
+
* no second cadence timer anywhere; the S13-T06 lint rule enforces it).
|
|
999
|
+
* The S13 ladder's defer-link-picking arms/disarms against this counter;
|
|
1000
|
+
* §17 telemetry reads it for idle-wakeup accounting.
|
|
1001
|
+
*/
|
|
1002
|
+
getFrameCadence(): number;
|
|
1003
|
+
/**
|
|
1004
|
+
* @internal F10-02 op counters (live object — snapshot before comparing):
|
|
1005
|
+
* the perf-gate-delta suite proves the brush fast path does O(Δ) work —
|
|
1006
|
+
* zero full recomposes/refreshes/cascades across a scrub. §17 telemetry
|
|
1007
|
+
* (S13-T07) will fold these into `lastCommitMs`-adjacent accounting.
|
|
1008
|
+
*/
|
|
1009
|
+
getPerfCounters(): Readonly<{
|
|
1010
|
+
brushSlotsTranslated: number;
|
|
1011
|
+
fullBrushRefreshes: number;
|
|
1012
|
+
fullCascades: number;
|
|
1013
|
+
fullNodeRecomposes: number;
|
|
1014
|
+
fullEdgeRecomposes: number;
|
|
1015
|
+
}>;
|
|
1016
|
+
/**
|
|
1017
|
+
* §17 telemetry snapshot (S13-T07): counts, byte estimates, queue depth,
|
|
1018
|
+
* revisions, last-commit phase decomposition, active ladder steps,
|
|
1019
|
+
* execution lane, range availability, and the pressure mirror — never raw
|
|
1020
|
+
* attrs or ids. Synchronous in every lifecycle state (pre-scene fields
|
|
1021
|
+
* read zero/absent). `validate` is folded into `derive` until the
|
|
1022
|
+
* columnar lane splits acceptance from derivation (PR-E).
|
|
1023
|
+
*/
|
|
1024
|
+
getPerfSnapshot(): GraphPerfSnapshot;
|
|
961
1025
|
hideNodes(ids: readonly NodeId[]): void;
|
|
962
1026
|
showNodes(ids: readonly NodeId[]): void;
|
|
963
1027
|
showAll(): void;
|
|
@@ -1355,6 +1419,22 @@ declare function buildAdjacency(links: Uint32Array, pointCount: number): Adjacen
|
|
|
1355
1419
|
* `adj.neighbors` — do not mutate, and do not hold across a rebuild.
|
|
1356
1420
|
*/
|
|
1357
1421
|
declare function neighborsOf(adj: Adjacency, index: number): Uint32Array;
|
|
1422
|
+
/**
|
|
1423
|
+
* CSR INCIDENCE: point → incident EDGE SLOTS (F10-02). The plain Adjacency
|
|
1424
|
+
* stores neighbor points, which cannot drive incident-edge dirtying — the
|
|
1425
|
+
* §9.1 delta cascade needs the edge slots themselves. Same two counting
|
|
1426
|
+
* passes and the same conventions: undirected (each edge listed under both
|
|
1427
|
+
* endpoints), parallel edges repeat, and a self-loop lists its edge slot
|
|
1428
|
+
* twice under its point — consumers' per-edge operations are idempotent, so
|
|
1429
|
+
* the duplicate is harmless and cheaper than a dedupe pass.
|
|
1430
|
+
*/
|
|
1431
|
+
interface Incidence {
|
|
1432
|
+
/** Length `pointCount + 1`; edges of point `i` live at
|
|
1433
|
+
* `edgeSlots[offsets[i] … offsets[i + 1])`. */
|
|
1434
|
+
readonly offsets: Uint32Array;
|
|
1435
|
+
/** Length `links.length` (each edge appears once per endpoint slot). */
|
|
1436
|
+
readonly edgeSlots: Uint32Array;
|
|
1437
|
+
}
|
|
1358
1438
|
|
|
1359
1439
|
/**
|
|
1360
1440
|
* §13/§15 CPU link-pick fallback: a uniform grid over ALL links in SPACE
|
|
@@ -2137,6 +2217,7 @@ declare function canonicalFilterKey(specOrExpr: unknown): string;
|
|
|
2137
2217
|
* balanced increments/decrements whenever a clear()/release() leaves zero
|
|
2138
2218
|
* held memberships.
|
|
2139
2219
|
*/
|
|
2220
|
+
|
|
2140
2221
|
/** Default muted alpha for dimmed entities (§9.1 'dim' mode). */
|
|
2141
2222
|
declare const DIM_ALPHA_DEFAULT = 0.15;
|
|
2142
2223
|
/**
|
|
@@ -2149,12 +2230,38 @@ interface MaskSource {
|
|
|
2149
2230
|
readonly name: string;
|
|
2150
2231
|
setNodeFailures(hideIdx: Iterable<number> | null, dimIdx?: Iterable<number> | null): void;
|
|
2151
2232
|
setEdgeFailures(hideIdx: Iterable<number> | null, dimIdx?: Iterable<number> | null): void;
|
|
2233
|
+
/**
|
|
2234
|
+
* O(Δ) delta form of the HIDE lane (F10-02): adds/removes individual slots
|
|
2235
|
+
* from this source's membership without replaying the full set. Freely
|
|
2236
|
+
* composable with the replace form — a later setNodeFailures re-baselines.
|
|
2237
|
+
* `crossings`, when supplied, receives the slots whose hide counter
|
|
2238
|
+
* crossed zero DURING THIS CALL (callee-cleared first): the incremental
|
|
2239
|
+
* cascade's input, which per-drain `pending` tracking cannot provide.
|
|
2240
|
+
*/
|
|
2241
|
+
updateNodeFailures(addHide: ArrayLike<number> | null, removeHide: ArrayLike<number> | null, crossings?: MaskCrossings): void;
|
|
2242
|
+
updateEdgeFailures(addHide: ArrayLike<number> | null, removeHide: ArrayLike<number> | null): void;
|
|
2152
2243
|
/** Empties all four lane memberships (the source stays usable). */
|
|
2153
2244
|
clear(): void;
|
|
2154
2245
|
/** clear() + permanently retires the handle (further set/clear throws;
|
|
2155
2246
|
* release() itself is idempotent). */
|
|
2156
2247
|
release(): void;
|
|
2157
2248
|
}
|
|
2249
|
+
/** Per-CALL zero-crossings reported by the delta ops (reused, callee-cleared). */
|
|
2250
|
+
interface MaskCrossings {
|
|
2251
|
+
/** Slots whose hide counter went 0 → nonzero in this call. */
|
|
2252
|
+
becameFailing: number[];
|
|
2253
|
+
/** Slots whose hide counter went nonzero → 0 in this call. */
|
|
2254
|
+
becameClear: number[];
|
|
2255
|
+
}
|
|
2256
|
+
/** §17 O(Δ) operation counters (see resetStats/stats on SoftMask). */
|
|
2257
|
+
interface MaskStats {
|
|
2258
|
+
/** Slots visited by delta membership ops (add + remove attempts). */
|
|
2259
|
+
slotsVisited: number;
|
|
2260
|
+
/** Counter zero-crossings applied (both directions, all lanes). */
|
|
2261
|
+
zeroCrossings: number;
|
|
2262
|
+
/** Incident-edge visits performed by the delta cascade. */
|
|
2263
|
+
cascadeEdgesVisited: number;
|
|
2264
|
+
}
|
|
2158
2265
|
/**
|
|
2159
2266
|
* One drain payload. The four index arrays are REUSED across drains — copy
|
|
2160
2267
|
* before the next drainDirty() call if you need to keep them.
|
|
@@ -2187,6 +2294,8 @@ declare class SoftMask {
|
|
|
2187
2294
|
private overflowedFlag;
|
|
2188
2295
|
/** Total memberships currently held across all sources and lanes. */
|
|
2189
2296
|
private totalHeld;
|
|
2297
|
+
/** §17 O(Δ) op counters (F10-02 gate instrumentation). */
|
|
2298
|
+
private readonly statsBox;
|
|
2190
2299
|
constructor(nodeCapacity: number, edgeCapacity: number);
|
|
2191
2300
|
get nodeCapacity(): number;
|
|
2192
2301
|
get edgeCapacity(): number;
|
|
@@ -2217,12 +2326,29 @@ declare class SoftMask {
|
|
|
2217
2326
|
* endpoint (their previous cascade contribution, if any, is removed).
|
|
2218
2327
|
*/
|
|
2219
2328
|
applyNodeCascadeToEdges(links: Uint32Array): void;
|
|
2329
|
+
/**
|
|
2330
|
+
* O(incident-edges) delta form of the §9.1 cascade (F10-02): for each node
|
|
2331
|
+
* whose HIDE visibility crossed zero, recompute only its incident edges'
|
|
2332
|
+
* cascade state from the CURRENT node counters and apply the delta through
|
|
2333
|
+
* the same internal cascade source the full form uses — the two compose
|
|
2334
|
+
* freely (the full form re-baselines). Edges shared by two crossed nodes
|
|
2335
|
+
* are visited twice; the membership delta is idempotent, so the second
|
|
2336
|
+
* visit is an O(1) no-op. `incidence` must describe the SAME `links`
|
|
2337
|
+
* buffer (edge slot i ↔ links[2i]/[2i+1]).
|
|
2338
|
+
*/
|
|
2339
|
+
applyNodeCascadeToEdgesDelta(links: Uint32Array, incidence: Incidence, crossedNodes: readonly number[]): void;
|
|
2220
2340
|
/**
|
|
2221
2341
|
* Drains the zero-crossing dirty lists accumulated since the previous
|
|
2222
2342
|
* drain. Only NET flips are emitted (state compared against the previous
|
|
2223
2343
|
* drain). The returned index arrays are reused by the next drain.
|
|
2224
2344
|
*/
|
|
2225
2345
|
drainDirty(): MaskDrain;
|
|
2346
|
+
/** §17 telemetry: estimated bytes of mask storage held (S13-T07):
|
|
2347
|
+
* four counter lanes (+pending trackers) and per-source flag columns. */
|
|
2348
|
+
estimatedBytes(): number;
|
|
2349
|
+
/** §17 O(Δ) op counters (live object — snapshot before comparing). */
|
|
2350
|
+
get stats(): Readonly<MaskStats>;
|
|
2351
|
+
resetStats(): void;
|
|
2226
2352
|
visibleNodeCount(): number;
|
|
2227
2353
|
visibleEdgeCount(): number;
|
|
2228
2354
|
/** Visible iff hideFailures === 0 (out-of-range slots read not-visible). */
|
|
@@ -2241,6 +2367,14 @@ declare class SoftMask {
|
|
|
2241
2367
|
* membership partially applied; duplicates within `incoming` count once.
|
|
2242
2368
|
*/
|
|
2243
2369
|
private applyMembership;
|
|
2370
|
+
/**
|
|
2371
|
+
* O(Δ) delta ops on one lane membership (F10-02). Adds and removes are
|
|
2372
|
+
* idempotent per slot (adding a member / removing a non-member is a
|
|
2373
|
+
* no-op); removed slots leave HOLES in `list` (compacted past 50%), so
|
|
2374
|
+
* replace/clear passes must honor the bit0 guard above. `crossings`, when
|
|
2375
|
+
* given, is cleared and then receives this CALL's hide zero-crossings.
|
|
2376
|
+
*/
|
|
2377
|
+
private applyMembershipDelta;
|
|
2244
2378
|
private increment;
|
|
2245
2379
|
private decrement;
|
|
2246
2380
|
/** Records the first zero-crossing of a slot per drain period, remembering
|
|
@@ -2324,10 +2458,16 @@ interface CrossfilterStats {
|
|
|
2324
2458
|
fullSorts: number;
|
|
2325
2459
|
/** Permutation merges performed by appendRows. */
|
|
2326
2460
|
permutationMerges: number;
|
|
2461
|
+
/** Incremental filtered-layer bin adjustments (F10-02: O(Δ·D)). */
|
|
2462
|
+
binUpdates: number;
|
|
2463
|
+
/** Full O(rows) filtered-layer recomputes (materialization/oracle only). */
|
|
2464
|
+
filteredRecomputes: number;
|
|
2327
2465
|
}
|
|
2328
2466
|
declare class TypedColumnCrossfilter<N = Record<string, unknown>> {
|
|
2329
2467
|
/** Test instrumentation; see CrossfilterStats. Reset with resetStats(). */
|
|
2330
2468
|
readonly stats: CrossfilterStats;
|
|
2469
|
+
/** Count of dims whose filtered layer is live-maintained (F10-02). */
|
|
2470
|
+
private liveDims;
|
|
2331
2471
|
private dims;
|
|
2332
2472
|
private byKey;
|
|
2333
2473
|
private specs;
|
|
@@ -2344,6 +2484,12 @@ declare class TypedColumnCrossfilter<N = Record<string, unknown>> {
|
|
|
2344
2484
|
/** Monotonic from 0; advances exactly once per observable setBrush change. */
|
|
2345
2485
|
get selectionRevision(): number;
|
|
2346
2486
|
resetStats(): void;
|
|
2487
|
+
/** §17 telemetry: estimated bytes of typed-column storage held (S13-T07).
|
|
2488
|
+
* Documented components: per-dim value/permutation/bin/code/pass arrays,
|
|
2489
|
+
* the global failure counter, and the external mask. */
|
|
2490
|
+
estimatedBytes(): number;
|
|
2491
|
+
/** F10-02 live-layer bookkeeping — the ONLY writer of `filteredLive`. */
|
|
2492
|
+
private setFilteredLive;
|
|
2347
2493
|
/**
|
|
2348
2494
|
* (Re)initialize columns from scratch. Clears all brushes and the external
|
|
2349
2495
|
* mask (use replaceAll to rebuild while preserving brushes by key). Does not
|
|
@@ -2404,6 +2550,22 @@ declare class TypedColumnCrossfilter<N = Record<string, unknown>> {
|
|
|
2404
2550
|
private rebinRange;
|
|
2405
2551
|
private binIndex;
|
|
2406
2552
|
private flip;
|
|
2553
|
+
/**
|
|
2554
|
+
* F10-02 inline maintenance of LIVE filtered layers, dispatched from the
|
|
2555
|
+
* one place that knows the failCount transition. `boundary` is the
|
|
2556
|
+
* other-failures picture at the interesting side of the flip (after for
|
|
2557
|
+
* shown, before for hidden):
|
|
2558
|
+
* - 0 → the slot crossed the FULLY-VISIBLE boundary: every other live
|
|
2559
|
+
* layer counts it (own layers ignore the own-dim brush, so the brushed
|
|
2560
|
+
* dim's layer is provably unchanged by its own flip);
|
|
2561
|
+
* - 1 → exactly one OTHER dim still fails the slot: only that dim's
|
|
2562
|
+
* what-if-I-cleared-mine layer flips;
|
|
2563
|
+
* - ≥2 → no layer can change.
|
|
2564
|
+
* External-mask-excluded and hygiene-invalid slots contribute nothing
|
|
2565
|
+
* either way and are skipped.
|
|
2566
|
+
*/
|
|
2567
|
+
private maintainFiltered;
|
|
2568
|
+
private adjustLayer;
|
|
2407
2569
|
private walkSorted;
|
|
2408
2570
|
private walkList;
|
|
2409
2571
|
private applyRangeTransition;
|
|
@@ -2609,6 +2771,11 @@ interface EnginePolicy {
|
|
|
2609
2771
|
readonly clusterForce: 'native' | 'inert';
|
|
2610
2772
|
/** Channels eligible for ranged (partial) uploads; empty = full replaces. */
|
|
2611
2773
|
readonly rangedChannels: ReadonlySet<EngineBufferChannel>;
|
|
2774
|
+
/** §17 stop-at-rest: 'stops' when the engine declares idleFrames:'stops'.
|
|
2775
|
+
* Observability only (telemetry/harness read it) — an idle-spinning engine
|
|
2776
|
+
* is a documented state, never a degradation entry: nothing was
|
|
2777
|
+
* host-REQUESTED, so there is nothing to warn about. */
|
|
2778
|
+
readonly quiescence: 'stops' | 'free-running';
|
|
2612
2779
|
/** Exactly one entry per REQUESTED-but-unsupported feature; requested and
|
|
2613
2780
|
* supported — or simply never requested — contributes nothing. */
|
|
2614
2781
|
readonly degradations: readonly EnginePolicyDegradation[];
|
|
@@ -2766,6 +2933,8 @@ declare class MetricStore<N = Record<string, unknown>> {
|
|
|
2766
2933
|
/** Admitted async columns by metric name; NaN encodes null. */
|
|
2767
2934
|
private readonly columns;
|
|
2768
2935
|
private degreePasses;
|
|
2936
|
+
/** §17 telemetry: estimated bytes of metric storage held (S13-T07). */
|
|
2937
|
+
estimatedBytes(): number;
|
|
2769
2938
|
/** Number of combined degree-family compute passes (test observability). */
|
|
2770
2939
|
get degreeComputePasses(): number;
|
|
2771
2940
|
/**
|
|
@@ -2992,4 +3161,195 @@ declare function escapeXml(text: string): string;
|
|
|
2992
3161
|
*/
|
|
2993
3162
|
declare function renderSvg(scene: SvgScene, opts?: RenderSvgOptions): string;
|
|
2994
3163
|
|
|
2995
|
-
|
|
3164
|
+
/**
|
|
3165
|
+
* §5.1 columnar-NATIVE acceptance rules (PR-F wave 1, ADR-006) — the column
|
|
3166
|
+
* -domain twin of validate.ts, built to run INSIDE the worker over typed
|
|
3167
|
+
* columns without materializing a single row object.
|
|
3168
|
+
*
|
|
3169
|
+
* Semantics mirror the object lane EXACTLY (the equivalence oracle pins
|
|
3170
|
+
* rosters AND diagnostics, message strings included):
|
|
3171
|
+
* - duplicate node ids drop, first occurrence wins ('duplicate-node-id',
|
|
3172
|
+
* warning) — and edges addressing a dropped duplicate ROW remap to the
|
|
3173
|
+
* surviving occurrence, because the object lane resolves endpoints by ID
|
|
3174
|
+
* STRING, which survives.
|
|
3175
|
+
* - duplicate edge ids drop, first wins ('duplicate-edge-id', warning).
|
|
3176
|
+
* - self-loops are RETAINED with 'self-loop-retained' (info).
|
|
3177
|
+
* - invalid-node / invalid-edge / dangling-edge cannot occur here: ids come
|
|
3178
|
+
* from a structurally validated dictionary column and endpoints are
|
|
3179
|
+
* in-bounds indices by prior validation (validateColumnarStructure).
|
|
3180
|
+
*
|
|
3181
|
+
* Duplicates hide in TWO encodings: two rows sharing a code, and two
|
|
3182
|
+
* DISTINCT dictionary entries holding equal strings. Both are handled by
|
|
3183
|
+
* canonicalizing the dictionary first (O(dictionary)), then scanning rows
|
|
3184
|
+
* with an integer seen-set (O(rows)) — no per-row string work.
|
|
3185
|
+
*
|
|
3186
|
+
* Worker-safe by construction: pure over typed arrays; no DOM, no instance
|
|
3187
|
+
* state, no Date/random.
|
|
3188
|
+
*/
|
|
3189
|
+
|
|
3190
|
+
interface ColumnarAcceptance {
|
|
3191
|
+
/** 1 = the ORIGINAL row survives into the accepted roster. */
|
|
3192
|
+
keepNodes: Uint8Array;
|
|
3193
|
+
keepEdges: Uint8Array;
|
|
3194
|
+
acceptedNodeCount: number;
|
|
3195
|
+
acceptedEdgeCount: number;
|
|
3196
|
+
/** ORIGINAL node row → accepted index of its SURVIVING id (a dropped
|
|
3197
|
+
* duplicate row points at the first occurrence's accepted index). */
|
|
3198
|
+
nodeAcceptedIndex: Int32Array;
|
|
3199
|
+
/** Resolved links (2 × acceptedEdgeCount), endpoints in ACCEPTED node
|
|
3200
|
+
* indices, remapped through surviving occurrences. */
|
|
3201
|
+
links: Uint32Array;
|
|
3202
|
+
/** Batched, object-lane-identical diagnostics (codes, counts, capped
|
|
3203
|
+
* samples, message strings). */
|
|
3204
|
+
diagnostics: GraphDiagnostic[];
|
|
3205
|
+
}
|
|
3206
|
+
/**
|
|
3207
|
+
* Run the acceptance rules over a STRUCTURALLY VALID columnar snapshot
|
|
3208
|
+
* (validateColumnarStructure returned no issues — lengths and bounds are
|
|
3209
|
+
* trusted here).
|
|
3210
|
+
*/
|
|
3211
|
+
declare function acceptColumnar(snapshot: ColumnarGraphSnapshot<unknown, unknown>): ColumnarAcceptance;
|
|
3212
|
+
|
|
3213
|
+
/**
|
|
3214
|
+
* §5 columnar snapshot lane (S13-T01, ADR-006) — structural validation and
|
|
3215
|
+
* the materialization bridge.
|
|
3216
|
+
*
|
|
3217
|
+
* Validation is O(number of columns + rows) and runs BEFORE transfer or
|
|
3218
|
+
* admission. Columnar structural corruption is intentionally not repaired
|
|
3219
|
+
* row by row — offset/index misalignment can reinterpret every later row —
|
|
3220
|
+
* so any structural issue rejects the WHOLE snapshot, the prior scene stays
|
|
3221
|
+
* intact, and nothing throws from a React render (spec §5.1).
|
|
3222
|
+
*
|
|
3223
|
+
* The bridge materializes a VALID columnar snapshot into the object form and
|
|
3224
|
+
* feeds the existing pipeline, so duplicate-id / dangling-edge / self-loop
|
|
3225
|
+
* resolution stays in exactly one place (validate.ts) and the columnar lane
|
|
3226
|
+
* inherits every object-lane rule by construction (ADR-006: T01 lands
|
|
3227
|
+
* behind `execution: 'main'` with zero behavior change). The
|
|
3228
|
+
* zero-materialization path arrives with the worker waves.
|
|
3229
|
+
*
|
|
3230
|
+
* Null semantics: `nulls` is one byte per row, nonzero = null. Null attr
|
|
3231
|
+
* values materialize as `null` (JSON-ish; every numeric/temporal consumer
|
|
3232
|
+
* already coerces). A null or out-of-range id CODE is structural corruption
|
|
3233
|
+
* — ids are identity, not data.
|
|
3234
|
+
*/
|
|
3235
|
+
|
|
3236
|
+
declare function isColumnarSnapshot<N, E>(input: GraphSnapshotInput<N, E>): input is ColumnarGraphSnapshot<N, E>;
|
|
3237
|
+
/** One structural defect. `where` is '<entity>.<column>' or '<entity>.<field>'. */
|
|
3238
|
+
interface ColumnarIssue {
|
|
3239
|
+
where: string;
|
|
3240
|
+
problem: 'not-a-string-column' | 'length-mismatch' | 'code-out-of-range' | 'null-id' | 'nulls-length-mismatch' | 'endpoint-out-of-range' | 'endpoint-length-mismatch' | 'bad-length' | 'bad-column-kind';
|
|
3241
|
+
detail: string;
|
|
3242
|
+
}
|
|
3243
|
+
/**
|
|
3244
|
+
* O(columns + rows) structural validation. Empty array ⇒ structurally sound
|
|
3245
|
+
* (duplicate ids, self-loops, and parallel-edge rules are NOT checked here —
|
|
3246
|
+
* they are shared object-lane semantics applied after materialization).
|
|
3247
|
+
*/
|
|
3248
|
+
declare function validateColumnarStructure(snapshot: ColumnarGraphSnapshot<unknown, unknown>): ColumnarIssue[];
|
|
3249
|
+
/**
|
|
3250
|
+
* Materialize a STRUCTURALLY VALID columnar snapshot into the object form.
|
|
3251
|
+
* Call only after `validateColumnarStructure` returned no issues — this
|
|
3252
|
+
* function trusts lengths and bounds.
|
|
3253
|
+
*/
|
|
3254
|
+
declare function materializeColumnarSnapshot<N, E>(snapshot: ColumnarGraphSnapshot<N, E>): GraphSnapshot<N, E>;
|
|
3255
|
+
/**
|
|
3256
|
+
* Build the AcceptedGraph DIRECTLY from clean columns + the acceptance
|
|
3257
|
+
* verdicts (worker or main produced — same module either way): only kept
|
|
3258
|
+
* rows materialize, `nodeIndex` falls out of the same pass, and
|
|
3259
|
+
* `validateSnapshot`'s O(rows) object scan never runs. The verdicts are
|
|
3260
|
+
* trusted — callers pass an acceptance produced from THIS snapshot.
|
|
3261
|
+
*/
|
|
3262
|
+
declare function buildAcceptedFromColumnar<N, E>(snapshot: ColumnarGraphSnapshot<N, E>, acceptance: Pick<ColumnarAcceptance, 'keepNodes' | 'keepEdges' | 'acceptedNodeCount' | 'acceptedEdgeCount' | 'diagnostics'>): AcceptedGraph<N, E>;
|
|
3263
|
+
/** Every distinct underlying ArrayBuffer reachable from the snapshot's typed
|
|
3264
|
+
* arrays — the detach set for `bufferOwnership: 'transfer'` and the
|
|
3265
|
+
* byteLength witness set for its tests. */
|
|
3266
|
+
declare function columnarArrayBuffers(snapshot: ColumnarGraphSnapshot<unknown, unknown>): ArrayBuffer[];
|
|
3267
|
+
/**
|
|
3268
|
+
* `bufferOwnership: 'transfer'` — detach every underlying ArrayBuffer.
|
|
3269
|
+
* Called ONLY after validation and admission both succeeded (ADR-006 D4:
|
|
3270
|
+
* reject-before-allocation extends to reject-before-detach). Returns the
|
|
3271
|
+
* number of buffers detached. SharedArrayBuffer-backed views are skipped
|
|
3272
|
+
* (they cannot detach and remain shared by contract).
|
|
3273
|
+
*/
|
|
3274
|
+
declare function detachColumnarBuffers(snapshot: ColumnarGraphSnapshot<unknown, unknown>): number;
|
|
3275
|
+
|
|
3276
|
+
/**
|
|
3277
|
+
* §17 serializable field descriptors (S13-T01, ADR-006 D1) — the worker-lane
|
|
3278
|
+
* accessor forms: `FieldAccessor` + `SerializableTransform` + the `field()`
|
|
3279
|
+
* manual-schema helper. Descriptors are DATA, never code: they cross the
|
|
3280
|
+
* worker boundary by structured clone, compare by canonical structural
|
|
3281
|
+
* value, and unknown transform ops are validation errors (spec: "descriptors
|
|
3282
|
+
* are never evaluated as code").
|
|
3283
|
+
*
|
|
3284
|
+
* This module ships the building blocks and their evaluation semantics; the
|
|
3285
|
+
* styling-accessor unions widen to accept descriptor forms in the wave that
|
|
3286
|
+
* makes projection consume them (accepting a form the projector ignores
|
|
3287
|
+
* would be a silent no-op, worse than absence).
|
|
3288
|
+
*
|
|
3289
|
+
* Path semantics (v1, deliberately flat): a path addresses `attrs[path]`,
|
|
3290
|
+
* with the FilterExpr convention that the literal `'id'` reads the entity
|
|
3291
|
+
* id. No dot traversal — columnar snapshots are flat columns, and the
|
|
3292
|
+
* prepared-data mapping validation rejects a missing column before
|
|
3293
|
+
* projection ever runs.
|
|
3294
|
+
*/
|
|
3295
|
+
|
|
3296
|
+
/** Branded attr path — `field<A,T>()` is a manual-schema ASSERTION (compile
|
|
3297
|
+
* -time narrowing for codegen/schema packages), not runtime validation. */
|
|
3298
|
+
type TypedFieldPath<A, T> = string & {
|
|
3299
|
+
readonly __attrs?: A;
|
|
3300
|
+
readonly __value?: T;
|
|
3301
|
+
};
|
|
3302
|
+
declare function field<A, T>(path: string): TypedFieldPath<A, T>;
|
|
3303
|
+
/** §17 transform whitelist. Closed set — extending it is a spec amendment. */
|
|
3304
|
+
type SerializableTransform = {
|
|
3305
|
+
op: 'identity';
|
|
3306
|
+
} | {
|
|
3307
|
+
op: 'number';
|
|
3308
|
+
} | {
|
|
3309
|
+
op: 'lowercase';
|
|
3310
|
+
} | {
|
|
3311
|
+
op: 'date-to-epoch-ms';
|
|
3312
|
+
} | {
|
|
3313
|
+
op: 'coalesce';
|
|
3314
|
+
value: JsonValue;
|
|
3315
|
+
};
|
|
3316
|
+
interface FieldAccessor<A, T> {
|
|
3317
|
+
field: TypedFieldPath<A, T>;
|
|
3318
|
+
transform?: SerializableTransform;
|
|
3319
|
+
}
|
|
3320
|
+
/** Reasons a candidate failed `validateFieldAccessor` (typed, no throw). */
|
|
3321
|
+
type DescriptorIssue = {
|
|
3322
|
+
kind: 'not-an-object';
|
|
3323
|
+
} | {
|
|
3324
|
+
kind: 'field-not-a-string';
|
|
3325
|
+
} | {
|
|
3326
|
+
kind: 'unknown-transform-op';
|
|
3327
|
+
op: string;
|
|
3328
|
+
} | {
|
|
3329
|
+
kind: 'transform-not-an-object';
|
|
3330
|
+
} | {
|
|
3331
|
+
kind: 'coalesce-missing-value';
|
|
3332
|
+
};
|
|
3333
|
+
/**
|
|
3334
|
+
* Structural guard: is this value SHAPED like a FieldAccessor? Deliberately
|
|
3335
|
+
* strict about the transform whitelist (unknown ops are errors, not
|
|
3336
|
+
* passthroughs) and deliberately loose about extra keys (forward-compatible
|
|
3337
|
+
* clone targets). Functions are never descriptors.
|
|
3338
|
+
*/
|
|
3339
|
+
declare function validateFieldAccessor(value: unknown): DescriptorIssue | null;
|
|
3340
|
+
declare function isFieldAccessor(value: unknown): value is FieldAccessor<unknown, unknown>;
|
|
3341
|
+
/**
|
|
3342
|
+
* Canonical structural fingerprint (spec: descriptors "compare by canonical
|
|
3343
|
+
* structural value, invalidate only their dependent channel"). Stable across
|
|
3344
|
+
* key order and object identity; usable as a channel-invalidation key on
|
|
3345
|
+
* both sides of the worker boundary.
|
|
3346
|
+
*/
|
|
3347
|
+
declare function descriptorKey(accessor: FieldAccessor<unknown, unknown>): string;
|
|
3348
|
+
/**
|
|
3349
|
+
* Evaluate a descriptor against an entity's `(id, attrs)` — the pure
|
|
3350
|
+
* function both lanes share (ADR-006 D2: byte-exact parity starts with ONE
|
|
3351
|
+
* evaluation implementation, imported by both threads, never duplicated).
|
|
3352
|
+
*/
|
|
3353
|
+
declare function evaluateFieldAccessor(accessor: FieldAccessor<unknown, unknown>, id: string, attrs: Readonly<Record<string, unknown>> | undefined): unknown;
|
|
3354
|
+
|
|
3355
|
+
export { ATLAS_MAX_CONCURRENT_DEFAULT, ATLAS_MAX_ENTRIES_DEFAULT, ATLAS_MAX_RETRIES_DEFAULT, AcceptanceQueue, AcceptedEdge, AcceptedGraph, AccessibilityConfig, Accessor, type Adjacency, type AdmitColumnsOptions, type AdmitColumnsResult, type AdmitServiceResultArgs, BASE_PENDING_KEY, BRUSH_HISTORY_COALESCE_MS, BeginIngestOptions, type BrushDelta, BrushState, CATEGORICAL_PALETTE, type CategoricalScale, type ColumnarAcceptance, ColumnarGraphSnapshot, type ColumnarIssue, type CompiledFilter, type CreateGraphInstanceOptions, type CreateRequestContextArgs, CrossfilterSession, type CrossfilterStats, DEFAULT_BIN_COUNT, DIM_ALPHA_DEFAULT, DIVERGING_RANGE_DEFAULT, type DescriptorIssue, DimensionSpec, DimensionSummary, type DivergingScale, DomainPolicy, DomainStore, EDGE_PICK_TOLERANCE_PX, EdgeId, type EdgePickRoute, EdgePickingFacade, type EdgePickingFacadeOptions, EngineBufferChannel, type EnginePolicy, type EnginePolicyDegradation, type ExpandNodeResult, type ExpansionOverlayRecord, ExpansionService, type FetchLike, type FieldAccessor, type FilterErrorAggregate, FilterExpr, FilterSpec, GRAPH_THEME_DARK, GRAPH_THEME_LIGHT, GraphDiagnostic, GraphEventMap, GraphEventName, GraphHostUpdate, type GraphInstance, GraphListenerControl, GraphNode, GraphPerfSnapshot, type GraphServices, GraphSnapshot, GraphSnapshotInput, GraphStoreState, GraphTheme, type GraphViewState, type GroupByDerivation, GroupBySpec, type GroupRewrite, GroupSpec, type GroupValidationResult, HISTORY_LIMIT_DEFAULT, type HistoryCommand, type HistoryDepths, HistoryKernel, type HistoryKernelOptions, INGEST_MAX_FLUSH_LATENCY_MS_DEFAULT, INGEST_MAX_PENDING_BYTES_DEFAULT, INGEST_OVERFLOW_FACTOR, type ImageAtlasBatch, ImageAtlasPipeline, type ImageAtlasPipelineOptions, type ImageDecode, type ImageResolver, IngestBatch, IngestSession, JsonValue, LABEL_MAX_VISIBLE_CAP, LABEL_MAX_VISIBLE_DEFAULT, type LabelCandidate, type LabelCandidateResult, type LabelCandidateViewport, LabelConfig, LabelPlacement, type LabelSubscriptions, type LinkPickGridSnapshot, LinkPickIndex, type LinkVisibilityMask, type LocalExpansionBase, type LocalSearchBase, type LocalSearchService, META_EDGE_MAX_WIDTH, type MaskDrain, type MaskSource, type MergeBase, type MergeResult, MetaEdge, type MetaEdgeRecord, MetricColumn, type MetricModelInput, MetricName, MetricStore, NodeId, OVERVIEW_HOT_INTERVAL_MS, OVERVIEW_IDLE_INTERVAL_MS, OVERVIEW_SIZE_DEFAULT, type OverviewBounds, OverviewController, type OverviewControllerOptions, type OverviewRaster, type OverviewScene, PHYSICAL_DEFAULT_LINK_WIDTH, PHYSICAL_DEFAULT_POINT_SIZE, PathOptions, PathResult, PathService, PendingExpansions, type ReconcileResult, Reconciler, type RegisterExpansionResult, RenderScene, type RenderSvgOptions, RequestContext, type RequestContextHandle, type RequestedEngineFeatures, type ResolveDomainArgs, ResolvedCluster, ResolvedGroup, type ResolvedScope, RevisionAwareService, RevisionDimension, type RevisionSnapshot, Revisions, type RowTally, SEARCH_CACHE_LIMIT, SEARCH_LIMIT_DEFAULT, SEARCH_SCAN_CHUNK, SEARCH_SCORE_EXACT_ID, SEARCH_SCORE_ID_PREFIX, SEARCH_SCORE_SUBSTRING, SEARCH_SCORE_TOKEN_START_BONUS, SEQUENTIAL_RANGE_DEFAULT, SUPER_NODE_MAX_SIZE, SVG_MAX_ELEMENTS_DEFAULT, Scale, type ScaleChannelInfo, type ScaleInfoRow, ScaleLimits, SceneGroups, SceneLinkRef, ScenePointRef, SearchActivation, SearchResult, type SearchService, type SelectLabelCandidatesArgs, SelectionState, type SequentialScale, type SerializableScale, type SerializableTransform, type ServiceCacheKeyArgs, type SessionContribution, type SetViewStateResult, SoftMask, type StageResult, type StagingTallies, type StampedEdge, type StampedNode, SubgraphSpec, type SuperNodeRecord, SvgBudgetError, type SvgScene, type SvgSceneEdge, type SvgSceneLabel, type SvgSceneNode, TIMELINE_STEP_DEFAULT, TIMELINE_TICK_MS_DEFAULT, ThemeInput, TimelinePlayback, TypedColumnCrossfilter, type TypedFieldPath, VIEW_STATE_VERSION, type ViewBrushState, type ViewLayoutSpec, type ViewStateVerdict, type ViewStyling, ViewportState, WorkerFactoryOption, acceptColumnar, admitServiceResult, assertCapabilityMethodParity, baseFromAccepted, baseFromContribution, buildAcceptedAdjacency, buildAcceptedFromColumnar, buildAdjacency, canonicalFilterKey, canonicalJson, canonicalScaleKey, cascadeEdges, categoricalIndex, categoricalRows, coerceNumeric, coerceNumericInto, collapseParallelEdges, columnarArrayBuffers, compileEdgeFilter, compileNodeFilter, computeNumericDomain, createGraphInstance, createLocalExpansionService, createLocalSearchService, createRequestContext, deriveGroupsByKey, descriptorKey, detachColumnarBuffers, divergingColor, escapeXml, estimateBatchBytes, evaluateFieldAccessor, evaluateFilterExpr, field, groupByDerivedId, groupSceneKey, interpolateColor, isColumnarSnapshot, isFieldAccessor, materializeColumnarSnapshot, medianLinkWidthPx, mergeDiagnostics, mergeModel, metaEdgePublicId, metaEdgeSceneKey, metaEdgeWidthFor, neighborsOf, newContribution, newStagingTallies, nextRequestId, normalizeCommitForCapabilities, parseColor, pointSegmentDistanceSquared, projectColors, projectSizes, renderSvg, resolveEnginePolicy, resolveFilterField, resolveManualGroups, resolveScope, resolveTheme, rewriteGroups, sameDataRef, sameGroupBySpec, sameGroupSpecArrays, sceneGroupsOf, sceneLinkRefAt, scenePointRefAt, selectLabelCandidates, sequentialColor, sequentialSize, serviceCacheKey, sessionCommitDiagnostics, stageBatch, superNodeSizeFor, validateColumnarStructure, validateFieldAccessor, validateFilterExpr, validateGroupBySpec, validateGroupSpecs, validateSnapshot, validateViewState };
|