@reticlehq/core 2.14.0 → 3.1.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 (143) hide show
  1. package/dist/{artifacts-entry.d.ts → artifacts/artifacts-entry.d.ts} +7 -7
  2. package/dist/{artifacts-entry.js → artifacts/artifacts-entry.js} +7 -7
  3. package/dist/artifacts/flow-composition.d.ts +30 -0
  4. package/dist/artifacts/flow-composition.js +19 -0
  5. package/dist/{flow-constants.d.ts → artifacts/flow-constants.d.ts} +89 -3
  6. package/dist/{flow-constants.js → artifacts/flow-constants.js} +95 -4
  7. package/dist/artifacts/flow-mutation-target.d.ts +39 -0
  8. package/dist/artifacts/flow-mutation-target.js +89 -0
  9. package/dist/artifacts/flow-order.d.ts +30 -0
  10. package/dist/artifacts/flow-order.js +49 -0
  11. package/dist/artifacts/flow-select.d.ts +56 -0
  12. package/dist/artifacts/flow-select.js +56 -0
  13. package/dist/artifacts/flow-step-tool.d.ts +31 -0
  14. package/dist/artifacts/flow-step-tool.js +31 -0
  15. package/dist/artifacts/flow-types.d.ts +3736 -0
  16. package/dist/artifacts/flow-types.js +463 -0
  17. package/dist/artifacts/flow-unreached.d.ts +12 -0
  18. package/dist/artifacts/flow-unreached.js +24 -0
  19. package/dist/{impact.d.ts → artifacts/impact.d.ts} +119 -103
  20. package/dist/{impact.js → artifacts/impact.js} +14 -5
  21. package/dist/{journal.d.ts → artifacts/journal.d.ts} +51 -7
  22. package/dist/{journal.js → artifacts/journal.js} +38 -2
  23. package/dist/artifacts/step-effect.d.ts +29 -0
  24. package/dist/artifacts/step-effect.js +28 -0
  25. package/dist/hooks/hook-events.d.ts +311 -0
  26. package/dist/hooks/hook-events.js +127 -0
  27. package/dist/hooks/hooks-entry.d.ts +9 -0
  28. package/dist/hooks/hooks-entry.js +9 -0
  29. package/dist/{brand.d.ts → identity/brand.d.ts} +7 -0
  30. package/dist/{contract-fingerprint.d.ts → identity/contract-fingerprint.d.ts} +21 -3
  31. package/dist/{contract-fingerprint.js → identity/contract-fingerprint.js} +22 -4
  32. package/dist/{document-identity.d.ts → identity/document-identity.d.ts} +4 -5
  33. package/dist/{document-identity.js → identity/document-identity.js} +4 -5
  34. package/dist/{source-constants.d.ts → identity/source-constants.d.ts} +4 -4
  35. package/dist/{source-constants.js → identity/source-constants.js} +4 -4
  36. package/dist/index.d.ts +56 -43
  37. package/dist/index.js +65 -45
  38. package/dist/onboarding.d.ts +114 -0
  39. package/dist/onboarding.js +141 -0
  40. package/dist/realm/registry.d.ts +212 -0
  41. package/dist/realm/registry.js +302 -0
  42. package/dist/{dev-server-registry.d.ts → registry/dev-server-registry.d.ts} +6 -7
  43. package/dist/{dev-server-registry.js → registry/dev-server-registry.js} +28 -19
  44. package/dist/{project-registry.d.ts → registry/project-registry.d.ts} +5 -5
  45. package/dist/{project-registry.js → registry/project-registry.js} +5 -5
  46. package/dist/schema/command-name.json +31 -0
  47. package/dist/schema/event-payloads.json +791 -0
  48. package/dist/schema/hello-message.json +70 -2
  49. package/dist/schema/reticle-message.json +70 -2
  50. package/dist/telemetry-entry.d.ts +1 -1
  51. package/dist/telemetry-entry.js +1 -1
  52. package/dist/telemetry-feedback.d.ts +15 -16
  53. package/dist/telemetry-feedback.js +11 -12
  54. package/dist/telemetry-license.d.ts +1 -1
  55. package/dist/telemetry-license.js +1 -1
  56. package/dist/telemetry-refusal.d.ts +11 -11
  57. package/dist/telemetry-refusal.js +7 -8
  58. package/dist/telemetry-session.d.ts +51 -59
  59. package/dist/telemetry-session.js +47 -55
  60. package/dist/telemetry.d.ts +243 -214
  61. package/dist/telemetry.js +83 -98
  62. package/dist/tour-entry.d.ts +10 -0
  63. package/dist/tour-entry.js +10 -0
  64. package/dist/tour.d.ts +125 -0
  65. package/dist/tour.js +165 -0
  66. package/dist/{consequence.d.ts → verdict/consequence.d.ts} +32 -15
  67. package/dist/{consequence.js → verdict/consequence.js} +9 -31
  68. package/dist/{finding-fingerprint.js → verdict/finding-fingerprint.js} +1 -1
  69. package/dist/{findings.d.ts → verdict/findings.d.ts} +86 -39
  70. package/dist/{findings.js → verdict/findings.js} +103 -49
  71. package/dist/{instrumentation-gap.d.ts → verdict/instrumentation-gap.d.ts} +7 -14
  72. package/dist/{instrumentation-gap.js → verdict/instrumentation-gap.js} +7 -15
  73. package/dist/{intent.d.ts → verdict/intent.d.ts} +35 -46
  74. package/dist/{intent.js → verdict/intent.js} +11 -22
  75. package/dist/verdict/revision.d.ts +44 -0
  76. package/dist/verdict/revision.js +53 -0
  77. package/dist/{run-context.d.ts → verdict/run-context.d.ts} +13 -34
  78. package/dist/{run-context.js → verdict/run-context.js} +15 -36
  79. package/dist/{security.js → verdict/security.js} +12 -21
  80. package/dist/{verification-run.d.ts → verdict/verification-run.d.ts} +381 -105
  81. package/dist/{verification-run.js → verdict/verification-run.js} +157 -21
  82. package/dist/{verified-constants.d.ts → verdict/verified-constants.d.ts} +25 -13
  83. package/dist/{verified-constants.js → verdict/verified-constants.js} +25 -13
  84. package/dist/{verify-progress.d.ts → verdict/verify-progress.d.ts} +18 -22
  85. package/dist/{verify-progress.js → verdict/verify-progress.js} +6 -10
  86. package/dist/wire/channel.d.ts +46 -0
  87. package/dist/wire/channel.js +95 -0
  88. package/dist/{constants.d.ts → wire/constants/constants.d.ts} +91 -28
  89. package/dist/{constants.js → wire/constants/constants.js} +105 -28
  90. package/dist/{session-constants.d.ts → wire/constants/session-constants.d.ts} +9 -2
  91. package/dist/{session-constants.js → wire/constants/session-constants.js} +9 -2
  92. package/dist/{desktop-contract.js → wire/desktop-contract.js} +1 -1
  93. package/dist/{event-classification.js → wire/event-classification.js} +1 -1
  94. package/dist/{event-payloads.d.ts → wire/event-payloads.d.ts} +68 -13
  95. package/dist/{event-payloads.js → wire/event-payloads.js} +21 -3
  96. package/dist/{event-priority.d.ts → wire/event-priority.d.ts} +1 -4
  97. package/dist/{event-priority.js → wire/event-priority.js} +2 -5
  98. package/dist/{global-press.js → wire/global-press.js} +1 -1
  99. package/dist/{messages.d.ts → wire/messages.d.ts} +239 -48
  100. package/dist/{messages.js → wire/messages.js} +68 -5
  101. package/dist/wire/narrow.d.ts +39 -0
  102. package/dist/wire/narrow.js +45 -0
  103. package/dist/{net.d.ts → wire/net.d.ts} +12 -13
  104. package/dist/{net.js → wire/net.js} +12 -13
  105. package/dist/wire/platform.d.ts +37 -0
  106. package/dist/wire/platform.js +36 -0
  107. package/dist/{redaction.js → wire/redaction.js} +12 -12
  108. package/dist/wire/tool-names.d.ts +133 -0
  109. package/dist/wire/tool-names.js +142 -0
  110. package/dist/{toon.js → wire/toon.js} +1 -1
  111. package/dist/{types.d.ts → wire/types.d.ts} +77 -76
  112. package/dist/{types.js → wire/types.js} +4 -3
  113. package/dist/{no-session-reason.d.ts → words/no-session-reason.d.ts} +7 -3
  114. package/dist/{no-session-reason.js → words/no-session-reason.js} +7 -3
  115. package/dist/{notices.d.ts → words/notices.d.ts} +8 -12
  116. package/dist/{notices.js → words/notices.js} +8 -12
  117. package/package.json +16 -7
  118. package/dist/flow-types.d.ts +0 -1711
  119. package/dist/flow-types.js +0 -247
  120. package/dist/{impact-savings.d.ts → artifacts/impact-savings.d.ts} +0 -0
  121. package/dist/{impact-savings.js → artifacts/impact-savings.js} +0 -0
  122. package/dist/{brand.js → identity/brand.js} +0 -0
  123. package/dist/{edit-epoch.d.ts → identity/edit-epoch.d.ts} +0 -0
  124. package/dist/{edit-epoch.js → identity/edit-epoch.js} +0 -0
  125. package/dist/{project-id.d.ts → identity/project-id.d.ts} +0 -0
  126. package/dist/{project-id.js → identity/project-id.js} +0 -0
  127. package/dist/{daemon-registry.d.ts → registry/daemon-registry.d.ts} +0 -0
  128. package/dist/{daemon-registry.js → registry/daemon-registry.js} +0 -0
  129. package/dist/{finding-fingerprint.d.ts → verdict/finding-fingerprint.d.ts} +0 -0
  130. package/dist/{security.d.ts → verdict/security.d.ts} +0 -0
  131. package/dist/{desktop-contract.d.ts → wire/desktop-contract.d.ts} +0 -0
  132. package/dist/{event-classification.d.ts → wire/event-classification.d.ts} +0 -0
  133. package/dist/{global-press.d.ts → wire/global-press.d.ts} +0 -0
  134. package/dist/{redaction.d.ts → wire/redaction.d.ts} +0 -0
  135. package/dist/{state-select.d.ts → wire/state-select.d.ts} +0 -0
  136. package/dist/{state-select.js → wire/state-select.js} +0 -0
  137. package/dist/{toon.d.ts → wire/toon.d.ts} +0 -0
  138. package/dist/{browser-misdirect.d.ts → words/browser-misdirect.d.ts} +0 -0
  139. package/dist/{browser-misdirect.js → words/browser-misdirect.js} +0 -0
  140. package/dist/{unreachable-notice.d.ts → words/unreachable-notice.d.ts} +0 -0
  141. package/dist/{unreachable-notice.js → words/unreachable-notice.js} +0 -0
  142. package/dist/{upgrade.d.ts → words/upgrade.d.ts} +2 -2
  143. /package/dist/{upgrade.js → words/upgrade.js} +0 -0
@@ -1,1711 +0,0 @@
1
- import { z } from 'zod';
2
- import { ActionType, type DriftReason, type HealStatus, type ReplayStatus } from './constants.js';
3
- /**
4
- * The MCP tool names that can appear as a recorded flow step's `tool`. These are the ONLY tool names
5
- * that cross the wire into a persisted flow file — the browser recorder stamps them, the server replays
6
- * them, and FlowStep types them — so they live in core, the wire contract. The full agent-facing tool
7
- * surface stays server-side (ReticleTool); ReticleTool references THESE for the flow-persisted three, so
8
- * there is one source of truth and a rename cannot silently desync the recorder from the replayer (a
9
- * tool rename once killed four e2e specs — this closes the browser/server half of that drift).
10
- */
11
- export declare const FlowStepTool: {
12
- readonly ACT: "reticle_act";
13
- readonly ACT_SEQUENCE: "reticle_act_sequence";
14
- readonly ACT_AND_WAIT: "reticle_act_and_wait";
15
- };
16
- export type FlowStepTool = (typeof FlowStepTool)[keyof typeof FlowStepTool];
17
- /**
18
- * A semantic anchor: how a step re-finds its element/event at replay
19
- * time. Never a volatile eXX ref. testid/role+name bind a DOM element; signal binds an event.
20
- */
21
- export declare const FlowAnchorSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
22
- kind: z.ZodLiteral<"testid">;
23
- value: z.ZodString;
24
- source: z.ZodOptional<z.ZodObject<{
25
- file: z.ZodString;
26
- line: z.ZodNumber;
27
- column: z.ZodOptional<z.ZodNumber>;
28
- }, "strip", z.ZodTypeAny, {
29
- file: string;
30
- line: number;
31
- column?: number | undefined;
32
- }, {
33
- file: string;
34
- line: number;
35
- column?: number | undefined;
36
- }>>;
37
- }, "strip", z.ZodTypeAny, {
38
- value: string;
39
- kind: "testid";
40
- source?: {
41
- file: string;
42
- line: number;
43
- column?: number | undefined;
44
- } | undefined;
45
- }, {
46
- value: string;
47
- kind: "testid";
48
- source?: {
49
- file: string;
50
- line: number;
51
- column?: number | undefined;
52
- } | undefined;
53
- }>, z.ZodObject<{
54
- kind: z.ZodLiteral<"role">;
55
- role: z.ZodString;
56
- name: z.ZodOptional<z.ZodString>;
57
- }, "strip", z.ZodTypeAny, {
58
- role: string;
59
- kind: "role";
60
- name?: string | undefined;
61
- }, {
62
- role: string;
63
- kind: "role";
64
- name?: string | undefined;
65
- }>, z.ZodObject<{
66
- kind: z.ZodLiteral<"signal">;
67
- name: z.ZodString;
68
- }, "strip", z.ZodTypeAny, {
69
- name: string;
70
- kind: "signal";
71
- }, {
72
- name: string;
73
- kind: "signal";
74
- }>, z.ZodObject<{
75
- kind: z.ZodLiteral<"component">;
76
- component: z.ZodOptional<z.ZodString>;
77
- source: z.ZodOptional<z.ZodObject<{
78
- file: z.ZodString;
79
- line: z.ZodNumber;
80
- column: z.ZodOptional<z.ZodNumber>;
81
- }, "strip", z.ZodTypeAny, {
82
- file: string;
83
- line: number;
84
- column?: number | undefined;
85
- }, {
86
- file: string;
87
- line: number;
88
- column?: number | undefined;
89
- }>>;
90
- role: z.ZodOptional<z.ZodString>;
91
- name: z.ZodOptional<z.ZodString>;
92
- }, "strip", z.ZodTypeAny, {
93
- kind: "component";
94
- source?: {
95
- file: string;
96
- line: number;
97
- column?: number | undefined;
98
- } | undefined;
99
- role?: string | undefined;
100
- component?: string | undefined;
101
- name?: string | undefined;
102
- }, {
103
- kind: "component";
104
- source?: {
105
- file: string;
106
- line: number;
107
- column?: number | undefined;
108
- } | undefined;
109
- role?: string | undefined;
110
- component?: string | undefined;
111
- name?: string | undefined;
112
- }>]>;
113
- export type FlowAnchor = z.infer<typeof FlowAnchorSchema>;
114
- /**
115
- * A post-condition a step asserts (compiled from a structured annotation; optional).
116
- *
117
- * Strict, at every nesting level: an unrecognized key (a typo, or a predicate kind this schema
118
- * doesn't model, e.g. `allOf`, or a typo'd `net`/`console`/`element`/`state` sub-field) must fail
119
- * to parse instead of being silently dropped. A loose z.object() here would quietly discard the
120
- * extra key and leave the step with a weaker (or empty) assertion than its author wrote — the
121
- * flow then replays green against nothing, having proved no real regression.
122
- */
123
- export declare const FlowExpectSchema: z.ZodObject<{
124
- signal: z.ZodOptional<z.ZodString>;
125
- /**
126
- * Optional payload shape an `assert-signal` annotation requires the signal
127
- * to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
128
- * bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
129
- */
130
- signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
131
- /**
132
- * Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
133
- * only way a saved flow can keep a cardinality the agent actually asserted. Without it a
134
- * `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
135
- * one made: the replayed flow then goes green on the double-fire it was recorded to catch.
136
- * Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
137
- */
138
- signalCount: z.ZodOptional<z.ZodNumber>;
139
- net: z.ZodOptional<z.ZodObject<{
140
- method: z.ZodOptional<z.ZodString>;
141
- urlContains: z.ZodOptional<z.ZodString>;
142
- status: z.ZodOptional<z.ZodNumber>;
143
- /**
144
- * Exact number of matching requests since the action — turns presence into a cardinality
145
- * assertion. Catches the double-submit / useEffect-double-fire / retry-storm regression class:
146
- * the request fired (presence passes) but fired the WRONG number of times. Omit = presence (≥1).
147
- */
148
- count: z.ZodOptional<z.ZodNumber>;
149
- }, "strict", z.ZodTypeAny, {
150
- status?: number | undefined;
151
- method?: string | undefined;
152
- count?: number | undefined;
153
- urlContains?: string | undefined;
154
- }, {
155
- status?: number | undefined;
156
- method?: string | undefined;
157
- count?: number | undefined;
158
- urlContains?: string | undefined;
159
- }>>;
160
- /**
161
- * Console golden end-condition: assert the action logged (or, with absent:true, did NOT log) a
162
- * console message at `level` (default 'error'). `absent:true` is the common case — "the action
163
- * completed with a clean console" — catching the regression where an action throws a caught error
164
- * / logs an uncaught rejection while the UI still renders fine (a presence check passes it).
165
- */
166
- console: z.ZodOptional<z.ZodObject<{
167
- level: z.ZodOptional<z.ZodString>;
168
- absent: z.ZodOptional<z.ZodBoolean>;
169
- }, "strict", z.ZodTypeAny, {
170
- level?: string | undefined;
171
- absent?: boolean | undefined;
172
- }, {
173
- level?: string | undefined;
174
- absent?: boolean | undefined;
175
- }>>;
176
- element: z.ZodOptional<z.ZodObject<{
177
- testid: z.ZodOptional<z.ZodString>;
178
- role: z.ZodOptional<z.ZodString>;
179
- name: z.ZodOptional<z.ZodString>;
180
- }, "strict", z.ZodTypeAny, {
181
- testid?: string | undefined;
182
- role?: string | undefined;
183
- name?: string | undefined;
184
- }, {
185
- testid?: string | undefined;
186
- role?: string | undefined;
187
- name?: string | undefined;
188
- }>>;
189
- /**
190
- * Rendered text as an end-condition, using the shapes the assert surface already accepts.
191
- *
192
- * The gap this closes: an app with no testids, no `reticle.signal`, no registrable store and no
193
- * network call on the interaction under test -- a discount price computed and rendered, a
194
- * formatted total, a derived label -- could not produce an asserted flow AT ALL. Everything the
195
- * vocabulary offered needed a channel that app does not have, so the only honest outcome was
196
- * `assertion-free`, which is a permanent green (#811).
197
- *
198
- * Derived-DOM rendering is a large share of what actually breaks in a UI, and it was the share
199
- * that could not be pinned.
200
- *
201
- * Classified PRESENCE, not consequence, and that is not a technicality: text is read from the
202
- * DOM, so a locator healed to the wrong element can still satisfy it. It earns `presence-only`,
203
- * which is a real grade above `assertion-free` and honestly below `signal`/`net`/`state`.
204
- */
205
- text: z.ZodOptional<z.ZodObject<{
206
- contains: z.ZodString;
207
- /** Narrow the search to a container, exactly as the `text` predicate's `scope` does. */
208
- scope: z.ZodOptional<z.ZodString>;
209
- /** Assert the text is GONE — the regression check for a cleared error or a dismissed toast. */
210
- absent: z.ZodOptional<z.ZodBoolean>;
211
- /** Require the match to be visible, not merely present in the DOM. */
212
- visible: z.ZodOptional<z.ZodBoolean>;
213
- }, "strict", z.ZodTypeAny, {
214
- contains: string;
215
- visible?: boolean | undefined;
216
- absent?: boolean | undefined;
217
- scope?: string | undefined;
218
- }, {
219
- contains: string;
220
- visible?: boolean | undefined;
221
- absent?: boolean | undefined;
222
- scope?: string | undefined;
223
- }>>;
224
- /**
225
- * Assert a registered store's value — the source of truth no DOM/network read can reach. Compiles
226
- * to the predicate engine's `state` predicate. Additive/optional — a flow without it still parses
227
- * and the on-disk version stays FLOW_FILE_VERSION 1. `equals` accepts a literal, omitted = presence,
228
- * or a `{ $gte | $contains | $length }` operator pattern.
229
- */
230
- state: z.ZodOptional<z.ZodObject<{
231
- store: z.ZodOptional<z.ZodString>;
232
- path: z.ZodString;
233
- equals: z.ZodOptional<z.ZodUnknown>;
234
- /**
235
- * Treat this as an INVARIANT that must still hold AFTER the action settles, rather than a
236
- * condition to wait for. Set it for a blast-radius check ("this unrelated path must NOT have
237
- * moved") — without it a wait-until-true read passes before an over-reaching side-effect lands.
238
- */
239
- hold: z.ZodOptional<z.ZodBoolean>;
240
- }, "strict", z.ZodTypeAny, {
241
- path: string;
242
- store?: string | undefined;
243
- equals?: unknown;
244
- hold?: boolean | undefined;
245
- }, {
246
- path: string;
247
- store?: string | undefined;
248
- equals?: unknown;
249
- hold?: boolean | undefined;
250
- }>>;
251
- }, "strict", z.ZodTypeAny, {
252
- state?: {
253
- path: string;
254
- store?: string | undefined;
255
- equals?: unknown;
256
- hold?: boolean | undefined;
257
- } | undefined;
258
- signal?: string | undefined;
259
- text?: {
260
- contains: string;
261
- visible?: boolean | undefined;
262
- absent?: boolean | undefined;
263
- scope?: string | undefined;
264
- } | undefined;
265
- signalData?: Record<string, unknown> | undefined;
266
- signalCount?: number | undefined;
267
- net?: {
268
- status?: number | undefined;
269
- method?: string | undefined;
270
- count?: number | undefined;
271
- urlContains?: string | undefined;
272
- } | undefined;
273
- console?: {
274
- level?: string | undefined;
275
- absent?: boolean | undefined;
276
- } | undefined;
277
- element?: {
278
- testid?: string | undefined;
279
- role?: string | undefined;
280
- name?: string | undefined;
281
- } | undefined;
282
- }, {
283
- state?: {
284
- path: string;
285
- store?: string | undefined;
286
- equals?: unknown;
287
- hold?: boolean | undefined;
288
- } | undefined;
289
- signal?: string | undefined;
290
- text?: {
291
- contains: string;
292
- visible?: boolean | undefined;
293
- absent?: boolean | undefined;
294
- scope?: string | undefined;
295
- } | undefined;
296
- signalData?: Record<string, unknown> | undefined;
297
- signalCount?: number | undefined;
298
- net?: {
299
- status?: number | undefined;
300
- method?: string | undefined;
301
- count?: number | undefined;
302
- urlContains?: string | undefined;
303
- } | undefined;
304
- console?: {
305
- level?: string | undefined;
306
- absent?: boolean | undefined;
307
- } | undefined;
308
- element?: {
309
- testid?: string | undefined;
310
- role?: string | undefined;
311
- name?: string | undefined;
312
- } | undefined;
313
- }>;
314
- export type FlowExpect = z.infer<typeof FlowExpectSchema>;
315
- /** One step of a flow: an anchored action (+ optional expectation). */
316
- export interface FlowStep {
317
- /** FlowStepTool.ACT | FlowStepTool.ACT_SEQUENCE (core, shared with ReticleTool). */
318
- tool: string;
319
- anchor: FlowAnchor;
320
- action?: ActionType;
321
- args?: Record<string, unknown>;
322
- expect?: FlowExpect;
323
- /** true when the anchor is best-effort (no testid was resolvable at record time). NOT dropped. */
324
- degraded?: boolean;
325
- /**
326
- * How long THIS step's `expect` waits for its consequence, in ms. Overrides the flow's
327
- * `signalTimeoutMs` and the built-in FLOW_SIGNAL_TIMEOUT_MS default.
328
- *
329
- * Replay's wait was a fixed 4s with no way to raise it, and that is not a tuning knob — it decides
330
- * whether an honest flow can ever be green. Two field reports, same shape: a login whose POST takes
331
- * a measured 5.5s against a remote Postgres, and a CAD import whose LLM-backed perception takes
332
- * ~22s. Both were verified live with `act_and_wait { timeout_ms }`, both drifted on replay at
333
- * ~4020ms with `signal_not_observed`, and both were reported to the user as NO LONGER TRUE — a
334
- * working feature called a regression. The only ways to green them were to weaken or delete the
335
- * assertion, which the rules correctly forbid, so the flow was honest and permanently red.
336
- *
337
- * One agent tried exactly this field and `expect.timeout_ms`, and both were silently dropped.
338
- * Replay must not be stricter than the tool that recorded the step.
339
- */
340
- timeoutMs?: number;
341
- /** sub-steps for an act_sequence, each independently anchored. */
342
- steps?: FlowStep[];
343
- }
344
- export declare const FlowStepSchema: z.ZodType<FlowStep>;
345
- /**
346
- * A legible-drift record returned when an anchor misses at replay.
347
- * The "whose fault is it" payload: what was expected, why it's gone, and the closest surviving
348
- * anchor (a concrete fix suggestion). Never a bare "command failed".
349
- */
350
- export interface Drift {
351
- /** Named reason kind (testid not found / signal not observed). */
352
- reasonKind: DriftReason;
353
- /** Human sentence, e.g. `testid "chat-send" not found`. */
354
- reason: string;
355
- /** The missed anchor value (the testid string, or the signal name). */
356
- anchor: string;
357
- /** Closest present testid via the live near-miss; null only when the page has no testids (or signal drift). */
358
- nearest: string | null;
359
- /**
360
- * True when two or more present testids tie at the minimum edit distance, so `nearest` is an
361
- * arbitrary pick. An ambiguous drift is NEVER auto-healed (a wrong rebind ships a bug green) —
362
- * it is surfaced for a human/agent to choose. Absent ⇒ unambiguous.
363
- */
364
- ambiguous?: boolean;
365
- }
366
- /** The per-step result of re-resolving + running one anchored step. */
367
- export interface FlowStepResult {
368
- /** 0-based index of this step in the flow. */
369
- step: number;
370
- /** The tool the step runs — FlowStepTool.ACT | ACT_SEQUENCE (core). */
371
- tool: string;
372
- /** The testid/signal value the step is bound to (the re-resolved anchor). */
373
- anchor: string;
374
- /**
375
- * The route (pathname) the page was on when this step ran — the "which page" of the journey.
376
- * Additive/optional: present when a route is observable, absent in route-less contexts (e.g. a
377
- * fake session with no route events). Lets a replay result read as a page-by-page journey.
378
- */
379
- page?: string;
380
- /**
381
- * A compact summary of the observable CONSEQUENCE in the window right after this step ran — the
382
- * "what happened" of the journey: a route change, a domain signal (e.g. a modal opening), a
383
- * network call, or console errors. Additive/optional and intentionally terse (token-cheap). It
384
- * captures what had landed by the time the action settled, so a very-late async effect may not
385
- * appear; the asserted consequence (expect/success) is the authoritative pass/fail signal.
386
- */
387
- consequence?: string;
388
- /**
389
- * Wall-clock ms this step took (dispatch → post-settle), from the session's injected elapsed clock.
390
- * Additive/optional: absent in contexts with no advancing clock. Feeds per-step run-to-run perf diffs.
391
- */
392
- durationMs?: number;
393
- ok: boolean;
394
- error?: string;
395
- note?: string;
396
- /** Present iff this step stopped on an anchor miss. */
397
- drift?: Drift;
398
- /**
399
- * A confidence-scored nearest-match rebind for this drifted step (additive,
400
- * optional). Set only for a confident testid drift.
401
- */
402
- proposal?: HealProposal;
403
- }
404
- /**
405
- * The autonomy decision envelope — the feedback a human used to give, made machine-actionable. From
406
- * a replay result it states the verdict, what changed, WHERE in the source to look (file:line, from a
407
- * component anchor), a suggested fix, and the single next action — so a coding agent decides its next
408
- * move without a human in the loop. Terse by design (token-cheap).
409
- */
410
- export interface ReplayDecision {
411
- /** pass = intent held; drift = a locator/anchor missed; fail = an action or the success oracle failed. */
412
- verdict: 'pass' | 'drift' | 'fail';
413
- /** One-line human/agent summary of the outcome. */
414
- summary: string;
415
- /** What regressed (the drift reason or failure), when not a pass. */
416
- whatChanged?: string;
417
- /** Where to look — `file:line` from the failing step's source anchor, or the page route. */
418
- whereInSource?: string;
419
- /** A concrete fix hint (e.g. rebind to the nearest surviving anchor). */
420
- suggestedFix?: string;
421
- /** The single next action the agent should take. */
422
- nextAction: string;
423
- }
424
- /**
425
- * One flow's line in a suite verdict — pass counts as a name; a failure carries the actionable
426
- * decision fields so the agent can fix it without re-querying.
427
- */
428
- export interface SuiteFlowResult {
429
- flow: string;
430
- /**
431
- * The flow never ran: its file failed to load, or its leased context never came up. Nothing was
432
- * learned about the app, so this row is not a regression — it is Reticle reporting its own failure
433
- * in the same array as the app's. Measured: one sweep emitted 8 `flow-regression` bug_found events
434
- * off rows like these, from a suite where no flow ever executed.
435
- */
436
- couldNotRun?: boolean;
437
- verdict: 'pass' | 'drift' | 'fail';
438
- whatChanged?: string;
439
- whereInSource?: string;
440
- nextAction?: string;
441
- }
442
- /**
443
- * The consolidated verdict of replaying EVERY known flow — the autonomous loop's "did I break
444
- * anything, and what do I fix" answer in one deterministic call. Passing flows are counted; only
445
- * failures carry detail (token-cheap). `status` is fail if any flow drifted or errored.
446
- */
447
- export interface SuiteVerdict {
448
- /**
449
- * `unverifiable` means the suite contained flows that CANNOT FAIL, so "pass" would be a lie.
450
- *
451
- * A recorded flow with no steps, or one that asserts no observable consequence, replays green no
452
- * matter what the app does. Reporting `pass` for it is a false green in the exact feature sold as
453
- * the regression suite — measured: a flow saved as `{steps: [], intent: "..."}`, which `flow_save`
454
- * had ALREADY graded assertion-free with a warning, came back "all 1 flow pass".
455
- */
456
- status: 'pass' | 'fail' | 'unverifiable';
457
- total: number;
458
- passed: number;
459
- failed: number;
460
- summary: string;
461
- /** Only the failing flows, with their decision (verdict, what changed, where, next action). */
462
- failures: SuiteFlowResult[];
463
- /**
464
- * Flows that replayed without error but assert nothing, so their green means nothing. Counted
465
- * apart from `passed` — a number that includes them is not a count of anything verified.
466
- */
467
- unverifiable?: {
468
- flow: string;
469
- reason: string;
470
- }[];
471
- /**
472
- * Flows that have both passed AND failed on UNCHANGED code — intermittent, not regressions.
473
- *
474
- * A flake and a regression demand opposite responses: one is chased, the other is quarantined. The
475
- * ledger that answers this already existed and was written only by the CLI, so an agent replaying a
476
- * suite a hundred times could never learn which of its failures were noise. Omitted entirely when
477
- * the ledger has not seen enough runs to say.
478
- */
479
- flaky?: string[];
480
- }
481
- /** The reticle_flow_replay envelope. */
482
- export interface FlowReplayResult {
483
- name: string;
484
- status: ReplayStatus;
485
- steps: FlowStepResult[];
486
- /** The machine-actionable decision derived from this replay (autonomy layer). */
487
- decision?: ReplayDecision;
488
- /** Set when status === 'error' (load failure or resolved action failure). */
489
- error?: {
490
- code: string;
491
- message: string;
492
- };
493
- /**
494
- * Set when the replay STOPPED before the end of the flow.
495
- *
496
- * Replay breaks on the first failing step, so a flow that halted returns fewer step results than
497
- * it has steps — and nothing said so. A caller reading a two-step flow's one result saw a step
498
- * that was simply absent, which was reported as replay "silently skipping" an action. It does not
499
- * skip; it stops, and now it says where and how much it never reached. Omitted entirely when every
500
- * step ran, so a clean pass carries no extra bytes.
501
- */
502
- halted?: {
503
- atStep: number;
504
- notAttempted: number;
505
- };
506
- /**
507
- * Set on an `ok` replay whose flow cannot fail: it asserts no observable consequence, or has no
508
- * steps at all. The replay genuinely completed, so the status stays `ok` — but a bare `ok` read
509
- * as proof the feature works is exactly the false confidence `flow-risk.ts` argues against, and
510
- * `reticle_flow_verify` already refuses to count these as passes. This carries the same reason,
511
- * from the same function, to the single-flow caller who would otherwise never see it.
512
- */
513
- unverifiable?: {
514
- reason: string;
515
- };
516
- /**
517
- * The confident rebind proposals aggregated across drifted steps (additive,
518
- * optional — present only when at least one drifted step has a confident nearest match).
519
- */
520
- proposals?: HealProposal[];
521
- /**
522
- * The push-default deviation report over this replay's route segments (ranked deviations vs the learned
523
- * envelope, or a fall-back note below N=3 runs). Additive; present when segments were observed.
524
- */
525
- deviation?: unknown;
526
- /**
527
- * What the project already knows about this flow, fetched from shared memory on the agent's
528
- * behalf.
529
- *
530
- * Present only when the project is linked, memory sync is on, and the team has actually captured
531
- * something about this flow. Consulting shared memory used to be a separate act an agent had to
532
- * remember to perform — measured across a real corpus, every subject showed zero reads, not
533
- * because the knowledge was useless but because nothing ever asked for it. A verification that
534
- * asks on the agent's behalf is the difference between memory the platform stores and memory the
535
- * platform uses.
536
- *
537
- * Deliberately additive and deliberately small: a verdict whose own result has been pushed below
538
- * a wall of statements is a worse verdict.
539
- */
540
- knows?: {
541
- statement: string;
542
- status: string;
543
- }[];
544
- }
545
- /**
546
- * The on-disk flow file: diffable, git-tracked, anchor-resolved.
547
- * The optional `dynamic` field (both `dynamic` + `success` are optional, so a
548
- * file with neither still parses — back-compat is locked by a test).
549
- */
550
- export declare const FlowFileSchema: z.ZodObject<{
551
- version: z.ZodLiteral<1>;
552
- name: z.ZodString;
553
- /**
554
- * The business goal this flow exists to verify, one line (e.g. "ship a deploy to production").
555
- * Optional + back-compat (a flow without it still parses). Set via an `intent` annotation. The
556
- * point of "intent + outcome oracle": a flow that declares an intent should also assert an
557
- * observable business OUTCOME (a consequence success-state), or it claims to verify a goal it
558
- * cannot actually check — flow-classify flags that gap.
559
- */
560
- intent: z.ZodOptional<z.ZodString>;
561
- /**
562
- * The intent-ledger row this flow discharges — the id in `.reticle/intent.json`.
563
- *
564
- * `intent` above is the prose a recorder captured; this is the LINK to the ledger that already
565
- * models declared → bound → proved and records which verdict discharged what. Without it there
566
- * would be two ways to say what a change is for, which is the defect this codebase keeps paying
567
- * for: a flow's goal and an intent's statement would drift apart with nothing to reconcile them.
568
- *
569
- * Set at save time from the flow's own prose, or written by hand to point a flow at an intent
570
- * declared earlier via `reticle_intent` — a flow can prove something somebody else declared.
571
- * Optional + back-compat: a flow without it replays exactly as before, and the on-disk version
572
- * stays FLOW_FILE_VERSION 1.
573
- */
574
- intentId: z.ZodOptional<z.ZodString>;
575
- /**
576
- * The project the flow was recorded against (the connecting session's HELLO `projectId`), stamped at
577
- * save time. Scopes a flow to its app so a shared daemon's HUD lists only the current project's flows
578
- * instead of every project that ever saved to that daemon. Optional + back-compat: a flow with no
579
- * projectId is treated as global (visible everywhere), so pre-existing files parse and still show.
580
- */
581
- projectId: z.ZodOptional<z.ZodString>;
582
- /**
583
- * The route (pathname) the journey started on, captured at record time. Replay navigates here
584
- * before step 1 so a flow whose first anchor lives on another page doesn't drift on step 1 ("a
585
- * step no longer matches") just because replay began on the wrong page. Optional + back-compat: a
586
- * flow without it (or recorded before this shipped) replays from the current page as before, and
587
- * the on-disk version stays FLOW_FILE_VERSION 1.
588
- */
589
- startPath: z.ZodOptional<z.ZodString>;
590
- fixture: z.ZodOptional<z.ZodString>;
591
- /** From the injected clock (ms) — deterministic in tests, byte-stable on disk. */
592
- createdAt: z.ZodNumber;
593
- steps: z.ZodArray<z.ZodType<FlowStep, z.ZodTypeDef, FlowStep>, "many">;
594
- /**
595
- * How long every step of this flow waits for its declared consequence, in ms. A step's own
596
- * `timeoutMs` wins over it; absent both, FLOW_SIGNAL_TIMEOUT_MS applies.
597
- *
598
- * Flow-level because slowness is usually a property of the APP, not of one control — a remote
599
- * database, a model-backed endpoint, a cold container. Optional + back-compat: a flow without it
600
- * replays exactly as before and the on-disk version stays FLOW_FILE_VERSION 1.
601
- */
602
- signalTimeoutMs: z.ZodOptional<z.ZodNumber>;
603
- success: z.ZodOptional<z.ZodObject<{
604
- signal: z.ZodOptional<z.ZodString>;
605
- /**
606
- * Optional payload shape an `assert-signal` annotation requires the signal
607
- * to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
608
- * bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
609
- */
610
- signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
611
- /**
612
- * Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
613
- * only way a saved flow can keep a cardinality the agent actually asserted. Without it a
614
- * `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
615
- * one made: the replayed flow then goes green on the double-fire it was recorded to catch.
616
- * Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
617
- */
618
- signalCount: z.ZodOptional<z.ZodNumber>;
619
- net: z.ZodOptional<z.ZodObject<{
620
- method: z.ZodOptional<z.ZodString>;
621
- urlContains: z.ZodOptional<z.ZodString>;
622
- status: z.ZodOptional<z.ZodNumber>;
623
- /**
624
- * Exact number of matching requests since the action — turns presence into a cardinality
625
- * assertion. Catches the double-submit / useEffect-double-fire / retry-storm regression class:
626
- * the request fired (presence passes) but fired the WRONG number of times. Omit = presence (≥1).
627
- */
628
- count: z.ZodOptional<z.ZodNumber>;
629
- }, "strict", z.ZodTypeAny, {
630
- status?: number | undefined;
631
- method?: string | undefined;
632
- count?: number | undefined;
633
- urlContains?: string | undefined;
634
- }, {
635
- status?: number | undefined;
636
- method?: string | undefined;
637
- count?: number | undefined;
638
- urlContains?: string | undefined;
639
- }>>;
640
- /**
641
- * Console golden end-condition: assert the action logged (or, with absent:true, did NOT log) a
642
- * console message at `level` (default 'error'). `absent:true` is the common case — "the action
643
- * completed with a clean console" — catching the regression where an action throws a caught error
644
- * / logs an uncaught rejection while the UI still renders fine (a presence check passes it).
645
- */
646
- console: z.ZodOptional<z.ZodObject<{
647
- level: z.ZodOptional<z.ZodString>;
648
- absent: z.ZodOptional<z.ZodBoolean>;
649
- }, "strict", z.ZodTypeAny, {
650
- level?: string | undefined;
651
- absent?: boolean | undefined;
652
- }, {
653
- level?: string | undefined;
654
- absent?: boolean | undefined;
655
- }>>;
656
- element: z.ZodOptional<z.ZodObject<{
657
- testid: z.ZodOptional<z.ZodString>;
658
- role: z.ZodOptional<z.ZodString>;
659
- name: z.ZodOptional<z.ZodString>;
660
- }, "strict", z.ZodTypeAny, {
661
- testid?: string | undefined;
662
- role?: string | undefined;
663
- name?: string | undefined;
664
- }, {
665
- testid?: string | undefined;
666
- role?: string | undefined;
667
- name?: string | undefined;
668
- }>>;
669
- /**
670
- * Rendered text as an end-condition, using the shapes the assert surface already accepts.
671
- *
672
- * The gap this closes: an app with no testids, no `reticle.signal`, no registrable store and no
673
- * network call on the interaction under test -- a discount price computed and rendered, a
674
- * formatted total, a derived label -- could not produce an asserted flow AT ALL. Everything the
675
- * vocabulary offered needed a channel that app does not have, so the only honest outcome was
676
- * `assertion-free`, which is a permanent green (#811).
677
- *
678
- * Derived-DOM rendering is a large share of what actually breaks in a UI, and it was the share
679
- * that could not be pinned.
680
- *
681
- * Classified PRESENCE, not consequence, and that is not a technicality: text is read from the
682
- * DOM, so a locator healed to the wrong element can still satisfy it. It earns `presence-only`,
683
- * which is a real grade above `assertion-free` and honestly below `signal`/`net`/`state`.
684
- */
685
- text: z.ZodOptional<z.ZodObject<{
686
- contains: z.ZodString;
687
- /** Narrow the search to a container, exactly as the `text` predicate's `scope` does. */
688
- scope: z.ZodOptional<z.ZodString>;
689
- /** Assert the text is GONE — the regression check for a cleared error or a dismissed toast. */
690
- absent: z.ZodOptional<z.ZodBoolean>;
691
- /** Require the match to be visible, not merely present in the DOM. */
692
- visible: z.ZodOptional<z.ZodBoolean>;
693
- }, "strict", z.ZodTypeAny, {
694
- contains: string;
695
- visible?: boolean | undefined;
696
- absent?: boolean | undefined;
697
- scope?: string | undefined;
698
- }, {
699
- contains: string;
700
- visible?: boolean | undefined;
701
- absent?: boolean | undefined;
702
- scope?: string | undefined;
703
- }>>;
704
- /**
705
- * Assert a registered store's value — the source of truth no DOM/network read can reach. Compiles
706
- * to the predicate engine's `state` predicate. Additive/optional — a flow without it still parses
707
- * and the on-disk version stays FLOW_FILE_VERSION 1. `equals` accepts a literal, omitted = presence,
708
- * or a `{ $gte | $contains | $length }` operator pattern.
709
- */
710
- state: z.ZodOptional<z.ZodObject<{
711
- store: z.ZodOptional<z.ZodString>;
712
- path: z.ZodString;
713
- equals: z.ZodOptional<z.ZodUnknown>;
714
- /**
715
- * Treat this as an INVARIANT that must still hold AFTER the action settles, rather than a
716
- * condition to wait for. Set it for a blast-radius check ("this unrelated path must NOT have
717
- * moved") — without it a wait-until-true read passes before an over-reaching side-effect lands.
718
- */
719
- hold: z.ZodOptional<z.ZodBoolean>;
720
- }, "strict", z.ZodTypeAny, {
721
- path: string;
722
- store?: string | undefined;
723
- equals?: unknown;
724
- hold?: boolean | undefined;
725
- }, {
726
- path: string;
727
- store?: string | undefined;
728
- equals?: unknown;
729
- hold?: boolean | undefined;
730
- }>>;
731
- }, "strict", z.ZodTypeAny, {
732
- state?: {
733
- path: string;
734
- store?: string | undefined;
735
- equals?: unknown;
736
- hold?: boolean | undefined;
737
- } | undefined;
738
- signal?: string | undefined;
739
- text?: {
740
- contains: string;
741
- visible?: boolean | undefined;
742
- absent?: boolean | undefined;
743
- scope?: string | undefined;
744
- } | undefined;
745
- signalData?: Record<string, unknown> | undefined;
746
- signalCount?: number | undefined;
747
- net?: {
748
- status?: number | undefined;
749
- method?: string | undefined;
750
- count?: number | undefined;
751
- urlContains?: string | undefined;
752
- } | undefined;
753
- console?: {
754
- level?: string | undefined;
755
- absent?: boolean | undefined;
756
- } | undefined;
757
- element?: {
758
- testid?: string | undefined;
759
- role?: string | undefined;
760
- name?: string | undefined;
761
- } | undefined;
762
- }, {
763
- state?: {
764
- path: string;
765
- store?: string | undefined;
766
- equals?: unknown;
767
- hold?: boolean | undefined;
768
- } | undefined;
769
- signal?: string | undefined;
770
- text?: {
771
- contains: string;
772
- visible?: boolean | undefined;
773
- absent?: boolean | undefined;
774
- scope?: string | undefined;
775
- } | undefined;
776
- signalData?: Record<string, unknown> | undefined;
777
- signalCount?: number | undefined;
778
- net?: {
779
- status?: number | undefined;
780
- method?: string | undefined;
781
- count?: number | undefined;
782
- urlContains?: string | undefined;
783
- } | undefined;
784
- console?: {
785
- level?: string | undefined;
786
- absent?: boolean | undefined;
787
- } | undefined;
788
- element?: {
789
- testid?: string | undefined;
790
- role?: string | undefined;
791
- name?: string | undefined;
792
- } | undefined;
793
- }>>;
794
- /**
795
- * Anchors whose CONTENT must not be asserted (e.g. LLM output). Replay asserts
796
- * presence, not words. Compiled from a `mark-dynamic` annotation.
797
- */
798
- dynamic: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
799
- kind: z.ZodLiteral<"testid">;
800
- value: z.ZodString;
801
- source: z.ZodOptional<z.ZodObject<{
802
- file: z.ZodString;
803
- line: z.ZodNumber;
804
- column: z.ZodOptional<z.ZodNumber>;
805
- }, "strip", z.ZodTypeAny, {
806
- file: string;
807
- line: number;
808
- column?: number | undefined;
809
- }, {
810
- file: string;
811
- line: number;
812
- column?: number | undefined;
813
- }>>;
814
- }, "strip", z.ZodTypeAny, {
815
- value: string;
816
- kind: "testid";
817
- source?: {
818
- file: string;
819
- line: number;
820
- column?: number | undefined;
821
- } | undefined;
822
- }, {
823
- value: string;
824
- kind: "testid";
825
- source?: {
826
- file: string;
827
- line: number;
828
- column?: number | undefined;
829
- } | undefined;
830
- }>, z.ZodObject<{
831
- kind: z.ZodLiteral<"role">;
832
- role: z.ZodString;
833
- name: z.ZodOptional<z.ZodString>;
834
- }, "strip", z.ZodTypeAny, {
835
- role: string;
836
- kind: "role";
837
- name?: string | undefined;
838
- }, {
839
- role: string;
840
- kind: "role";
841
- name?: string | undefined;
842
- }>, z.ZodObject<{
843
- kind: z.ZodLiteral<"signal">;
844
- name: z.ZodString;
845
- }, "strip", z.ZodTypeAny, {
846
- name: string;
847
- kind: "signal";
848
- }, {
849
- name: string;
850
- kind: "signal";
851
- }>, z.ZodObject<{
852
- kind: z.ZodLiteral<"component">;
853
- component: z.ZodOptional<z.ZodString>;
854
- source: z.ZodOptional<z.ZodObject<{
855
- file: z.ZodString;
856
- line: z.ZodNumber;
857
- column: z.ZodOptional<z.ZodNumber>;
858
- }, "strip", z.ZodTypeAny, {
859
- file: string;
860
- line: number;
861
- column?: number | undefined;
862
- }, {
863
- file: string;
864
- line: number;
865
- column?: number | undefined;
866
- }>>;
867
- role: z.ZodOptional<z.ZodString>;
868
- name: z.ZodOptional<z.ZodString>;
869
- }, "strip", z.ZodTypeAny, {
870
- kind: "component";
871
- source?: {
872
- file: string;
873
- line: number;
874
- column?: number | undefined;
875
- } | undefined;
876
- role?: string | undefined;
877
- component?: string | undefined;
878
- name?: string | undefined;
879
- }, {
880
- kind: "component";
881
- source?: {
882
- file: string;
883
- line: number;
884
- column?: number | undefined;
885
- } | undefined;
886
- role?: string | undefined;
887
- component?: string | undefined;
888
- name?: string | undefined;
889
- }>]>, "many">>;
890
- }, "strip", z.ZodTypeAny, {
891
- version: 1;
892
- name: string;
893
- steps: FlowStep[];
894
- createdAt: number;
895
- projectId?: string | undefined;
896
- intent?: string | undefined;
897
- intentId?: string | undefined;
898
- startPath?: string | undefined;
899
- fixture?: string | undefined;
900
- signalTimeoutMs?: number | undefined;
901
- success?: {
902
- state?: {
903
- path: string;
904
- store?: string | undefined;
905
- equals?: unknown;
906
- hold?: boolean | undefined;
907
- } | undefined;
908
- signal?: string | undefined;
909
- text?: {
910
- contains: string;
911
- visible?: boolean | undefined;
912
- absent?: boolean | undefined;
913
- scope?: string | undefined;
914
- } | undefined;
915
- signalData?: Record<string, unknown> | undefined;
916
- signalCount?: number | undefined;
917
- net?: {
918
- status?: number | undefined;
919
- method?: string | undefined;
920
- count?: number | undefined;
921
- urlContains?: string | undefined;
922
- } | undefined;
923
- console?: {
924
- level?: string | undefined;
925
- absent?: boolean | undefined;
926
- } | undefined;
927
- element?: {
928
- testid?: string | undefined;
929
- role?: string | undefined;
930
- name?: string | undefined;
931
- } | undefined;
932
- } | undefined;
933
- dynamic?: ({
934
- value: string;
935
- kind: "testid";
936
- source?: {
937
- file: string;
938
- line: number;
939
- column?: number | undefined;
940
- } | undefined;
941
- } | {
942
- role: string;
943
- kind: "role";
944
- name?: string | undefined;
945
- } | {
946
- name: string;
947
- kind: "signal";
948
- } | {
949
- kind: "component";
950
- source?: {
951
- file: string;
952
- line: number;
953
- column?: number | undefined;
954
- } | undefined;
955
- role?: string | undefined;
956
- component?: string | undefined;
957
- name?: string | undefined;
958
- })[] | undefined;
959
- }, {
960
- version: 1;
961
- name: string;
962
- steps: FlowStep[];
963
- createdAt: number;
964
- projectId?: string | undefined;
965
- intent?: string | undefined;
966
- intentId?: string | undefined;
967
- startPath?: string | undefined;
968
- fixture?: string | undefined;
969
- signalTimeoutMs?: number | undefined;
970
- success?: {
971
- state?: {
972
- path: string;
973
- store?: string | undefined;
974
- equals?: unknown;
975
- hold?: boolean | undefined;
976
- } | undefined;
977
- signal?: string | undefined;
978
- text?: {
979
- contains: string;
980
- visible?: boolean | undefined;
981
- absent?: boolean | undefined;
982
- scope?: string | undefined;
983
- } | undefined;
984
- signalData?: Record<string, unknown> | undefined;
985
- signalCount?: number | undefined;
986
- net?: {
987
- status?: number | undefined;
988
- method?: string | undefined;
989
- count?: number | undefined;
990
- urlContains?: string | undefined;
991
- } | undefined;
992
- console?: {
993
- level?: string | undefined;
994
- absent?: boolean | undefined;
995
- } | undefined;
996
- element?: {
997
- testid?: string | undefined;
998
- role?: string | undefined;
999
- name?: string | undefined;
1000
- } | undefined;
1001
- } | undefined;
1002
- dynamic?: ({
1003
- value: string;
1004
- kind: "testid";
1005
- source?: {
1006
- file: string;
1007
- line: number;
1008
- column?: number | undefined;
1009
- } | undefined;
1010
- } | {
1011
- role: string;
1012
- kind: "role";
1013
- name?: string | undefined;
1014
- } | {
1015
- name: string;
1016
- kind: "signal";
1017
- } | {
1018
- kind: "component";
1019
- source?: {
1020
- file: string;
1021
- line: number;
1022
- column?: number | undefined;
1023
- } | undefined;
1024
- role?: string | undefined;
1025
- component?: string | undefined;
1026
- name?: string | undefined;
1027
- })[] | undefined;
1028
- }>;
1029
- export type FlowFile = z.infer<typeof FlowFileSchema>;
1030
- /**
1031
- * The in-page → wire payload for a finished human recording. The browser
1032
- * compiles captured interactions into a FlowFile-shaped object (resolving semantic anchors at
1033
- * capture time) and emits it as ONE EventType.FLOW_RECORDED event; the server persists it.
1034
- */
1035
- export declare const RecordedFlowSchema: z.ZodObject<{
1036
- name: z.ZodString;
1037
- flow: z.ZodObject<{
1038
- version: z.ZodLiteral<1>;
1039
- name: z.ZodString;
1040
- /**
1041
- * The business goal this flow exists to verify, one line (e.g. "ship a deploy to production").
1042
- * Optional + back-compat (a flow without it still parses). Set via an `intent` annotation. The
1043
- * point of "intent + outcome oracle": a flow that declares an intent should also assert an
1044
- * observable business OUTCOME (a consequence success-state), or it claims to verify a goal it
1045
- * cannot actually check — flow-classify flags that gap.
1046
- */
1047
- intent: z.ZodOptional<z.ZodString>;
1048
- /**
1049
- * The intent-ledger row this flow discharges — the id in `.reticle/intent.json`.
1050
- *
1051
- * `intent` above is the prose a recorder captured; this is the LINK to the ledger that already
1052
- * models declared → bound → proved and records which verdict discharged what. Without it there
1053
- * would be two ways to say what a change is for, which is the defect this codebase keeps paying
1054
- * for: a flow's goal and an intent's statement would drift apart with nothing to reconcile them.
1055
- *
1056
- * Set at save time from the flow's own prose, or written by hand to point a flow at an intent
1057
- * declared earlier via `reticle_intent` — a flow can prove something somebody else declared.
1058
- * Optional + back-compat: a flow without it replays exactly as before, and the on-disk version
1059
- * stays FLOW_FILE_VERSION 1.
1060
- */
1061
- intentId: z.ZodOptional<z.ZodString>;
1062
- /**
1063
- * The project the flow was recorded against (the connecting session's HELLO `projectId`), stamped at
1064
- * save time. Scopes a flow to its app so a shared daemon's HUD lists only the current project's flows
1065
- * instead of every project that ever saved to that daemon. Optional + back-compat: a flow with no
1066
- * projectId is treated as global (visible everywhere), so pre-existing files parse and still show.
1067
- */
1068
- projectId: z.ZodOptional<z.ZodString>;
1069
- /**
1070
- * The route (pathname) the journey started on, captured at record time. Replay navigates here
1071
- * before step 1 so a flow whose first anchor lives on another page doesn't drift on step 1 ("a
1072
- * step no longer matches") just because replay began on the wrong page. Optional + back-compat: a
1073
- * flow without it (or recorded before this shipped) replays from the current page as before, and
1074
- * the on-disk version stays FLOW_FILE_VERSION 1.
1075
- */
1076
- startPath: z.ZodOptional<z.ZodString>;
1077
- fixture: z.ZodOptional<z.ZodString>;
1078
- /** From the injected clock (ms) — deterministic in tests, byte-stable on disk. */
1079
- createdAt: z.ZodNumber;
1080
- steps: z.ZodArray<z.ZodType<FlowStep, z.ZodTypeDef, FlowStep>, "many">;
1081
- /**
1082
- * How long every step of this flow waits for its declared consequence, in ms. A step's own
1083
- * `timeoutMs` wins over it; absent both, FLOW_SIGNAL_TIMEOUT_MS applies.
1084
- *
1085
- * Flow-level because slowness is usually a property of the APP, not of one control — a remote
1086
- * database, a model-backed endpoint, a cold container. Optional + back-compat: a flow without it
1087
- * replays exactly as before and the on-disk version stays FLOW_FILE_VERSION 1.
1088
- */
1089
- signalTimeoutMs: z.ZodOptional<z.ZodNumber>;
1090
- success: z.ZodOptional<z.ZodObject<{
1091
- signal: z.ZodOptional<z.ZodString>;
1092
- /**
1093
- * Optional payload shape an `assert-signal` annotation requires the signal
1094
- * to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
1095
- * bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
1096
- */
1097
- signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1098
- /**
1099
- * Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
1100
- * only way a saved flow can keep a cardinality the agent actually asserted. Without it a
1101
- * `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
1102
- * one made: the replayed flow then goes green on the double-fire it was recorded to catch.
1103
- * Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
1104
- */
1105
- signalCount: z.ZodOptional<z.ZodNumber>;
1106
- net: z.ZodOptional<z.ZodObject<{
1107
- method: z.ZodOptional<z.ZodString>;
1108
- urlContains: z.ZodOptional<z.ZodString>;
1109
- status: z.ZodOptional<z.ZodNumber>;
1110
- /**
1111
- * Exact number of matching requests since the action — turns presence into a cardinality
1112
- * assertion. Catches the double-submit / useEffect-double-fire / retry-storm regression class:
1113
- * the request fired (presence passes) but fired the WRONG number of times. Omit = presence (≥1).
1114
- */
1115
- count: z.ZodOptional<z.ZodNumber>;
1116
- }, "strict", z.ZodTypeAny, {
1117
- status?: number | undefined;
1118
- method?: string | undefined;
1119
- count?: number | undefined;
1120
- urlContains?: string | undefined;
1121
- }, {
1122
- status?: number | undefined;
1123
- method?: string | undefined;
1124
- count?: number | undefined;
1125
- urlContains?: string | undefined;
1126
- }>>;
1127
- /**
1128
- * Console golden end-condition: assert the action logged (or, with absent:true, did NOT log) a
1129
- * console message at `level` (default 'error'). `absent:true` is the common case — "the action
1130
- * completed with a clean console" — catching the regression where an action throws a caught error
1131
- * / logs an uncaught rejection while the UI still renders fine (a presence check passes it).
1132
- */
1133
- console: z.ZodOptional<z.ZodObject<{
1134
- level: z.ZodOptional<z.ZodString>;
1135
- absent: z.ZodOptional<z.ZodBoolean>;
1136
- }, "strict", z.ZodTypeAny, {
1137
- level?: string | undefined;
1138
- absent?: boolean | undefined;
1139
- }, {
1140
- level?: string | undefined;
1141
- absent?: boolean | undefined;
1142
- }>>;
1143
- element: z.ZodOptional<z.ZodObject<{
1144
- testid: z.ZodOptional<z.ZodString>;
1145
- role: z.ZodOptional<z.ZodString>;
1146
- name: z.ZodOptional<z.ZodString>;
1147
- }, "strict", z.ZodTypeAny, {
1148
- testid?: string | undefined;
1149
- role?: string | undefined;
1150
- name?: string | undefined;
1151
- }, {
1152
- testid?: string | undefined;
1153
- role?: string | undefined;
1154
- name?: string | undefined;
1155
- }>>;
1156
- /**
1157
- * Rendered text as an end-condition, using the shapes the assert surface already accepts.
1158
- *
1159
- * The gap this closes: an app with no testids, no `reticle.signal`, no registrable store and no
1160
- * network call on the interaction under test -- a discount price computed and rendered, a
1161
- * formatted total, a derived label -- could not produce an asserted flow AT ALL. Everything the
1162
- * vocabulary offered needed a channel that app does not have, so the only honest outcome was
1163
- * `assertion-free`, which is a permanent green (#811).
1164
- *
1165
- * Derived-DOM rendering is a large share of what actually breaks in a UI, and it was the share
1166
- * that could not be pinned.
1167
- *
1168
- * Classified PRESENCE, not consequence, and that is not a technicality: text is read from the
1169
- * DOM, so a locator healed to the wrong element can still satisfy it. It earns `presence-only`,
1170
- * which is a real grade above `assertion-free` and honestly below `signal`/`net`/`state`.
1171
- */
1172
- text: z.ZodOptional<z.ZodObject<{
1173
- contains: z.ZodString;
1174
- /** Narrow the search to a container, exactly as the `text` predicate's `scope` does. */
1175
- scope: z.ZodOptional<z.ZodString>;
1176
- /** Assert the text is GONE — the regression check for a cleared error or a dismissed toast. */
1177
- absent: z.ZodOptional<z.ZodBoolean>;
1178
- /** Require the match to be visible, not merely present in the DOM. */
1179
- visible: z.ZodOptional<z.ZodBoolean>;
1180
- }, "strict", z.ZodTypeAny, {
1181
- contains: string;
1182
- visible?: boolean | undefined;
1183
- absent?: boolean | undefined;
1184
- scope?: string | undefined;
1185
- }, {
1186
- contains: string;
1187
- visible?: boolean | undefined;
1188
- absent?: boolean | undefined;
1189
- scope?: string | undefined;
1190
- }>>;
1191
- /**
1192
- * Assert a registered store's value — the source of truth no DOM/network read can reach. Compiles
1193
- * to the predicate engine's `state` predicate. Additive/optional — a flow without it still parses
1194
- * and the on-disk version stays FLOW_FILE_VERSION 1. `equals` accepts a literal, omitted = presence,
1195
- * or a `{ $gte | $contains | $length }` operator pattern.
1196
- */
1197
- state: z.ZodOptional<z.ZodObject<{
1198
- store: z.ZodOptional<z.ZodString>;
1199
- path: z.ZodString;
1200
- equals: z.ZodOptional<z.ZodUnknown>;
1201
- /**
1202
- * Treat this as an INVARIANT that must still hold AFTER the action settles, rather than a
1203
- * condition to wait for. Set it for a blast-radius check ("this unrelated path must NOT have
1204
- * moved") — without it a wait-until-true read passes before an over-reaching side-effect lands.
1205
- */
1206
- hold: z.ZodOptional<z.ZodBoolean>;
1207
- }, "strict", z.ZodTypeAny, {
1208
- path: string;
1209
- store?: string | undefined;
1210
- equals?: unknown;
1211
- hold?: boolean | undefined;
1212
- }, {
1213
- path: string;
1214
- store?: string | undefined;
1215
- equals?: unknown;
1216
- hold?: boolean | undefined;
1217
- }>>;
1218
- }, "strict", z.ZodTypeAny, {
1219
- state?: {
1220
- path: string;
1221
- store?: string | undefined;
1222
- equals?: unknown;
1223
- hold?: boolean | undefined;
1224
- } | undefined;
1225
- signal?: string | undefined;
1226
- text?: {
1227
- contains: string;
1228
- visible?: boolean | undefined;
1229
- absent?: boolean | undefined;
1230
- scope?: string | undefined;
1231
- } | undefined;
1232
- signalData?: Record<string, unknown> | undefined;
1233
- signalCount?: number | undefined;
1234
- net?: {
1235
- status?: number | undefined;
1236
- method?: string | undefined;
1237
- count?: number | undefined;
1238
- urlContains?: string | undefined;
1239
- } | undefined;
1240
- console?: {
1241
- level?: string | undefined;
1242
- absent?: boolean | undefined;
1243
- } | undefined;
1244
- element?: {
1245
- testid?: string | undefined;
1246
- role?: string | undefined;
1247
- name?: string | undefined;
1248
- } | undefined;
1249
- }, {
1250
- state?: {
1251
- path: string;
1252
- store?: string | undefined;
1253
- equals?: unknown;
1254
- hold?: boolean | undefined;
1255
- } | undefined;
1256
- signal?: string | undefined;
1257
- text?: {
1258
- contains: string;
1259
- visible?: boolean | undefined;
1260
- absent?: boolean | undefined;
1261
- scope?: string | undefined;
1262
- } | undefined;
1263
- signalData?: Record<string, unknown> | undefined;
1264
- signalCount?: number | undefined;
1265
- net?: {
1266
- status?: number | undefined;
1267
- method?: string | undefined;
1268
- count?: number | undefined;
1269
- urlContains?: string | undefined;
1270
- } | undefined;
1271
- console?: {
1272
- level?: string | undefined;
1273
- absent?: boolean | undefined;
1274
- } | undefined;
1275
- element?: {
1276
- testid?: string | undefined;
1277
- role?: string | undefined;
1278
- name?: string | undefined;
1279
- } | undefined;
1280
- }>>;
1281
- /**
1282
- * Anchors whose CONTENT must not be asserted (e.g. LLM output). Replay asserts
1283
- * presence, not words. Compiled from a `mark-dynamic` annotation.
1284
- */
1285
- dynamic: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1286
- kind: z.ZodLiteral<"testid">;
1287
- value: z.ZodString;
1288
- source: z.ZodOptional<z.ZodObject<{
1289
- file: z.ZodString;
1290
- line: z.ZodNumber;
1291
- column: z.ZodOptional<z.ZodNumber>;
1292
- }, "strip", z.ZodTypeAny, {
1293
- file: string;
1294
- line: number;
1295
- column?: number | undefined;
1296
- }, {
1297
- file: string;
1298
- line: number;
1299
- column?: number | undefined;
1300
- }>>;
1301
- }, "strip", z.ZodTypeAny, {
1302
- value: string;
1303
- kind: "testid";
1304
- source?: {
1305
- file: string;
1306
- line: number;
1307
- column?: number | undefined;
1308
- } | undefined;
1309
- }, {
1310
- value: string;
1311
- kind: "testid";
1312
- source?: {
1313
- file: string;
1314
- line: number;
1315
- column?: number | undefined;
1316
- } | undefined;
1317
- }>, z.ZodObject<{
1318
- kind: z.ZodLiteral<"role">;
1319
- role: z.ZodString;
1320
- name: z.ZodOptional<z.ZodString>;
1321
- }, "strip", z.ZodTypeAny, {
1322
- role: string;
1323
- kind: "role";
1324
- name?: string | undefined;
1325
- }, {
1326
- role: string;
1327
- kind: "role";
1328
- name?: string | undefined;
1329
- }>, z.ZodObject<{
1330
- kind: z.ZodLiteral<"signal">;
1331
- name: z.ZodString;
1332
- }, "strip", z.ZodTypeAny, {
1333
- name: string;
1334
- kind: "signal";
1335
- }, {
1336
- name: string;
1337
- kind: "signal";
1338
- }>, z.ZodObject<{
1339
- kind: z.ZodLiteral<"component">;
1340
- component: z.ZodOptional<z.ZodString>;
1341
- source: z.ZodOptional<z.ZodObject<{
1342
- file: z.ZodString;
1343
- line: z.ZodNumber;
1344
- column: z.ZodOptional<z.ZodNumber>;
1345
- }, "strip", z.ZodTypeAny, {
1346
- file: string;
1347
- line: number;
1348
- column?: number | undefined;
1349
- }, {
1350
- file: string;
1351
- line: number;
1352
- column?: number | undefined;
1353
- }>>;
1354
- role: z.ZodOptional<z.ZodString>;
1355
- name: z.ZodOptional<z.ZodString>;
1356
- }, "strip", z.ZodTypeAny, {
1357
- kind: "component";
1358
- source?: {
1359
- file: string;
1360
- line: number;
1361
- column?: number | undefined;
1362
- } | undefined;
1363
- role?: string | undefined;
1364
- component?: string | undefined;
1365
- name?: string | undefined;
1366
- }, {
1367
- kind: "component";
1368
- source?: {
1369
- file: string;
1370
- line: number;
1371
- column?: number | undefined;
1372
- } | undefined;
1373
- role?: string | undefined;
1374
- component?: string | undefined;
1375
- name?: string | undefined;
1376
- }>]>, "many">>;
1377
- }, "strip", z.ZodTypeAny, {
1378
- version: 1;
1379
- name: string;
1380
- steps: FlowStep[];
1381
- createdAt: number;
1382
- projectId?: string | undefined;
1383
- intent?: string | undefined;
1384
- intentId?: string | undefined;
1385
- startPath?: string | undefined;
1386
- fixture?: string | undefined;
1387
- signalTimeoutMs?: number | undefined;
1388
- success?: {
1389
- state?: {
1390
- path: string;
1391
- store?: string | undefined;
1392
- equals?: unknown;
1393
- hold?: boolean | undefined;
1394
- } | undefined;
1395
- signal?: string | undefined;
1396
- text?: {
1397
- contains: string;
1398
- visible?: boolean | undefined;
1399
- absent?: boolean | undefined;
1400
- scope?: string | undefined;
1401
- } | undefined;
1402
- signalData?: Record<string, unknown> | undefined;
1403
- signalCount?: number | undefined;
1404
- net?: {
1405
- status?: number | undefined;
1406
- method?: string | undefined;
1407
- count?: number | undefined;
1408
- urlContains?: string | undefined;
1409
- } | undefined;
1410
- console?: {
1411
- level?: string | undefined;
1412
- absent?: boolean | undefined;
1413
- } | undefined;
1414
- element?: {
1415
- testid?: string | undefined;
1416
- role?: string | undefined;
1417
- name?: string | undefined;
1418
- } | undefined;
1419
- } | undefined;
1420
- dynamic?: ({
1421
- value: string;
1422
- kind: "testid";
1423
- source?: {
1424
- file: string;
1425
- line: number;
1426
- column?: number | undefined;
1427
- } | undefined;
1428
- } | {
1429
- role: string;
1430
- kind: "role";
1431
- name?: string | undefined;
1432
- } | {
1433
- name: string;
1434
- kind: "signal";
1435
- } | {
1436
- kind: "component";
1437
- source?: {
1438
- file: string;
1439
- line: number;
1440
- column?: number | undefined;
1441
- } | undefined;
1442
- role?: string | undefined;
1443
- component?: string | undefined;
1444
- name?: string | undefined;
1445
- })[] | undefined;
1446
- }, {
1447
- version: 1;
1448
- name: string;
1449
- steps: FlowStep[];
1450
- createdAt: number;
1451
- projectId?: string | undefined;
1452
- intent?: string | undefined;
1453
- intentId?: string | undefined;
1454
- startPath?: string | undefined;
1455
- fixture?: string | undefined;
1456
- signalTimeoutMs?: number | undefined;
1457
- success?: {
1458
- state?: {
1459
- path: string;
1460
- store?: string | undefined;
1461
- equals?: unknown;
1462
- hold?: boolean | undefined;
1463
- } | undefined;
1464
- signal?: string | undefined;
1465
- text?: {
1466
- contains: string;
1467
- visible?: boolean | undefined;
1468
- absent?: boolean | undefined;
1469
- scope?: string | undefined;
1470
- } | undefined;
1471
- signalData?: Record<string, unknown> | undefined;
1472
- signalCount?: number | undefined;
1473
- net?: {
1474
- status?: number | undefined;
1475
- method?: string | undefined;
1476
- count?: number | undefined;
1477
- urlContains?: string | undefined;
1478
- } | undefined;
1479
- console?: {
1480
- level?: string | undefined;
1481
- absent?: boolean | undefined;
1482
- } | undefined;
1483
- element?: {
1484
- testid?: string | undefined;
1485
- role?: string | undefined;
1486
- name?: string | undefined;
1487
- } | undefined;
1488
- } | undefined;
1489
- dynamic?: ({
1490
- value: string;
1491
- kind: "testid";
1492
- source?: {
1493
- file: string;
1494
- line: number;
1495
- column?: number | undefined;
1496
- } | undefined;
1497
- } | {
1498
- role: string;
1499
- kind: "role";
1500
- name?: string | undefined;
1501
- } | {
1502
- name: string;
1503
- kind: "signal";
1504
- } | {
1505
- kind: "component";
1506
- source?: {
1507
- file: string;
1508
- line: number;
1509
- column?: number | undefined;
1510
- } | undefined;
1511
- role?: string | undefined;
1512
- component?: string | undefined;
1513
- name?: string | undefined;
1514
- })[] | undefined;
1515
- }>;
1516
- }, "strip", z.ZodTypeAny, {
1517
- flow: {
1518
- version: 1;
1519
- name: string;
1520
- steps: FlowStep[];
1521
- createdAt: number;
1522
- projectId?: string | undefined;
1523
- intent?: string | undefined;
1524
- intentId?: string | undefined;
1525
- startPath?: string | undefined;
1526
- fixture?: string | undefined;
1527
- signalTimeoutMs?: number | undefined;
1528
- success?: {
1529
- state?: {
1530
- path: string;
1531
- store?: string | undefined;
1532
- equals?: unknown;
1533
- hold?: boolean | undefined;
1534
- } | undefined;
1535
- signal?: string | undefined;
1536
- text?: {
1537
- contains: string;
1538
- visible?: boolean | undefined;
1539
- absent?: boolean | undefined;
1540
- scope?: string | undefined;
1541
- } | undefined;
1542
- signalData?: Record<string, unknown> | undefined;
1543
- signalCount?: number | undefined;
1544
- net?: {
1545
- status?: number | undefined;
1546
- method?: string | undefined;
1547
- count?: number | undefined;
1548
- urlContains?: string | undefined;
1549
- } | undefined;
1550
- console?: {
1551
- level?: string | undefined;
1552
- absent?: boolean | undefined;
1553
- } | undefined;
1554
- element?: {
1555
- testid?: string | undefined;
1556
- role?: string | undefined;
1557
- name?: string | undefined;
1558
- } | undefined;
1559
- } | undefined;
1560
- dynamic?: ({
1561
- value: string;
1562
- kind: "testid";
1563
- source?: {
1564
- file: string;
1565
- line: number;
1566
- column?: number | undefined;
1567
- } | undefined;
1568
- } | {
1569
- role: string;
1570
- kind: "role";
1571
- name?: string | undefined;
1572
- } | {
1573
- name: string;
1574
- kind: "signal";
1575
- } | {
1576
- kind: "component";
1577
- source?: {
1578
- file: string;
1579
- line: number;
1580
- column?: number | undefined;
1581
- } | undefined;
1582
- role?: string | undefined;
1583
- component?: string | undefined;
1584
- name?: string | undefined;
1585
- })[] | undefined;
1586
- };
1587
- name: string;
1588
- }, {
1589
- flow: {
1590
- version: 1;
1591
- name: string;
1592
- steps: FlowStep[];
1593
- createdAt: number;
1594
- projectId?: string | undefined;
1595
- intent?: string | undefined;
1596
- intentId?: string | undefined;
1597
- startPath?: string | undefined;
1598
- fixture?: string | undefined;
1599
- signalTimeoutMs?: number | undefined;
1600
- success?: {
1601
- state?: {
1602
- path: string;
1603
- store?: string | undefined;
1604
- equals?: unknown;
1605
- hold?: boolean | undefined;
1606
- } | undefined;
1607
- signal?: string | undefined;
1608
- text?: {
1609
- contains: string;
1610
- visible?: boolean | undefined;
1611
- absent?: boolean | undefined;
1612
- scope?: string | undefined;
1613
- } | undefined;
1614
- signalData?: Record<string, unknown> | undefined;
1615
- signalCount?: number | undefined;
1616
- net?: {
1617
- status?: number | undefined;
1618
- method?: string | undefined;
1619
- count?: number | undefined;
1620
- urlContains?: string | undefined;
1621
- } | undefined;
1622
- console?: {
1623
- level?: string | undefined;
1624
- absent?: boolean | undefined;
1625
- } | undefined;
1626
- element?: {
1627
- testid?: string | undefined;
1628
- role?: string | undefined;
1629
- name?: string | undefined;
1630
- } | undefined;
1631
- } | undefined;
1632
- dynamic?: ({
1633
- value: string;
1634
- kind: "testid";
1635
- source?: {
1636
- file: string;
1637
- line: number;
1638
- column?: number | undefined;
1639
- } | undefined;
1640
- } | {
1641
- role: string;
1642
- kind: "role";
1643
- name?: string | undefined;
1644
- } | {
1645
- name: string;
1646
- kind: "signal";
1647
- } | {
1648
- kind: "component";
1649
- source?: {
1650
- file: string;
1651
- line: number;
1652
- column?: number | undefined;
1653
- } | undefined;
1654
- role?: string | undefined;
1655
- component?: string | undefined;
1656
- name?: string | undefined;
1657
- })[] | undefined;
1658
- };
1659
- name: string;
1660
- }>;
1661
- /** A concrete, confidence-scored rebind proposed for one drifted step. */
1662
- export interface HealProposal {
1663
- /** 0-based step index in the flow. */
1664
- step: number;
1665
- /** Old (missing) testid anchor value. */
1666
- from: string;
1667
- /** Proposed nearest present testid. */
1668
- to: string;
1669
- /** Normalized (0,1]; >= HEAL_CONFIDENCE_MIN to be applicable. */
1670
- confidence: number;
1671
- }
1672
- /** One applied rebind (a HealProposal that was written to disk). */
1673
- export interface HealChange {
1674
- step: number;
1675
- from: string;
1676
- to: string;
1677
- }
1678
- /** The reticle_flow_heal envelope. */
1679
- export interface FlowHealResult {
1680
- name: string;
1681
- status: HealStatus;
1682
- /** Whether the file was rewritten (true only when status === 'healed'). */
1683
- applied: boolean;
1684
- /** Confident, applicable rebinds. With apply:false these are the dry-run diff. */
1685
- proposals: HealProposal[];
1686
- /** Anchors actually written (empty unless applied). */
1687
- changed: HealChange[];
1688
- /** Human one-liner for the agent (e.g. "nothing to heal", floor explanation). */
1689
- message: string;
1690
- error?: {
1691
- code: string;
1692
- message: string;
1693
- };
1694
- }
1695
- export type RecordedFlow = z.infer<typeof RecordedFlowSchema>;
1696
- /**
1697
- * One replayable-flow chip on the in-page HUD.
1698
- *
1699
- * Crosses the bridge: the daemon builds these from the flows on disk and pushes them with
1700
- * `ReticleCommand.FLOWS`; the presenter panel renders one ▶ button per chip. It lived as two
1701
- * identical `interface FlowChip` declarations — one in the server, one in the browser — which is the
1702
- * shape that drifts silently, because nothing links the two and no test crosses the boundary.
1703
- *
1704
- * A TYPE and not a zod schema on purpose: the browser SDK ships into the user's app and carries no
1705
- * zod, so the receiving side narrows the raw wire value by hand. The type is what both ends agree on.
1706
- */
1707
- export interface FlowChip {
1708
- name: string;
1709
- /** The testid the flow's first step anchors to, when it has one — the panel hides chips that cannot start on the current page. */
1710
- start?: string;
1711
- }