@reticlehq/core 3.6.0 → 3.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.
Files changed (90) hide show
  1. package/dist/artifacts/artifacts-entry.d.ts +2 -0
  2. package/dist/artifacts/artifacts-entry.js +2 -0
  3. package/dist/artifacts/drive-script.d.ts +158 -52
  4. package/dist/artifacts/drive-script.js +24 -1
  5. package/dist/artifacts/flow-constants.d.ts +18 -0
  6. package/dist/artifacts/flow-constants.js +20 -0
  7. package/dist/artifacts/flow-results.d.ts +450 -0
  8. package/dist/artifacts/flow-results.js +1 -0
  9. package/dist/artifacts/flow-types.d.ts +25 -437
  10. package/dist/artifacts/flow-types.js +5 -2
  11. package/dist/artifacts/harness-credits.d.ts +39 -0
  12. package/dist/artifacts/harness-credits.js +69 -0
  13. package/dist/artifacts/harness-map.d.ts +98 -0
  14. package/dist/artifacts/harness-map.js +36 -0
  15. package/dist/artifacts/impact.d.ts +354 -145
  16. package/dist/artifacts/impact.js +66 -48
  17. package/dist/artifacts/journal.d.ts +56 -5
  18. package/dist/artifacts/journal.js +26 -0
  19. package/dist/artifacts/screenshot-upload.d.ts +51 -0
  20. package/dist/artifacts/screenshot-upload.js +26 -0
  21. package/dist/hooks/hook-events.d.ts +4 -4
  22. package/dist/hud-entry.d.ts +1 -0
  23. package/dist/hud-entry.js +2 -0
  24. package/dist/index.d.ts +5 -0
  25. package/dist/index.js +5 -0
  26. package/dist/onboarding.d.ts +8 -0
  27. package/dist/onboarding.js +6 -0
  28. package/dist/realm/registry.js +19 -1
  29. package/dist/schema/command-message.json +30 -0
  30. package/dist/schema/command-name.json +3 -1
  31. package/dist/schema/event-payloads.json +40 -2
  32. package/dist/schema/reticle-message.json +30 -0
  33. package/dist/telemetry-bug.d.ts +169 -0
  34. package/dist/telemetry-bug.js +123 -0
  35. package/dist/telemetry-entry.d.ts +1 -0
  36. package/dist/telemetry-entry.js +1 -0
  37. package/dist/telemetry-feedback.d.ts +2 -2
  38. package/dist/telemetry-refusal.d.ts +2 -2
  39. package/dist/telemetry-session.d.ts +74 -0
  40. package/dist/telemetry-session.js +54 -0
  41. package/dist/telemetry-signals.d.ts +339 -0
  42. package/dist/telemetry-signals.js +138 -0
  43. package/dist/telemetry.d.ts +300 -254
  44. package/dist/telemetry.js +40 -115
  45. package/dist/verdict/disparity.d.ts +105 -0
  46. package/dist/verdict/disparity.js +40 -0
  47. package/dist/verdict/findings.d.ts +6 -0
  48. package/dist/verdict/findings.js +9 -0
  49. package/dist/verdict/instrumentation-coverage.d.ts +115 -0
  50. package/dist/verdict/instrumentation-coverage.js +226 -0
  51. package/dist/verdict/instrumentation-gap.js +1 -1
  52. package/dist/verdict/intent.d.ts +19 -5
  53. package/dist/verdict/intent.js +13 -1
  54. package/dist/verdict/predicate-tree.d.ts +15 -0
  55. package/dist/verdict/predicate-tree.js +21 -0
  56. package/dist/verdict/predicate.d.ts +14 -0
  57. package/dist/verdict/predicate.js +87 -3
  58. package/dist/verdict/security.d.ts +25 -0
  59. package/dist/verdict/security.js +82 -0
  60. package/dist/verdict/verification-run.d.ts +620 -32
  61. package/dist/verdict/verification-run.js +82 -0
  62. package/dist/wire/constants/constants.d.ts +15 -16
  63. package/dist/wire/constants/constants.js +16 -17
  64. package/dist/wire/constants/hud-controls.js +17 -5
  65. package/dist/wire/constants/hud-use.d.ts +29 -4
  66. package/dist/wire/constants/hud-use.js +26 -4
  67. package/dist/wire/constants/mcp-wire.d.ts +10 -0
  68. package/dist/wire/constants/mcp-wire.js +10 -0
  69. package/dist/wire/constants/reticle-chrome.d.ts +19 -0
  70. package/dist/wire/constants/reticle-chrome.js +19 -0
  71. package/dist/wire/constants/session-constants.d.ts +15 -2
  72. package/dist/wire/constants/session-constants.js +15 -2
  73. package/dist/wire/desktop-contract.d.ts +8 -0
  74. package/dist/wire/desktop-contract.js +11 -0
  75. package/dist/wire/event-payloads.d.ts +56 -4
  76. package/dist/wire/event-payloads.js +17 -0
  77. package/dist/wire/messages.d.ts +105 -32
  78. package/dist/wire/messages.js +9 -1
  79. package/dist/wire/platform-link.d.ts +77 -0
  80. package/dist/wire/platform-link.js +45 -0
  81. package/dist/wire/tool-names.d.ts +2 -0
  82. package/dist/wire/tool-names.js +2 -0
  83. package/dist/wire/types.d.ts +19 -6
  84. package/dist/wire/types.js +5 -0
  85. package/dist/words/notices.d.ts +1 -1
  86. package/dist/words/notices.js +1 -1
  87. package/dist/words/upgrade.js +1 -1
  88. package/dist/words/writing-rule.d.ts +14 -0
  89. package/dist/words/writing-rule.js +17 -0
  90. package/package.json +1 -1
@@ -219,6 +219,22 @@
219
219
  },
220
220
  "at": {
221
221
  "type": "number"
222
+ },
223
+ "shifted": {
224
+ "type": "object",
225
+ "properties": {
226
+ "ref": {
227
+ "type": "string"
228
+ },
229
+ "selector": {
230
+ "type": "string"
231
+ }
232
+ },
233
+ "required": [
234
+ "ref",
235
+ "selector"
236
+ ],
237
+ "additionalProperties": false
222
238
  }
223
239
  },
224
240
  "required": [
@@ -246,6 +262,14 @@
246
262
  },
247
263
  "hash": {
248
264
  "type": "string"
265
+ },
266
+ "how": {
267
+ "type": "string",
268
+ "enum": [
269
+ "push",
270
+ "replace",
271
+ "pop"
272
+ ]
249
273
  }
250
274
  },
251
275
  "required": [
@@ -253,7 +277,8 @@
253
277
  "to",
254
278
  "pathname",
255
279
  "search",
256
- "hash"
280
+ "hash",
281
+ "how"
257
282
  ],
258
283
  "additionalProperties": false,
259
284
  "$schema": "http://json-schema.org/draft-07/schema#"
@@ -768,7 +793,10 @@
768
793
  "replay",
769
794
  "sync",
770
795
  "signin",
771
- "harness"
796
+ "harness",
797
+ "harness-run",
798
+ "harness-stop",
799
+ "harness-link"
772
800
  ]
773
801
  },
774
802
  "text": {
@@ -866,14 +894,24 @@
866
894
  "chat",
867
895
  "flows",
868
896
  "notes",
897
+ "harness",
869
898
  "settings",
870
899
  "report",
900
+ "account",
871
901
  "none"
872
902
  ]
873
903
  },
874
904
  "slide": {
875
905
  "type": "string",
876
906
  "maxLength": 56
907
+ },
908
+ "prompt": {
909
+ "type": "string",
910
+ "enum": [
911
+ "rail",
912
+ "harness",
913
+ "header"
914
+ ]
877
915
  }
878
916
  },
879
917
  "additionalProperties": false,
@@ -177,6 +177,36 @@
177
177
  "enum": [
178
178
  "harness"
179
179
  ]
180
+ },
181
+ "outward": {
182
+ "type": "object",
183
+ "properties": {
184
+ "allowed": {
185
+ "type": "array",
186
+ "items": {
187
+ "type": "string",
188
+ "enum": [
189
+ "invite",
190
+ "send",
191
+ "share",
192
+ "delete",
193
+ "pay",
194
+ "publish",
195
+ "revoke",
196
+ "transfer",
197
+ "sign out",
198
+ "change role",
199
+ "create key",
200
+ "change state"
201
+ ]
202
+ },
203
+ "maxItems": 16
204
+ }
205
+ },
206
+ "required": [
207
+ "allowed"
208
+ ],
209
+ "additionalProperties": false
180
210
  }
181
211
  },
182
212
  "required": [
@@ -0,0 +1,169 @@
1
+ /**
2
+ * The `bug_found` event: how Reticle found a defect, and who caused it. Split out of `telemetry.ts`
3
+ * as its own subject, and re-exported from there, so every `@reticlehq/core/telemetry` import still
4
+ * reaches it.
5
+ */
6
+ import { z } from 'zod';
7
+ /**
8
+ * How Reticle came to find a defect. Four routes, in descending order of "a human would have missed
9
+ * this": a contradiction is invisible to someone watching the screen, a crawl finding required no
10
+ * script at all, a replay failure is a regression on something that used to work, and a failed
11
+ * assertion is the agent's own check not holding.
12
+ */
13
+ export declare const BugSource: {
14
+ /** Channels disagreed — the false green. A passing screen sitting on a failed write. */
15
+ readonly CONTRADICTION: "contradiction";
16
+ /** `reticle_crawl` found it autonomously, with nobody writing a test. */
17
+ readonly CRAWL: "crawl";
18
+ /** A saved flow that used to pass stopped passing — a regression. */
19
+ readonly REPLAY: "replay";
20
+ /** An assertion the agent declared did not hold. */
21
+ readonly ASSERTION: "assertion";
22
+ };
23
+ export type BugSource = (typeof BugSource)[keyof typeof BugSource];
24
+ /**
25
+ * WHOSE fault the defect was.
26
+ *
27
+ * `bugsFound` is not publishable without this, and a count confidently wrong about whose fault
28
+ * something is, is worse than no count: it points at the customer. Two rules keep it honest:
29
+ *
30
+ * 1. **Always present.** `UNCLASSIFIED` is a value, not a gap. Absence would mean an old sender or a
31
+ * path that forgot; a value means the classifier ran and declined.
32
+ * 2. **`APP` requires POSITIVE evidence** — something the app itself did: a request that came back
33
+ * failed, a signal the app fired carrying data that disagrees with its own screen, a written
34
+ * field echoed back changed. Never "nothing else explained it". Core already draws exactly this
35
+ * line for the verdict, in `ABSENCE_DERIVED_CONTRADICTIONS`, and that is the line reused rather
36
+ * than a second judgement invented beside it.
37
+ */
38
+ export declare const BugAttribution: {
39
+ /** A defect in the app under test — the only bucket that belongs in a published defect count. */
40
+ readonly APP: "app";
41
+ /** The agent's own call was wrong: a path, store or target that never existed. Teach the agent. */
42
+ readonly REQUEST: "request";
43
+ /** Reticle could not see or could not drive. Our bug, or our configuration. Ship a fix. */
44
+ readonly RETICLE: "reticle";
45
+ /**
46
+ * The classifier looked and the evidence could not say.
47
+ *
48
+ * The honest majority, and it must stay a value rather than becoming a gap: a failed
49
+ * `element.present` covers "the button is missing", "the API is down" and "the agent mistyped a
50
+ * testid" identically, and an owner invented for it would put a guess into a published number.
51
+ * Exclude it from a defect count; never fold it into `app`.
52
+ */
53
+ readonly UNCLASSIFIED: "unclassified";
54
+ };
55
+ export type BugAttribution = (typeof BugAttribution)[keyof typeof BugAttribution];
56
+ /**
57
+ * One defect Reticle found in the app under test.
58
+ *
59
+ * `kind` is the taxonomy value from `findings.ts` — `signal-contradicted`, `console-error`,
60
+ * `duplicate-request` and so on. Never a selector, a URL, an element, or any description of the
61
+ * user's app — THAT a class of defect was found, never WHAT it was in.
62
+ */
63
+ export declare const BugFoundSchema: z.ZodObject<{
64
+ source: z.ZodNativeEnum<{
65
+ /** Channels disagreed — the false green. A passing screen sitting on a failed write. */
66
+ readonly CONTRADICTION: "contradiction";
67
+ /** `reticle_crawl` found it autonomously, with nobody writing a test. */
68
+ readonly CRAWL: "crawl";
69
+ /** A saved flow that used to pass stopped passing — a regression. */
70
+ readonly REPLAY: "replay";
71
+ /** An assertion the agent declared did not hold. */
72
+ readonly ASSERTION: "assertion";
73
+ }>;
74
+ /** The classified kind from Reticle's own findings vocabulary. */
75
+ kind: z.ZodString;
76
+ /**
77
+ * True when the defect PRESENTED AS SUCCESS — the screen advanced, the assertion passed, the click
78
+ * looked fine — while another channel showed it had not.
79
+ *
80
+ * Defined by the presentation rather than by "an assertion passed", because the same defect arrives
81
+ * both ways: through `reticle_assert` there IS a passing assertion to contradict, and through
82
+ * `reticle_crawl` there is no assertion at all and the UI simply moved on over a failed write. Both
83
+ * are the thing a human watching the screen cannot see, and that is what the flag has to mean if
84
+ * the number is going to be published.
85
+ *
86
+ * The subset worth naming separately, because it is the only category Reticle can claim as uniquely
87
+ * its own: every other kind of bug is findable by a careful human or an ordinary test.
88
+ */
89
+ falseGreen: z.ZodBoolean;
90
+ /** Which tool surfaced it. */
91
+ tool: z.ZodOptional<z.ZodString>;
92
+ /**
93
+ * TRUE when this KIND was already reported in this session — i.e. this is another INSTANCE of a
94
+ * defect already counted, not another defect.
95
+ *
96
+ * Both numbers are claims, and they are different ones. "Reticle found N defects" is the headline;
97
+ * "users hit them M times" is the frequency that says which ones actually cost anybody anything.
98
+ * Without this flag the event stream answers only the second while looking like it answers the
99
+ * first, so any distinct-defect count read off it is silently inflated — the exact way a published
100
+ * number goes wrong. Count `repeat: false` for distinct, count everything for instances.
101
+ *
102
+ * Scoped to the SESSION, because that is the only identity available: the payload deliberately
103
+ * carries no selector, URL or app detail, so the same defect in two sessions cannot be recognised
104
+ * as one — and must not be, since that would need data this event refuses to collect.
105
+ */
106
+ repeat: z.ZodBoolean;
107
+ /**
108
+ * Whose fault it was, ALWAYS present — `unclassified` when the evidence cannot say, never absent.
109
+ *
110
+ * Absence and "the evidence could not say" are different facts, and only one of them is a
111
+ * measurement. Count `attribution: 'app'` for defects found in anybody's product; see
112
+ * `BugAttribution` for why `app` needs positive evidence.
113
+ */
114
+ attribution: z.ZodNativeEnum<{
115
+ /** A defect in the app under test — the only bucket that belongs in a published defect count. */
116
+ readonly APP: "app";
117
+ /** The agent's own call was wrong: a path, store or target that never existed. Teach the agent. */
118
+ readonly REQUEST: "request";
119
+ /** Reticle could not see or could not drive. Our bug, or our configuration. Ship a fix. */
120
+ readonly RETICLE: "reticle";
121
+ /**
122
+ * The classifier looked and the evidence could not say.
123
+ *
124
+ * The honest majority, and it must stay a value rather than becoming a gap: a failed
125
+ * `element.present` covers "the button is missing", "the API is down" and "the agent mistyped a
126
+ * testid" identically, and an owner invented for it would put a guess into a published number.
127
+ * Exclude it from a defect count; never fold it into `app`.
128
+ */
129
+ readonly UNCLASSIFIED: "unclassified";
130
+ }>;
131
+ /**
132
+ * A stable hash identifying THIS defect across sessions — same kind at the same route = same
133
+ * fingerprint, regardless of when or where it was found.
134
+ *
135
+ * The inputs (route, selector) never travel raw — only the 8-char hex hash does, following the
136
+ * same privacy pattern as `projectId`. The analytics side groups on it to answer "was this bug
137
+ * fixed?" (the fingerprint stops appearing) and to deduplicate the same defect found by parallel
138
+ * agents in one run.
139
+ *
140
+ * OPTIONAL because old senders and the `reticle verify` CLI path do not yet compute it. Absent
141
+ * means "not fingerprinted", never "a different defect from one that has a fingerprint".
142
+ */
143
+ fingerprint: z.ZodOptional<z.ZodString>;
144
+ /**
145
+ * Which hit of this `fingerprint` in the session, from 1. Two hits of one defect used to be
146
+ * byte-identical rows, so a duplicated delivery and a real second hit could not be told apart.
147
+ * `occurrence: 1` is the distinct defect within a session. Absent on older senders.
148
+ */
149
+ occurrence: z.ZodOptional<z.ZodNumber>;
150
+ }, "strip", z.ZodTypeAny, {
151
+ kind: string;
152
+ source: "replay" | "contradiction" | "crawl" | "assertion";
153
+ attribution: "reticle" | "request" | "app" | "unclassified";
154
+ falseGreen: boolean;
155
+ repeat: boolean;
156
+ tool?: string | undefined;
157
+ fingerprint?: string | undefined;
158
+ occurrence?: number | undefined;
159
+ }, {
160
+ kind: string;
161
+ source: "replay" | "contradiction" | "crawl" | "assertion";
162
+ attribution: "reticle" | "request" | "app" | "unclassified";
163
+ falseGreen: boolean;
164
+ repeat: boolean;
165
+ tool?: string | undefined;
166
+ fingerprint?: string | undefined;
167
+ occurrence?: number | undefined;
168
+ }>;
169
+ export type BugFound = z.infer<typeof BugFoundSchema>;
@@ -0,0 +1,123 @@
1
+ /**
2
+ * The `bug_found` event: how Reticle found a defect, and who caused it. Split out of `telemetry.ts`
3
+ * as its own subject, and re-exported from there, so every `@reticlehq/core/telemetry` import still
4
+ * reaches it.
5
+ */
6
+ import { z } from 'zod';
7
+ /**
8
+ * How Reticle came to find a defect. Four routes, in descending order of "a human would have missed
9
+ * this": a contradiction is invisible to someone watching the screen, a crawl finding required no
10
+ * script at all, a replay failure is a regression on something that used to work, and a failed
11
+ * assertion is the agent's own check not holding.
12
+ */
13
+ export const BugSource = {
14
+ /** Channels disagreed — the false green. A passing screen sitting on a failed write. */
15
+ CONTRADICTION: 'contradiction',
16
+ /** `reticle_crawl` found it autonomously, with nobody writing a test. */
17
+ CRAWL: 'crawl',
18
+ /** A saved flow that used to pass stopped passing — a regression. */
19
+ REPLAY: 'replay',
20
+ /** An assertion the agent declared did not hold. */
21
+ ASSERTION: 'assertion',
22
+ };
23
+ /**
24
+ * WHOSE fault the defect was.
25
+ *
26
+ * `bugsFound` is not publishable without this, and a count confidently wrong about whose fault
27
+ * something is, is worse than no count: it points at the customer. Two rules keep it honest:
28
+ *
29
+ * 1. **Always present.** `UNCLASSIFIED` is a value, not a gap. Absence would mean an old sender or a
30
+ * path that forgot; a value means the classifier ran and declined.
31
+ * 2. **`APP` requires POSITIVE evidence** — something the app itself did: a request that came back
32
+ * failed, a signal the app fired carrying data that disagrees with its own screen, a written
33
+ * field echoed back changed. Never "nothing else explained it". Core already draws exactly this
34
+ * line for the verdict, in `ABSENCE_DERIVED_CONTRADICTIONS`, and that is the line reused rather
35
+ * than a second judgement invented beside it.
36
+ */
37
+ export const BugAttribution = {
38
+ /** A defect in the app under test — the only bucket that belongs in a published defect count. */
39
+ APP: 'app',
40
+ /** The agent's own call was wrong: a path, store or target that never existed. Teach the agent. */
41
+ REQUEST: 'request',
42
+ /** Reticle could not see or could not drive. Our bug, or our configuration. Ship a fix. */
43
+ RETICLE: 'reticle',
44
+ /**
45
+ * The classifier looked and the evidence could not say.
46
+ *
47
+ * The honest majority, and it must stay a value rather than becoming a gap: a failed
48
+ * `element.present` covers "the button is missing", "the API is down" and "the agent mistyped a
49
+ * testid" identically, and an owner invented for it would put a guess into a published number.
50
+ * Exclude it from a defect count; never fold it into `app`.
51
+ */
52
+ UNCLASSIFIED: 'unclassified',
53
+ };
54
+ /**
55
+ * One defect Reticle found in the app under test.
56
+ *
57
+ * `kind` is the taxonomy value from `findings.ts` — `signal-contradicted`, `console-error`,
58
+ * `duplicate-request` and so on. Never a selector, a URL, an element, or any description of the
59
+ * user's app — THAT a class of defect was found, never WHAT it was in.
60
+ */
61
+ export const BugFoundSchema = z.object({
62
+ source: z.nativeEnum(BugSource),
63
+ /** The classified kind from Reticle's own findings vocabulary. */
64
+ kind: z.string().min(1).max(64),
65
+ /**
66
+ * True when the defect PRESENTED AS SUCCESS — the screen advanced, the assertion passed, the click
67
+ * looked fine — while another channel showed it had not.
68
+ *
69
+ * Defined by the presentation rather than by "an assertion passed", because the same defect arrives
70
+ * both ways: through `reticle_assert` there IS a passing assertion to contradict, and through
71
+ * `reticle_crawl` there is no assertion at all and the UI simply moved on over a failed write. Both
72
+ * are the thing a human watching the screen cannot see, and that is what the flag has to mean if
73
+ * the number is going to be published.
74
+ *
75
+ * The subset worth naming separately, because it is the only category Reticle can claim as uniquely
76
+ * its own: every other kind of bug is findable by a careful human or an ordinary test.
77
+ */
78
+ falseGreen: z.boolean(),
79
+ /** Which tool surfaced it. */
80
+ tool: z.string().min(1).max(64).optional(),
81
+ /**
82
+ * TRUE when this KIND was already reported in this session — i.e. this is another INSTANCE of a
83
+ * defect already counted, not another defect.
84
+ *
85
+ * Both numbers are claims, and they are different ones. "Reticle found N defects" is the headline;
86
+ * "users hit them M times" is the frequency that says which ones actually cost anybody anything.
87
+ * Without this flag the event stream answers only the second while looking like it answers the
88
+ * first, so any distinct-defect count read off it is silently inflated — the exact way a published
89
+ * number goes wrong. Count `repeat: false` for distinct, count everything for instances.
90
+ *
91
+ * Scoped to the SESSION, because that is the only identity available: the payload deliberately
92
+ * carries no selector, URL or app detail, so the same defect in two sessions cannot be recognised
93
+ * as one — and must not be, since that would need data this event refuses to collect.
94
+ */
95
+ repeat: z.boolean(),
96
+ /**
97
+ * Whose fault it was, ALWAYS present — `unclassified` when the evidence cannot say, never absent.
98
+ *
99
+ * Absence and "the evidence could not say" are different facts, and only one of them is a
100
+ * measurement. Count `attribution: 'app'` for defects found in anybody's product; see
101
+ * `BugAttribution` for why `app` needs positive evidence.
102
+ */
103
+ attribution: z.nativeEnum(BugAttribution),
104
+ /**
105
+ * A stable hash identifying THIS defect across sessions — same kind at the same route = same
106
+ * fingerprint, regardless of when or where it was found.
107
+ *
108
+ * The inputs (route, selector) never travel raw — only the 8-char hex hash does, following the
109
+ * same privacy pattern as `projectId`. The analytics side groups on it to answer "was this bug
110
+ * fixed?" (the fingerprint stops appearing) and to deduplicate the same defect found by parallel
111
+ * agents in one run.
112
+ *
113
+ * OPTIONAL because old senders and the `reticle verify` CLI path do not yet compute it. Absent
114
+ * means "not fingerprinted", never "a different defect from one that has a fingerprint".
115
+ */
116
+ fingerprint: z.string().max(16).optional(),
117
+ /**
118
+ * Which hit of this `fingerprint` in the session, from 1. Two hits of one defect used to be
119
+ * byte-identical rows, so a duplicated delivery and a real second hit could not be told apart.
120
+ * `occurrence: 1` is the distinct defect within a session. Absent on older senders.
121
+ */
122
+ occurrence: z.number().int().positive().optional(),
123
+ });
@@ -13,3 +13,4 @@ export * from './telemetry-refusal.js';
13
13
  export * from './telemetry-session.js';
14
14
  export * from './telemetry-license.js';
15
15
  export * from './telemetry-feedback.js';
16
+ export * from './telemetry-signals.js';
@@ -13,3 +13,4 @@ export * from './telemetry-refusal.js';
13
13
  export * from './telemetry-session.js';
14
14
  export * from './telemetry-license.js';
15
15
  export * from './telemetry-feedback.js';
16
+ export * from './telemetry-signals.js';
@@ -241,7 +241,7 @@ export declare const FeedbackSchema: z.ZodObject<{
241
241
  }, "strip", z.ZodTypeAny, {
242
242
  text: string;
243
243
  kind: "bug" | "gap" | "ambiguity" | "feature_request" | "improvement" | "experience";
244
- source: "human" | "agent";
244
+ source: "agent" | "human";
245
245
  impact?: string | undefined;
246
246
  model?: string | undefined;
247
247
  trace?: string | undefined;
@@ -259,7 +259,7 @@ export declare const FeedbackSchema: z.ZodObject<{
259
259
  }, {
260
260
  text: string;
261
261
  kind: "bug" | "gap" | "ambiguity" | "feature_request" | "improvement" | "experience";
262
- source: "human" | "agent";
262
+ source: "agent" | "human";
263
263
  impact?: string | undefined;
264
264
  model?: string | undefined;
265
265
  trace?: string | undefined;
@@ -83,13 +83,13 @@ export declare const ToolRefusalSchema: z.ZodObject<{
83
83
  */
84
84
  retried: z.ZodBoolean;
85
85
  }, "strip", z.ZodTypeAny, {
86
- reason: "other" | "no_session" | "no_match" | "unsupported" | "bad_args" | "not_ready";
87
86
  tool: string;
87
+ reason: "other" | "no_session" | "no_match" | "unsupported" | "bad_args" | "not_ready";
88
88
  retried: boolean;
89
89
  noSessionReason?: "auth_refused" | "lease_expired" | "tab_gone" | "navigated_away" | "route_server_error" | "app_not_reopened" | "config_elsewhere" | "no_listener_no_config" | "no_listener" | "no_config" | "sdk_not_reaching_daemon" | undefined;
90
90
  }, {
91
- reason: "other" | "no_session" | "no_match" | "unsupported" | "bad_args" | "not_ready";
92
91
  tool: string;
92
+ reason: "other" | "no_session" | "no_match" | "unsupported" | "bad_args" | "not_ready";
93
93
  retried: boolean;
94
94
  noSessionReason?: "auth_refused" | "lease_expired" | "tab_gone" | "navigated_away" | "route_server_error" | "app_not_reopened" | "config_elsewhere" | "no_listener_no_config" | "no_listener" | "no_config" | "sdk_not_reaching_daemon" | undefined;
95
95
  }>;
@@ -6,6 +6,35 @@
6
6
  * every new thing worth measuring lands in one of these two shapes.
7
7
  */
8
8
  import { z } from 'zod';
9
+ /**
10
+ * The one-time advisories that point an agent at the platform and the Harness, by kind. Closed: a
11
+ * nudge whose kind is not listed here never reaches the wire.
12
+ */
13
+ export declare const AgentNudgeKind: {
14
+ /** Unlinked, after the first verdict: `reticle connect` keeps it and lets the Harness test the app. */
15
+ readonly CONNECT: "connect";
16
+ /** Linked, below the Harness's coverage: close the named gaps. */
17
+ readonly CLOSE_GAPS: "close_gaps";
18
+ /** Linked, at the Harness's coverage with the Harness off: the user can switch it on. */
19
+ readonly SWITCH_ON: "switch_on";
20
+ /** Harness on, and the agent is driving a long journey by hand: hand it to explore. */
21
+ readonly EXPLORE: "explore";
22
+ };
23
+ export type AgentNudgeKind = (typeof AgentNudgeKind)[keyof typeof AgentNudgeKind];
24
+ /**
25
+ * A coverage percent, in fifths. A bucket answers "how far from the gate" without an exact number
26
+ * that, beside the stack and the size, starts to describe one app.
27
+ */
28
+ export declare const CoverageBucket: {
29
+ readonly B0: "0-19";
30
+ readonly B20: "20-39";
31
+ readonly B40: "40-59";
32
+ readonly B60: "60-79";
33
+ readonly B80: "80-100";
34
+ };
35
+ export type CoverageBucket = (typeof CoverageBucket)[keyof typeof CoverageBucket];
36
+ /** The bucket a 0..100 percent falls in. */
37
+ export declare function coverageBucketOf(percent: number): CoverageBucket;
9
38
  /**
10
39
  * One distinct error shape seen during a session, with the detail needed to fix it.
11
40
  *
@@ -453,6 +482,15 @@ export declare const SessionSummarySchema: z.ZodObject<{
453
482
  * asked whether it worked is the finding, so absence and `false` must not look alike.
454
483
  */
455
484
  endedWithVerdict: z.ZodOptional<z.ZodBoolean>;
485
+ /**
486
+ * Session totals, on the FINAL summary only. Every scalar counter above (`toolCalls`,
487
+ * `verifications`, `bugsFound`, ...) is windowed on EVERY event, the final one included, so the
488
+ * counts summed across a session's `session_progress` + `daemon_stopped` rows are the session's
489
+ * total. These are the same totals read off one row, under names a sum cannot pick up by mistake.
490
+ */
491
+ lifetimeToolCalls: z.ZodOptional<z.ZodNumber>;
492
+ lifetimeVerifications: z.ZodOptional<z.ZodNumber>;
493
+ lifetimeBugsFound: z.ZodOptional<z.ZodNumber>;
456
494
  /**
457
495
  * Was the update nudge actually delivered to an agent during this daemon run.
458
496
  *
@@ -495,6 +533,32 @@ export declare const SessionSummarySchema: z.ZodObject<{
495
533
  hudSlides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
496
534
  hudJourney: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
497
535
  hudJourneyCut: z.ZodOptional<z.ZodLiteral<true>>;
536
+ /**
537
+ * The one-time platform and Harness advisories an agent was shown, by kind (`AgentNudgeKind`).
538
+ * Whether a connect or an explore followed is read beside it: `cli_command_run` for `connect`, and
539
+ * `toolCounts` / `toolParams` for `reticle_verify`'s explore. Windowed; absent when none was shown.
540
+ */
541
+ nudgesShown: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<{
542
+ /** Unlinked, after the first verdict: `reticle connect` keeps it and lets the Harness test the app. */
543
+ readonly CONNECT: "connect";
544
+ /** Linked, below the Harness's coverage: close the named gaps. */
545
+ readonly CLOSE_GAPS: "close_gaps";
546
+ /** Linked, at the Harness's coverage with the Harness off: the user can switch it on. */
547
+ readonly SWITCH_ON: "switch_on";
548
+ /** Harness on, and the agent is driving a long journey by hand: hand it to explore. */
549
+ readonly EXPLORE: "explore";
550
+ }>, z.ZodNumber>>;
551
+ /**
552
+ * Harness drives refused for coverage below the gate, by coverage bucket (`CoverageBucket`).
553
+ * Windowed; absent when none was refused.
554
+ */
555
+ harnessRefusedCoverage: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<{
556
+ readonly B0: "0-19";
557
+ readonly B20: "20-39";
558
+ readonly B40: "40-59";
559
+ readonly B60: "60-79";
560
+ readonly B80: "80-100";
561
+ }>, z.ZodNumber>>;
498
562
  /** Was this a clean shutdown, or a periodic flush of a still-running session? */
499
563
  final: z.ZodBoolean;
500
564
  /**
@@ -572,6 +636,9 @@ export declare const SessionSummarySchema: z.ZodObject<{
572
636
  errorsRecovered?: number | undefined;
573
637
  errorsRepeated?: number | undefined;
574
638
  endedWithVerdict?: boolean | undefined;
639
+ lifetimeToolCalls?: number | undefined;
640
+ lifetimeVerifications?: number | undefined;
641
+ lifetimeBugsFound?: number | undefined;
575
642
  updateNudged?: boolean | undefined;
576
643
  updateOffered?: string | undefined;
577
644
  hudControls?: Record<string, number> | undefined;
@@ -580,6 +647,8 @@ export declare const SessionSummarySchema: z.ZodObject<{
580
647
  hudSlides?: Record<string, number> | undefined;
581
648
  hudJourney?: string[] | undefined;
582
649
  hudJourneyCut?: true | undefined;
650
+ nudgesShown?: Partial<Record<"connect" | "close_gaps" | "switch_on" | "explore", number>> | undefined;
651
+ harnessRefusedCoverage?: Partial<Record<"0-19" | "20-39" | "40-59" | "60-79" | "80-100", number>> | undefined;
583
652
  exit?: "signal" | "idle" | "unknown" | undefined;
584
653
  }, {
585
654
  durationMs: number;
@@ -643,6 +712,9 @@ export declare const SessionSummarySchema: z.ZodObject<{
643
712
  errorsRecovered?: number | undefined;
644
713
  errorsRepeated?: number | undefined;
645
714
  endedWithVerdict?: boolean | undefined;
715
+ lifetimeToolCalls?: number | undefined;
716
+ lifetimeVerifications?: number | undefined;
717
+ lifetimeBugsFound?: number | undefined;
646
718
  updateNudged?: boolean | undefined;
647
719
  updateOffered?: string | undefined;
648
720
  hudControls?: Record<string, number> | undefined;
@@ -651,6 +723,8 @@ export declare const SessionSummarySchema: z.ZodObject<{
651
723
  hudSlides?: Record<string, number> | undefined;
652
724
  hudJourney?: string[] | undefined;
653
725
  hudJourneyCut?: true | undefined;
726
+ nudgesShown?: Partial<Record<"connect" | "close_gaps" | "switch_on" | "explore", number>> | undefined;
727
+ harnessRefusedCoverage?: Partial<Record<"0-19" | "20-39" | "40-59" | "60-79" | "80-100", number>> | undefined;
654
728
  exit?: "signal" | "idle" | "unknown" | undefined;
655
729
  }>;
656
730
  export type SessionSummary = z.infer<typeof SessionSummarySchema>;
@@ -6,6 +6,38 @@
6
6
  * every new thing worth measuring lands in one of these two shapes.
7
7
  */
8
8
  import { z } from 'zod';
9
+ /**
10
+ * The one-time advisories that point an agent at the platform and the Harness, by kind. Closed: a
11
+ * nudge whose kind is not listed here never reaches the wire.
12
+ */
13
+ export const AgentNudgeKind = {
14
+ /** Unlinked, after the first verdict: `reticle connect` keeps it and lets the Harness test the app. */
15
+ CONNECT: 'connect',
16
+ /** Linked, below the Harness's coverage: close the named gaps. */
17
+ CLOSE_GAPS: 'close_gaps',
18
+ /** Linked, at the Harness's coverage with the Harness off: the user can switch it on. */
19
+ SWITCH_ON: 'switch_on',
20
+ /** Harness on, and the agent is driving a long journey by hand: hand it to explore. */
21
+ EXPLORE: 'explore',
22
+ };
23
+ /**
24
+ * A coverage percent, in fifths. A bucket answers "how far from the gate" without an exact number
25
+ * that, beside the stack and the size, starts to describe one app.
26
+ */
27
+ export const CoverageBucket = {
28
+ B0: '0-19',
29
+ B20: '20-39',
30
+ B40: '40-59',
31
+ B60: '60-79',
32
+ B80: '80-100',
33
+ };
34
+ const BUCKET_WIDTH = 20;
35
+ const BUCKETS = Object.values(CoverageBucket);
36
+ /** The bucket a 0..100 percent falls in. */
37
+ export function coverageBucketOf(percent) {
38
+ const index = Math.min(BUCKETS.length - 1, Math.max(0, Math.floor(percent / BUCKET_WIDTH)));
39
+ return BUCKETS[index] ?? CoverageBucket.B0;
40
+ }
9
41
  /**
10
42
  * One distinct error shape seen during a session, with the detail needed to fix it.
11
43
  *
@@ -322,6 +354,15 @@ export const SessionSummarySchema = z.object({
322
354
  * asked whether it worked is the finding, so absence and `false` must not look alike.
323
355
  */
324
356
  endedWithVerdict: z.boolean().optional(),
357
+ /**
358
+ * Session totals, on the FINAL summary only. Every scalar counter above (`toolCalls`,
359
+ * `verifications`, `bugsFound`, ...) is windowed on EVERY event, the final one included, so the
360
+ * counts summed across a session's `session_progress` + `daemon_stopped` rows are the session's
361
+ * total. These are the same totals read off one row, under names a sum cannot pick up by mistake.
362
+ */
363
+ lifetimeToolCalls: z.number().int().nonnegative().optional(),
364
+ lifetimeVerifications: z.number().int().nonnegative().optional(),
365
+ lifetimeBugsFound: z.number().int().nonnegative().optional(),
325
366
  /**
326
367
  * Was the update nudge actually delivered to an agent during this daemon run.
327
368
  *
@@ -364,6 +405,19 @@ export const SessionSummarySchema = z.object({
364
405
  hudSlides: z.record(z.number()).optional(),
365
406
  hudJourney: z.array(z.string().max(64)).max(60).optional(),
366
407
  hudJourneyCut: z.literal(true).optional(),
408
+ /**
409
+ * The one-time platform and Harness advisories an agent was shown, by kind (`AgentNudgeKind`).
410
+ * Whether a connect or an explore followed is read beside it: `cli_command_run` for `connect`, and
411
+ * `toolCounts` / `toolParams` for `reticle_verify`'s explore. Windowed; absent when none was shown.
412
+ */
413
+ nudgesShown: z.record(z.nativeEnum(AgentNudgeKind), z.number().int().positive()).optional(),
414
+ /**
415
+ * Harness drives refused for coverage below the gate, by coverage bucket (`CoverageBucket`).
416
+ * Windowed; absent when none was refused.
417
+ */
418
+ harnessRefusedCoverage: z
419
+ .record(z.nativeEnum(CoverageBucket), z.number().int().positive())
420
+ .optional(),
367
421
  /** Was this a clean shutdown, or a periodic flush of a still-running session? */
368
422
  final: z.boolean(),
369
423
  /**