@rasputin-ai/node 0.6.2 → 0.7.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.
- package/dist/execution-recorder/error-observation.d.ts +14 -0
- package/dist/execution-recorder/error-observation.d.ts.map +1 -0
- package/dist/execution-recorder/execution-recorder-types.d.ts +10 -7
- package/dist/execution-recorder/execution-recorder-types.d.ts.map +1 -1
- package/dist/execution-recorder/execution-recorder.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +119 -62
- package/dist/instrument/build.js +142 -130
- package/dist/instrument/bun.js +143 -131
- package/dist/instrument/node.js +143 -131
- package/dist/internal.d.ts +1 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +117 -56
- package/dist/rasputin-init.d.ts.map +1 -1
- package/dist/sdk-meta.d.ts +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ErrorObservation } from '@rasputin-ai/core';
|
|
2
|
+
export type ObservationProvenance = 'instrumented-throw' | 'scope-observe';
|
|
3
|
+
export type ObservationBinding = {
|
|
4
|
+
owner: object;
|
|
5
|
+
ownerGeneration: number;
|
|
6
|
+
recordingId: string;
|
|
7
|
+
recordingGeneration: number;
|
|
8
|
+
occurrenceId: number;
|
|
9
|
+
provenance: ObservationProvenance;
|
|
10
|
+
};
|
|
11
|
+
export declare const mintErrorObservation: (binding: ObservationBinding) => ErrorObservation;
|
|
12
|
+
export declare const bindingForObservation: (value: unknown) => ObservationBinding | undefined;
|
|
13
|
+
export declare const inertErrorObservation: () => ErrorObservation;
|
|
14
|
+
//# sourceMappingURL=error-observation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-observation.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/error-observation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG,eAAe,CAAC;AAE3E,MAAM,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,qBAAqB,CAAC;CAClC,CAAC;AAIF,eAAO,MAAM,oBAAoB,GAAI,SAAS,kBAAkB,KAAG,gBAIlE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,kBAAkB,GAAG,SAG3E,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,gBAExC,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* event model explicit allows the same bounded state to represent HTTP requests, jobs, scheduled
|
|
4
4
|
* work, and future serverless invocations without coupling the recorder to one framework lifecycle.
|
|
5
5
|
*/
|
|
6
|
-
import type { RuntimeExecutionEvent, RuntimeExecutionKind, RuntimeExecutionMetadata, RuntimeExecutionState, RuntimeFunctionDefinition, SourcePosition } from '@rasputin-ai/core';
|
|
6
|
+
import type { ErrorObservation, RuntimeExecutionEvent, RuntimeExecutionKind, RuntimeExecutionMetadata, RuntimeExecutionState, RuntimeFunctionDefinition, SourcePosition } from '@rasputin-ai/core';
|
|
7
7
|
import type { EncodedFunctionPlan } from '@rasputin-ai/recorder';
|
|
8
8
|
import type { PreparedFunctionPlan } from './function-plan';
|
|
9
9
|
/** A file glob (`src/logger/**`) or a regular expression matched against a function id. */
|
|
@@ -62,7 +62,7 @@ export type ExecutionRecorderOptions = {
|
|
|
62
62
|
*/
|
|
63
63
|
maxExecutionHoldMs?: number;
|
|
64
64
|
/**
|
|
65
|
-
* How many finished error recordings to keep for later
|
|
65
|
+
* How many finished error recordings to keep for later observation lookups.
|
|
66
66
|
* Older finished recordings are evicted and report `unavailable` /
|
|
67
67
|
* `retained_state_evicted`. Default: 32.
|
|
68
68
|
*/
|
|
@@ -151,13 +151,16 @@ export type ExecutionRecorderStats = {
|
|
|
151
151
|
export type ExecutionScope = {
|
|
152
152
|
/** Run `callback` under this recording's async context and return exactly what it returned. */
|
|
153
153
|
run: <T>(callback: () => T) => T;
|
|
154
|
-
/**
|
|
155
|
-
|
|
154
|
+
/**
|
|
155
|
+
* Observe this failure as belonging to this execution. Ownership is fixed
|
|
156
|
+
* here; later capture only materializes this handle.
|
|
157
|
+
*/
|
|
158
|
+
observeError: (error: unknown) => ErrorObservation;
|
|
156
159
|
/** Mark the recording finished. The caller owns async completion. */
|
|
157
160
|
finish: (metadata?: Partial<ExecutionMetadata>) => void;
|
|
158
161
|
};
|
|
159
162
|
export type ExecutionRuntimeScope = ExecutionScope & {
|
|
160
|
-
getErrorState: (
|
|
163
|
+
getErrorState: (observation: ErrorObservation) => ExecutionState | undefined;
|
|
161
164
|
};
|
|
162
165
|
export type PreparedCallHandle = {
|
|
163
166
|
leave: (value?: unknown) => unknown;
|
|
@@ -175,7 +178,7 @@ export type PreparedCallHandle = {
|
|
|
175
178
|
resume: (value?: unknown) => unknown;
|
|
176
179
|
};
|
|
177
180
|
export type RasputinExecution = {
|
|
178
|
-
/** Start a recording you will drive yourself with `run` / `
|
|
181
|
+
/** Start a recording you will drive yourself with `run` / `observeError` / `finish`. */
|
|
179
182
|
createScope: (metadata: ExecutionMetadata) => ExecutionScope;
|
|
180
183
|
/**
|
|
181
184
|
* Wrap a function yourself when automatic instrumentation is not available.
|
|
@@ -191,7 +194,7 @@ export type ExecutionRuntime = {
|
|
|
191
194
|
createScope: (metadata: ExecutionMetadata) => ExecutionRuntimeScope;
|
|
192
195
|
trace: RasputinExecution['trace'];
|
|
193
196
|
getStats: RasputinExecution['getStats'];
|
|
194
|
-
getErrorState: (
|
|
197
|
+
getErrorState: (observation: ErrorObservation) => ExecutionState | undefined;
|
|
195
198
|
runFunction: <T>(definition: RuntimeFunctionDefinition | string, args: ArrayLike<unknown>, callback: () => T) => T;
|
|
196
199
|
runFunctionPlans: <T>(plans: readonly EncodedFunctionPlan[], planIndex: number, args: ArrayLike<unknown>, callback: () => T, omitValues?: boolean) => T;
|
|
197
200
|
prepareFunctionPlans: (plans: readonly EncodedFunctionPlan[]) => PreparedFunctionPlan[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-recorder-types.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACX,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,cAAc,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,2FAA2F;AAC3F,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvD,kFAAkF;AAClF,MAAM,MAAM,wBAAwB,GAAG;IACtC,sFAAsF;IACtF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sGAAsG;IACtG,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAC5C,wGAAwG;IACxG,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iEAAiE;IACjE,eAAe,CAAC,EAAE,MA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,oBAAoB,EAAE,MAAM,CAAC;IAC7B,4DAA4D;IAC5D,oBAAoB,EAAE,MAAM,CAAC;IAC7B,2DAA2D;IAC3D,wBAAwB,EAAE,MAAM,CAAC;IACjC,8EAA8E;IAC9E,wBAAwB,EAAE,MAAM,CAAC;IACjC,4FAA4F;IAC5F,0BAA0B,EAAE,MAAM,CAAC;IACnC,sEAAsE;IACtE,2BAA2B,EAAE,MAAM,CAAC;IACpC,wDAAwD;IACxD,2BAA2B,EAAE,MAAM,CAAC;IACpC,kEAAkE;IAClE,qBAAqB,EAAE,MAAM,CAAC;IAC9B,8DAA8D;IAC9D,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gFAAgF;IAChF,qBAAqB,EAAE,MAAM,CAAC;IAC9B,iEAAiE;IACjE,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gFAAgF;IAChF,eAAe,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oDAAoD;IACpD,eAAe,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,wBAAwB,EAAE,MAAM,CAAC;IACjC,iGAAiG;IACjG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0GAA0G;IAC1G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,uBAAuB,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,qEAAqE;AACrE,MAAM,MAAM,cAAc,GAAG;IAC5B,+FAA+F;IAC/F,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IACjC
|
|
1
|
+
{"version":3,"file":"execution-recorder-types.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACX,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,cAA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AM,CAAC,EACjB,UAAU,CAAC,EAAE,OAAO,KAChB,CAAC,CAAC;IACP,oBAAoB,EAAE,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,CAAC;IACxF,mBAAmB,EAAE,CAAC,CAAC,EACtB,IAAI,EAAE,oBAAoB,EAC1B,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,EACxB,QAAQ,EAAE,MAAM,CAAC,EACjB,UAAU,CAAC,EAAE,OAAO,KAChB,CAAC,CAAC;IACP,qBAAqB,EAAE,CACtB,IAAI,EAAE,oBAAoB,EAC1B,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,EACxB,UAAU,CAAC,EAAE,OAAO,KAChB,kBAAkB,CAAC;CACxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-recorder.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execution-recorder.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAGX,wBAAwB,EACxB,gBAAgB,EAGhB,MAAM,4BAA4B,CAAC;AA2OpC,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,GACnC,SAAS,wBAAwB,GAAG,SAAS,KAC3C,gBA2/CF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { CaptureContext, RasputinClient, RasputinOptions } from '@rasputin-ai/core';
|
|
1
|
+
export type { CaptureContext, ErrorObservation, RasputinClient, RasputinOptions, } from '@rasputin-ai/core';
|
|
2
2
|
export type { ExecutionFunctionDescriptor, ExecutionKind, ExecutionMetadata, ExecutionRecorderOptions, ExecutionRecorderStats, ExecutionScope, ExecutionSourceExclusion, RasputinExecution, } from './execution-recorder';
|
|
3
3
|
export type { RasputinNodeClient, RasputinNodeClientStats, RasputinNodeOptions, } from './rasputin-init';
|
|
4
4
|
export { RasputinInit } from './rasputin-init';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,GACf,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACX,2BAA2B,EAC3B,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,cAAc,EACd,wBAAwB,EACxB,iBAAiB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACX,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -694,6 +694,21 @@ import {
|
|
|
694
694
|
runtimeFunctionId as runtimeFunctionId2
|
|
695
695
|
} from "@rasputin-ai/core";
|
|
696
696
|
|
|
697
|
+
// src/execution-recorder/error-observation.ts
|
|
698
|
+
var bindings = /* @__PURE__ */ new WeakMap();
|
|
699
|
+
var mintErrorObservation = (binding) => {
|
|
700
|
+
const observation = Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
701
|
+
bindings.set(observation, binding);
|
|
702
|
+
return observation;
|
|
703
|
+
};
|
|
704
|
+
var bindingForObservation = (value) => {
|
|
705
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
706
|
+
return bindings.get(value);
|
|
707
|
+
};
|
|
708
|
+
var inertErrorObservation = () => {
|
|
709
|
+
return Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
710
|
+
};
|
|
711
|
+
|
|
697
712
|
// src/execution-recorder/execution-journal.ts
|
|
698
713
|
var KIND_ENTER = 1;
|
|
699
714
|
var KIND_EXIT = 2;
|
|
@@ -2700,8 +2715,7 @@ var noOpExecution = {
|
|
|
2700
2715
|
createScope: () => ({
|
|
2701
2716
|
run: (callback) => callback(),
|
|
2702
2717
|
getErrorState: () => void 0,
|
|
2703
|
-
|
|
2704
|
-
},
|
|
2718
|
+
observeError: () => inertErrorObservation(),
|
|
2705
2719
|
finish: () => {
|
|
2706
2720
|
}
|
|
2707
2721
|
}),
|
|
@@ -2814,7 +2828,12 @@ var createExecutionRecorder = (options) => {
|
|
|
2814
2828
|
let nextRuntimePlanId = 1;
|
|
2815
2829
|
const internedPlans = /* @__PURE__ */ new Map();
|
|
2816
2830
|
const preparedModules = /* @__PURE__ */ new WeakMap();
|
|
2817
|
-
const
|
|
2831
|
+
const owner = {};
|
|
2832
|
+
const ownerGeneration = 1;
|
|
2833
|
+
let storageClock = 0;
|
|
2834
|
+
let occurrenceCounter = 0;
|
|
2835
|
+
const recordingsById = /* @__PURE__ */ new Map();
|
|
2836
|
+
const evictedRecordingIds = [];
|
|
2818
2837
|
const retainedErrorRecordings = [];
|
|
2819
2838
|
const phases = phaseTimingEnabled ? { alsNs: 0n, materializeNs: 0n } : void 0;
|
|
2820
2839
|
const stats = {
|
|
@@ -3047,6 +3066,39 @@ var createExecutionRecorder = (options) => {
|
|
|
3047
3066
|
};
|
|
3048
3067
|
return boundedState.truncated?.size ? enforceRuntimeStateSizeBudget(boundedState, runtimeStateSizeBudget) : boundedState;
|
|
3049
3068
|
};
|
|
3069
|
+
const forgetDiscardedRecording = (recording) => {
|
|
3070
|
+
if (recording.hasError || recording.retainedForError) return;
|
|
3071
|
+
recordingsById.delete(recording.executionId);
|
|
3072
|
+
};
|
|
3073
|
+
const discardSuccessfulEvidence = (recording) => {
|
|
3074
|
+
if (recording.evidenceDiscarded) return;
|
|
3075
|
+
recording.evidenceDiscarded = true;
|
|
3076
|
+
recording.cachedState = void 0;
|
|
3077
|
+
recording.repeatedCalls = [];
|
|
3078
|
+
recording.lateCapturedCallIds = void 0;
|
|
3079
|
+
recording.capturedErrors = /* @__PURE__ */ new WeakMap();
|
|
3080
|
+
if (recording.journal) {
|
|
3081
|
+
journalPool.release(recording.journal);
|
|
3082
|
+
recording.journal = void 0;
|
|
3083
|
+
}
|
|
3084
|
+
recordingsById.delete(recording.executionId);
|
|
3085
|
+
};
|
|
3086
|
+
const mintOccurrence = (recording, provenance) => mintErrorObservation({
|
|
3087
|
+
owner,
|
|
3088
|
+
ownerGeneration,
|
|
3089
|
+
recordingId: recording.executionId,
|
|
3090
|
+
recordingGeneration: recording.storageGeneration,
|
|
3091
|
+
occurrenceId: ++occurrenceCounter,
|
|
3092
|
+
provenance
|
|
3093
|
+
});
|
|
3094
|
+
const dropOldestEvictedRecording = () => {
|
|
3095
|
+
while (evictedRecordingIds.length > maxRetainedErrorRecordings) {
|
|
3096
|
+
const oldId = evictedRecordingIds.shift();
|
|
3097
|
+
if (!oldId) continue;
|
|
3098
|
+
const old = recordingsById.get(oldId);
|
|
3099
|
+
if (old?.evicted) recordingsById.delete(oldId);
|
|
3100
|
+
}
|
|
3101
|
+
};
|
|
3050
3102
|
const evictRetainedRecording = (recording) => {
|
|
3051
3103
|
const eventCount = recording.cachedState?.events.length ?? recording.journal?.eventCount ?? 0;
|
|
3052
3104
|
const dropped = (recording.cachedState?.truncated?.eventsDropped ?? recording.journal?.dropped ?? 0) + eventCount;
|
|
@@ -3071,6 +3123,8 @@ var createExecutionRecorder = (options) => {
|
|
|
3071
3123
|
eventsDropped: Math.max(1, dropped)
|
|
3072
3124
|
}
|
|
3073
3125
|
};
|
|
3126
|
+
evictedRecordingIds.push(recording.executionId);
|
|
3127
|
+
dropOldestEvictedRecording();
|
|
3074
3128
|
};
|
|
3075
3129
|
const trimFinishedRetainedRecordings = (keep) => {
|
|
3076
3130
|
while (retainedErrorRecordings.length > maxRetainedErrorRecordings) {
|
|
@@ -3148,10 +3202,17 @@ var createExecutionRecorder = (options) => {
|
|
|
3148
3202
|
}
|
|
3149
3203
|
}
|
|
3150
3204
|
};
|
|
3151
|
-
const
|
|
3152
|
-
recording.
|
|
3153
|
-
|
|
3154
|
-
|
|
3205
|
+
const retainFailure = (recording) => {
|
|
3206
|
+
if (recording.evidenceDiscarded) return;
|
|
3207
|
+
if (!recording.hasError) {
|
|
3208
|
+
recording.hasError = true;
|
|
3209
|
+
stats.errorSnapshots++;
|
|
3210
|
+
if (recording.memory.underPressure && !recording.partialSnapshotCounted) {
|
|
3211
|
+
recording.partialSnapshotCounted = true;
|
|
3212
|
+
stats.partialErrorSnapshots++;
|
|
3213
|
+
}
|
|
3214
|
+
}
|
|
3215
|
+
if (recording.budgetExpired) {
|
|
3155
3216
|
const eventsDropped = Math.max(
|
|
3156
3217
|
1,
|
|
3157
3218
|
recording.cachedState?.capture?.eventsDropped ?? recording.cachedState?.truncated?.eventsDropped ?? recording.memory.eventsDropped
|
|
@@ -3169,15 +3230,23 @@ var createExecutionRecorder = (options) => {
|
|
|
3169
3230
|
};
|
|
3170
3231
|
}
|
|
3171
3232
|
retainErrorRecording(recording);
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3233
|
+
recordingsById.set(recording.executionId, recording);
|
|
3234
|
+
};
|
|
3235
|
+
const observeFailure = (recording, provenance) => {
|
|
3236
|
+
if (!recording.evidenceDiscarded) {
|
|
3237
|
+
retainFailure(recording);
|
|
3238
|
+
}
|
|
3239
|
+
return mintOccurrence(recording, provenance);
|
|
3240
|
+
};
|
|
3241
|
+
const stateForObservation = (observation) => {
|
|
3242
|
+
const binding = bindingForObservation(observation);
|
|
3243
|
+
if (!binding) return void 0;
|
|
3244
|
+
if (binding.owner !== owner || binding.ownerGeneration !== ownerGeneration) return void 0;
|
|
3245
|
+
const recording = recordingsById.get(binding.recordingId);
|
|
3246
|
+
if (!recording || recording.evidenceDiscarded || recording.storageGeneration !== binding.recordingGeneration) {
|
|
3247
|
+
return void 0;
|
|
3179
3248
|
}
|
|
3180
|
-
|
|
3249
|
+
return stateFrom(recording, recording.finishedAtNs);
|
|
3181
3250
|
};
|
|
3182
3251
|
const countDroppedEvents = (recording, droppedBefore) => {
|
|
3183
3252
|
const dropped = recording.journal?.dropped ?? droppedBefore;
|
|
@@ -3241,11 +3310,9 @@ var createExecutionRecorder = (options) => {
|
|
|
3241
3310
|
};
|
|
3242
3311
|
const captureCompletedThrow = (recording, plan, args, parentCallId, startedAtNs, error, capturedArgs) => {
|
|
3243
3312
|
if (!recording.journal) {
|
|
3244
|
-
rememberError(error, recording);
|
|
3245
3313
|
return;
|
|
3246
3314
|
}
|
|
3247
3315
|
if (!memoryBudget.reserveCall(recording.memory, plan.estimatedCallBytes)) {
|
|
3248
|
-
rememberError(error, recording);
|
|
3249
3316
|
return;
|
|
3250
3317
|
}
|
|
3251
3318
|
const callId = ++recording.nextCallId;
|
|
@@ -3271,7 +3338,6 @@ var createExecutionRecorder = (options) => {
|
|
|
3271
3338
|
capturedError.commit();
|
|
3272
3339
|
}
|
|
3273
3340
|
countDroppedEvents(recording, droppedBefore);
|
|
3274
|
-
rememberError(error, recording);
|
|
3275
3341
|
};
|
|
3276
3342
|
const recordSuppressedCall = (recording, group, parentCallId, startedAtNs, endedAtNs) => {
|
|
3277
3343
|
stats.repeatedCallsSuppressed++;
|
|
@@ -3317,7 +3383,12 @@ var createExecutionRecorder = (options) => {
|
|
|
3317
3383
|
try {
|
|
3318
3384
|
if (!recording.finished || recording.inFlightCalls > 0) return;
|
|
3319
3385
|
memoryBudget.release(recording.memory);
|
|
3386
|
+
if (!recording.hasError && !recording.retainedForError) {
|
|
3387
|
+
discardSuccessfulEvidence(recording);
|
|
3388
|
+
return;
|
|
3389
|
+
}
|
|
3320
3390
|
releaseJournalIfIdle(recording);
|
|
3391
|
+
forgetDiscardedRecording(recording);
|
|
3321
3392
|
} catch {
|
|
3322
3393
|
}
|
|
3323
3394
|
};
|
|
@@ -3329,6 +3400,9 @@ var createExecutionRecorder = (options) => {
|
|
|
3329
3400
|
recording.finished = true;
|
|
3330
3401
|
if (metadata) mergeExecutionMetadata(recording.execution, metadata);
|
|
3331
3402
|
stats.activeExecutions = Math.max(0, stats.activeExecutions - 1);
|
|
3403
|
+
if (recording.runFailed && !recording.hasError) {
|
|
3404
|
+
retainFailure(recording);
|
|
3405
|
+
}
|
|
3332
3406
|
if (!recording.hasError) {
|
|
3333
3407
|
stats.successfulExecutionsDiscarded++;
|
|
3334
3408
|
}
|
|
@@ -3354,6 +3428,7 @@ var createExecutionRecorder = (options) => {
|
|
|
3354
3428
|
sweepLongLivedExecutions(recorderStartedAtNs);
|
|
3355
3429
|
const recording = {
|
|
3356
3430
|
executionId: `${Date.now()}-${process.pid}-${++executionCounter}`,
|
|
3431
|
+
storageGeneration: ++storageClock,
|
|
3357
3432
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3358
3433
|
startedAtNs: recorderStartedAtNs,
|
|
3359
3434
|
inlineRecorderTimeNs: 0n,
|
|
@@ -3376,6 +3451,7 @@ var createExecutionRecorder = (options) => {
|
|
|
3376
3451
|
stats.activeExecutions++;
|
|
3377
3452
|
stats.peakActiveExecutions = Math.max(stats.peakActiveExecutions, stats.activeExecutions);
|
|
3378
3453
|
liveRecordings.push(recording);
|
|
3454
|
+
recordingsById.set(recording.executionId, recording);
|
|
3379
3455
|
addRecorderTime(recording, process.hrtime.bigint() - recorderStartedAtNs);
|
|
3380
3456
|
const store = { recording };
|
|
3381
3457
|
return {
|
|
@@ -3389,8 +3465,9 @@ var createExecutionRecorder = (options) => {
|
|
|
3389
3465
|
try {
|
|
3390
3466
|
return callback();
|
|
3391
3467
|
} catch (error) {
|
|
3468
|
+
recording.runFailed = true;
|
|
3392
3469
|
if (recording.budgetExpired || recording.evicted) {
|
|
3393
|
-
|
|
3470
|
+
retainFailure(recording);
|
|
3394
3471
|
}
|
|
3395
3472
|
throw error;
|
|
3396
3473
|
}
|
|
@@ -3400,21 +3477,21 @@ var createExecutionRecorder = (options) => {
|
|
|
3400
3477
|
return callback();
|
|
3401
3478
|
}
|
|
3402
3479
|
},
|
|
3403
|
-
|
|
3480
|
+
observeError: (_error) => {
|
|
3404
3481
|
try {
|
|
3405
|
-
|
|
3406
|
-
if (errorMetadata) mergeExecutionMetadata(recording.execution, errorMetadata);
|
|
3407
|
-
rememberError(error, recording);
|
|
3408
|
-
addRecorderTime(recording, process.hrtime.bigint() - getStateStartedAtNs);
|
|
3409
|
-
return stateFrom(recording, recording.finishedAtNs);
|
|
3482
|
+
return observeFailure(recording, "scope-observe");
|
|
3410
3483
|
} catch {
|
|
3411
|
-
return
|
|
3484
|
+
return inertErrorObservation();
|
|
3412
3485
|
}
|
|
3413
3486
|
},
|
|
3414
|
-
|
|
3487
|
+
getErrorState: (observation) => {
|
|
3415
3488
|
try {
|
|
3416
|
-
|
|
3489
|
+
const getStateStartedAtNs = process.hrtime.bigint();
|
|
3490
|
+
const state = stateForObservation(observation);
|
|
3491
|
+
addRecorderTime(recording, process.hrtime.bigint() - getStateStartedAtNs);
|
|
3492
|
+
return state;
|
|
3417
3493
|
} catch {
|
|
3494
|
+
return void 0;
|
|
3418
3495
|
}
|
|
3419
3496
|
},
|
|
3420
3497
|
finish: (finishMetadata) => finish(store, finishMetadata)
|
|
@@ -3423,16 +3500,9 @@ var createExecutionRecorder = (options) => {
|
|
|
3423
3500
|
return noOpExecution.createScope(metadata);
|
|
3424
3501
|
}
|
|
3425
3502
|
};
|
|
3426
|
-
const getErrorState = (
|
|
3427
|
-
const getStateStartedAtNs = process.hrtime.bigint();
|
|
3503
|
+
const getErrorState = (observation) => {
|
|
3428
3504
|
try {
|
|
3429
|
-
|
|
3430
|
-
const recording = (weakKey ? errorExecutions.get(weakKey) : void 0) ?? currentStore()?.recording;
|
|
3431
|
-
if (!recording) return void 0;
|
|
3432
|
-
if (metadata) mergeExecutionMetadata(recording.execution, metadata);
|
|
3433
|
-
rememberError(error, recording);
|
|
3434
|
-
addRecorderTime(recording, process.hrtime.bigint() - getStateStartedAtNs);
|
|
3435
|
-
return stateFrom(recording, recording.finishedAtNs);
|
|
3505
|
+
return stateForObservation(observation);
|
|
3436
3506
|
} catch {
|
|
3437
3507
|
return void 0;
|
|
3438
3508
|
}
|
|
@@ -3467,7 +3537,7 @@ var createExecutionRecorder = (options) => {
|
|
|
3467
3537
|
return callback();
|
|
3468
3538
|
} catch (error) {
|
|
3469
3539
|
if (store.recording.budgetExpired || store.recording.evicted) {
|
|
3470
|
-
|
|
3540
|
+
retainFailure(store.recording);
|
|
3471
3541
|
}
|
|
3472
3542
|
throw error;
|
|
3473
3543
|
}
|
|
@@ -3515,8 +3585,7 @@ var createExecutionRecorder = (options) => {
|
|
|
3515
3585
|
recorderStartedAtNs,
|
|
3516
3586
|
callback,
|
|
3517
3587
|
() => settleInFlight(recording),
|
|
3518
|
-
(
|
|
3519
|
-
rememberError(error, recording);
|
|
3588
|
+
(_error) => {
|
|
3520
3589
|
settleInFlight(recording);
|
|
3521
3590
|
}
|
|
3522
3591
|
);
|
|
@@ -3548,8 +3617,7 @@ var createExecutionRecorder = (options) => {
|
|
|
3548
3617
|
recorderStartedAtNs,
|
|
3549
3618
|
callback,
|
|
3550
3619
|
() => settleInFlight(recording),
|
|
3551
|
-
(
|
|
3552
|
-
rememberError(error, recording);
|
|
3620
|
+
(_error) => {
|
|
3553
3621
|
settleInFlight(recording);
|
|
3554
3622
|
}
|
|
3555
3623
|
);
|
|
@@ -3567,8 +3635,7 @@ var createExecutionRecorder = (options) => {
|
|
|
3567
3635
|
recorderStartedAtNs,
|
|
3568
3636
|
callback,
|
|
3569
3637
|
() => settleInFlight(recording),
|
|
3570
|
-
(
|
|
3571
|
-
rememberError(error, recording);
|
|
3638
|
+
(_error) => {
|
|
3572
3639
|
settleInFlight(recording);
|
|
3573
3640
|
}
|
|
3574
3641
|
);
|
|
@@ -3592,7 +3659,6 @@ var createExecutionRecorder = (options) => {
|
|
|
3592
3659
|
},
|
|
3593
3660
|
(error) => {
|
|
3594
3661
|
if (!recording.journal) {
|
|
3595
|
-
rememberError(error, recording);
|
|
3596
3662
|
settleInFlight(recording);
|
|
3597
3663
|
return;
|
|
3598
3664
|
}
|
|
@@ -3606,7 +3672,6 @@ var createExecutionRecorder = (options) => {
|
|
|
3606
3672
|
);
|
|
3607
3673
|
stats.functionCallsCaptured++;
|
|
3608
3674
|
capturedError.commit();
|
|
3609
|
-
rememberError(error, recording);
|
|
3610
3675
|
settleInFlight(recording);
|
|
3611
3676
|
}
|
|
3612
3677
|
);
|
|
@@ -3681,8 +3746,7 @@ var createExecutionRecorder = (options) => {
|
|
|
3681
3746
|
const expiredStore = { recording: expired };
|
|
3682
3747
|
return {
|
|
3683
3748
|
leave: (value) => value,
|
|
3684
|
-
fail: (
|
|
3685
|
-
rememberError(error, expired);
|
|
3749
|
+
fail: () => {
|
|
3686
3750
|
},
|
|
3687
3751
|
end: () => {
|
|
3688
3752
|
},
|
|
@@ -3816,10 +3880,9 @@ var createExecutionRecorder = (options) => {
|
|
|
3816
3880
|
}
|
|
3817
3881
|
return value;
|
|
3818
3882
|
},
|
|
3819
|
-
fail: (
|
|
3883
|
+
fail: (_error) => {
|
|
3820
3884
|
if (status === "failed") return;
|
|
3821
3885
|
status = "failed";
|
|
3822
|
-
rememberError(error, recording);
|
|
3823
3886
|
},
|
|
3824
3887
|
end: finishEnd,
|
|
3825
3888
|
...context
|
|
@@ -3840,10 +3903,9 @@ var createExecutionRecorder = (options) => {
|
|
|
3840
3903
|
}
|
|
3841
3904
|
return value;
|
|
3842
3905
|
},
|
|
3843
|
-
fail: (
|
|
3906
|
+
fail: (_error) => {
|
|
3844
3907
|
if (status === "failed") return;
|
|
3845
3908
|
status = "failed";
|
|
3846
|
-
rememberError(error, recording);
|
|
3847
3909
|
},
|
|
3848
3910
|
end: finishEnd,
|
|
3849
3911
|
...context
|
|
@@ -3856,7 +3918,8 @@ var createExecutionRecorder = (options) => {
|
|
|
3856
3918
|
journal.startCall(plan.runtimePlanId, callId, parentCallId, enterTimestampNs, capturedArgs);
|
|
3857
3919
|
} catch {
|
|
3858
3920
|
journal.dropCall();
|
|
3859
|
-
return dropWithoutCapture((
|
|
3921
|
+
return dropWithoutCapture(() => {
|
|
3922
|
+
});
|
|
3860
3923
|
}
|
|
3861
3924
|
const callStore = { recording, currentCallId: callId };
|
|
3862
3925
|
const captured = bindStoreTransitions(callStore, parentStore, recording, plan);
|
|
@@ -3871,7 +3934,6 @@ var createExecutionRecorder = (options) => {
|
|
|
3871
3934
|
};
|
|
3872
3935
|
const writeThrow = (error) => {
|
|
3873
3936
|
if (!recording.journal) {
|
|
3874
|
-
rememberError(error, recording);
|
|
3875
3937
|
return;
|
|
3876
3938
|
}
|
|
3877
3939
|
const capturedError = serializedError(recording, error, callId);
|
|
@@ -3884,7 +3946,6 @@ var createExecutionRecorder = (options) => {
|
|
|
3884
3946
|
);
|
|
3885
3947
|
stats.functionCallsCaptured++;
|
|
3886
3948
|
capturedError.commit();
|
|
3887
|
-
rememberError(error, recording);
|
|
3888
3949
|
};
|
|
3889
3950
|
return {
|
|
3890
3951
|
leave: (value) => {
|
|
@@ -3900,7 +3961,6 @@ var createExecutionRecorder = (options) => {
|
|
|
3900
3961
|
try {
|
|
3901
3962
|
writeThrow(error);
|
|
3902
3963
|
} catch {
|
|
3903
|
-
rememberError(error, recording);
|
|
3904
3964
|
}
|
|
3905
3965
|
},
|
|
3906
3966
|
end: () => {
|
|
@@ -4205,7 +4265,7 @@ var installGlobalHandlers = (client, options = {}) => {
|
|
|
4205
4265
|
|
|
4206
4266
|
// src/sdk-meta.ts
|
|
4207
4267
|
var SDK_NAME = "@rasputin-ai/node";
|
|
4208
|
-
var SDK_VERSION = "0.
|
|
4268
|
+
var SDK_VERSION = "0.7.0";
|
|
4209
4269
|
|
|
4210
4270
|
// src/rasputin-init.ts
|
|
4211
4271
|
var publicExecution = (runtime) => ({
|
|
@@ -4213,7 +4273,7 @@ var publicExecution = (runtime) => ({
|
|
|
4213
4273
|
const scope = runtime.createScope(metadata);
|
|
4214
4274
|
return {
|
|
4215
4275
|
run: scope.run,
|
|
4216
|
-
|
|
4276
|
+
observeError: scope.observeError,
|
|
4217
4277
|
finish: scope.finish
|
|
4218
4278
|
};
|
|
4219
4279
|
},
|
|
@@ -4267,10 +4327,7 @@ var RasputinInit = (options) => {
|
|
|
4267
4327
|
sdkVersion: SDK_VERSION,
|
|
4268
4328
|
sdkName: SDK_NAME,
|
|
4269
4329
|
installTransportSignalHandlers: options.installTransportSignalHandlers,
|
|
4270
|
-
|
|
4271
|
-
error,
|
|
4272
|
-
context?.request ? { kind: "http", request: context.request } : void 0
|
|
4273
|
-
)
|
|
4330
|
+
resolveObservation: (observation) => runtime.getErrorState(observation)
|
|
4274
4331
|
});
|
|
4275
4332
|
if (enabled) {
|
|
4276
4333
|
loadInstrumentationManifestIfPresent(
|