@reticlehq/core 3.5.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 (113) hide show
  1. package/dist/artifacts/artifacts-entry.d.ts +4 -0
  2. package/dist/artifacts/artifacts-entry.js +4 -0
  3. package/dist/artifacts/drive-script.d.ts +1404 -0
  4. package/dist/artifacts/drive-script.js +220 -0
  5. package/dist/artifacts/flow-constants.d.ts +19 -0
  6. package/dist/artifacts/flow-constants.js +21 -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 +75 -427
  10. package/dist/artifacts/flow-types.js +15 -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/hud-notices.d.ts +134 -0
  16. package/dist/artifacts/hud-notices.js +124 -0
  17. package/dist/artifacts/impact.d.ts +489 -189
  18. package/dist/artifacts/impact.js +90 -47
  19. package/dist/artifacts/journal.d.ts +105 -5
  20. package/dist/artifacts/journal.js +41 -0
  21. package/dist/artifacts/prompt-context.d.ts +105 -0
  22. package/dist/artifacts/prompt-context.js +108 -0
  23. package/dist/artifacts/screenshot-upload.d.ts +51 -0
  24. package/dist/artifacts/screenshot-upload.js +26 -0
  25. package/dist/desktop-contract.cjs +1 -0
  26. package/dist/desktop-contract.d.cts +1 -0
  27. package/dist/hooks/hook-events.d.ts +4 -4
  28. package/dist/hud-entry.d.ts +2 -0
  29. package/dist/hud-entry.js +4 -0
  30. package/dist/identity/contract-fingerprint.d.ts +9 -0
  31. package/dist/identity/contract-fingerprint.js +12 -0
  32. package/dist/identity/testid-attribute.d.ts +18 -0
  33. package/dist/identity/testid-attribute.js +24 -0
  34. package/dist/index.d.ts +9 -1
  35. package/dist/index.js +9 -1
  36. package/dist/onboarding.d.ts +10 -2
  37. package/dist/onboarding.js +6 -0
  38. package/dist/realm/registry.js +19 -1
  39. package/dist/schema/command-message.json +36 -0
  40. package/dist/schema/command-name.json +5 -1
  41. package/dist/schema/event-payloads.json +56 -2
  42. package/dist/schema/reticle-message.json +36 -0
  43. package/dist/telemetry-bug.d.ts +169 -0
  44. package/dist/telemetry-bug.js +123 -0
  45. package/dist/telemetry-entry.d.ts +1 -0
  46. package/dist/telemetry-entry.js +1 -0
  47. package/dist/telemetry-feedback.d.ts +2 -2
  48. package/dist/telemetry-refusal.d.ts +5 -4
  49. package/dist/telemetry-session.d.ts +79 -1
  50. package/dist/telemetry-session.js +57 -1
  51. package/dist/telemetry-signals.d.ts +339 -0
  52. package/dist/telemetry-signals.js +138 -0
  53. package/dist/telemetry.d.ts +330 -276
  54. package/dist/telemetry.js +40 -115
  55. package/dist/tour.d.ts +1 -0
  56. package/dist/tour.js +13 -5
  57. package/dist/verdict/consequence.d.ts +3 -0
  58. package/dist/verdict/disparity.d.ts +105 -0
  59. package/dist/verdict/disparity.js +40 -0
  60. package/dist/verdict/findings.d.ts +11 -0
  61. package/dist/verdict/findings.js +16 -0
  62. package/dist/verdict/instrumentation-coverage.d.ts +115 -0
  63. package/dist/verdict/instrumentation-coverage.js +226 -0
  64. package/dist/verdict/instrumentation-gap.js +1 -1
  65. package/dist/verdict/intent.d.ts +19 -5
  66. package/dist/verdict/intent.js +13 -1
  67. package/dist/verdict/predicate-tree.d.ts +15 -0
  68. package/dist/verdict/predicate-tree.js +21 -0
  69. package/dist/verdict/predicate.d.ts +28 -0
  70. package/dist/verdict/predicate.js +94 -15
  71. package/dist/verdict/security.d.ts +25 -0
  72. package/dist/verdict/security.js +82 -0
  73. package/dist/verdict/verdict-attribution.js +1 -0
  74. package/dist/verdict/verification-run.d.ts +638 -32
  75. package/dist/verdict/verification-run.js +90 -0
  76. package/dist/verdict/verified-constants.d.ts +19 -0
  77. package/dist/verdict/verified-constants.js +22 -0
  78. package/dist/wire/constants/constants.d.ts +60 -32
  79. package/dist/wire/constants/constants.js +61 -33
  80. package/dist/wire/constants/hud-controls.d.ts +1 -1
  81. package/dist/wire/constants/hud-controls.js +34 -1
  82. package/dist/wire/constants/hud-use.d.ts +89 -1
  83. package/dist/wire/constants/hud-use.js +62 -1
  84. package/dist/wire/constants/mcp-wire.d.ts +10 -0
  85. package/dist/wire/constants/mcp-wire.js +10 -0
  86. package/dist/wire/constants/reticle-chrome.d.ts +19 -0
  87. package/dist/wire/constants/reticle-chrome.js +19 -0
  88. package/dist/wire/constants/session-constants.d.ts +21 -0
  89. package/dist/wire/constants/session-constants.js +21 -0
  90. package/dist/wire/desktop-contract.d.ts +11 -0
  91. package/dist/wire/desktop-contract.js +14 -0
  92. package/dist/wire/event-payloads.d.ts +77 -4
  93. package/dist/wire/event-payloads.js +27 -0
  94. package/dist/wire/global-press.d.ts +34 -3
  95. package/dist/wire/global-press.js +91 -3
  96. package/dist/wire/hold.d.ts +14 -0
  97. package/dist/wire/hold.js +18 -0
  98. package/dist/wire/messages.d.ts +129 -32
  99. package/dist/wire/messages.js +17 -1
  100. package/dist/wire/platform-link.d.ts +238 -0
  101. package/dist/wire/platform-link.js +234 -0
  102. package/dist/wire/tool-names.d.ts +2 -0
  103. package/dist/wire/tool-names.js +2 -0
  104. package/dist/wire/types.d.ts +26 -6
  105. package/dist/wire/types.js +5 -0
  106. package/dist/words/no-session-reason.d.ts +7 -0
  107. package/dist/words/no-session-reason.js +7 -0
  108. package/dist/words/notices.d.ts +1 -1
  109. package/dist/words/notices.js +5 -3
  110. package/dist/words/upgrade.js +1 -1
  111. package/dist/words/writing-rule.d.ts +14 -0
  112. package/dist/words/writing-rule.js +17 -0
  113. package/package.json +1 -1
@@ -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;
@@ -63,6 +63,7 @@ export declare const ToolRefusalSchema: z.ZodObject<{
63
63
  readonly AUTH_REFUSED: "auth_refused";
64
64
  readonly LEASE_EXPIRED: "lease_expired";
65
65
  readonly TAB_GONE: "tab_gone";
66
+ readonly NAVIGATED_AWAY: "navigated_away";
66
67
  readonly ROUTE_SERVER_ERROR: "route_server_error";
67
68
  readonly APP_NOT_REOPENED: "app_not_reopened";
68
69
  readonly CONFIG_ELSEWHERE: "config_elsewhere";
@@ -82,14 +83,14 @@ export declare const ToolRefusalSchema: z.ZodObject<{
82
83
  */
83
84
  retried: z.ZodBoolean;
84
85
  }, "strip", z.ZodTypeAny, {
85
- reason: "other" | "no_session" | "no_match" | "unsupported" | "bad_args" | "not_ready";
86
86
  tool: string;
87
+ reason: "other" | "no_session" | "no_match" | "unsupported" | "bad_args" | "not_ready";
87
88
  retried: boolean;
88
- noSessionReason?: "auth_refused" | "lease_expired" | "tab_gone" | "route_server_error" | "app_not_reopened" | "config_elsewhere" | "no_listener_no_config" | "no_listener" | "no_config" | "sdk_not_reaching_daemon" | undefined;
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;
89
90
  }, {
90
- reason: "other" | "no_session" | "no_match" | "unsupported" | "bad_args" | "not_ready";
91
91
  tool: string;
92
+ reason: "other" | "no_session" | "no_match" | "unsupported" | "bad_args" | "not_ready";
92
93
  retried: boolean;
93
- noSessionReason?: "auth_refused" | "lease_expired" | "tab_gone" | "route_server_error" | "app_not_reopened" | "config_elsewhere" | "no_listener_no_config" | "no_listener" | "no_config" | "sdk_not_reaching_daemon" | undefined;
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;
94
95
  }>;
95
96
  export type ToolRefusal = z.infer<typeof ToolRefusalSchema>;
@@ -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
  *
@@ -486,13 +524,41 @@ export declare const SessionSummarySchema: z.ZodObject<{
486
524
  * `hudControls` counts presses per control id (a toggle as `id:on` / `id:off`), `hudViewMs` and
487
525
  * `hudPanelMs` time how the HUD sat (bubble / collapsed / expanded) and which panel was showing,
488
526
  * and `hudJourney` is the window's presses and view changes in order, cut at 60 with
489
- * `hudJourneyCut`. Every key is a control id from core's closed list: names, never values.
527
+ * `hudJourneyCut`. `hudSlides` counts how often each rail slide was shown, by its id. Every key
528
+ * is a control or slide id Reticle authored: names, never values.
490
529
  */
491
530
  hudControls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
492
531
  hudViewMs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
493
532
  hudPanelMs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
533
+ hudSlides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
494
534
  hudJourney: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
495
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>>;
496
562
  /** Was this a clean shutdown, or a periodic flush of a still-running session? */
497
563
  final: z.ZodBoolean;
498
564
  /**
@@ -570,13 +636,19 @@ export declare const SessionSummarySchema: z.ZodObject<{
570
636
  errorsRecovered?: number | undefined;
571
637
  errorsRepeated?: number | undefined;
572
638
  endedWithVerdict?: boolean | undefined;
639
+ lifetimeToolCalls?: number | undefined;
640
+ lifetimeVerifications?: number | undefined;
641
+ lifetimeBugsFound?: number | undefined;
573
642
  updateNudged?: boolean | undefined;
574
643
  updateOffered?: string | undefined;
575
644
  hudControls?: Record<string, number> | undefined;
576
645
  hudViewMs?: Record<string, number> | undefined;
577
646
  hudPanelMs?: Record<string, number> | undefined;
647
+ hudSlides?: Record<string, number> | undefined;
578
648
  hudJourney?: string[] | undefined;
579
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;
580
652
  exit?: "signal" | "idle" | "unknown" | undefined;
581
653
  }, {
582
654
  durationMs: number;
@@ -640,13 +712,19 @@ export declare const SessionSummarySchema: z.ZodObject<{
640
712
  errorsRecovered?: number | undefined;
641
713
  errorsRepeated?: number | undefined;
642
714
  endedWithVerdict?: boolean | undefined;
715
+ lifetimeToolCalls?: number | undefined;
716
+ lifetimeVerifications?: number | undefined;
717
+ lifetimeBugsFound?: number | undefined;
643
718
  updateNudged?: boolean | undefined;
644
719
  updateOffered?: string | undefined;
645
720
  hudControls?: Record<string, number> | undefined;
646
721
  hudViewMs?: Record<string, number> | undefined;
647
722
  hudPanelMs?: Record<string, number> | undefined;
723
+ hudSlides?: Record<string, number> | undefined;
648
724
  hudJourney?: string[] | undefined;
649
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;
650
728
  exit?: "signal" | "idle" | "unknown" | undefined;
651
729
  }>;
652
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
  *
@@ -355,13 +396,28 @@ export const SessionSummarySchema = z.object({
355
396
  * `hudControls` counts presses per control id (a toggle as `id:on` / `id:off`), `hudViewMs` and
356
397
  * `hudPanelMs` time how the HUD sat (bubble / collapsed / expanded) and which panel was showing,
357
398
  * and `hudJourney` is the window's presses and view changes in order, cut at 60 with
358
- * `hudJourneyCut`. Every key is a control id from core's closed list: names, never values.
399
+ * `hudJourneyCut`. `hudSlides` counts how often each rail slide was shown, by its id. Every key
400
+ * is a control or slide id Reticle authored: names, never values.
359
401
  */
360
402
  hudControls: z.record(z.number()).optional(),
361
403
  hudViewMs: z.record(z.number()).optional(),
362
404
  hudPanelMs: z.record(z.number()).optional(),
405
+ hudSlides: z.record(z.number()).optional(),
363
406
  hudJourney: z.array(z.string().max(64)).max(60).optional(),
364
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(),
365
421
  /** Was this a clean shutdown, or a periodic flush of a still-running session? */
366
422
  final: z.boolean(),
367
423
  /**