@reticlehq/core 2.5.0 → 2.6.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.
@@ -73,6 +73,14 @@ export declare const ReticleEnv: {
73
73
  * killing live runs mid-install. Derived from the base when unset.
74
74
  */
75
75
  readonly IDLE_ATTACHED: "RETICLE_IDLE_ATTACHED_MS";
76
+ /**
77
+ * How often the daemon writes `reticle_daemon_alive`, so a GAP in its log is evidence it died.
78
+ *
79
+ * Overridable for the same reason the idle windows are: a spec that has to prove "a killed daemon
80
+ * is distinguishable from a tidy one" cannot wait 30 seconds per beat, and a spec that instead
81
+ * re-implements the cadence is insensitive to the thing it claims to guard.
82
+ */
83
+ readonly HEARTBEAT: "RETICLE_HEARTBEAT_MS";
76
84
  /** Directory holding the auto-provisioned pairing token. Defaults to ~/.reticle; relocatable for CI. */
77
85
  readonly PAIRING_TOKEN_DIR: "RETICLE_PAIRING_TOKEN_DIR";
78
86
  /** Force the durable causal journal off (`0`/`false`/`off`) or on (`1`/`true`/`on`); default on. */
@@ -404,6 +412,14 @@ export declare const InputModeReason: {
404
412
  readonly DRAG_TARGET_UNRESOLVED: "drag-target-unresolved";
405
413
  readonly PROVIDER_DECLINED: "provider-declined";
406
414
  readonly PROVIDER_ERROR: "provider-error";
415
+ /**
416
+ * No real-input provider is configured at all, and the caller explicitly asked for one with
417
+ * `native:true`. Only emitted on that explicit ask: without a provider EVERY action is synthetic,
418
+ * so annotating all of them would put a reason on the most-used tool in the product for no gain.
419
+ * An agent that asked for a trusted click, though, has an expectation to correct — and this is
420
+ * permanent for the session, not a transient downgrade, so it should stop asking.
421
+ */
422
+ readonly NOT_CONFIGURED: "real-input-not-configured-for-this-session";
407
423
  };
408
424
  export type InputModeReason = (typeof InputModeReason)[keyof typeof InputModeReason];
409
425
  /** Best-effort caveats attached to action results so the agent can interpret a no-op. */
package/dist/constants.js CHANGED
@@ -75,6 +75,14 @@ export const ReticleEnv = {
75
75
  * killing live runs mid-install. Derived from the base when unset.
76
76
  */
77
77
  IDLE_ATTACHED: 'RETICLE_IDLE_ATTACHED_MS',
78
+ /**
79
+ * How often the daemon writes `reticle_daemon_alive`, so a GAP in its log is evidence it died.
80
+ *
81
+ * Overridable for the same reason the idle windows are: a spec that has to prove "a killed daemon
82
+ * is distinguishable from a tidy one" cannot wait 30 seconds per beat, and a spec that instead
83
+ * re-implements the cadence is insensitive to the thing it claims to guard.
84
+ */
85
+ HEARTBEAT: 'RETICLE_HEARTBEAT_MS',
78
86
  /** Directory holding the auto-provisioned pairing token. Defaults to ~/.reticle; relocatable for CI. */
79
87
  PAIRING_TOKEN_DIR: 'RETICLE_PAIRING_TOKEN_DIR',
80
88
  /** Force the durable causal journal off (`0`/`false`/`off`) or on (`1`/`true`/`on`); default on. */
@@ -403,6 +411,14 @@ export const InputModeReason = {
403
411
  DRAG_TARGET_UNRESOLVED: 'drag-target-unresolved', // drag toRef missing or not locatable
404
412
  PROVIDER_DECLINED: 'provider-declined', // provider chose not to perform
405
413
  PROVIDER_ERROR: 'provider-error', // provider threw → fell back to synthetic
414
+ /**
415
+ * No real-input provider is configured at all, and the caller explicitly asked for one with
416
+ * `native:true`. Only emitted on that explicit ask: without a provider EVERY action is synthetic,
417
+ * so annotating all of them would put a reason on the most-used tool in the product for no gain.
418
+ * An agent that asked for a trusted click, though, has an expectation to correct — and this is
419
+ * permanent for the session, not a transient downgrade, so it should stop asking.
420
+ */
421
+ NOT_CONFIGURED: 'real-input-not-configured-for-this-session',
406
422
  };
407
423
  /** Best-effort caveats attached to action results so the agent can interpret a no-op. */
408
424
  export const ActionWarning = {
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The high-volume, low-signal floor. These fire continuously on any live page and are the ONLY
3
+ * thing that should be sacrificed when a buffer is full. Everything else is scarce evidence a
4
+ * verdict depends on. Shared by the browser transport queue and the server ring buffer so both
5
+ * eviction policies agree on what to sacrifice.
6
+ */
7
+ export declare const CHURN_TYPES: ReadonlySet<string>;
@@ -0,0 +1,15 @@
1
+ import { EventType } from './constants.js';
2
+ /**
3
+ * The high-volume, low-signal floor. These fire continuously on any live page and are the ONLY
4
+ * thing that should be sacrificed when a buffer is full. Everything else is scarce evidence a
5
+ * verdict depends on. Shared by the browser transport queue and the server ring buffer so both
6
+ * eviction policies agree on what to sacrifice.
7
+ */
8
+ export const CHURN_TYPES = new Set([
9
+ EventType.DOM_TEXT,
10
+ EventType.ANIM_START,
11
+ EventType.ANIM_END,
12
+ EventType.RENDER_COMMIT,
13
+ EventType.PAGE_HEALTH,
14
+ EventType.SCROLL_POSITION,
15
+ ]);
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@
9
9
  */
10
10
  export * from './constants.js';
11
11
  export * from './source-constants.js';
12
+ export * from './event-classification.js';
12
13
  export * from './verified-constants.js';
13
14
  export * from './session-constants.js';
14
15
  export * from './messages.js';
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@
10
10
  // ── STABLE public surface: the wire/domain contract ──────────────────────────────────────────────
11
11
  export * from './constants.js'; // EventType, ActionType, wire constants, TRANSPORT_LIMITS, …
12
12
  export * from './source-constants.js'; // DATA_RETICLE_SOURCE_ATTR, RETICLE_ROOT_GLOBAL
13
+ export * from './event-classification.js'; // CHURN_TYPES — shared eviction priority for buffer/queue
13
14
  export * from './verified-constants.js'; // Verified — the one field an agent gates on
14
15
  export * from './session-constants.js';
15
16
  export * from './messages.js'; // ReticleEvent + the message schemas
@@ -289,6 +289,16 @@ export declare const SessionSummarySchema: z.ZodObject<{
289
289
  peakConcurrentTools: z.ZodOptional<z.ZodNumber>;
290
290
  /** Calls for a tool name that does not exist. A non-zero value means our surface is confusing. */
291
291
  unknownToolCalls: z.ZodOptional<z.ZodNumber>;
292
+ /**
293
+ * WHICH tools the agent reached for that do not exist, with counts.
294
+ *
295
+ * The count alone said "our surface confused someone" and could never say what they wanted. The
296
+ * name is a feature request in the agent's own vocabulary — and it is a NAME, from our own tool
297
+ * namespace, carrying no app data, so it is safe under the send-names-never-values rule.
298
+ *
299
+ * Bounded and truncated: a guess is a short identifier, and anything longer is not one.
300
+ */
301
+ unknownTools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
292
302
  /**
293
303
  * Tool calls that failed because there was no app to reach — no session connected, no session by
294
304
  * that id, or several with none named.
@@ -341,8 +351,100 @@ export declare const SessionSummarySchema: z.ZodObject<{
341
351
  }>>;
342
352
  /** Distinct MCP clients seen (`claude-code`, `cursor`), so multi-agent use is visible. */
343
353
  clients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
354
+ /**
355
+ * Client name -> version. The other half of `clients`, and the half that explains regressions.
356
+ *
357
+ * MCP's `clientInfo` carries a name AND a version; we read both at the handshake and kept only
358
+ * the name. A product whose users are agents needs to slice every rate by which agent, on which
359
+ * build — a single global figure hides the finding entirely.
360
+ *
361
+ * NOT the model: `clientInfo` has no concept of one, so the transport genuinely cannot report it.
362
+ * Agents self-report it on feedback, which is the only mechanism there is.
363
+ */
364
+ clientVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
365
+ /**
366
+ * Which tool surface was live. The 18-tool default and the 48-tool full surface are different
367
+ * products from inside an agent's context window, and comparing outcomes across them is how we
368
+ * learn whether the trim helps or hurts.
369
+ */
370
+ surface: z.ZodOptional<z.ZodString>;
371
+ /**
372
+ * How many times an app's SDK dialled this daemon. **Session-lifetime, never windowed.**
373
+ *
374
+ * Zero here is the single most diagnostic number in the payload: the daemon ran and no app ever
375
+ * connected, which is a BROKEN INSTALL. Non-zero with no tool calls is the opposite problem — the
376
+ * install works and the agent never asked. Before this field those two were the same row, and
377
+ * they have opposite fixes. Measured 2026-08-10/11: 88 of 116 users attached an agent and never
378
+ * drove, and we could not say which case any of them was.
379
+ *
380
+ * A counter rather than an event because the SDK reconnects on every page reload — an event per
381
+ * connect would be high volume for a question one number answers.
382
+ */
383
+ appConnects: z.ZodOptional<z.ZodNumber>;
384
+ /**
385
+ * Milliseconds from daemon start to the FIRST app connecting. Absent when none ever did.
386
+ *
387
+ * Separates "the app was already running" from "the human had to go start it", which is the
388
+ * difference between a smooth install and one that needed a second step nobody documented.
389
+ */
390
+ msToFirstApp: z.ZodOptional<z.ZodNumber>;
391
+ /**
392
+ * What state the AGENT's work was in when the session ended. Absent on a periodic flush.
393
+ *
394
+ * Distinct from `exit`, which says why the PROCESS ended. A daemon can exit tidily on idle while
395
+ * the agent's work was abandoned mid-task, and those are different findings.
396
+ *
397
+ * Measured 2026-08-10/11: 20 of the 28 agents that drove an app produced no verdict, and nothing
398
+ * could say whether that was a product failure or a task that simply ended.
399
+ *
400
+ * Most of this is derivable at query time from `toolCalls` / `verifications` /
401
+ * `abandonedActions`. The part that is NOT derivable is `client_left` — whether the agent
402
+ * detached or simply stopped asking — which is why the daemon records it rather than leaving the
403
+ * whole thing to a query.
404
+ */
405
+ endReason: z.ZodOptional<z.ZodEnum<["never_used", "explored", "abandoned", "verified", "client_left"]>>;
406
+ /**
407
+ * How often Reticle invited the agent to send feedback.
408
+ *
409
+ * The denominator for `feedback_submitted`. A prompt nobody acts on is decoration, and without
410
+ * this we could never tell the difference between "agents have nothing to report" and "our
411
+ * invitation is invisible". Instrumenting our own nudge is what makes it a designed system
412
+ * rather than a hope.
413
+ */
414
+ feedbackPrompted: z.ZodOptional<z.ZodNumber>;
415
+ /**
416
+ * Tool errors bucketed by WHOSE defect they are: `schema` (our grammar failed to explain itself),
417
+ * `state` (the world moved), `refusal` (we said no on purpose), `other` (a blind spot).
418
+ *
419
+ * `toolErrors` is one number over three failures with three different fixes. Only the `schema`
420
+ * bucket is fixable by writing better descriptions, and it was indistinguishable from the rest.
421
+ */
422
+ errorClasses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
423
+ /**
424
+ * Errors after which the agent's NEXT call succeeded — the message worked.
425
+ *
426
+ * The best measure of an error message is what the agent does next, and we had the loop
427
+ * (`consecutiveRepeats`) and the shape (`errors[]`) but never the join. This is the most
428
+ * agent-specific metric in the payload: a human would sigh, a log would show nothing.
429
+ */
430
+ errorsRecovered: z.ZodOptional<z.ZodNumber>;
431
+ /** Errors whose very next call failed again — the message did not land. */
432
+ errorsRepeated: z.ZodOptional<z.ZodNumber>;
344
433
  /** Was this a clean shutdown, or a periodic flush of a still-running session? */
345
434
  final: z.ZodBoolean;
435
+ /**
436
+ * WHY the daemon exited. Absent on a periodic flush (`final: false`) — nothing exited.
437
+ *
438
+ * Without this, a designed exit and a real failure are the same row. Measured 2026-08-10/11: 299
439
+ * of 321 `mcp_connection_lost` events were `sse_ended` — the stream the daemon closes on its own
440
+ * scheduled idle shutdown — so the metric meant to say "the agent lost its tools" was mostly
441
+ * counting the daemon going to sleep as designed, and a genuine outage was invisible inside it.
442
+ *
443
+ * The daemon has always known this (`recordExitReason`); it simply never put it on an event. The
444
+ * proxy that emits the outage cannot know it — it only sees a socket end — so the join is made
445
+ * here, on the one event that fires at the same moment and already carries the session.
446
+ */
447
+ exit: z.ZodOptional<z.ZodEnum<["idle", "signal", "unknown"]>>;
346
448
  }, "strip", z.ZodTypeAny, {
347
449
  durationMs: number;
348
450
  toolCalls: number;
@@ -350,6 +452,7 @@ export declare const SessionSummarySchema: z.ZodObject<{
350
452
  toolErrors: number;
351
453
  verifications: number;
352
454
  final: boolean;
455
+ surface?: string | undefined;
353
456
  errors?: {
354
457
  message: string;
355
458
  count: number;
@@ -380,6 +483,7 @@ export declare const SessionSummarySchema: z.ZodObject<{
380
483
  browserCommands?: number | undefined;
381
484
  peakConcurrentTools?: number | undefined;
382
485
  unknownToolCalls?: number | undefined;
486
+ unknownTools?: Record<string, number> | undefined;
383
487
  noSessionErrors?: number | undefined;
384
488
  consecutiveRepeats?: Record<string, number> | undefined;
385
489
  abandonedActions?: number | undefined;
@@ -392,6 +496,15 @@ export declare const SessionSummarySchema: z.ZodObject<{
392
496
  cpuCount: number;
393
497
  } | undefined;
394
498
  clients?: string[] | undefined;
499
+ clientVersions?: Record<string, string> | undefined;
500
+ appConnects?: number | undefined;
501
+ msToFirstApp?: number | undefined;
502
+ endReason?: "never_used" | "explored" | "abandoned" | "verified" | "client_left" | undefined;
503
+ feedbackPrompted?: number | undefined;
504
+ errorClasses?: Record<string, number> | undefined;
505
+ errorsRecovered?: number | undefined;
506
+ errorsRepeated?: number | undefined;
507
+ exit?: "signal" | "idle" | "unknown" | undefined;
395
508
  }, {
396
509
  durationMs: number;
397
510
  toolCalls: number;
@@ -399,6 +512,7 @@ export declare const SessionSummarySchema: z.ZodObject<{
399
512
  toolErrors: number;
400
513
  verifications: number;
401
514
  final: boolean;
515
+ surface?: string | undefined;
402
516
  errors?: {
403
517
  message: string;
404
518
  count: number;
@@ -429,6 +543,7 @@ export declare const SessionSummarySchema: z.ZodObject<{
429
543
  browserCommands?: number | undefined;
430
544
  peakConcurrentTools?: number | undefined;
431
545
  unknownToolCalls?: number | undefined;
546
+ unknownTools?: Record<string, number> | undefined;
432
547
  noSessionErrors?: number | undefined;
433
548
  consecutiveRepeats?: Record<string, number> | undefined;
434
549
  abandonedActions?: number | undefined;
@@ -441,6 +556,15 @@ export declare const SessionSummarySchema: z.ZodObject<{
441
556
  cpuCount: number;
442
557
  } | undefined;
443
558
  clients?: string[] | undefined;
559
+ clientVersions?: Record<string, string> | undefined;
560
+ appConnects?: number | undefined;
561
+ msToFirstApp?: number | undefined;
562
+ endReason?: "never_used" | "explored" | "abandoned" | "verified" | "client_left" | undefined;
563
+ feedbackPrompted?: number | undefined;
564
+ errorClasses?: Record<string, number> | undefined;
565
+ errorsRecovered?: number | undefined;
566
+ errorsRepeated?: number | undefined;
567
+ exit?: "signal" | "idle" | "unknown" | undefined;
444
568
  }>;
445
569
  export type SessionSummary = z.infer<typeof SessionSummarySchema>;
446
570
  /**
@@ -466,6 +590,19 @@ export type ProjectSize = (typeof ProjectSize)[keyof typeof ProjectSize];
466
590
  export declare const ProjectProfileSchema: z.ZodObject<{
467
591
  /** Framework detected from package.json (`next`, `vite`, `vue`, `astro`, …). */
468
592
  stack: z.ZodOptional<z.ZodString>;
593
+ /**
594
+ * WHERE the stack was found — and therefore how much to trust the absence of one.
595
+ *
596
+ * `cwd` means the daemon was sitting in the app. `workspace` means it was not, and discovery had
597
+ * to walk down to find it. The split is the diagnostic: it says how often our inference needs
598
+ * help, which is the question that decides whether an agent-correction surface is worth building
599
+ * at all.
600
+ *
601
+ * Measured 2026-08-10/11, before discovery existed here: stack was detected on **0 of the 77
602
+ * projects where Reticle was demonstrably set up**, and 0 of 166 `size: huge` ones. A detector
603
+ * that reads one directory reports nothing precisely where the real repos are.
604
+ */
605
+ stackSource: z.ZodOptional<z.ZodEnum<["cwd", "workspace"]>>;
469
606
  /** Its MAJOR version only — "breaks on React 19" is a work item, a full semver is a fingerprint. */
470
607
  stackMajor: z.ZodOptional<z.ZodNumber>;
471
608
  size: z.ZodOptional<z.ZodNativeEnum<{
@@ -530,6 +667,7 @@ export declare const ProjectProfileSchema: z.ZodObject<{
530
667
  featureDepth: number;
531
668
  stack?: string | undefined;
532
669
  stackMajor?: number | undefined;
670
+ stackSource?: "cwd" | "workspace" | undefined;
533
671
  size?: "medium" | "tiny" | "small" | "large" | "huge" | undefined;
534
672
  monorepo?: boolean | undefined;
535
673
  forge?: "github" | "gitlab" | "bitbucket" | "azure" | "sourcehut" | "codeberg" | "self_hosted" | undefined;
@@ -546,6 +684,7 @@ export declare const ProjectProfileSchema: z.ZodObject<{
546
684
  featureDepth: number;
547
685
  stack?: string | undefined;
548
686
  stackMajor?: number | undefined;
687
+ stackSource?: "cwd" | "workspace" | undefined;
549
688
  size?: "medium" | "tiny" | "small" | "large" | "huge" | undefined;
550
689
  monorepo?: boolean | undefined;
551
690
  forge?: "github" | "gitlab" | "bitbucket" | "azure" | "sourcehut" | "codeberg" | "self_hosted" | undefined;
@@ -182,6 +182,16 @@ export const SessionSummarySchema = z.object({
182
182
  peakConcurrentTools: z.number().int().nonnegative().optional(),
183
183
  /** Calls for a tool name that does not exist. A non-zero value means our surface is confusing. */
184
184
  unknownToolCalls: z.number().int().nonnegative().optional(),
185
+ /**
186
+ * WHICH tools the agent reached for that do not exist, with counts.
187
+ *
188
+ * The count alone said "our surface confused someone" and could never say what they wanted. The
189
+ * name is a feature request in the agent's own vocabulary — and it is a NAME, from our own tool
190
+ * namespace, carrying no app data, so it is safe under the send-names-never-values rule.
191
+ *
192
+ * Bounded and truncated: a guess is a short identifier, and anything longer is not one.
193
+ */
194
+ unknownTools: z.record(z.string().max(64), z.number().int().nonnegative()).optional(),
185
195
  /**
186
196
  * Tool calls that failed because there was no app to reach — no session connected, no session by
187
197
  * that id, or several with none named.
@@ -210,8 +220,100 @@ export const SessionSummarySchema = z.object({
210
220
  machine: MachineSnapshotSchema.optional(),
211
221
  /** Distinct MCP clients seen (`claude-code`, `cursor`), so multi-agent use is visible. */
212
222
  clients: z.array(z.string().max(64)).max(8).optional(),
223
+ /**
224
+ * Client name -> version. The other half of `clients`, and the half that explains regressions.
225
+ *
226
+ * MCP's `clientInfo` carries a name AND a version; we read both at the handshake and kept only
227
+ * the name. A product whose users are agents needs to slice every rate by which agent, on which
228
+ * build — a single global figure hides the finding entirely.
229
+ *
230
+ * NOT the model: `clientInfo` has no concept of one, so the transport genuinely cannot report it.
231
+ * Agents self-report it on feedback, which is the only mechanism there is.
232
+ */
233
+ clientVersions: z.record(z.string().max(64), z.string().max(32)).optional(),
234
+ /**
235
+ * Which tool surface was live. The 18-tool default and the 48-tool full surface are different
236
+ * products from inside an agent's context window, and comparing outcomes across them is how we
237
+ * learn whether the trim helps or hurts.
238
+ */
239
+ surface: z.string().max(32).optional(),
240
+ /**
241
+ * How many times an app's SDK dialled this daemon. **Session-lifetime, never windowed.**
242
+ *
243
+ * Zero here is the single most diagnostic number in the payload: the daemon ran and no app ever
244
+ * connected, which is a BROKEN INSTALL. Non-zero with no tool calls is the opposite problem — the
245
+ * install works and the agent never asked. Before this field those two were the same row, and
246
+ * they have opposite fixes. Measured 2026-08-10/11: 88 of 116 users attached an agent and never
247
+ * drove, and we could not say which case any of them was.
248
+ *
249
+ * A counter rather than an event because the SDK reconnects on every page reload — an event per
250
+ * connect would be high volume for a question one number answers.
251
+ */
252
+ appConnects: z.number().int().nonnegative().optional(),
253
+ /**
254
+ * Milliseconds from daemon start to the FIRST app connecting. Absent when none ever did.
255
+ *
256
+ * Separates "the app was already running" from "the human had to go start it", which is the
257
+ * difference between a smooth install and one that needed a second step nobody documented.
258
+ */
259
+ msToFirstApp: z.number().int().nonnegative().optional(),
260
+ /**
261
+ * What state the AGENT's work was in when the session ended. Absent on a periodic flush.
262
+ *
263
+ * Distinct from `exit`, which says why the PROCESS ended. A daemon can exit tidily on idle while
264
+ * the agent's work was abandoned mid-task, and those are different findings.
265
+ *
266
+ * Measured 2026-08-10/11: 20 of the 28 agents that drove an app produced no verdict, and nothing
267
+ * could say whether that was a product failure or a task that simply ended.
268
+ *
269
+ * Most of this is derivable at query time from `toolCalls` / `verifications` /
270
+ * `abandonedActions`. The part that is NOT derivable is `client_left` — whether the agent
271
+ * detached or simply stopped asking — which is why the daemon records it rather than leaving the
272
+ * whole thing to a query.
273
+ */
274
+ endReason: z.enum(['never_used', 'explored', 'abandoned', 'verified', 'client_left']).optional(),
275
+ /**
276
+ * How often Reticle invited the agent to send feedback.
277
+ *
278
+ * The denominator for `feedback_submitted`. A prompt nobody acts on is decoration, and without
279
+ * this we could never tell the difference between "agents have nothing to report" and "our
280
+ * invitation is invisible". Instrumenting our own nudge is what makes it a designed system
281
+ * rather than a hope.
282
+ */
283
+ feedbackPrompted: z.number().int().nonnegative().optional(),
284
+ /**
285
+ * Tool errors bucketed by WHOSE defect they are: `schema` (our grammar failed to explain itself),
286
+ * `state` (the world moved), `refusal` (we said no on purpose), `other` (a blind spot).
287
+ *
288
+ * `toolErrors` is one number over three failures with three different fixes. Only the `schema`
289
+ * bucket is fixable by writing better descriptions, and it was indistinguishable from the rest.
290
+ */
291
+ errorClasses: z.record(z.string().max(16), z.number().int().nonnegative()).optional(),
292
+ /**
293
+ * Errors after which the agent's NEXT call succeeded — the message worked.
294
+ *
295
+ * The best measure of an error message is what the agent does next, and we had the loop
296
+ * (`consecutiveRepeats`) and the shape (`errors[]`) but never the join. This is the most
297
+ * agent-specific metric in the payload: a human would sigh, a log would show nothing.
298
+ */
299
+ errorsRecovered: z.number().int().nonnegative().optional(),
300
+ /** Errors whose very next call failed again — the message did not land. */
301
+ errorsRepeated: z.number().int().nonnegative().optional(),
213
302
  /** Was this a clean shutdown, or a periodic flush of a still-running session? */
214
303
  final: z.boolean(),
304
+ /**
305
+ * WHY the daemon exited. Absent on a periodic flush (`final: false`) — nothing exited.
306
+ *
307
+ * Without this, a designed exit and a real failure are the same row. Measured 2026-08-10/11: 299
308
+ * of 321 `mcp_connection_lost` events were `sse_ended` — the stream the daemon closes on its own
309
+ * scheduled idle shutdown — so the metric meant to say "the agent lost its tools" was mostly
310
+ * counting the daemon going to sleep as designed, and a genuine outage was invisible inside it.
311
+ *
312
+ * The daemon has always known this (`recordExitReason`); it simply never put it on an event. The
313
+ * proxy that emits the outage cannot know it — it only sees a socket end — so the join is made
314
+ * here, on the one event that fires at the same moment and already carries the session.
315
+ */
316
+ exit: z.enum(['idle', 'signal', 'unknown']).optional(),
215
317
  });
216
318
  /**
217
319
  * Coarse size buckets. A bucket answers "is this a toy or a real codebase" — which is the actual
@@ -235,6 +337,19 @@ export const ProjectSize = {
235
337
  export const ProjectProfileSchema = z.object({
236
338
  /** Framework detected from package.json (`next`, `vite`, `vue`, `astro`, …). */
237
339
  stack: z.string().min(1).max(64).optional(),
340
+ /**
341
+ * WHERE the stack was found — and therefore how much to trust the absence of one.
342
+ *
343
+ * `cwd` means the daemon was sitting in the app. `workspace` means it was not, and discovery had
344
+ * to walk down to find it. The split is the diagnostic: it says how often our inference needs
345
+ * help, which is the question that decides whether an agent-correction surface is worth building
346
+ * at all.
347
+ *
348
+ * Measured 2026-08-10/11, before discovery existed here: stack was detected on **0 of the 77
349
+ * projects where Reticle was demonstrably set up**, and 0 of 166 `size: huge` ones. A detector
350
+ * that reads one directory reports nothing precisely where the real repos are.
351
+ */
352
+ stackSource: z.enum(['cwd', 'workspace']).optional(),
238
353
  /** Its MAJOR version only — "breaks on React 19" is a work item, a full semver is a fingerprint. */
239
354
  stackMajor: z.number().int().nonnegative().optional(),
240
355
  size: z.nativeEnum(ProjectSize).optional(),
@@ -160,14 +160,24 @@ export type TelemetryActor = (typeof TelemetryActor)[keyof typeof TelemetryActor
160
160
  * What `projectId` was derived from — and therefore whether it is comparable ACROSS machines.
161
161
  *
162
162
  * This is the field that keeps "how many users share this project" from silently lying. A
163
- * cwd-derived id is unique per machine, so those rows always show exactly one user per project. Left
163
+ * path-derived id is unique per machine, so those rows always show exactly one user per project. Left
164
164
  * unlabelled they would drag the average toward 1 and hide real team adoption; labelled, the
165
165
  * analytics can restrict that question to `git_origin` rows, where it is a real measurement.
166
+ *
167
+ * The three non-origin sources are ordered by how stable they are WITHIN one machine, which is the
168
+ * property the funnel actually needs: `init` runs in the app directory and the daemon is spawned from
169
+ * wherever the agent's client happens to sit, so an id that changes with the working directory
170
+ * severs the two halves of the funnel. Only `cwd` has that defect, and it is now the last resort
171
+ * rather than the first fallback — measured 2026-08-11 at 1131 ids for 243 users.
166
172
  */
167
173
  export declare const ProjectIdSource: {
168
174
  /** Hash of the shared git origin — the same on every clone, so cross-machine counting is valid. */
169
175
  readonly GIT_ORIGIN: "git_origin";
170
- /** Hash of the local directory path — unique per machine; NOT comparable across users. */
176
+ /** Hash of the repo ROOT path — machine-local, but the same for every directory inside the repo. */
177
+ readonly GIT_ROOT: "git_root";
178
+ /** Hash of the nearest package.json's directory — machine-local; used when there is no git at all. */
179
+ readonly PACKAGE_ROOT: "package_root";
180
+ /** Hash of the raw working directory — the last resort, and the only source that is NOT stable. */
171
181
  readonly CWD: "cwd";
172
182
  };
173
183
  export type ProjectIdSource = (typeof ProjectIdSource)[keyof typeof ProjectIdSource];
@@ -244,6 +254,7 @@ export declare const VerificationSchema: z.ZodObject<{
244
254
  */
245
255
  reason: z.ZodOptional<z.ZodNativeEnum<{
246
256
  readonly INCONCLUSIVE: "inconclusive";
257
+ readonly OBSERVATION_LOST: "observation_lost";
247
258
  readonly ASSERTION_FAILED: "assertion_failed";
248
259
  readonly CONTRADICTED: "contradicted";
249
260
  readonly ALREADY_TRUE: "already_true";
@@ -255,21 +266,21 @@ export declare const VerificationSchema: z.ZodObject<{
255
266
  readonly PROVED: "proved";
256
267
  }>>;
257
268
  }, "strip", z.ZodTypeAny, {
258
- via: string;
259
269
  verified: string;
270
+ via: string;
260
271
  passed: boolean;
261
272
  falseGreenCaught: boolean;
262
273
  durationMs?: number | undefined;
263
- reason?: "inconclusive" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
274
+ reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
264
275
  brand?: "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | "other" | undefined;
265
276
  browser?: string | undefined;
266
277
  }, {
267
- via: string;
268
278
  verified: string;
279
+ via: string;
269
280
  passed: boolean;
270
281
  falseGreenCaught: boolean;
271
282
  durationMs?: number | undefined;
272
- reason?: "inconclusive" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
283
+ reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
273
284
  brand?: "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | "other" | undefined;
274
285
  browser?: string | undefined;
275
286
  }>;
@@ -310,6 +321,18 @@ export type VersionChange = z.infer<typeof VersionChangeSchema>;
310
321
  * give the hash a meaning, while keeping the line that matters: our code and our failure, never the
311
322
  * user's code and never their data.
312
323
  */
324
+ /**
325
+ * Whether a failed connection was aimed at a port Reticle itself uses.
326
+ *
327
+ * An enum rather than the number, because the number is the reporter's and the answer is ours: all
328
+ * anyone needs to know is whose problem it is. Refused on a Reticle port is a lifecycle problem —
329
+ * a daemon that is not up; refused anywhere else is somebody else's service.
330
+ */
331
+ export declare const CrashPort: {
332
+ readonly RETICLE: "reticle";
333
+ readonly OTHER: "other";
334
+ };
335
+ export type CrashPort = (typeof CrashPort)[keyof typeof CrashPort];
313
336
  export declare const CrashSchema: z.ZodObject<{
314
337
  /** `uncaught_exception` | `unhandled_rejection`. */
315
338
  kind: z.ZodString;
@@ -373,11 +396,40 @@ export declare const CrashSchema: z.ZodObject<{
373
396
  load1x100: number;
374
397
  cpuCount: number;
375
398
  }>>;
399
+ /**
400
+ * The failing SYSCALL — `connect`, `write`, `open`. Already inside `message`; structured here so
401
+ * it can be grouped on rather than parsed back out of prose.
402
+ */
403
+ syscall: z.ZodOptional<z.ZodString>;
404
+ /**
405
+ * The symbolic errno — `ECONNREFUSED`, `EPIPE`. The name, never the platform-specific number.
406
+ */
407
+ errno: z.ZodOptional<z.ZodString>;
408
+ /**
409
+ * Was the target the machine it was running on?
410
+ *
411
+ * One bit, and it splits two populations that currently look identical and have different owners:
412
+ * refused ON loopback is a Reticle-lifecycle problem (no daemon), refused off-box is a network
413
+ * problem that is not ours.
414
+ */
415
+ loopback: z.ZodOptional<z.ZodBoolean>;
416
+ /** Whether the port was one of ours, as an enum. The number itself is never sent. */
417
+ port: z.ZodOptional<z.ZodEnum<["reticle", "other"]>>;
418
+ /**
419
+ * The innermost frame naming NODE's own source — `node:net:1637`.
420
+ *
421
+ * Only present when the crash is a system error AND no Reticle frame survived, which is exactly
422
+ * the report that otherwise arrives with no location at all. It is a line in Node's published
423
+ * source: it says a connect failed rather than a DNS lookup, and carries nothing about the
424
+ * machine, the app, or anyone's directory layout.
425
+ */
426
+ internalFrame: z.ZodOptional<z.ZodString>;
376
427
  }, "strip", z.ZodTypeAny, {
377
428
  kind: string;
378
429
  message?: string | undefined;
379
430
  errorType?: string | undefined;
380
431
  tool?: string | undefined;
432
+ port?: "other" | "reticle" | undefined;
381
433
  fingerprint?: string | undefined;
382
434
  machine?: {
383
435
  rssMb: number;
@@ -391,11 +443,16 @@ export declare const CrashSchema: z.ZodObject<{
391
443
  breadcrumb?: string[] | undefined;
392
444
  nodeVersion?: string | undefined;
393
445
  arch?: string | undefined;
446
+ syscall?: string | undefined;
447
+ errno?: string | undefined;
448
+ loopback?: boolean | undefined;
449
+ internalFrame?: string | undefined;
394
450
  }, {
395
451
  kind: string;
396
452
  message?: string | undefined;
397
453
  errorType?: string | undefined;
398
454
  tool?: string | undefined;
455
+ port?: "other" | "reticle" | undefined;
399
456
  fingerprint?: string | undefined;
400
457
  machine?: {
401
458
  rssMb: number;
@@ -409,6 +466,10 @@ export declare const CrashSchema: z.ZodObject<{
409
466
  breadcrumb?: string[] | undefined;
410
467
  nodeVersion?: string | undefined;
411
468
  arch?: string | undefined;
469
+ syscall?: string | undefined;
470
+ errno?: string | undefined;
471
+ loopback?: boolean | undefined;
472
+ internalFrame?: string | undefined;
412
473
  }>;
413
474
  export type Crash = z.infer<typeof CrashSchema>;
414
475
  /**
@@ -519,14 +580,14 @@ export declare const BugFoundSchema: z.ZodObject<{
519
580
  source: "replay" | "contradiction" | "crawl" | "assertion";
520
581
  falseGreen: boolean;
521
582
  repeat: boolean;
522
- attribution?: "app" | "request" | "reticle" | undefined;
583
+ attribution?: "app" | "reticle" | "request" | undefined;
523
584
  tool?: string | undefined;
524
585
  }, {
525
586
  kind: string;
526
587
  source: "replay" | "contradiction" | "crawl" | "assertion";
527
588
  falseGreen: boolean;
528
589
  repeat: boolean;
529
- attribution?: "app" | "request" | "reticle" | undefined;
590
+ attribution?: "app" | "reticle" | "request" | undefined;
530
591
  tool?: string | undefined;
531
592
  }>;
532
593
  export type BugFound = z.infer<typeof BugFoundSchema>;
@@ -612,14 +673,28 @@ export declare const McpOutageSchema: z.ZodObject<{
612
673
  }>;
613
674
  /** Consecutive reconnects tried when this was reported. `first` is near 1; a spent budget is high. */
614
675
  attempts: z.ZodNumber;
676
+ /**
677
+ * In-flight tool calls this drop actually killed — the only part an agent can FEEL.
678
+ *
679
+ * Without it every drop looks equally bad. Measured 2026-08-10/11: **320 of 321 outages were
680
+ * `stage: first` with `attempts: 1`** — the stream ended once and the proxy reconnected, which for
681
+ * an agent with nothing in flight is invisible. Reading that 321 as "the agent lost its tools 321
682
+ * times" overstates the problem by roughly the whole number, and buries the one drop that mattered.
683
+ *
684
+ * Zero means nobody noticed. Non-zero is the number of calls that came back `-32001` and the count
685
+ * worth driving down.
686
+ */
687
+ pendingLost: z.ZodOptional<z.ZodNumber>;
615
688
  }, "strip", z.ZodTypeAny, {
616
689
  reason: "other" | "sse_ended" | "sse_error" | "sse_aborted" | "sse_closed" | "connect_error";
617
690
  attempts: number;
618
691
  stage: "first" | "budget_spent";
692
+ pendingLost?: number | undefined;
619
693
  }, {
620
694
  reason: "other" | "sse_ended" | "sse_error" | "sse_aborted" | "sse_closed" | "connect_error";
621
695
  attempts: number;
622
696
  stage: "first" | "budget_spent";
697
+ pendingLost?: number | undefined;
623
698
  }>;
624
699
  export type McpOutage = z.infer<typeof McpOutageSchema>;
625
700
  /** How `reticle init` went. The onboarding funnel, which had no instrumentation whatsoever. */
@@ -790,7 +865,11 @@ export declare const TelemetryEventSchema: z.ZodObject<{
790
865
  projectIdSource: z.ZodOptional<z.ZodNativeEnum<{
791
866
  /** Hash of the shared git origin — the same on every clone, so cross-machine counting is valid. */
792
867
  readonly GIT_ORIGIN: "git_origin";
793
- /** Hash of the local directory path — unique per machine; NOT comparable across users. */
868
+ /** Hash of the repo ROOT path — machine-local, but the same for every directory inside the repo. */
869
+ readonly GIT_ROOT: "git_root";
870
+ /** Hash of the nearest package.json's directory — machine-local; used when there is no git at all. */
871
+ readonly PACKAGE_ROOT: "package_root";
872
+ /** Hash of the raw working directory — the last resort, and the only source that is NOT stable. */
794
873
  readonly CWD: "cwd";
795
874
  }>>;
796
875
  /** `process.platform` (darwin/linux/win32) — OS mix, low cardinality, non-identifying. */
@@ -967,6 +1046,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
967
1046
  browserCommands: z.ZodOptional<z.ZodNumber>;
968
1047
  peakConcurrentTools: z.ZodOptional<z.ZodNumber>;
969
1048
  unknownToolCalls: z.ZodOptional<z.ZodNumber>;
1049
+ unknownTools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
970
1050
  noSessionErrors: z.ZodOptional<z.ZodNumber>;
971
1051
  consecutiveRepeats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
972
1052
  abandonedActions: z.ZodOptional<z.ZodNumber>;
@@ -993,7 +1073,17 @@ export declare const TelemetryEventSchema: z.ZodObject<{
993
1073
  cpuCount: number;
994
1074
  }>>;
995
1075
  clients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1076
+ clientVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1077
+ surface: z.ZodOptional<z.ZodString>;
1078
+ appConnects: z.ZodOptional<z.ZodNumber>;
1079
+ msToFirstApp: z.ZodOptional<z.ZodNumber>;
1080
+ endReason: z.ZodOptional<z.ZodEnum<["never_used", "explored", "abandoned", "verified", "client_left"]>>;
1081
+ feedbackPrompted: z.ZodOptional<z.ZodNumber>;
1082
+ errorClasses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1083
+ errorsRecovered: z.ZodOptional<z.ZodNumber>;
1084
+ errorsRepeated: z.ZodOptional<z.ZodNumber>;
996
1085
  final: z.ZodBoolean;
1086
+ exit: z.ZodOptional<z.ZodEnum<["idle", "signal", "unknown"]>>;
997
1087
  }, "strip", z.ZodTypeAny, {
998
1088
  durationMs: number;
999
1089
  toolCalls: number;
@@ -1001,6 +1091,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1001
1091
  toolErrors: number;
1002
1092
  verifications: number;
1003
1093
  final: boolean;
1094
+ surface?: string | undefined;
1004
1095
  errors?: {
1005
1096
  message: string;
1006
1097
  count: number;
@@ -1031,6 +1122,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1031
1122
  browserCommands?: number | undefined;
1032
1123
  peakConcurrentTools?: number | undefined;
1033
1124
  unknownToolCalls?: number | undefined;
1125
+ unknownTools?: Record<string, number> | undefined;
1034
1126
  noSessionErrors?: number | undefined;
1035
1127
  consecutiveRepeats?: Record<string, number> | undefined;
1036
1128
  abandonedActions?: number | undefined;
@@ -1043,6 +1135,15 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1043
1135
  cpuCount: number;
1044
1136
  } | undefined;
1045
1137
  clients?: string[] | undefined;
1138
+ clientVersions?: Record<string, string> | undefined;
1139
+ appConnects?: number | undefined;
1140
+ msToFirstApp?: number | undefined;
1141
+ endReason?: "never_used" | "explored" | "abandoned" | "verified" | "client_left" | undefined;
1142
+ feedbackPrompted?: number | undefined;
1143
+ errorClasses?: Record<string, number> | undefined;
1144
+ errorsRecovered?: number | undefined;
1145
+ errorsRepeated?: number | undefined;
1146
+ exit?: "signal" | "idle" | "unknown" | undefined;
1046
1147
  }, {
1047
1148
  durationMs: number;
1048
1149
  toolCalls: number;
@@ -1050,6 +1151,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1050
1151
  toolErrors: number;
1051
1152
  verifications: number;
1052
1153
  final: boolean;
1154
+ surface?: string | undefined;
1053
1155
  errors?: {
1054
1156
  message: string;
1055
1157
  count: number;
@@ -1080,6 +1182,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1080
1182
  browserCommands?: number | undefined;
1081
1183
  peakConcurrentTools?: number | undefined;
1082
1184
  unknownToolCalls?: number | undefined;
1185
+ unknownTools?: Record<string, number> | undefined;
1083
1186
  noSessionErrors?: number | undefined;
1084
1187
  consecutiveRepeats?: Record<string, number> | undefined;
1085
1188
  abandonedActions?: number | undefined;
@@ -1092,10 +1195,20 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1092
1195
  cpuCount: number;
1093
1196
  } | undefined;
1094
1197
  clients?: string[] | undefined;
1198
+ clientVersions?: Record<string, string> | undefined;
1199
+ appConnects?: number | undefined;
1200
+ msToFirstApp?: number | undefined;
1201
+ endReason?: "never_used" | "explored" | "abandoned" | "verified" | "client_left" | undefined;
1202
+ feedbackPrompted?: number | undefined;
1203
+ errorClasses?: Record<string, number> | undefined;
1204
+ errorsRecovered?: number | undefined;
1205
+ errorsRepeated?: number | undefined;
1206
+ exit?: "signal" | "idle" | "unknown" | undefined;
1095
1207
  }>>;
1096
1208
  /** Only on `project_profiled`: the shape and depth-of-use of the project. */
1097
1209
  project: z.ZodOptional<z.ZodObject<{
1098
1210
  stack: z.ZodOptional<z.ZodString>;
1211
+ stackSource: z.ZodOptional<z.ZodEnum<["cwd", "workspace"]>>;
1099
1212
  stackMajor: z.ZodOptional<z.ZodNumber>;
1100
1213
  size: z.ZodOptional<z.ZodNativeEnum<{
1101
1214
  readonly TINY: "tiny";
@@ -1140,6 +1253,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1140
1253
  featureDepth: number;
1141
1254
  stack?: string | undefined;
1142
1255
  stackMajor?: number | undefined;
1256
+ stackSource?: "cwd" | "workspace" | undefined;
1143
1257
  size?: "medium" | "tiny" | "small" | "large" | "huge" | undefined;
1144
1258
  monorepo?: boolean | undefined;
1145
1259
  forge?: "github" | "gitlab" | "bitbucket" | "azure" | "sourcehut" | "codeberg" | "self_hosted" | undefined;
@@ -1156,6 +1270,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1156
1270
  featureDepth: number;
1157
1271
  stack?: string | undefined;
1158
1272
  stackMajor?: number | undefined;
1273
+ stackSource?: "cwd" | "workspace" | undefined;
1159
1274
  size?: "medium" | "tiny" | "small" | "large" | "huge" | undefined;
1160
1275
  monorepo?: boolean | undefined;
1161
1276
  forge?: "github" | "gitlab" | "bitbucket" | "azure" | "sourcehut" | "codeberg" | "self_hosted" | undefined;
@@ -1220,6 +1335,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1220
1335
  */
1221
1336
  reason: z.ZodOptional<z.ZodNativeEnum<{
1222
1337
  readonly INCONCLUSIVE: "inconclusive";
1338
+ readonly OBSERVATION_LOST: "observation_lost";
1223
1339
  readonly ASSERTION_FAILED: "assertion_failed";
1224
1340
  readonly CONTRADICTED: "contradicted";
1225
1341
  readonly ALREADY_TRUE: "already_true";
@@ -1231,21 +1347,21 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1231
1347
  readonly PROVED: "proved";
1232
1348
  }>>;
1233
1349
  }, "strip", z.ZodTypeAny, {
1234
- via: string;
1235
1350
  verified: string;
1351
+ via: string;
1236
1352
  passed: boolean;
1237
1353
  falseGreenCaught: boolean;
1238
1354
  durationMs?: number | undefined;
1239
- reason?: "inconclusive" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
1355
+ reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
1240
1356
  brand?: "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | "other" | undefined;
1241
1357
  browser?: string | undefined;
1242
1358
  }, {
1243
- via: string;
1244
1359
  verified: string;
1360
+ via: string;
1245
1361
  passed: boolean;
1246
1362
  falseGreenCaught: boolean;
1247
1363
  durationMs?: number | undefined;
1248
- reason?: "inconclusive" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
1364
+ reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
1249
1365
  brand?: "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | "other" | undefined;
1250
1366
  browser?: string | undefined;
1251
1367
  }>>;
@@ -1339,11 +1455,40 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1339
1455
  load1x100: number;
1340
1456
  cpuCount: number;
1341
1457
  }>>;
1458
+ /**
1459
+ * The failing SYSCALL — `connect`, `write`, `open`. Already inside `message`; structured here so
1460
+ * it can be grouped on rather than parsed back out of prose.
1461
+ */
1462
+ syscall: z.ZodOptional<z.ZodString>;
1463
+ /**
1464
+ * The symbolic errno — `ECONNREFUSED`, `EPIPE`. The name, never the platform-specific number.
1465
+ */
1466
+ errno: z.ZodOptional<z.ZodString>;
1467
+ /**
1468
+ * Was the target the machine it was running on?
1469
+ *
1470
+ * One bit, and it splits two populations that currently look identical and have different owners:
1471
+ * refused ON loopback is a Reticle-lifecycle problem (no daemon), refused off-box is a network
1472
+ * problem that is not ours.
1473
+ */
1474
+ loopback: z.ZodOptional<z.ZodBoolean>;
1475
+ /** Whether the port was one of ours, as an enum. The number itself is never sent. */
1476
+ port: z.ZodOptional<z.ZodEnum<["reticle", "other"]>>;
1477
+ /**
1478
+ * The innermost frame naming NODE's own source — `node:net:1637`.
1479
+ *
1480
+ * Only present when the crash is a system error AND no Reticle frame survived, which is exactly
1481
+ * the report that otherwise arrives with no location at all. It is a line in Node's published
1482
+ * source: it says a connect failed rather than a DNS lookup, and carries nothing about the
1483
+ * machine, the app, or anyone's directory layout.
1484
+ */
1485
+ internalFrame: z.ZodOptional<z.ZodString>;
1342
1486
  }, "strip", z.ZodTypeAny, {
1343
1487
  kind: string;
1344
1488
  message?: string | undefined;
1345
1489
  errorType?: string | undefined;
1346
1490
  tool?: string | undefined;
1491
+ port?: "other" | "reticle" | undefined;
1347
1492
  fingerprint?: string | undefined;
1348
1493
  machine?: {
1349
1494
  rssMb: number;
@@ -1357,11 +1502,16 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1357
1502
  breadcrumb?: string[] | undefined;
1358
1503
  nodeVersion?: string | undefined;
1359
1504
  arch?: string | undefined;
1505
+ syscall?: string | undefined;
1506
+ errno?: string | undefined;
1507
+ loopback?: boolean | undefined;
1508
+ internalFrame?: string | undefined;
1360
1509
  }, {
1361
1510
  kind: string;
1362
1511
  message?: string | undefined;
1363
1512
  errorType?: string | undefined;
1364
1513
  tool?: string | undefined;
1514
+ port?: "other" | "reticle" | undefined;
1365
1515
  fingerprint?: string | undefined;
1366
1516
  machine?: {
1367
1517
  rssMb: number;
@@ -1375,6 +1525,10 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1375
1525
  breadcrumb?: string[] | undefined;
1376
1526
  nodeVersion?: string | undefined;
1377
1527
  arch?: string | undefined;
1528
+ syscall?: string | undefined;
1529
+ errno?: string | undefined;
1530
+ loopback?: boolean | undefined;
1531
+ internalFrame?: string | undefined;
1378
1532
  }>>;
1379
1533
  /** Only on `identified` — self-declared, opt-in, and the only personal data ever sent. */
1380
1534
  identity: z.ZodOptional<z.ZodObject<{
@@ -1498,14 +1652,14 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1498
1652
  source: "replay" | "contradiction" | "crawl" | "assertion";
1499
1653
  falseGreen: boolean;
1500
1654
  repeat: boolean;
1501
- attribution?: "app" | "request" | "reticle" | undefined;
1655
+ attribution?: "app" | "reticle" | "request" | undefined;
1502
1656
  tool?: string | undefined;
1503
1657
  }, {
1504
1658
  kind: string;
1505
1659
  source: "replay" | "contradiction" | "crawl" | "assertion";
1506
1660
  falseGreen: boolean;
1507
1661
  repeat: boolean;
1508
- attribution?: "app" | "request" | "reticle" | undefined;
1662
+ attribution?: "app" | "reticle" | "request" | undefined;
1509
1663
  tool?: string | undefined;
1510
1664
  }>>;
1511
1665
  /** Only on `mcp_connection_lost`: which stage of the outage, why, and after how many retries. */
@@ -1530,14 +1684,28 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1530
1684
  }>;
1531
1685
  /** Consecutive reconnects tried when this was reported. `first` is near 1; a spent budget is high. */
1532
1686
  attempts: z.ZodNumber;
1687
+ /**
1688
+ * In-flight tool calls this drop actually killed — the only part an agent can FEEL.
1689
+ *
1690
+ * Without it every drop looks equally bad. Measured 2026-08-10/11: **320 of 321 outages were
1691
+ * `stage: first` with `attempts: 1`** — the stream ended once and the proxy reconnected, which for
1692
+ * an agent with nothing in flight is invisible. Reading that 321 as "the agent lost its tools 321
1693
+ * times" overstates the problem by roughly the whole number, and buries the one drop that mattered.
1694
+ *
1695
+ * Zero means nobody noticed. Non-zero is the number of calls that came back `-32001` and the count
1696
+ * worth driving down.
1697
+ */
1698
+ pendingLost: z.ZodOptional<z.ZodNumber>;
1533
1699
  }, "strip", z.ZodTypeAny, {
1534
1700
  reason: "other" | "sse_ended" | "sse_error" | "sse_aborted" | "sse_closed" | "connect_error";
1535
1701
  attempts: number;
1536
1702
  stage: "first" | "budget_spent";
1703
+ pendingLost?: number | undefined;
1537
1704
  }, {
1538
1705
  reason: "other" | "sse_ended" | "sse_error" | "sse_aborted" | "sse_closed" | "connect_error";
1539
1706
  attempts: number;
1540
1707
  stage: "first" | "budget_spent";
1708
+ pendingLost?: number | undefined;
1541
1709
  }>>;
1542
1710
  }, "strip", z.ZodTypeAny, {
1543
1711
  event: "reticle_installed" | "cli_command_run" | "daemon_started" | "daemon_stopped" | "session_progress" | "verification_completed" | "project_profiled" | "version_changed" | "runtime_crashed" | "feedback_submitted" | "identified" | "mcp_client_connected" | "mcp_connection_lost" | "init_completed" | "bug_found";
@@ -1555,7 +1723,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1555
1723
  source: "replay" | "contradiction" | "crawl" | "assertion";
1556
1724
  falseGreen: boolean;
1557
1725
  repeat: boolean;
1558
- attribution?: "app" | "request" | "reticle" | undefined;
1726
+ attribution?: "app" | "reticle" | "request" | undefined;
1559
1727
  tool?: string | undefined;
1560
1728
  } | undefined;
1561
1729
  project?: {
@@ -1570,6 +1738,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1570
1738
  featureDepth: number;
1571
1739
  stack?: string | undefined;
1572
1740
  stackMajor?: number | undefined;
1741
+ stackSource?: "cwd" | "workspace" | undefined;
1573
1742
  size?: "medium" | "tiny" | "small" | "large" | "huge" | undefined;
1574
1743
  monorepo?: boolean | undefined;
1575
1744
  forge?: "github" | "gitlab" | "bitbucket" | "azure" | "sourcehut" | "codeberg" | "self_hosted" | undefined;
@@ -1582,6 +1751,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1582
1751
  toolErrors: number;
1583
1752
  verifications: number;
1584
1753
  final: boolean;
1754
+ surface?: string | undefined;
1585
1755
  errors?: {
1586
1756
  message: string;
1587
1757
  count: number;
@@ -1612,6 +1782,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1612
1782
  browserCommands?: number | undefined;
1613
1783
  peakConcurrentTools?: number | undefined;
1614
1784
  unknownToolCalls?: number | undefined;
1785
+ unknownTools?: Record<string, number> | undefined;
1615
1786
  noSessionErrors?: number | undefined;
1616
1787
  consecutiveRepeats?: Record<string, number> | undefined;
1617
1788
  abandonedActions?: number | undefined;
@@ -1624,8 +1795,17 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1624
1795
  cpuCount: number;
1625
1796
  } | undefined;
1626
1797
  clients?: string[] | undefined;
1798
+ clientVersions?: Record<string, string> | undefined;
1799
+ appConnects?: number | undefined;
1800
+ msToFirstApp?: number | undefined;
1801
+ endReason?: "never_used" | "explored" | "abandoned" | "verified" | "client_left" | undefined;
1802
+ feedbackPrompted?: number | undefined;
1803
+ errorClasses?: Record<string, number> | undefined;
1804
+ errorsRecovered?: number | undefined;
1805
+ errorsRepeated?: number | undefined;
1806
+ exit?: "signal" | "idle" | "unknown" | undefined;
1627
1807
  } | undefined;
1628
- projectIdSource?: "cwd" | "git_origin" | undefined;
1808
+ projectIdSource?: "cwd" | "git_origin" | "git_root" | "package_root" | undefined;
1629
1809
  tzOffsetMin?: number | undefined;
1630
1810
  feedback?: {
1631
1811
  text: string;
@@ -1649,12 +1829,12 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1649
1829
  actor?: "agent" | "human" | undefined;
1650
1830
  flags?: string[] | undefined;
1651
1831
  verification?: {
1652
- via: string;
1653
1832
  verified: string;
1833
+ via: string;
1654
1834
  passed: boolean;
1655
1835
  falseGreenCaught: boolean;
1656
1836
  durationMs?: number | undefined;
1657
- reason?: "inconclusive" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
1837
+ reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
1658
1838
  brand?: "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | "other" | undefined;
1659
1839
  browser?: string | undefined;
1660
1840
  } | undefined;
@@ -1669,6 +1849,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1669
1849
  message?: string | undefined;
1670
1850
  errorType?: string | undefined;
1671
1851
  tool?: string | undefined;
1852
+ port?: "other" | "reticle" | undefined;
1672
1853
  fingerprint?: string | undefined;
1673
1854
  machine?: {
1674
1855
  rssMb: number;
@@ -1682,6 +1863,10 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1682
1863
  breadcrumb?: string[] | undefined;
1683
1864
  nodeVersion?: string | undefined;
1684
1865
  arch?: string | undefined;
1866
+ syscall?: string | undefined;
1867
+ errno?: string | undefined;
1868
+ loopback?: boolean | undefined;
1869
+ internalFrame?: string | undefined;
1685
1870
  } | undefined;
1686
1871
  identity?: {
1687
1872
  context: "company" | "side_project" | "open_source" | "learning";
@@ -1703,6 +1888,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1703
1888
  reason: "other" | "sse_ended" | "sse_error" | "sse_aborted" | "sse_closed" | "connect_error";
1704
1889
  attempts: number;
1705
1890
  stage: "first" | "budget_spent";
1891
+ pendingLost?: number | undefined;
1706
1892
  } | undefined;
1707
1893
  }, {
1708
1894
  event: "reticle_installed" | "cli_command_run" | "daemon_started" | "daemon_stopped" | "session_progress" | "verification_completed" | "project_profiled" | "version_changed" | "runtime_crashed" | "feedback_submitted" | "identified" | "mcp_client_connected" | "mcp_connection_lost" | "init_completed" | "bug_found";
@@ -1720,7 +1906,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1720
1906
  source: "replay" | "contradiction" | "crawl" | "assertion";
1721
1907
  falseGreen: boolean;
1722
1908
  repeat: boolean;
1723
- attribution?: "app" | "request" | "reticle" | undefined;
1909
+ attribution?: "app" | "reticle" | "request" | undefined;
1724
1910
  tool?: string | undefined;
1725
1911
  } | undefined;
1726
1912
  project?: {
@@ -1735,6 +1921,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1735
1921
  featureDepth: number;
1736
1922
  stack?: string | undefined;
1737
1923
  stackMajor?: number | undefined;
1924
+ stackSource?: "cwd" | "workspace" | undefined;
1738
1925
  size?: "medium" | "tiny" | "small" | "large" | "huge" | undefined;
1739
1926
  monorepo?: boolean | undefined;
1740
1927
  forge?: "github" | "gitlab" | "bitbucket" | "azure" | "sourcehut" | "codeberg" | "self_hosted" | undefined;
@@ -1747,6 +1934,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1747
1934
  toolErrors: number;
1748
1935
  verifications: number;
1749
1936
  final: boolean;
1937
+ surface?: string | undefined;
1750
1938
  errors?: {
1751
1939
  message: string;
1752
1940
  count: number;
@@ -1777,6 +1965,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1777
1965
  browserCommands?: number | undefined;
1778
1966
  peakConcurrentTools?: number | undefined;
1779
1967
  unknownToolCalls?: number | undefined;
1968
+ unknownTools?: Record<string, number> | undefined;
1780
1969
  noSessionErrors?: number | undefined;
1781
1970
  consecutiveRepeats?: Record<string, number> | undefined;
1782
1971
  abandonedActions?: number | undefined;
@@ -1789,8 +1978,17 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1789
1978
  cpuCount: number;
1790
1979
  } | undefined;
1791
1980
  clients?: string[] | undefined;
1981
+ clientVersions?: Record<string, string> | undefined;
1982
+ appConnects?: number | undefined;
1983
+ msToFirstApp?: number | undefined;
1984
+ endReason?: "never_used" | "explored" | "abandoned" | "verified" | "client_left" | undefined;
1985
+ feedbackPrompted?: number | undefined;
1986
+ errorClasses?: Record<string, number> | undefined;
1987
+ errorsRecovered?: number | undefined;
1988
+ errorsRepeated?: number | undefined;
1989
+ exit?: "signal" | "idle" | "unknown" | undefined;
1792
1990
  } | undefined;
1793
- projectIdSource?: "cwd" | "git_origin" | undefined;
1991
+ projectIdSource?: "cwd" | "git_origin" | "git_root" | "package_root" | undefined;
1794
1992
  tzOffsetMin?: number | undefined;
1795
1993
  feedback?: {
1796
1994
  text: string;
@@ -1814,12 +2012,12 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1814
2012
  actor?: "agent" | "human" | undefined;
1815
2013
  flags?: string[] | undefined;
1816
2014
  verification?: {
1817
- via: string;
1818
2015
  verified: string;
2016
+ via: string;
1819
2017
  passed: boolean;
1820
2018
  falseGreenCaught: boolean;
1821
2019
  durationMs?: number | undefined;
1822
- reason?: "inconclusive" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
2020
+ reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
1823
2021
  brand?: "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | "other" | undefined;
1824
2022
  browser?: string | undefined;
1825
2023
  } | undefined;
@@ -1834,6 +2032,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1834
2032
  message?: string | undefined;
1835
2033
  errorType?: string | undefined;
1836
2034
  tool?: string | undefined;
2035
+ port?: "other" | "reticle" | undefined;
1837
2036
  fingerprint?: string | undefined;
1838
2037
  machine?: {
1839
2038
  rssMb: number;
@@ -1847,6 +2046,10 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1847
2046
  breadcrumb?: string[] | undefined;
1848
2047
  nodeVersion?: string | undefined;
1849
2048
  arch?: string | undefined;
2049
+ syscall?: string | undefined;
2050
+ errno?: string | undefined;
2051
+ loopback?: boolean | undefined;
2052
+ internalFrame?: string | undefined;
1850
2053
  } | undefined;
1851
2054
  identity?: {
1852
2055
  context: "company" | "side_project" | "open_source" | "learning";
@@ -1868,6 +2071,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1868
2071
  reason: "other" | "sse_ended" | "sse_error" | "sse_aborted" | "sse_closed" | "connect_error";
1869
2072
  attempts: number;
1870
2073
  stage: "first" | "budget_spent";
2074
+ pendingLost?: number | undefined;
1871
2075
  } | undefined;
1872
2076
  }>;
1873
2077
  export type TelemetryEvent = z.infer<typeof TelemetryEventSchema>;
package/dist/telemetry.js CHANGED
@@ -186,14 +186,24 @@ export const TelemetryActor = {
186
186
  * What `projectId` was derived from — and therefore whether it is comparable ACROSS machines.
187
187
  *
188
188
  * This is the field that keeps "how many users share this project" from silently lying. A
189
- * cwd-derived id is unique per machine, so those rows always show exactly one user per project. Left
189
+ * path-derived id is unique per machine, so those rows always show exactly one user per project. Left
190
190
  * unlabelled they would drag the average toward 1 and hide real team adoption; labelled, the
191
191
  * analytics can restrict that question to `git_origin` rows, where it is a real measurement.
192
+ *
193
+ * The three non-origin sources are ordered by how stable they are WITHIN one machine, which is the
194
+ * property the funnel actually needs: `init` runs in the app directory and the daemon is spawned from
195
+ * wherever the agent's client happens to sit, so an id that changes with the working directory
196
+ * severs the two halves of the funnel. Only `cwd` has that defect, and it is now the last resort
197
+ * rather than the first fallback — measured 2026-08-11 at 1131 ids for 243 users.
192
198
  */
193
199
  export const ProjectIdSource = {
194
200
  /** Hash of the shared git origin — the same on every clone, so cross-machine counting is valid. */
195
201
  GIT_ORIGIN: 'git_origin',
196
- /** Hash of the local directory path — unique per machine; NOT comparable across users. */
202
+ /** Hash of the repo ROOT path — machine-local, but the same for every directory inside the repo. */
203
+ GIT_ROOT: 'git_root',
204
+ /** Hash of the nearest package.json's directory — machine-local; used when there is no git at all. */
205
+ PACKAGE_ROOT: 'package_root',
206
+ /** Hash of the raw working directory — the last resort, and the only source that is NOT stable. */
197
207
  CWD: 'cwd',
198
208
  };
199
209
  /**
@@ -283,6 +293,17 @@ export const VersionChangeSchema = z.object({
283
293
  * give the hash a meaning, while keeping the line that matters: our code and our failure, never the
284
294
  * user's code and never their data.
285
295
  */
296
+ /**
297
+ * Whether a failed connection was aimed at a port Reticle itself uses.
298
+ *
299
+ * An enum rather than the number, because the number is the reporter's and the answer is ours: all
300
+ * anyone needs to know is whose problem it is. Refused on a Reticle port is a lifecycle problem —
301
+ * a daemon that is not up; refused anywhere else is somebody else's service.
302
+ */
303
+ export const CrashPort = {
304
+ RETICLE: 'reticle',
305
+ OTHER: 'other',
306
+ };
286
307
  export const CrashSchema = z.object({
287
308
  /** `uncaught_exception` | `unhandled_rejection`. */
288
309
  kind: z.string().min(1).max(32),
@@ -325,6 +346,34 @@ export const CrashSchema = z.object({
325
346
  * trace and are completely different problems; this is what tells them apart.
326
347
  */
327
348
  machine: MachineSnapshotSchema.optional(),
349
+ /**
350
+ * The failing SYSCALL — `connect`, `write`, `open`. Already inside `message`; structured here so
351
+ * it can be grouped on rather than parsed back out of prose.
352
+ */
353
+ syscall: z.string().max(32).optional(),
354
+ /**
355
+ * The symbolic errno — `ECONNREFUSED`, `EPIPE`. The name, never the platform-specific number.
356
+ */
357
+ errno: z.string().max(32).optional(),
358
+ /**
359
+ * Was the target the machine it was running on?
360
+ *
361
+ * One bit, and it splits two populations that currently look identical and have different owners:
362
+ * refused ON loopback is a Reticle-lifecycle problem (no daemon), refused off-box is a network
363
+ * problem that is not ours.
364
+ */
365
+ loopback: z.boolean().optional(),
366
+ /** Whether the port was one of ours, as an enum. The number itself is never sent. */
367
+ port: z.enum([CrashPort.RETICLE, CrashPort.OTHER]).optional(),
368
+ /**
369
+ * The innermost frame naming NODE's own source — `node:net:1637`.
370
+ *
371
+ * Only present when the crash is a system error AND no Reticle frame survived, which is exactly
372
+ * the report that otherwise arrives with no location at all. It is a line in Node's published
373
+ * source: it says a connect failed rather than a DNS lookup, and carries nothing about the
374
+ * machine, the app, or anyone's directory layout.
375
+ */
376
+ internalFrame: z.string().max(64).optional(),
328
377
  });
329
378
  /**
330
379
  * How Reticle came to find a defect. Four routes, in descending order of "a human would have missed
@@ -467,6 +516,18 @@ export const McpOutageSchema = z.object({
467
516
  reason: z.nativeEnum(OutageReason),
468
517
  /** Consecutive reconnects tried when this was reported. `first` is near 1; a spent budget is high. */
469
518
  attempts: z.number().int().nonnegative(),
519
+ /**
520
+ * In-flight tool calls this drop actually killed — the only part an agent can FEEL.
521
+ *
522
+ * Without it every drop looks equally bad. Measured 2026-08-10/11: **320 of 321 outages were
523
+ * `stage: first` with `attempts: 1`** — the stream ended once and the proxy reconnected, which for
524
+ * an agent with nothing in flight is invisible. Reading that 321 as "the agent lost its tools 321
525
+ * times" overstates the problem by roughly the whole number, and buries the one drop that mattered.
526
+ *
527
+ * Zero means nobody noticed. Non-zero is the number of calls that came back `-32001` and the count
528
+ * worth driving down.
529
+ */
530
+ pendingLost: z.number().int().nonnegative().optional(),
470
531
  });
471
532
  /** How `reticle init` went. The onboarding funnel, which had no instrumentation whatsoever. */
472
533
  export const InitOutcomeSchema = z.object({
@@ -24,7 +24,7 @@ export type Verified = (typeof Verified)[keyof typeof Verified];
24
24
  /**
25
25
  * WHY a verdict came out the way it did — the deciding clause of the rule, named.
26
26
  *
27
- * `Verified` has three values and the rule has ten clauses, so the wire collapsed opposite facts
27
+ * `Verified` has three values and the rule has eleven clauses, so the wire collapsed opposite facts
28
28
  * into one string. Measured over a real session: `unknown` covered "the agent malformed the call",
29
29
  * "the app answered 202 and has not finished", and "Reticle could not see the capture" — three
30
30
  * owners needing three opposite responses, one bar on a dashboard. `no` was no better: "channels
@@ -38,6 +38,22 @@ export type Verified = (typeof Verified)[keyof typeof Verified];
38
38
  export declare const VerifiedReason: {
39
39
  /** The assertion was never EVALUATED — under-specified call, or nothing instrumented to read. */
40
40
  readonly INCONCLUSIVE: "inconclusive";
41
+ /**
42
+ * The tab went away mid-wait, so the action's outcome was never observed. NOT a failure.
43
+ *
44
+ * This existed as a fact and had nowhere to go. `waitForPredicate` finishes a disconnected wait
45
+ * with `{ pass: false, failureReason: 'session disconnected' }`, and the only clause that took a
46
+ * false `pass` said ASSERTION_FAILED — so a reload during a wait produced, verbatim:
47
+ *
48
+ * verified: "no", verifiedReason: "assertion_failed",
49
+ * because: "the declared consequence did not hold", source: "src/components/Counter.tsx:18"
50
+ *
51
+ * The app was fine; the observer left. An agent reading that goes and edits Counter.tsx. Every
52
+ * other clause in this rule is tuned to avoid claiming more than was observed, and the absence of
53
+ * this member made the nearest available answer a false claim in the opposite direction — a false
54
+ * RED, from the layer whose entire job is not to produce one.
55
+ */
56
+ readonly OBSERVATION_LOST: "observation_lost";
41
57
  /** The declared consequence did not hold. */
42
58
  readonly ASSERTION_FAILED: "assertion_failed";
43
59
  /** Channels disagreed about the action — the false green this product exists to catch. */
@@ -23,7 +23,7 @@ export const Verified = {
23
23
  /**
24
24
  * WHY a verdict came out the way it did — the deciding clause of the rule, named.
25
25
  *
26
- * `Verified` has three values and the rule has ten clauses, so the wire collapsed opposite facts
26
+ * `Verified` has three values and the rule has eleven clauses, so the wire collapsed opposite facts
27
27
  * into one string. Measured over a real session: `unknown` covered "the agent malformed the call",
28
28
  * "the app answered 202 and has not finished", and "Reticle could not see the capture" — three
29
29
  * owners needing three opposite responses, one bar on a dashboard. `no` was no better: "channels
@@ -37,6 +37,22 @@ export const Verified = {
37
37
  export const VerifiedReason = {
38
38
  /** The assertion was never EVALUATED — under-specified call, or nothing instrumented to read. */
39
39
  INCONCLUSIVE: 'inconclusive',
40
+ /**
41
+ * The tab went away mid-wait, so the action's outcome was never observed. NOT a failure.
42
+ *
43
+ * This existed as a fact and had nowhere to go. `waitForPredicate` finishes a disconnected wait
44
+ * with `{ pass: false, failureReason: 'session disconnected' }`, and the only clause that took a
45
+ * false `pass` said ASSERTION_FAILED — so a reload during a wait produced, verbatim:
46
+ *
47
+ * verified: "no", verifiedReason: "assertion_failed",
48
+ * because: "the declared consequence did not hold", source: "src/components/Counter.tsx:18"
49
+ *
50
+ * The app was fine; the observer left. An agent reading that goes and edits Counter.tsx. Every
51
+ * other clause in this rule is tuned to avoid claiming more than was observed, and the absence of
52
+ * this member made the nearest available answer a false claim in the opposite direction — a false
53
+ * RED, from the layer whose entire job is not to produce one.
54
+ */
55
+ OBSERVATION_LOST: 'observation_lost',
40
56
  /** The declared consequence did not hold. */
41
57
  ASSERTION_FAILED: 'assertion_failed',
42
58
  /** Channels disagreed about the action — the false green this product exists to catch. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/core",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "The Reticle foundation: the shared wire contract — types, zod schemas, constants, messages, and the isomorphic kernel that every Reticle package (browser SDK, server, kits, test harness) imports. Depends only on zod.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",