@solidnative-dev/observability 0.0.0-stage → 0.1.0-alpha.0

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.
@@ -0,0 +1,155 @@
1
+ import { parseCausalDebugSnapshot, } from "./debug-snapshot.js";
2
+ import { parseSolidDiagnosticsDebugEnvelope, } from "./diagnostics-debug.js";
3
+ export const NATIVE_SOLID_DIAGNOSTICS_CORRELATION_KIND = "solid-native.solid-diagnostics-correlation";
4
+ export const NATIVE_SOLID_DIAGNOSTICS_CORRELATION_SCHEMA_VERSION = 0;
5
+ export const NATIVE_SOLID_DIAGNOSTICS_CORRELATION_MODE = "static-name-and-capture-window";
6
+ export const NATIVE_SOLID_DIAGNOSTICS_CORRELATION_WINDOW_TOLERANCE_MS = 250;
7
+ function compareText(left, right) {
8
+ return left < right ? -1 : left > right ? 1 : 0;
9
+ }
10
+ function correlationTolerance(options) {
11
+ if (typeof options !== "object" || options === null) {
12
+ throw new TypeError("Solid diagnostics correlation options are required.");
13
+ }
14
+ const tolerance = options.windowToleranceMilliseconds ??
15
+ NATIVE_SOLID_DIAGNOSTICS_CORRELATION_WINDOW_TOLERANCE_MS;
16
+ if (!Number.isFinite(tolerance) || tolerance < 0 || tolerance > 10_000) {
17
+ throw new TypeError("Solid diagnostics correlation window tolerance must be a finite number from 0 through 10000 milliseconds.");
18
+ }
19
+ return tolerance;
20
+ }
21
+ function collectCauseNames(causes, names) {
22
+ for (const cause of causes) {
23
+ names.add(cause.name);
24
+ if (cause.causes !== undefined)
25
+ collectCauseNames(cause.causes, names);
26
+ }
27
+ }
28
+ function operationDescendants(operationId, operationById, childrenById) {
29
+ const descendantIds = new Set();
30
+ const pending = [...(childrenById.get(operationId) ?? [])];
31
+ for (let index = 0; index < pending.length; index += 1) {
32
+ const candidate = pending[index];
33
+ if (candidate === undefined ||
34
+ candidate === operationId ||
35
+ descendantIds.has(candidate)) {
36
+ continue;
37
+ }
38
+ descendantIds.add(candidate);
39
+ pending.push(...(childrenById.get(candidate) ?? []));
40
+ }
41
+ return Object.freeze([...descendantIds]
42
+ .map((id) => operationById.get(id))
43
+ .filter((operation) => operation !== undefined));
44
+ }
45
+ /**
46
+ * Correlates Solid's value-free attribution output with native causal work by
47
+ * stable computation name and a bounded wall-clock window. Solid does not yet
48
+ * expose a per-rerun correlation token, so this result deliberately never
49
+ * claims an exact one-to-one rerun join.
50
+ */
51
+ export function correlateNativeSolidDiagnostics(diagnosticsValue, snapshotValue, options = {}) {
52
+ const diagnostics = parseSolidDiagnosticsDebugEnvelope(diagnosticsValue);
53
+ const snapshot = parseCausalDebugSnapshot(snapshotValue);
54
+ const tolerance = correlationTolerance(options);
55
+ const captureWindowStartedAt = Date.parse(diagnostics.capturedAt);
56
+ const captureWindowFinishedAt = captureWindowStartedAt + diagnostics.durationMilliseconds;
57
+ if (!Number.isFinite(captureWindowFinishedAt)) {
58
+ throw new RangeError("Solid diagnostics correlation capture window cannot be represented.");
59
+ }
60
+ const operationById = new Map(snapshot.operations.map((operation) => [operation.operationId, operation]));
61
+ const mutableChildrenById = new Map();
62
+ for (const operation of snapshot.operations) {
63
+ for (const causeId of operation.causes) {
64
+ const children = mutableChildrenById.get(causeId) ?? [];
65
+ children.push(operation.operationId);
66
+ mutableChildrenById.set(causeId, children);
67
+ }
68
+ }
69
+ const childrenById = new Map([...mutableChildrenById].map(([id, children]) => [
70
+ id,
71
+ Object.freeze(children),
72
+ ]));
73
+ const namedEffectReruns = diagnostics.reruns.filter((rerun) => rerun.nodeKind === "effect");
74
+ const outputNames = [
75
+ ...new Set(namedEffectReruns.map((rerun) => rerun.nodeName)),
76
+ ].sort(compareText);
77
+ const outputs = outputNames.map((name) => {
78
+ const reruns = namedEffectReruns.filter((rerun) => rerun.nodeName === name);
79
+ const causeNames = new Set();
80
+ for (const rerun of reruns)
81
+ collectCauseNames(rerun.causes, causeNames);
82
+ const nativeComputations = snapshot.operations.filter((operation) => operation.name === "solid-native.computation" &&
83
+ operation.startAttributes["computation.kind"] === "native-output" &&
84
+ operation.startAttributes["computation.name"] === name &&
85
+ operation.status === "ok" &&
86
+ operation.startedAt >= captureWindowStartedAt - tolerance &&
87
+ operation.startedAt <= captureWindowFinishedAt + tolerance &&
88
+ operation.startedAt <= snapshot.capturedAt);
89
+ const commits = new Map();
90
+ const mounts = new Map();
91
+ const frames = new Map();
92
+ for (const computation of nativeComputations) {
93
+ for (const descendant of operationDescendants(computation.operationId, operationById, childrenById)) {
94
+ if (descendant.name === "solid-native.commit" &&
95
+ descendant.status === "ok" &&
96
+ descendant.startedAt <= snapshot.capturedAt) {
97
+ commits.set(descendant.operationId, descendant);
98
+ }
99
+ }
100
+ }
101
+ for (const commit of commits.values()) {
102
+ for (const descendant of operationDescendants(commit.operationId, operationById, childrenById)) {
103
+ if (descendant.name === "solid-native.mount" &&
104
+ descendant.status === "ok" &&
105
+ descendant.startedAt <= snapshot.capturedAt) {
106
+ mounts.set(descendant.operationId, descendant);
107
+ }
108
+ }
109
+ }
110
+ for (const mount of mounts.values()) {
111
+ for (const descendant of operationDescendants(mount.operationId, operationById, childrenById)) {
112
+ if (descendant.name === "solid-native.frame" &&
113
+ descendant.status === "ok" &&
114
+ descendant.startedAt <= snapshot.capturedAt) {
115
+ frames.set(descendant.operationId, descendant);
116
+ }
117
+ }
118
+ }
119
+ return Object.freeze({
120
+ name,
121
+ rerunCount: reruns.length,
122
+ changedRerunCount: reruns.filter((rerun) => rerun.changed).length,
123
+ causeNames: Object.freeze([...causeNames].sort(compareText)),
124
+ nativeComputationOperationIds: Object.freeze(nativeComputations.map((operation) => operation.operationId)),
125
+ nativeCommitOperationIds: Object.freeze([...commits.keys()]),
126
+ nativeMountOperationIds: Object.freeze([...mounts.keys()]),
127
+ nativeFrameOperationIds: Object.freeze([...frames.keys()]),
128
+ completeNativeFrameChainCount: frames.size,
129
+ });
130
+ });
131
+ const unmatchedOutputNames = outputs
132
+ .filter((output) => output.nativeComputationOperationIds.length === 0)
133
+ .map((output) => output.name);
134
+ return Object.freeze({
135
+ schemaVersion: NATIVE_SOLID_DIAGNOSTICS_CORRELATION_SCHEMA_VERSION,
136
+ kind: NATIVE_SOLID_DIAGNOSTICS_CORRELATION_KIND,
137
+ correlationMode: NATIVE_SOLID_DIAGNOSTICS_CORRELATION_MODE,
138
+ exactPerRerunJoin: false,
139
+ diagnosticsCapturedAt: diagnostics.capturedAt,
140
+ diagnosticsDurationMilliseconds: diagnostics.durationMilliseconds,
141
+ captureWindowStartedAt,
142
+ captureWindowFinishedAt,
143
+ causalSnapshotCapturedAt: snapshot.capturedAt,
144
+ captureWindowFullyObserved: snapshot.capturedAt >= captureWindowFinishedAt,
145
+ causalEvictedOperationCount: snapshot.evictedOperationCount,
146
+ causalDiscardedRecordCount: snapshot.discardedRecordCount,
147
+ rerunCount: diagnostics.reruns.length,
148
+ namedEffectRerunCount: namedEffectReruns.length,
149
+ correlatedOutputCount: outputs.length - unmatchedOutputNames.length,
150
+ completeOutputCount: outputs.filter((output) => output.completeNativeFrameChainCount > 0).length,
151
+ unmatchedOutputNames: Object.freeze(unmatchedOutputNames),
152
+ outputs: Object.freeze(outputs),
153
+ });
154
+ }
155
+ //# sourceMappingURL=diagnostics-correlation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics-correlation.js","sourceRoot":"","sources":["../src/diagnostics-correlation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,GAEzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kCAAkC,GAEnC,MAAM,wBAAwB,CAAC;AAGhC,MAAM,CAAC,MAAM,yCAAyC,GACpD,4CAAqD,CAAC;AACxD,MAAM,CAAC,MAAM,mDAAmD,GAAG,CAAU,CAAC;AAC9E,MAAM,CAAC,MAAM,yCAAyC,GACpD,gCAAyC,CAAC;AAC5C,MAAM,CAAC,MAAM,wDAAwD,GAAG,GAAG,CAAC;AAuC5E,SAAS,WAAW,CAAC,IAAY,EAAE,KAAa;IAC9C,OAAO,IA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AE,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC;QACzD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;KAChC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,81 @@
1
+ export declare const SOLID_DIAGNOSTICS_DEBUG_SCHEMA_VERSION: 0;
2
+ export declare const SOLID_DIAGNOSTICS_DEBUG_KIND: "solid-native.solid-diagnostics-debug";
3
+ export declare const SOLID_DIAGNOSTICS_DEBUG_MAX_RECORDS = 256;
4
+ export declare const SOLID_DIAGNOSTICS_DEBUG_MAX_DEPENDENCIES = 64;
5
+ export declare const SOLID_DIAGNOSTICS_DEBUG_MAX_CAUSES = 32;
6
+ export declare const SOLID_DIAGNOSTICS_DEBUG_MAX_CAUSE_DEPTH = 8;
7
+ export declare const SOLID_DIAGNOSTICS_DEBUG_MAX_CAUSE_RECORDS = 4096;
8
+ export declare const SOLID_DIAGNOSTICS_DEBUG_MAX_NAME_LENGTH = 128;
9
+ export declare const SOLID_DIAGNOSTICS_DEBUG_MAX_SERIALIZED_BYTES = 1048576;
10
+ export interface SolidDiagnosticsDebugDiagnostic {
11
+ readonly sequence: number;
12
+ readonly code: string;
13
+ readonly kind: string;
14
+ readonly severity: "warn" | "error";
15
+ readonly ownerName?: string;
16
+ readonly nodeName?: string;
17
+ }
18
+ export interface SolidDiagnosticsDebugCause {
19
+ readonly sequence: number;
20
+ readonly kind: "write" | "derived" | "async" | "refresh";
21
+ readonly name: string;
22
+ readonly causes?: readonly SolidDiagnosticsDebugCause[];
23
+ }
24
+ export interface SolidDiagnosticsDebugRerun {
25
+ readonly run: number;
26
+ readonly nodeRuns: number;
27
+ readonly nodeKind: "effect" | "memo";
28
+ readonly nodeName: string;
29
+ readonly causes: readonly SolidDiagnosticsDebugCause[];
30
+ readonly dependencyCount: number;
31
+ readonly dependenciesAdded: readonly string[];
32
+ readonly dependenciesRemoved: readonly string[];
33
+ readonly selfMilliseconds: number;
34
+ readonly totalMilliseconds: number;
35
+ readonly changed: boolean;
36
+ readonly phase: "plain" | "transition" | "optimistic";
37
+ readonly held: boolean;
38
+ }
39
+ export interface SolidDiagnosticsDebugScopeCost {
40
+ readonly name: string;
41
+ readonly kind: "effect" | "memo";
42
+ readonly runs: number;
43
+ readonly selfMilliseconds: number;
44
+ readonly wastedMilliseconds: number;
45
+ readonly overlayMilliseconds: number;
46
+ }
47
+ export interface SolidDiagnosticsDebugWriteCost {
48
+ readonly name: string;
49
+ readonly runs: number;
50
+ readonly downstreamMilliseconds: number;
51
+ }
52
+ /**
53
+ * Explicit local-development envelope. It intentionally omits diagnostic
54
+ * messages/data, owner IDs, reactive values, source stacks, and rendered
55
+ * content even though Solid's in-process channels may retain them.
56
+ */
57
+ export interface SolidDiagnosticsDebugEnvelope {
58
+ readonly schemaVersion: typeof SOLID_DIAGNOSTICS_DEBUG_SCHEMA_VERSION;
59
+ readonly kind: typeof SOLID_DIAGNOSTICS_DEBUG_KIND;
60
+ readonly capturedAt: string;
61
+ readonly durationMilliseconds: number;
62
+ readonly truncated: boolean;
63
+ readonly droppedDiagnostics: number;
64
+ readonly diagnostics: readonly SolidDiagnosticsDebugDiagnostic[];
65
+ readonly reruns: readonly SolidDiagnosticsDebugRerun[];
66
+ readonly scopeCosts: readonly SolidDiagnosticsDebugScopeCost[];
67
+ readonly writeCosts: readonly SolidDiagnosticsDebugWriteCost[];
68
+ }
69
+ export interface CreateSolidDiagnosticsDebugEnvelopeOptions {
70
+ readonly capturedAt: string;
71
+ readonly durationMilliseconds: number;
72
+ readonly droppedDiagnostics?: number;
73
+ readonly diagnostics: readonly unknown[];
74
+ readonly reruns: readonly unknown[];
75
+ readonly costs: unknown;
76
+ }
77
+ export declare function createSolidDiagnosticsDebugEnvelope(options: CreateSolidDiagnosticsDebugEnvelopeOptions): SolidDiagnosticsDebugEnvelope;
78
+ export declare function serializeSolidDiagnosticsDebugEnvelope(envelope: SolidDiagnosticsDebugEnvelope): string;
79
+ /** Strictly validates and deeply freezes one detached debug artifact. */
80
+ export declare function parseSolidDiagnosticsDebugEnvelope(value: unknown): SolidDiagnosticsDebugEnvelope;
81
+ //# sourceMappingURL=diagnostics-debug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics-debug.d.ts","sourceRoot":"","sources":["../src/diagnostics-debug.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sCAAsC,EAAG,CAAU,CAAC;AACjE,eAAO,MAAM,4BAA4B,EACvC,sCAA+C,CAAC;AAClD,eAAO,MAAM,mCAAmC,MAAM,CAAC;AACvD,eAAO,MAAM,wCAAwC,KAAK,CAAC;AAC3D,eAAO,MAAM,kCAAkC,KAAK,CAAC;AACrD,eAAO,MAAM,uCAAuC,IAAI,CAAC;AACzD,eAAO,MAAM,yCAAyC,OAAQ,CAAC;AAC/D,eAAO,MAAM,uCAAuC,MAAM,CAAC;AAC3D,eAAO,MAAM,4CAA4C,UAAY,CAAC;AAEtE,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,0BAA0B,EAAE,CAAC;CACzD;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,GAAG,EAAE,MAAM,CA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