dsh-observe 0.2.12 → 0.2.14

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.
@@ -6,5 +6,5 @@
6
6
  * @module dsh-observe/version
7
7
  */
8
8
  /** The dsh-observe package version, kept in sync with package.json. */
9
- export const VERSION = '0.2.12';
9
+ export const VERSION = '0.2.14';
10
10
  //# sourceMappingURL=version.js.map
@@ -66,8 +66,29 @@ export declare const OBSERVE_STATUS_DESCRIPTOR: Readonly<{
66
66
  }>;
67
67
  readonly parameters: readonly never[];
68
68
  readonly result: Readonly<{
69
+ create: () => z.ZodObject<{
70
+ enabled: z.ZodBoolean;
71
+ backends: z.ZodObject<{
72
+ otlp: z.ZodBoolean;
73
+ langfuse: z.ZodBoolean;
74
+ }, z.core.$strip>;
75
+ queueDepth: z.ZodObject<{
76
+ otlp: z.ZodNumber;
77
+ langfuse: z.ZodNumber;
78
+ }, z.core.$strip>;
79
+ spool: z.ZodObject<{
80
+ otlp: z.ZodObject<{
81
+ batches: z.ZodNumber;
82
+ records: z.ZodNumber;
83
+ }, z.core.$strip>;
84
+ langfuse: z.ZodObject<{
85
+ batches: z.ZodNumber;
86
+ records: z.ZodNumber;
87
+ }, z.core.$strip>;
88
+ }, z.core.$strip>;
89
+ }, z.core.$strip>;
69
90
  mode: "strict";
70
- typeSymbol: "dsh-observe/types#ObserveStatus";
91
+ typeSymbol: string;
71
92
  schema: z.ZodObject<{
72
93
  enabled: z.ZodBoolean;
73
94
  backends: z.ZodObject<{
@@ -110,16 +131,22 @@ export declare const OBSERVE_SET_ENABLED_DESCRIPTOR: Readonly<{
110
131
  wire: string;
111
132
  source: "json";
112
133
  codec: Readonly<{
134
+ create: () => z.ZodObject<{
135
+ enabled: z.ZodBoolean;
136
+ }, z.core.$strip>;
113
137
  mode: "strict";
114
- typeSymbol: "dsh-observe/types#ObserveSetEnabledArgs";
138
+ typeSymbol: string;
115
139
  schema: z.ZodObject<{
116
140
  enabled: z.ZodBoolean;
117
141
  }, z.core.$strip>;
118
142
  }>;
119
143
  }>[];
120
144
  readonly result: Readonly<{
145
+ create: () => z.ZodObject<{
146
+ enabled: z.ZodBoolean;
147
+ }, z.core.$strip>;
121
148
  mode: "strict";
122
- typeSymbol: "dsh-observe/types#ObserveSetEnabledResult";
149
+ typeSymbol: string;
123
150
  schema: z.ZodObject<{
124
151
  enabled: z.ZodBoolean;
125
152
  }, z.core.$strip>;
@@ -141,8 +168,29 @@ export declare const OBSERVE_INVOCATIONS: readonly (Readonly<{
141
168
  }>;
142
169
  readonly parameters: readonly never[];
143
170
  readonly result: Readonly<{
171
+ create: () => z.ZodObject<{
172
+ enabled: z.ZodBoolean;
173
+ backends: z.ZodObject<{
174
+ otlp: z.ZodBoolean;
175
+ langfuse: z.ZodBoolean;
176
+ }, z.core.$strip>;
177
+ queueDepth: z.ZodObject<{
178
+ otlp: z.ZodNumber;
179
+ langfuse: z.ZodNumber;
180
+ }, z.core.$strip>;
181
+ spool: z.ZodObject<{
182
+ otlp: z.ZodObject<{
183
+ batches: z.ZodNumber;
184
+ records: z.ZodNumber;
185
+ }, z.core.$strip>;
186
+ langfuse: z.ZodObject<{
187
+ batches: z.ZodNumber;
188
+ records: z.ZodNumber;
189
+ }, z.core.$strip>;
190
+ }, z.core.$strip>;
191
+ }, z.core.$strip>;
144
192
  mode: "strict";
145
- typeSymbol: "dsh-observe/types#ObserveStatus";
193
+ typeSymbol: string;
146
194
  schema: z.ZodObject<{
147
195
  enabled: z.ZodBoolean;
148
196
  backends: z.ZodObject<{
@@ -183,16 +231,22 @@ export declare const OBSERVE_INVOCATIONS: readonly (Readonly<{
183
231
  wire: string;
184
232
  source: "json";
185
233
  codec: Readonly<{
234
+ create: () => z.ZodObject<{
235
+ enabled: z.ZodBoolean;
236
+ }, z.core.$strip>;
186
237
  mode: "strict";
187
- typeSymbol: "dsh-observe/types#ObserveSetEnabledArgs";
238
+ typeSymbol: string;
188
239
  schema: z.ZodObject<{
189
240
  enabled: z.ZodBoolean;
190
241
  }, z.core.$strip>;
191
242
  }>;
192
243
  }>[];
193
244
  readonly result: Readonly<{
245
+ create: () => z.ZodObject<{
246
+ enabled: z.ZodBoolean;
247
+ }, z.core.$strip>;
194
248
  mode: "strict";
195
- typeSymbol: "dsh-observe/types#ObserveSetEnabledResult";
249
+ typeSymbol: string;
196
250
  schema: z.ZodObject<{
197
251
  enabled: z.ZodBoolean;
198
252
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/wire.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,OAAO,EAAE,OAAO,CAAA;IAChB,sEAAsE;IACtE,QAAQ,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAA;IAC9C,kDAAkD;IAClD,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,UAAU,EAAE,WAAW,CAAC,CAAA;CAChD;AAED,6DAA6D;AAC7D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;iBAQhC,CAAA;AAEF,iFAAiF;AACjF,MAAM,WAAW,uBAAuB;IACtC,sDAAsD;IACtD,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,uEAAuE;AACvE,eAAO,MAAM,iCAAiC;;iBAE5C,CAAA;AAOF,iFAAiF;AACjF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaI,CAAA;AAE1C,+EAA+E;AAC/E,eAAO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D,CAAA;AAE1C,gEAAgE;AAChE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAG9B,CAAA"}
package/lib/types/wire.js CHANGED
@@ -24,6 +24,16 @@ export const OBSERVE_SET_ENABLED_RESULT_SCHEMA = z.object({
24
24
  const SET_ENABLED_ARGS_CODEC = z.object({
25
25
  enabled: z.boolean(),
26
26
  });
27
+ /**
28
+ * Strict wire codec carrying BOTH published and checkout faces: the `schema`
29
+ * field feeds the npm-published 0.1.5-rc.2 line, `create` feeds the checkout
30
+ * 0.1.6-alpha.1+ line (the loader materializes the schema lazily on first
31
+ * use). Built through a variable, so neither typecheck ruler flags the other
32
+ * face's field as excess.
33
+ */
34
+ function strictWire(typeSymbol, schema) {
35
+ return Object.freeze({ ...{ mode: 'strict', typeSymbol, schema }, create: () => schema });
36
+ }
27
37
  /** The `observe/status` invocation descriptor: the read-only status snapshot. */
28
38
  export const OBSERVE_STATUS_DESCRIPTOR = Object.freeze({
29
39
  id: 'dsh-observe#observe/status',
@@ -32,11 +42,7 @@ export const OBSERVE_STATUS_DESCRIPTOR = Object.freeze({
32
42
  method: 'status',
33
43
  invocation: Object.freeze({ kind: 'direct' }),
34
44
  parameters: Object.freeze([]),
35
- result: Object.freeze({
36
- mode: 'strict',
37
- typeSymbol: 'dsh-observe/types#ObserveStatus',
38
- schema: OBSERVE_STATUS_SCHEMA,
39
- }),
45
+ result: strictWire('dsh-observe/types#ObserveStatus', OBSERVE_STATUS_SCHEMA),
40
46
  sourceLocation: Object.freeze({ file: 'src/wire.ts', line: 1, column: 1 }),
41
47
  });
42
48
  /** The `observe/setEnabled` invocation descriptor: the runtime kill switch. */
@@ -50,17 +56,9 @@ export const OBSERVE_SET_ENABLED_DESCRIPTOR = Object.freeze({
50
56
  name: 'request',
51
57
  wire: 'request',
52
58
  source: 'json',
53
- codec: Object.freeze({
54
- mode: 'strict',
55
- typeSymbol: 'dsh-observe/types#ObserveSetEnabledArgs',
56
- schema: SET_ENABLED_ARGS_CODEC,
57
- }),
59
+ codec: strictWire('dsh-observe/types#ObserveSetEnabledArgs', SET_ENABLED_ARGS_CODEC),
58
60
  })]),
59
- result: Object.freeze({
60
- mode: 'strict',
61
- typeSymbol: 'dsh-observe/types#ObserveSetEnabledResult',
62
- schema: OBSERVE_SET_ENABLED_RESULT_SCHEMA,
63
- }),
61
+ result: strictWire('dsh-observe/types#ObserveSetEnabledResult', OBSERVE_SET_ENABLED_RESULT_SCHEMA),
64
62
  sourceLocation: Object.freeze({ file: 'src/wire.ts', line: 1, column: 1 }),
65
63
  });
66
64
  /** The canonical invocation list both Typert faces register. */
@@ -1 +1 @@
1
- {"version":3,"file":"wire.js","sourceRoot":"","sources":["../../src/wire.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAgBvB,6DAA6D;AAC7D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;IAChE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC;IAC5E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CA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6 @@
1
1
  {
2
2
  "name": "dsh-observe",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
4
4
  "description": "OpenTelemetry and Langfuse observability exporter for DeepSeek Harness: turn/step/tool/LLM spans, token and cost metrics, and sanitized LLM prompt/completion capture from the session/event stream, with async batching, bounded offline buffering, and retry with backoff.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,6 +41,7 @@
41
41
  ],
42
42
  "sideEffects": false,
43
43
  "dsh": {
44
+ "manifestVersion": 1,
44
45
  "bundle": {
45
46
  "patch": "./cordis.patch.yml"
46
47
  }
@@ -103,17 +104,18 @@
103
104
  "llm-observability"
104
105
  ],
105
106
  "engines": {
106
- "node": "^22.19.0 || >=24.0.0"
107
+ "node": "^22.19.0 || >=24.0.0",
108
+ "dsh": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0"
107
109
  },
108
110
  "packageManager": "pnpm@11.7.0",
109
111
  "peerDependencies": {
110
112
  "@deepseek-ai/cordis": "^4.0.2",
111
- "@deepseek-ai/dsh-llm": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
112
- "@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
113
- "@deepseek-ai/dsh-storage": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
114
- "@deepseek-ai/dsh-storage-domain": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
115
- "@deepseek-ai/dsh-storage-json": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
116
- "@deepseek-ai/dsh-typert-protocol": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
113
+ "@deepseek-ai/dsh-llm": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
114
+ "@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
115
+ "@deepseek-ai/dsh-storage": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
116
+ "@deepseek-ai/dsh-storage-domain": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
117
+ "@deepseek-ai/dsh-storage-json": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
118
+ "@deepseek-ai/dsh-typert-protocol": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
117
119
  "@deepseek-ai/schemastery": "^3.18.2"
118
120
  },
119
121
  "dependencies": {
@@ -122,16 +124,16 @@
122
124
  "zod": "^4.4.3"
123
125
  },
124
126
  "devDependencies": {
125
- "@deepseek-ai/dsh-attachment": "0.1.5-rc.2",
127
+ "@deepseek-ai/dsh-attachment": "0.1.6-alpha.2",
126
128
  "@deepseek-ai/cordis": "^4.0.2",
127
129
  "@deepseek-ai/cordis-plugin-include": "^1.0.7",
128
130
  "@deepseek-ai/cordis-plugin-loader": "^1.0.3",
129
- "@deepseek-ai/dsh-llm": "0.1.5-rc.2",
130
- "@deepseek-ai/dsh-session": "0.1.5-rc.2",
131
- "@deepseek-ai/dsh-storage": "0.1.5-rc.2",
132
- "@deepseek-ai/dsh-storage-domain": "0.1.5-rc.2",
133
- "@deepseek-ai/dsh-storage-json": "0.1.5-rc.2",
134
- "@deepseek-ai/dsh-typert-protocol": "0.1.5-rc.2",
131
+ "@deepseek-ai/dsh-llm": "0.1.6-alpha.2",
132
+ "@deepseek-ai/dsh-session": "0.1.6-alpha.2",
133
+ "@deepseek-ai/dsh-storage": "0.1.6-alpha.2",
134
+ "@deepseek-ai/dsh-storage-domain": "0.1.6-alpha.2",
135
+ "@deepseek-ai/dsh-storage-json": "0.1.6-alpha.2",
136
+ "@deepseek-ai/dsh-typert-protocol": "0.1.6-alpha.2",
135
137
  "@deepseek-ai/schemastery": "^3.18.2",
136
138
  "@types/node": "^22.19.0",
137
139
  "@vitest/coverage-v8": "^3.2.0",
@@ -147,8 +149,10 @@
147
149
  "lint": "oxlint",
148
150
  "prepare": "node scripts/prepare.mjs",
149
151
  "verify:self-contained": "node scripts/verify-self-contained.mjs",
152
+ "check:lockfile": "node scripts/check-lockfile-drift.mjs",
150
153
  "verify:artifacts": "node scripts/verify-artifacts.mjs",
151
154
  "verify:readme-sync": "node scripts/check-readme-sync.mjs",
155
+ "check:ruler-live": "node scripts/assert-ruler-live.mjs",
152
156
  "pack:check": "node scripts/prepare.mjs && pnpm pack"
153
157
  },
154
158
  "license": "Apache-2.0",
package/src/collector.ts CHANGED
@@ -15,7 +15,6 @@
15
15
  import type { TokenUsage } from '@deepseek-ai/dsh-llm'
16
16
  import type { StreamChunk } from '@deepseek-ai/dsh-llm/types'
17
17
  import type { EpochHeader, RequestContext, Session, SessionEvent } from '@deepseek-ai/dsh-session'
18
- import { deriveEventMessage } from '@deepseek-ai/dsh-session'
19
18
  import type { ResolvedConfig } from './config.ts'
20
19
  import type { JsonScalar, MetricRecord, SpanRecord, TokenCounts } from './model.ts'
21
20
  import { findPrice, costUsd } from './pricing.ts'
@@ -629,16 +628,17 @@ export class Collector {
629
628
  const parts: string[] = []
630
629
  const legacySystem = (header as unknown as { system?: string } | undefined)?.system
631
630
  if (legacySystem !== undefined) parts.push(legacySystem)
632
- // alpha.5 renamed the Session.events getter to snapshotEvents(); older hosts
633
- // (the >=0.1.0-rc.8 peer floor) still expose .events, so detect at runtime.
634
- const events = typeof session.snapshotEvents === 'function'
635
- ? session.snapshotEvents()
636
- : (session as unknown as { events: readonly SessionEvent[] }).events
637
- for (const seq of session.surface.nodes) {
638
- const event = events[seq]
639
- if (event === undefined) continue
640
- const message = deriveEventMessage(event)
641
- if (message !== null) parts.push(projectMessage(message))
631
+ // The projected model-visible history, not the raw log: `snapshotEvents()`
632
+ // is deprecated on the 0.1.6 line (new calls are prohibited), and the
633
+ // collector only ever needed the messages those surface nodes derive —
634
+ // node 0 is the rendered system prompt. Hosts old enough to lack
635
+ // `deriveMessages` contribute the logged header only, which is what their
636
+ // pre-0.1.5 logs carried anyway.
637
+ const derived = typeof session.deriveMessages === 'function'
638
+ ? session.deriveMessages()
639
+ : undefined
640
+ if (derived !== undefined) {
641
+ for (const message of derived) parts.push(projectMessage(message))
642
642
  }
643
643
  return sanitizeText(parts.join('\n'), this.config.sanitize.truncatePromptChars, this.config.sanitize)
644
644
  }
package/src/index.ts CHANGED
@@ -15,10 +15,11 @@
15
15
  */
16
16
 
17
17
  import type { Context } from '@deepseek-ai/cordis'
18
+ import type { Domain } from '@deepseek-ai/dsh-storage-domain'
18
19
  import type { Session, SessionEvent } from '@deepseek-ai/dsh-session'
19
20
  import { Config, resolveConfig } from './config.ts'
20
21
  import type { ExportRecord, MetricRecord, SpanRecord } from './model.ts'
21
- import { observeDomainSpec, openSpool } from './spool.ts'
22
+ import { observeDomainSpec, openSpool, DroppingSpool, type ObserveDomainSpec, type SpoolSurface } from './spool.ts'
22
23
  import { OtlpSink, LangfuseSink } from './sinks.ts'
23
24
  import { Pipeline } from './pipeline.ts'
24
25
  import { Collector } from './collector.ts'
@@ -58,25 +59,68 @@ export async function apply(ctx: Context, config: Config = {}): Promise<void> {
58
59
  const isEnabled = () => enabled
59
60
 
60
61
  const otlpSink = resolved.otlp === undefined ? undefined : new OtlpSink(resolved.otlp, logger)
62
+
63
+ /**
64
+ * Structural face of the optional (experimental) `inspector` service. Read
65
+ * structurally on purpose: the service is experimental and must never be
66
+ * injected, and it is an extra outlet beside the OTLP sink, never the only
67
+ * one.
68
+ */
69
+ interface InspectorLike {
70
+ publish(topic: string, payload: unknown, monotonicMs?: number): void
71
+ }
72
+ const inspector = ctx.get('inspector') as InspectorLike | undefined
73
+ const publishInspector = (topic: string, payload: unknown): void => {
74
+ if (inspector === undefined || typeof inspector.publish !== 'function') return
75
+ try {
76
+ inspector.publish(topic, payload)
77
+ } catch {
78
+ // Diagnostics must never break the export hot path.
79
+ }
80
+ }
81
+
61
82
  const recordMetric = (metric: MetricRecord): void => {
62
- if (isEnabled()) otlpSink?.recordMetric(metric)
83
+ if (!isEnabled()) return
84
+ otlpSink?.recordMetric(metric)
85
+ publishInspector('observe.metric', metric)
63
86
  }
64
87
 
65
- const domain = await ctx.storageDomain.open(observeDomainSpec)
66
- const spool = openSpool(
67
- domain,
68
- resolved.batch.maxBufferRecords,
69
- count => recordMetric({
70
- name: 'observe.dropped',
71
- kind: 'counter',
72
- unit: 'records',
73
- value: count,
74
- attributes: { reason: 'buffer_overflow' },
75
- }),
76
- count => {
77
- logger.warn(`spool: ${count} stored record(s) failed validation and were dropped`)
78
- },
79
- )
88
+ // The durable offline buffer. Opening the domain can fail — storageDomain is
89
+ // single-open per name, so a hot reload that races the previous instance's
90
+ // close fails the second open — and failing the whole mount over a
91
+ // best-effort buffer would take the exporter down with it. A failed open
92
+ // degrades to a dropping spool with one warning; a disposal that lands while
93
+ // the open is in flight closes the freshly opened handle immediately, or the
94
+ // single-open reservation leaks into the next mount (A02).
95
+ let domain: Domain<ObserveDomainSpec> | undefined
96
+ let spool: SpoolSurface = new DroppingSpool()
97
+ try {
98
+ const opened = await ctx.storageDomain.open(observeDomainSpec)
99
+ if (ctx.fiber.uid === null) {
100
+ await opened.close()
101
+ return
102
+ }
103
+ domain = opened
104
+ spool = openSpool(
105
+ opened,
106
+ resolved.batch.maxBufferRecords,
107
+ count => recordMetric({
108
+ name: 'observe.dropped',
109
+ kind: 'counter',
110
+ unit: 'records',
111
+ value: count,
112
+ attributes: { reason: 'buffer_overflow' },
113
+ }),
114
+ count => {
115
+ logger.warn(`spool: ${count} stored record(s) failed validation and were dropped`)
116
+ },
117
+ )
118
+ } catch (error) {
119
+ logger.warn(
120
+ `offline buffer unavailable (${error instanceof Error ? error.message : String(error)}); `
121
+ + 'continuing without the durable spool — spilled records are dropped instead of persisted',
122
+ )
123
+ }
80
124
 
81
125
  const pipelines: Pipeline[] = []
82
126
  if (otlpSink !== undefined) {
@@ -117,9 +161,13 @@ export async function apply(ctx: Context, config: Config = {}): Promise<void> {
117
161
  logger,
118
162
  )
119
163
 
120
- // One effect owns every timer and the teardown order: stop the timers,
121
- // final-flush the pipelines (spilling failures to the durable buffer),
122
- // then close the domain.
164
+ // One effect owns every timer, the event subscriptions, and the teardown
165
+ // order: stop the timers and unsubscribe first (so no event reaches the
166
+ // collector after disposal), final-flush the pipelines (spilling failures
167
+ // to the durable buffer), then close the domain. Keeping the listeners
168
+ // inside the effect is what makes a mid-apply disposal safe: a listener
169
+ // registered outside it would throw INACTIVE_EFFECT and take the remaining
170
+ // registrations with it (A02).
123
171
  ctx.effect(() => {
124
172
  const timers: ReturnType<typeof setInterval>[] = [
125
173
  setInterval(() => {
@@ -132,35 +180,40 @@ export async function apply(ctx: Context, config: Config = {}): Promise<void> {
132
180
  ? []
133
181
  : [setInterval(() => { void otlpSink.flushMetrics() }, resolved.batch.flushIntervalMs)]),
134
182
  ]
135
- return async () => {
136
- for (const timer of timers) clearInterval(timer)
137
- await Promise.all(pipelines.map(pipeline => pipeline.dispose()))
138
- await domain.close()
139
- }
140
- })
141
183
 
142
- // Consumer — consumes the harness session/event stream (and the optional tokenMeter) and feeds the export pipeline.
143
- ctx.on('session/event', (session: Session, event: SessionEvent) => {
144
- try {
145
- collector.handleEvent(session, event)
146
- } catch (error) {
147
- logger.warn(`session "${session.id}": event handling failed: ${error instanceof Error ? error.message : String(error)}`)
148
- }
149
- })
184
+ // Consumer — consumes the harness session/event stream (and the optional
185
+ // tokenMeter) and feeds the export pipeline.
186
+ const offEvent = ctx.on('session/event', (session: Session, event: SessionEvent) => {
187
+ try {
188
+ collector.handleEvent(session, event)
189
+ } catch (error) {
190
+ logger.warn(`session "${session.id}": event handling failed: ${error instanceof Error ? error.message : String(error)}`)
191
+ }
192
+ })
150
193
 
151
- // Best-effort kick: the session-flush durability checkpoint must not wait
152
- // on a remote observability backend, so exports run in the background.
153
- ctx.on('session/flush', () => {
154
- for (const pipeline of pipelines) pipeline.kick()
155
- })
194
+ // Best-effort kick: the session-flush durability checkpoint must not wait
195
+ // on a remote observability backend, so exports run in the background.
196
+ const offFlush = ctx.on('session/flush', () => {
197
+ for (const pipeline of pipelines) pipeline.kick()
198
+ })
156
199
 
157
- ctx.on('session/disposed', (session: Session) => {
158
- try {
159
- collector.handleSessionDisposed(session)
160
- } catch (error) {
161
- logger.warn(`session "${session.id}": disposal handling failed: ${error instanceof Error ? error.message : String(error)}`)
200
+ const offDisposed = ctx.on('session/disposed', (session: Session) => {
201
+ try {
202
+ collector.handleSessionDisposed(session)
203
+ } catch (error) {
204
+ logger.warn(`session "${session.id}": disposal handling failed: ${error instanceof Error ? error.message : String(error)}`)
205
+ }
206
+ for (const pipeline of pipelines) pipeline.kick()
207
+ })
208
+
209
+ return async () => {
210
+ for (const timer of timers) clearInterval(timer)
211
+ offEvent()
212
+ offFlush()
213
+ offDisposed()
214
+ await Promise.all(pipelines.map(pipeline => pipeline.dispose()))
215
+ await domain?.close()
162
216
  }
163
- for (const pipeline of pipelines) pipeline.kick()
164
217
  })
165
218
 
166
219
  if (resolved.remote) {
package/src/pipeline.ts CHANGED
@@ -10,13 +10,13 @@ import type { ResolvedBatch, ResolvedRetry } from './config.ts'
10
10
  import type { BackendName, ExportRecord, MetricRecord } from './model.ts'
11
11
  import { backoffDelayMs } from './backoff.ts'
12
12
  import type { ObserveLogger, SpanSink } from './sinks.ts'
13
- import type { Spool } from './spool.ts'
13
+ import type { SpoolSurface } from './spool.ts'
14
14
 
15
15
  /** Everything one pipeline needs. */
16
16
  export interface PipelineOptions {
17
17
  name: BackendName
18
18
  sink: SpanSink
19
- spool: Spool
19
+ spool: SpoolSurface
20
20
  batch: ResolvedBatch
21
21
  retry: ResolvedRetry
22
22
  logger: ObserveLogger
package/src/spool.ts CHANGED
@@ -55,11 +55,23 @@ export interface SpoolCounts {
55
55
  records: number
56
56
  }
57
57
 
58
+ /**
59
+ * The offline-buffer surface the delivery pipeline depends on. Declared
60
+ * structurally so a mount without durable storage can substitute
61
+ * {@link DroppingSpool} instead of pretending to hold the real spool.
62
+ */
63
+ export interface SpoolSurface {
64
+ push(backend: BackendName, records: ExportRecord[]): Promise<void>
65
+ peek(backend: BackendName, maxRecords: number): { batches: SpoolBatch[]; records: ExportRecord[] }
66
+ remove(batches: readonly SpoolBatch[]): Promise<void>
67
+ counts(): Record<BackendName, SpoolCounts>
68
+ }
69
+
58
70
  /**
59
71
  * The offline buffer over one storage-domain table. The domain itself is
60
72
  * opened and closed by the runtime; the spool only owns the table handle.
61
73
  */
62
- export class Spool {
74
+ export class Spool implements SpoolSurface {
63
75
  private nextSeq = 0
64
76
  private bufferedRecords = 0
65
77
 
@@ -194,3 +206,33 @@ export function openSpool(
194
206
  ): Spool {
195
207
  return new Spool(domain.table('spool'), maxBufferRecords, onDropped, onInvalid)
196
208
  }
209
+
210
+ /**
211
+ * The offline buffer's degraded stand-in, used when the storage domain could
212
+ * not be opened at mount (storageDomain is single-open per name, so a hot
213
+ * reload racing the previous instance's close fails the second open).
214
+ * Nothing is persisted and drains are no-ops; the runtime reports the
215
+ * degradation once at mount and keeps exporting in memory.
216
+ */
217
+ export class DroppingSpool implements SpoolSurface {
218
+ /** Records that would have been spilled into the durable buffer. */
219
+ dropped = 0
220
+
221
+ /** Count the records the durable buffer would have held. */
222
+ async push(_backend: BackendName, records: ExportRecord[]): Promise<void> {
223
+ this.dropped += records.length
224
+ }
225
+
226
+ /** Nothing is durable, so a drain always finds an empty buffer. */
227
+ peek(): { batches: SpoolBatch[]; records: ExportRecord[] } {
228
+ return { batches: [], records: [] }
229
+ }
230
+
231
+ /** No stored batches exist to delete. */
232
+ async remove(): Promise<void> {}
233
+
234
+ /** Occupancy of a buffer that holds nothing. */
235
+ counts(): Record<BackendName, SpoolCounts> {
236
+ return { otlp: { batches: 0, records: 0 }, langfuse: { batches: 0, records: 0 } }
237
+ }
238
+ }
package/src/version.ts CHANGED
@@ -7,4 +7,4 @@
7
7
  */
8
8
 
9
9
  /** The dsh-observe package version, kept in sync with package.json. */
10
- export const VERSION = '0.2.12'
10
+ export const VERSION = '0.2.14'
package/src/wire.ts CHANGED
@@ -49,6 +49,17 @@ const SET_ENABLED_ARGS_CODEC = z.object({
49
49
  enabled: z.boolean(),
50
50
  })
51
51
 
52
+ /**
53
+ * Strict wire codec carrying BOTH published and checkout faces: the `schema`
54
+ * field feeds the npm-published 0.1.5-rc.2 line, `create` feeds the checkout
55
+ * 0.1.6-alpha.1+ line (the loader materializes the schema lazily on first
56
+ * use). Built through a variable, so neither typecheck ruler flags the other
57
+ * face's field as excess.
58
+ */
59
+ function strictWire<T>(typeSymbol: string, schema: T) {
60
+ return Object.freeze({ ...{ mode: 'strict' as const, typeSymbol, schema }, create: () => schema })
61
+ }
62
+
52
63
  /** The `observe/status` invocation descriptor: the read-only status snapshot. */
53
64
  export const OBSERVE_STATUS_DESCRIPTOR = Object.freeze({
54
65
  id: 'dsh-observe#observe/status',
@@ -57,11 +68,7 @@ export const OBSERVE_STATUS_DESCRIPTOR = Object.freeze({
57
68
  method: 'status',
58
69
  invocation: Object.freeze({ kind: 'direct' }),
59
70
  parameters: Object.freeze([]),
60
- result: Object.freeze({
61
- mode: 'strict',
62
- typeSymbol: 'dsh-observe/types#ObserveStatus',
63
- schema: OBSERVE_STATUS_SCHEMA,
64
- }),
71
+ result: strictWire('dsh-observe/types#ObserveStatus', OBSERVE_STATUS_SCHEMA),
65
72
  sourceLocation: Object.freeze({ file: 'src/wire.ts', line: 1, column: 1 }),
66
73
  } as const) satisfies InvocationDescriptor
67
74
 
@@ -76,17 +83,9 @@ export const OBSERVE_SET_ENABLED_DESCRIPTOR = Object.freeze({
76
83
  name: 'request',
77
84
  wire: 'request',
78
85
  source: 'json',
79
- codec: Object.freeze({
80
- mode: 'strict',
81
- typeSymbol: 'dsh-observe/types#ObserveSetEnabledArgs',
82
- schema: SET_ENABLED_ARGS_CODEC,
83
- }),
86
+ codec: strictWire('dsh-observe/types#ObserveSetEnabledArgs', SET_ENABLED_ARGS_CODEC),
84
87
  } satisfies InvocationDescriptor['parameters'][number])]),
85
- result: Object.freeze({
86
- mode: 'strict',
87
- typeSymbol: 'dsh-observe/types#ObserveSetEnabledResult',
88
- schema: OBSERVE_SET_ENABLED_RESULT_SCHEMA,
89
- }),
88
+ result: strictWire('dsh-observe/types#ObserveSetEnabledResult', OBSERVE_SET_ENABLED_RESULT_SCHEMA),
90
89
  sourceLocation: Object.freeze({ file: 'src/wire.ts', line: 1, column: 1 }),
91
90
  } as const) satisfies InvocationDescriptor
92
91