@reticlehq/core 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -110,6 +110,37 @@ export declare const ContradictionKind: {
110
110
  readonly ROUTE_RENDERED_NOTHING: "route-rendered-nothing";
111
111
  };
112
112
  export type ContradictionKind = (typeof ContradictionKind)[keyof typeof ContradictionKind];
113
+ /**
114
+ * Contradictions inferred from the ABSENCE of evidence in a window whose end Reticle itself chose.
115
+ *
116
+ * The distinction is not cosmetic — it decides whether Reticle is entitled to say an action FAILED.
117
+ * The other kinds are things we positively observed: a request came back 500 while the UI advanced,
118
+ * a signal fired carrying data that disagrees with the DOM, a written field echoed a different
119
+ * value. Those are evidence AGAINST the action, and they must keep outranking a passing assertion,
120
+ * because a green assertion sitting on top of a failed write is the entire bug class this product
121
+ * exists to catch.
122
+ *
123
+ * These five are different. Each says "the thing I expected to see had not happened YET when I
124
+ * stopped looking" — and the window closes the moment the predicate first passes, which on an app
125
+ * that navigates optimistically is routinely before the network drains. Reproduced on the bench app:
126
+ * `auth:granted` fired WITH matching data, application state changed, the token was stored, capture
127
+ * integrity was clean and the honesty grade was `signal` — our strongest evidence class — and the
128
+ * verdict was still `no`, because one POST had not settled. A timing observation overruled a
129
+ * consequence observation, which inverts the grade hierarchy the verifier is built on.
130
+ *
131
+ * A false negative is not the mirror of a false positive here. A false positive stops an agent
132
+ * early; a false NEGATIVE makes it redo work that already succeeded, or stop trusting the verdict
133
+ * channel — and the verdict channel is the product. `bug.attribution` was deleted for exactly this
134
+ * reason: every `attribution: 'app'` on `request-never-settled` turned out to be a misattribution.
135
+ * We removed the field and left the verdict.
136
+ *
137
+ * So these downgrade a verdict to UNKNOWN rather than asserting NO. The finding is still reported in
138
+ * `contradictions` either way — nothing is hidden, and an agent that wants to wait and re-check has
139
+ * everything it needs to.
140
+ */
141
+ export declare const ABSENCE_DERIVED_CONTRADICTIONS: ReadonlySet<ContradictionKind>;
142
+ /** True when this kind was inferred from absence rather than positively observed. */
143
+ export declare function isAbsenceDerived(kind: string): boolean;
113
144
  /**
114
145
  * HTTP methods that CHANGE server state. Several contradiction rules are restricted to these on
115
146
  * purpose: a GET that fires without moving the UI is a prefetch, but a POST that does is a lost
package/dist/findings.js CHANGED
@@ -109,6 +109,45 @@ export const ContradictionKind = {
109
109
  */
110
110
  ROUTE_RENDERED_NOTHING: 'route-rendered-nothing',
111
111
  };
112
+ /**
113
+ * Contradictions inferred from the ABSENCE of evidence in a window whose end Reticle itself chose.
114
+ *
115
+ * The distinction is not cosmetic — it decides whether Reticle is entitled to say an action FAILED.
116
+ * The other kinds are things we positively observed: a request came back 500 while the UI advanced,
117
+ * a signal fired carrying data that disagrees with the DOM, a written field echoed a different
118
+ * value. Those are evidence AGAINST the action, and they must keep outranking a passing assertion,
119
+ * because a green assertion sitting on top of a failed write is the entire bug class this product
120
+ * exists to catch.
121
+ *
122
+ * These five are different. Each says "the thing I expected to see had not happened YET when I
123
+ * stopped looking" — and the window closes the moment the predicate first passes, which on an app
124
+ * that navigates optimistically is routinely before the network drains. Reproduced on the bench app:
125
+ * `auth:granted` fired WITH matching data, application state changed, the token was stored, capture
126
+ * integrity was clean and the honesty grade was `signal` — our strongest evidence class — and the
127
+ * verdict was still `no`, because one POST had not settled. A timing observation overruled a
128
+ * consequence observation, which inverts the grade hierarchy the verifier is built on.
129
+ *
130
+ * A false negative is not the mirror of a false positive here. A false positive stops an agent
131
+ * early; a false NEGATIVE makes it redo work that already succeeded, or stop trusting the verdict
132
+ * channel — and the verdict channel is the product. `bug.attribution` was deleted for exactly this
133
+ * reason: every `attribution: 'app'` on `request-never-settled` turned out to be a misattribution.
134
+ * We removed the field and left the verdict.
135
+ *
136
+ * So these downgrade a verdict to UNKNOWN rather than asserting NO. The finding is still reported in
137
+ * `contradictions` either way — nothing is hidden, and an agent that wants to wait and re-check has
138
+ * everything it needs to.
139
+ */
140
+ export const ABSENCE_DERIVED_CONTRADICTIONS = new Set([
141
+ ContradictionKind.REQUEST_NEVER_SETTLED,
142
+ ContradictionKind.RESPONSE_IGNORED,
143
+ ContradictionKind.ROUTE_RENDERED_NOTHING,
144
+ ContradictionKind.ACTION_HAD_NO_EFFECT,
145
+ ContradictionKind.DUPLICATE_REQUEST,
146
+ ]);
147
+ /** True when this kind was inferred from absence rather than positively observed. */
148
+ export function isAbsenceDerived(kind) {
149
+ return ABSENCE_DERIVED_CONTRADICTIONS.has(kind);
150
+ }
112
151
  /**
113
152
  * HTTP methods that CHANGE server state. Several contradiction rules are restricted to these on
114
153
  * purpose: a GET that fires without moving the UI is a prefetch, but a POST that does is a lost
@@ -374,7 +374,7 @@ export declare const SessionSummarySchema: z.ZodObject<{
374
374
  * Zero here is the single most diagnostic number in the payload: the daemon ran and no app ever
375
375
  * connected, which is a BROKEN INSTALL. Non-zero with no tool calls is the opposite problem — the
376
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
377
+ * they have opposite fixes. In the field most users who attached an agent never
378
378
  * drove, and we could not say which case any of them was.
379
379
  *
380
380
  * A counter rather than an event because the SDK reconnects on every page reload — an event per
@@ -394,7 +394,7 @@ export declare const SessionSummarySchema: z.ZodObject<{
394
394
  * Distinct from `exit`, which says why the PROCESS ended. A daemon can exit tidily on idle while
395
395
  * the agent's work was abandoned mid-task, and those are different findings.
396
396
  *
397
- * Measured 2026-08-10/11: 20 of the 28 agents that drove an app produced no verdict, and nothing
397
+ * In the field most agents that drove an app produced no verdict, and nothing
398
398
  * could say whether that was a product failure or a task that simply ended.
399
399
  *
400
400
  * Most of this is derivable at query time from `toolCalls` / `verifications` /
@@ -435,8 +435,8 @@ export declare const SessionSummarySchema: z.ZodObject<{
435
435
  /**
436
436
  * WHY the daemon exited. Absent on a periodic flush (`final: false`) — nothing exited.
437
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
438
+ * Without this, a designed exit and a real failure are the same row. In the field the large
439
+ * majority of `mcp_connection_lost` events were `sse_ended` — the stream the daemon closes on its own
440
440
  * scheduled idle shutdown — so the metric meant to say "the agent lost its tools" was mostly
441
441
  * counting the daemon going to sleep as designed, and a genuine outage was invisible inside it.
442
442
  *
@@ -598,8 +598,8 @@ export declare const ProjectProfileSchema: z.ZodObject<{
598
598
  * help, which is the question that decides whether an agent-correction surface is worth building
599
599
  * at all.
600
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
601
+ * Before discovery existed here, stack was detected on **none of the projects where Reticle was
602
+ * demonstrably set up**, and none of the large ones either. A detector
603
603
  * that reads one directory reports nothing precisely where the real repos are.
604
604
  */
605
605
  stackSource: z.ZodOptional<z.ZodEnum<["cwd", "workspace"]>>;
@@ -243,7 +243,7 @@ export const SessionSummarySchema = z.object({
243
243
  * Zero here is the single most diagnostic number in the payload: the daemon ran and no app ever
244
244
  * connected, which is a BROKEN INSTALL. Non-zero with no tool calls is the opposite problem — the
245
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
246
+ * they have opposite fixes. In the field most users who attached an agent never
247
247
  * drove, and we could not say which case any of them was.
248
248
  *
249
249
  * A counter rather than an event because the SDK reconnects on every page reload — an event per
@@ -263,7 +263,7 @@ export const SessionSummarySchema = z.object({
263
263
  * Distinct from `exit`, which says why the PROCESS ended. A daemon can exit tidily on idle while
264
264
  * the agent's work was abandoned mid-task, and those are different findings.
265
265
  *
266
- * Measured 2026-08-10/11: 20 of the 28 agents that drove an app produced no verdict, and nothing
266
+ * In the field most agents that drove an app produced no verdict, and nothing
267
267
  * could say whether that was a product failure or a task that simply ended.
268
268
  *
269
269
  * Most of this is derivable at query time from `toolCalls` / `verifications` /
@@ -304,8 +304,8 @@ export const SessionSummarySchema = z.object({
304
304
  /**
305
305
  * WHY the daemon exited. Absent on a periodic flush (`final: false`) — nothing exited.
306
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
307
+ * Without this, a designed exit and a real failure are the same row. In the field the large
308
+ * majority of `mcp_connection_lost` events were `sse_ended` — the stream the daemon closes on its own
309
309
  * scheduled idle shutdown — so the metric meant to say "the agent lost its tools" was mostly
310
310
  * counting the daemon going to sleep as designed, and a genuine outage was invisible inside it.
311
311
  *
@@ -345,8 +345,8 @@ export const ProjectProfileSchema = z.object({
345
345
  * help, which is the question that decides whether an agent-correction surface is worth building
346
346
  * at all.
347
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
348
+ * Before discovery existed here, stack was detected on **none of the projects where Reticle was
349
+ * demonstrably set up**, and none of the large ones either. A detector
350
350
  * that reads one directory reports nothing precisely where the real repos are.
351
351
  */
352
352
  stackSource: z.enum(['cwd', 'workspace']).optional(),
@@ -104,6 +104,26 @@ export declare const TelemetryEventKind: {
104
104
  * identical to healthy usage in every other metric.
105
105
  */
106
106
  readonly MCP_CLIENT_CONNECTED: "mcp_client_connected";
107
+ /**
108
+ * An app carrying the SDK connected to this daemon for the first time in its life.
109
+ *
110
+ * THE funnel step, and the one nothing could measure. Reticle's install has two halves — register
111
+ * the MCP server so the agent has the tools, and get the SDK into a running page so there is
112
+ * something for those tools to look at — and they are done at different times, by different
113
+ * commands, often in different directories. Almost everyone completes the first. The second is
114
+ * where the users go.
115
+ *
116
+ * Everything that existed before answered a different question. `daemon_started` and
117
+ * `mcp_client_connected` describe the agent half only. `session_appConnects` describes the app
118
+ * half but is a WINDOW counter: it resets on every flush, so a user whose app connected in one
119
+ * window reads zero in every other, and the population it under-counts is exactly the population
120
+ * being measured. A funnel built on it reported fewer instrumented users than there were users
121
+ * calling tools, which is impossible on its face and was the first sign the field was unusable.
122
+ *
123
+ * Fired ONCE per daemon run, on the first connect only — so `daemon_started` → `app_instrumented`
124
+ * is a real rate rather than an inference, and a reconnecting page cannot inflate it.
125
+ */
126
+ readonly APP_INSTRUMENTED: "app_instrumented";
107
127
  /**
108
128
  * The agent LOST its Reticle tools — the worst thing this product does to anyone, and until now
109
129
  * completely invisible in the field.
@@ -168,7 +188,7 @@ export type TelemetryActor = (typeof TelemetryActor)[keyof typeof TelemetryActor
168
188
  * property the funnel actually needs: `init` runs in the app directory and the daemon is spawned from
169
189
  * wherever the agent's client happens to sit, so an id that changes with the working directory
170
190
  * 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.
191
+ * rather than the first fallback — the field showed many ids minted for a single project.
172
192
  */
173
193
  export declare const ProjectIdSource: {
174
194
  /** Hash of the shared git origin — the same on every clone, so cross-machine counting is valid. */
@@ -265,6 +285,23 @@ export declare const VerificationSchema: z.ZodObject<{
265
285
  readonly UNSETTLED: "unsettled";
266
286
  readonly PROVED: "proved";
267
287
  }>>;
288
+ /**
289
+ * WHAT was lost, when `reason` is `unclean_capture` — see `CaptureLoss`.
290
+ *
291
+ * The three causes belong to three different owners and need three different fixes, and without
292
+ * this they are one bar. The one time we had to answer it the data could not, and the answer
293
+ * turned out to be that our own eviction counter was miscounting.
294
+ *
295
+ * ONE value, not a list: `losses` can hold several and a multi-value property is not something a
296
+ * dashboard can group by, so the FIRST is sent and the order in the producers is the order of
297
+ * ownership — ours before the page's. Absent on every verdict whose capture was clean.
298
+ */
299
+ uncleanLoss: z.ZodOptional<z.ZodNativeEnum<{
300
+ readonly BUFFER_LOSS: "buffer_loss";
301
+ readonly TRANSPORT_GAP: "transport_gap";
302
+ readonly BLIND_SPOT: "blind_spot";
303
+ readonly OTHER: "other";
304
+ }>>;
268
305
  }, "strip", z.ZodTypeAny, {
269
306
  verified: string;
270
307
  via: string;
@@ -272,8 +309,9 @@ export declare const VerificationSchema: z.ZodObject<{
272
309
  falseGreenCaught: boolean;
273
310
  durationMs?: number | undefined;
274
311
  reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
275
- brand?: "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | "other" | undefined;
312
+ brand?: "other" | "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | undefined;
276
313
  browser?: string | undefined;
314
+ uncleanLoss?: "buffer_loss" | "transport_gap" | "blind_spot" | "other" | undefined;
277
315
  }, {
278
316
  verified: string;
279
317
  via: string;
@@ -281,8 +319,9 @@ export declare const VerificationSchema: z.ZodObject<{
281
319
  falseGreenCaught: boolean;
282
320
  durationMs?: number | undefined;
283
321
  reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
284
- brand?: "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | "other" | undefined;
322
+ brand?: "other" | "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | undefined;
285
323
  browser?: string | undefined;
324
+ uncleanLoss?: "buffer_loss" | "transport_gap" | "blind_spot" | "other" | undefined;
286
325
  }>;
287
326
  export type Verification = z.infer<typeof VerificationSchema>;
288
327
  /** Which way the installed version moved, and between which versions. */
@@ -613,6 +652,31 @@ export declare const McpConnectionSchema: z.ZodObject<{
613
652
  client?: string | undefined;
614
653
  }>;
615
654
  export type McpConnection = z.infer<typeof McpConnectionSchema>;
655
+ /**
656
+ * `app_instrumented`: an app carrying the SDK reached this daemon for the first time.
657
+ *
658
+ * The install has two halves — the MCP server registered so the agent has the tools, and the SDK
659
+ * loaded by a running page so there is something to look at — and this is the only signal for the
660
+ * second. Deliberately carries NO stack and no framework: `project_profiled` already reports both
661
+ * for the same daemon run, and the two join on `sessionId`.
662
+ */
663
+ export declare const AppInstrumentationSchema: z.ZodObject<{
664
+ /** Whether `reticle init` had been run in this directory (a projectId is stamped). */
665
+ initialized: z.ZodBoolean;
666
+ /** Whether an MCP client was already attached when the app arrived. */
667
+ agentAttached: z.ZodBoolean;
668
+ /** How long the daemon had been up. Large values mean Reticle sat there with nothing wired. */
669
+ msToFirstApp: z.ZodNumber;
670
+ }, "strip", z.ZodTypeAny, {
671
+ msToFirstApp: number;
672
+ initialized: boolean;
673
+ agentAttached: boolean;
674
+ }, {
675
+ msToFirstApp: number;
676
+ initialized: boolean;
677
+ agentAttached: boolean;
678
+ }>;
679
+ export type AppInstrumentation = z.infer<typeof AppInstrumentationSchema>;
616
680
  /**
617
681
  * WHICH stage of an MCP outage this is. Reported at most twice per proxy process, and the two are
618
682
  * different facts: `first` says the session lost its tools at all, `budget_spent` says the proxy
@@ -676,7 +740,7 @@ export declare const McpOutageSchema: z.ZodObject<{
676
740
  /**
677
741
  * In-flight tool calls this drop actually killed — the only part an agent can FEEL.
678
742
  *
679
- * Without it every drop looks equally bad. Measured 2026-08-10/11: **320 of 321 outages were
743
+ * Without it every drop looks equally bad. In the field almost every outage was
680
744
  * `stage: first` with `attempts: 1`** — the stream ended once and the proxy reconnected, which for
681
745
  * an agent with nothing in flight is invisible. Reading that 321 as "the agent lost its tools 321
682
746
  * times" overstates the problem by roughly the whole number, and buries the one drop that mattered.
@@ -815,6 +879,26 @@ export declare const TelemetryEventSchema: z.ZodObject<{
815
879
  * identical to healthy usage in every other metric.
816
880
  */
817
881
  readonly MCP_CLIENT_CONNECTED: "mcp_client_connected";
882
+ /**
883
+ * An app carrying the SDK connected to this daemon for the first time in its life.
884
+ *
885
+ * THE funnel step, and the one nothing could measure. Reticle's install has two halves — register
886
+ * the MCP server so the agent has the tools, and get the SDK into a running page so there is
887
+ * something for those tools to look at — and they are done at different times, by different
888
+ * commands, often in different directories. Almost everyone completes the first. The second is
889
+ * where the users go.
890
+ *
891
+ * Everything that existed before answered a different question. `daemon_started` and
892
+ * `mcp_client_connected` describe the agent half only. `session_appConnects` describes the app
893
+ * half but is a WINDOW counter: it resets on every flush, so a user whose app connected in one
894
+ * window reads zero in every other, and the population it under-counts is exactly the population
895
+ * being measured. A funnel built on it reported fewer instrumented users than there were users
896
+ * calling tools, which is impossible on its face and was the first sign the field was unusable.
897
+ *
898
+ * Fired ONCE per daemon run, on the first connect only — so `daemon_started` → `app_instrumented`
899
+ * is a real rate rather than an inference, and a reconnecting page cannot inflate it.
900
+ */
901
+ readonly APP_INSTRUMENTED: "app_instrumented";
818
902
  /**
819
903
  * The agent LOST its Reticle tools — the worst thing this product does to anyone, and until now
820
904
  * completely invisible in the field.
@@ -1346,6 +1430,23 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1346
1430
  readonly UNSETTLED: "unsettled";
1347
1431
  readonly PROVED: "proved";
1348
1432
  }>>;
1433
+ /**
1434
+ * WHAT was lost, when `reason` is `unclean_capture` — see `CaptureLoss`.
1435
+ *
1436
+ * The three causes belong to three different owners and need three different fixes, and without
1437
+ * this they are one bar. The one time we had to answer it the data could not, and the answer
1438
+ * turned out to be that our own eviction counter was miscounting.
1439
+ *
1440
+ * ONE value, not a list: `losses` can hold several and a multi-value property is not something a
1441
+ * dashboard can group by, so the FIRST is sent and the order in the producers is the order of
1442
+ * ownership — ours before the page's. Absent on every verdict whose capture was clean.
1443
+ */
1444
+ uncleanLoss: z.ZodOptional<z.ZodNativeEnum<{
1445
+ readonly BUFFER_LOSS: "buffer_loss";
1446
+ readonly TRANSPORT_GAP: "transport_gap";
1447
+ readonly BLIND_SPOT: "blind_spot";
1448
+ readonly OTHER: "other";
1449
+ }>>;
1349
1450
  }, "strip", z.ZodTypeAny, {
1350
1451
  verified: string;
1351
1452
  via: string;
@@ -1353,8 +1454,9 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1353
1454
  falseGreenCaught: boolean;
1354
1455
  durationMs?: number | undefined;
1355
1456
  reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
1356
- brand?: "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | "other" | undefined;
1457
+ brand?: "other" | "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | undefined;
1357
1458
  browser?: string | undefined;
1459
+ uncleanLoss?: "buffer_loss" | "transport_gap" | "blind_spot" | "other" | undefined;
1358
1460
  }, {
1359
1461
  verified: string;
1360
1462
  via: string;
@@ -1362,8 +1464,9 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1362
1464
  falseGreenCaught: boolean;
1363
1465
  durationMs?: number | undefined;
1364
1466
  reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
1365
- brand?: "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | "other" | undefined;
1467
+ brand?: "other" | "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | undefined;
1366
1468
  browser?: string | undefined;
1469
+ uncleanLoss?: "buffer_loss" | "transport_gap" | "blind_spot" | "other" | undefined;
1367
1470
  }>>;
1368
1471
  /** Only on `version_changed`. */
1369
1472
  versionChange: z.ZodOptional<z.ZodObject<{
@@ -1687,7 +1790,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1687
1790
  /**
1688
1791
  * In-flight tool calls this drop actually killed — the only part an agent can FEEL.
1689
1792
  *
1690
- * Without it every drop looks equally bad. Measured 2026-08-10/11: **320 of 321 outages were
1793
+ * Without it every drop looks equally bad. In the field almost every outage was
1691
1794
  * `stage: first` with `attempts: 1`** — the stream ended once and the proxy reconnected, which for
1692
1795
  * an agent with nothing in flight is invisible. Reading that 321 as "the agent lost its tools 321
1693
1796
  * times" overstates the problem by roughly the whole number, and buries the one drop that mattered.
@@ -1707,8 +1810,25 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1707
1810
  stage: "first" | "budget_spent";
1708
1811
  pendingLost?: number | undefined;
1709
1812
  }>>;
1813
+ /** Only on `app_instrumented`: the install's second half finally happening. */
1814
+ instrumentation: z.ZodOptional<z.ZodObject<{
1815
+ /** Whether `reticle init` had been run in this directory (a projectId is stamped). */
1816
+ initialized: z.ZodBoolean;
1817
+ /** Whether an MCP client was already attached when the app arrived. */
1818
+ agentAttached: z.ZodBoolean;
1819
+ /** How long the daemon had been up. Large values mean Reticle sat there with nothing wired. */
1820
+ msToFirstApp: z.ZodNumber;
1821
+ }, "strip", z.ZodTypeAny, {
1822
+ msToFirstApp: number;
1823
+ initialized: boolean;
1824
+ agentAttached: boolean;
1825
+ }, {
1826
+ msToFirstApp: number;
1827
+ initialized: boolean;
1828
+ agentAttached: boolean;
1829
+ }>>;
1710
1830
  }, "strip", z.ZodTypeAny, {
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";
1831
+ 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" | "app_instrumented" | "mcp_connection_lost" | "init_completed" | "bug_found";
1712
1832
  version: string;
1713
1833
  ci: boolean;
1714
1834
  v: 3;
@@ -1835,8 +1955,9 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1835
1955
  falseGreenCaught: boolean;
1836
1956
  durationMs?: number | undefined;
1837
1957
  reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
1838
- brand?: "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | "other" | undefined;
1958
+ brand?: "other" | "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | undefined;
1839
1959
  browser?: string | undefined;
1960
+ uncleanLoss?: "buffer_loss" | "transport_gap" | "blind_spot" | "other" | undefined;
1840
1961
  } | undefined;
1841
1962
  versionChange?: {
1842
1963
  direction: string;
@@ -1890,8 +2011,13 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1890
2011
  stage: "first" | "budget_spent";
1891
2012
  pendingLost?: number | undefined;
1892
2013
  } | undefined;
2014
+ instrumentation?: {
2015
+ msToFirstApp: number;
2016
+ initialized: boolean;
2017
+ agentAttached: boolean;
2018
+ } | undefined;
1893
2019
  }, {
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";
2020
+ 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" | "app_instrumented" | "mcp_connection_lost" | "init_completed" | "bug_found";
1895
2021
  version: string;
1896
2022
  ci: boolean;
1897
2023
  v: 3;
@@ -2018,8 +2144,9 @@ export declare const TelemetryEventSchema: z.ZodObject<{
2018
2144
  falseGreenCaught: boolean;
2019
2145
  durationMs?: number | undefined;
2020
2146
  reason?: "inconclusive" | "observation_lost" | "assertion_failed" | "contradicted" | "already_true" | "unclean_capture" | "vacuous_grade" | "outcome_pending" | "outcome_unread" | "unsettled" | "proved" | undefined;
2021
- brand?: "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | "other" | undefined;
2147
+ brand?: "other" | "chrome" | "edge" | "arc" | "dia" | "brave" | "opera" | "firefox" | "safari" | undefined;
2022
2148
  browser?: string | undefined;
2149
+ uncleanLoss?: "buffer_loss" | "transport_gap" | "blind_spot" | "other" | undefined;
2023
2150
  } | undefined;
2024
2151
  versionChange?: {
2025
2152
  direction: string;
@@ -2073,5 +2200,10 @@ export declare const TelemetryEventSchema: z.ZodObject<{
2073
2200
  stage: "first" | "budget_spent";
2074
2201
  pendingLost?: number | undefined;
2075
2202
  } | undefined;
2203
+ instrumentation?: {
2204
+ msToFirstApp: number;
2205
+ initialized: boolean;
2206
+ agentAttached: boolean;
2207
+ } | undefined;
2076
2208
  }>;
2077
2209
  export type TelemetryEvent = z.infer<typeof TelemetryEventSchema>;
package/dist/telemetry.js CHANGED
@@ -18,7 +18,7 @@
18
18
  import { z } from 'zod';
19
19
  import { MachineSnapshotSchema, ProjectProfileSchema, SessionSummarySchema, } from './telemetry-session.js';
20
20
  import { BrowserBrand, FeedbackSchema } from './telemetry-feedback.js';
21
- import { VerifiedReason } from './verified-constants.js';
21
+ import { CaptureLoss, VerifiedReason } from './verified-constants.js';
22
22
  import { IdentitySchema } from './telemetry-feedback.js';
23
23
  /** Bump when the event shape changes so the analytics side can segment old senders. */
24
24
  export const TELEMETRY_EVENT_VERSION = 3;
@@ -108,6 +108,26 @@ export const TelemetryEventKind = {
108
108
  * identical to healthy usage in every other metric.
109
109
  */
110
110
  MCP_CLIENT_CONNECTED: 'mcp_client_connected',
111
+ /**
112
+ * An app carrying the SDK connected to this daemon for the first time in its life.
113
+ *
114
+ * THE funnel step, and the one nothing could measure. Reticle's install has two halves — register
115
+ * the MCP server so the agent has the tools, and get the SDK into a running page so there is
116
+ * something for those tools to look at — and they are done at different times, by different
117
+ * commands, often in different directories. Almost everyone completes the first. The second is
118
+ * where the users go.
119
+ *
120
+ * Everything that existed before answered a different question. `daemon_started` and
121
+ * `mcp_client_connected` describe the agent half only. `session_appConnects` describes the app
122
+ * half but is a WINDOW counter: it resets on every flush, so a user whose app connected in one
123
+ * window reads zero in every other, and the population it under-counts is exactly the population
124
+ * being measured. A funnel built on it reported fewer instrumented users than there were users
125
+ * calling tools, which is impossible on its face and was the first sign the field was unusable.
126
+ *
127
+ * Fired ONCE per daemon run, on the first connect only — so `daemon_started` → `app_instrumented`
128
+ * is a real rate rather than an inference, and a reconnecting page cannot inflate it.
129
+ */
130
+ APP_INSTRUMENTED: 'app_instrumented',
111
131
  /**
112
132
  * The agent LOST its Reticle tools — the worst thing this product does to anyone, and until now
113
133
  * completely invisible in the field.
@@ -160,6 +180,7 @@ const SESSION_SCOPED = new Set([
160
180
  TelemetryEventKind.DAEMON_STOPPED,
161
181
  TelemetryEventKind.SESSION_PROGRESS,
162
182
  TelemetryEventKind.MCP_CLIENT_CONNECTED,
183
+ TelemetryEventKind.APP_INSTRUMENTED,
163
184
  TelemetryEventKind.PROJECT_PROFILED,
164
185
  TelemetryEventKind.VERIFICATION_COMPLETED,
165
186
  TelemetryEventKind.BUG_FOUND,
@@ -194,7 +215,7 @@ export const TelemetryActor = {
194
215
  * property the funnel actually needs: `init` runs in the app directory and the daemon is spawned from
195
216
  * wherever the agent's client happens to sit, so an id that changes with the working directory
196
217
  * 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.
218
+ * rather than the first fallback — the field showed many ids minted for a single project.
198
219
  */
199
220
  export const ProjectIdSource = {
200
221
  /** Hash of the shared git origin — the same on every clone, so cross-machine counting is valid. */
@@ -267,6 +288,18 @@ export const VerificationSchema = z.object({
267
288
  * no clause behind it, and an older SDK reports none. Absent means unclassified, never guessed.
268
289
  */
269
290
  reason: z.nativeEnum(VerifiedReason).optional(),
291
+ /**
292
+ * WHAT was lost, when `reason` is `unclean_capture` — see `CaptureLoss`.
293
+ *
294
+ * The three causes belong to three different owners and need three different fixes, and without
295
+ * this they are one bar. The one time we had to answer it the data could not, and the answer
296
+ * turned out to be that our own eviction counter was miscounting.
297
+ *
298
+ * ONE value, not a list: `losses` can hold several and a multi-value property is not something a
299
+ * dashboard can group by, so the FIRST is sent and the order in the producers is the order of
300
+ * ownership — ours before the page's. Absent on every verdict whose capture was clean.
301
+ */
302
+ uncleanLoss: z.nativeEnum(CaptureLoss).optional(),
270
303
  });
271
304
  /** Which way the installed version moved, and between which versions. */
272
305
  export const VersionChangeSchema = z.object({
@@ -474,6 +507,22 @@ export const McpConnectionSchema = z.object({
474
507
  /** Which client, from its own handshake (`claude-code`, `cursor`). */
475
508
  client: z.string().min(1).max(64).optional(),
476
509
  });
510
+ /**
511
+ * `app_instrumented`: an app carrying the SDK reached this daemon for the first time.
512
+ *
513
+ * The install has two halves — the MCP server registered so the agent has the tools, and the SDK
514
+ * loaded by a running page so there is something to look at — and this is the only signal for the
515
+ * second. Deliberately carries NO stack and no framework: `project_profiled` already reports both
516
+ * for the same daemon run, and the two join on `sessionId`.
517
+ */
518
+ export const AppInstrumentationSchema = z.object({
519
+ /** Whether `reticle init` had been run in this directory (a projectId is stamped). */
520
+ initialized: z.boolean(),
521
+ /** Whether an MCP client was already attached when the app arrived. */
522
+ agentAttached: z.boolean(),
523
+ /** How long the daemon had been up. Large values mean Reticle sat there with nothing wired. */
524
+ msToFirstApp: z.number().int().nonnegative(),
525
+ });
477
526
  /**
478
527
  * WHICH stage of an MCP outage this is. Reported at most twice per proxy process, and the two are
479
528
  * different facts: `first` says the session lost its tools at all, `budget_spent` says the proxy
@@ -519,7 +568,7 @@ export const McpOutageSchema = z.object({
519
568
  /**
520
569
  * In-flight tool calls this drop actually killed — the only part an agent can FEEL.
521
570
  *
522
- * Without it every drop looks equally bad. Measured 2026-08-10/11: **320 of 321 outages were
571
+ * Without it every drop looks equally bad. In the field almost every outage was
523
572
  * `stage: first` with `attempts: 1`** — the stream ended once and the proxy reconnected, which for
524
573
  * an agent with nothing in flight is invisible. Reading that 321 as "the agent lost its tools 321
525
574
  * times" overstates the problem by roughly the whole number, and buries the one drop that mattered.
@@ -619,4 +668,6 @@ export const TelemetryEventSchema = z.object({
619
668
  bug: BugFoundSchema.optional(),
620
669
  /** Only on `mcp_connection_lost`: which stage of the outage, why, and after how many retries. */
621
670
  outage: McpOutageSchema.optional(),
671
+ /** Only on `app_instrumented`: the install's second half finally happening. */
672
+ instrumentation: AppInstrumentationSchema.optional(),
622
673
  });
package/dist/types.d.ts CHANGED
@@ -44,6 +44,16 @@ export declare const ElementQuerySchema: z.ZodObject<{
44
44
  }>>;
45
45
  /** CSS selector or ref to scope the search. */
46
46
  scope: z.ZodOptional<z.ZodString>;
47
+ /**
48
+ * Return the `scope` element ITSELF rather than searching inside it.
49
+ *
50
+ * Every other path excludes the scope root by construction, so a layout container with no role,
51
+ * name, testid or text of its own was unreachable — and that is routinely the element carrying the
52
+ * handler. Reported from the field: "click the empty region of this row" is an ordinary user
53
+ * action (dismiss, deselect, close, marquee-select) that could not be expressed at all, and the
54
+ * verification was handed back to the human. Requires `scope`.
55
+ */
56
+ self: z.ZodOptional<z.ZodBoolean>;
47
57
  }, "strip", z.ZodTypeAny, {
48
58
  testid?: string | undefined;
49
59
  role?: string | undefined;
@@ -62,6 +72,7 @@ export declare const ElementQuerySchema: z.ZodObject<{
62
72
  by?: "testid" | "role" | "component" | "text" | "label" | "placeholder" | "alt" | undefined;
63
73
  attrs?: string[] | undefined;
64
74
  scope?: string | undefined;
75
+ self?: boolean | undefined;
65
76
  }, {
66
77
  testid?: string | undefined;
67
78
  role?: string | undefined;
@@ -80,6 +91,7 @@ export declare const ElementQuerySchema: z.ZodObject<{
80
91
  by?: "testid" | "role" | "component" | "text" | "label" | "placeholder" | "alt" | undefined;
81
92
  attrs?: string[] | undefined;
82
93
  scope?: string | undefined;
94
+ self?: boolean | undefined;
83
95
  }>;
84
96
  export type ElementQuery = z.infer<typeof ElementQuerySchema>;
85
97
  /** Compact semantic descriptor of one element surfaced to the agent. */
package/dist/types.js CHANGED
@@ -26,6 +26,16 @@ export const ElementQuerySchema = z.object({
26
26
  .optional(),
27
27
  /** CSS selector or ref to scope the search. */
28
28
  scope: z.string().optional(),
29
+ /**
30
+ * Return the `scope` element ITSELF rather than searching inside it.
31
+ *
32
+ * Every other path excludes the scope root by construction, so a layout container with no role,
33
+ * name, testid or text of its own was unreachable — and that is routinely the element carrying the
34
+ * handler. Reported from the field: "click the empty region of this row" is an ordinary user
35
+ * action (dismiss, deselect, close, marquee-select) that could not be expressed at all, and the
36
+ * verification was handed back to the human. Requires `scope`.
37
+ */
38
+ self: z.boolean().optional(),
29
39
  });
30
40
  /** One named flow advertised by the app (mirrors the browser CapabilityFlow). */
31
41
  export const CapabilityFlowSchema = z.object({
@@ -74,6 +74,29 @@ export declare const VerifiedReason: {
74
74
  readonly PROVED: "proved";
75
75
  };
76
76
  export type VerifiedReason = (typeof VerifiedReason)[keyof typeof VerifiedReason];
77
+ /**
78
+ * WHAT made a capture unclean — the closed vocabulary behind `UNCLEAN_CAPTURE`.
79
+ *
80
+ * `unclean_capture` names three losses that belong to three different owners and need three
81
+ * different fixes: our server buffer, our browser transport, and a boundary in the page that nobody
82
+ * can see through. Until this existed they arrived as one value on a dashboard and as one sentence
83
+ * of free prose in `integrity.issues`, which is not something a query can group by.
84
+ *
85
+ * That cost real time. `unclean_capture` became a large share of all `unknown` verdicts in the
86
+ * field, and answering "which of the three?" took reading the eviction policy, because the data
87
+ * could not say. It was the first one, and it was a false alarm.
88
+ */
89
+ export declare const CaptureLoss: {
90
+ /** The server ring buffer evicted scarce evidence that belonged to the observation window. */
91
+ readonly BUFFER_LOSS: "buffer_loss";
92
+ /** The browser-side queue overflowed, so part of the window never reached the daemon at all. */
93
+ readonly TRANSPORT_GAP: "transport_gap";
94
+ /** A region the SDK cannot see through — a cross-origin frame, a closed shadow root. */
95
+ readonly BLIND_SPOT: "blind_spot";
96
+ /** A loss we have not classified. A classifier that cannot say "I don't know" lies instead. */
97
+ readonly OTHER: "other";
98
+ };
99
+ export type CaptureLoss = (typeof CaptureLoss)[keyof typeof CaptureLoss];
77
100
  /**
78
101
  * Actionable companion to NO_PROVIDER for the tools that genuinely intercept or capture through CDP
79
102
  * — network mocking and viewport control — which is NOT "visual capture".
@@ -72,6 +72,28 @@ export const VerifiedReason = {
72
72
  /** Held at a real grade over a clean capture with no channel disagreeing. */
73
73
  PROVED: 'proved',
74
74
  };
75
+ /**
76
+ * WHAT made a capture unclean — the closed vocabulary behind `UNCLEAN_CAPTURE`.
77
+ *
78
+ * `unclean_capture` names three losses that belong to three different owners and need three
79
+ * different fixes: our server buffer, our browser transport, and a boundary in the page that nobody
80
+ * can see through. Until this existed they arrived as one value on a dashboard and as one sentence
81
+ * of free prose in `integrity.issues`, which is not something a query can group by.
82
+ *
83
+ * That cost real time. `unclean_capture` became a large share of all `unknown` verdicts in the
84
+ * field, and answering "which of the three?" took reading the eviction policy, because the data
85
+ * could not say. It was the first one, and it was a false alarm.
86
+ */
87
+ export const CaptureLoss = {
88
+ /** The server ring buffer evicted scarce evidence that belonged to the observation window. */
89
+ BUFFER_LOSS: 'buffer_loss',
90
+ /** The browser-side queue overflowed, so part of the window never reached the daemon at all. */
91
+ TRANSPORT_GAP: 'transport_gap',
92
+ /** A region the SDK cannot see through — a cross-origin frame, a closed shadow root. */
93
+ BLIND_SPOT: 'blind_spot',
94
+ /** A loss we have not classified. A classifier that cannot say "I don't know" lies instead. */
95
+ OTHER: 'other',
96
+ };
75
97
  /**
76
98
  * Actionable companion to NO_PROVIDER for the tools that genuinely intercept or capture through CDP
77
99
  * — network mocking and viewport control — which is NOT "visual capture".
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/core",
3
- "version": "2.6.0",
3
+ "version": "2.7.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",