@reticlehq/core 2.13.1 → 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.
- package/dist/artifacts/artifacts-entry.d.ts +20 -0
- package/dist/artifacts/artifacts-entry.js +20 -0
- package/dist/artifacts/flow-composition.d.ts +30 -0
- package/dist/artifacts/flow-composition.js +19 -0
- package/dist/{flow-constants.d.ts → artifacts/flow-constants.d.ts} +97 -3
- package/dist/{flow-constants.js → artifacts/flow-constants.js} +103 -4
- package/dist/artifacts/flow-mutation-target.d.ts +39 -0
- package/dist/artifacts/flow-mutation-target.js +89 -0
- package/dist/artifacts/flow-order.d.ts +30 -0
- package/dist/artifacts/flow-order.js +49 -0
- package/dist/artifacts/flow-select.d.ts +56 -0
- package/dist/artifacts/flow-select.js +56 -0
- package/dist/artifacts/flow-step-tool.d.ts +31 -0
- package/dist/artifacts/flow-step-tool.js +31 -0
- package/dist/artifacts/flow-types.d.ts +3736 -0
- package/dist/artifacts/flow-types.js +463 -0
- package/dist/artifacts/flow-unreached.d.ts +12 -0
- package/dist/artifacts/flow-unreached.js +24 -0
- package/dist/{impact-savings.d.ts → artifacts/impact-savings.d.ts} +7 -3
- package/dist/{impact-savings.js → artifacts/impact-savings.js} +27 -4
- package/dist/{impact.d.ts → artifacts/impact.d.ts} +122 -54
- package/dist/{impact.js → artifacts/impact.js} +30 -0
- package/dist/{journal.d.ts → artifacts/journal.d.ts} +50 -6
- package/dist/{journal.js → artifacts/journal.js} +38 -2
- package/dist/artifacts/step-effect.d.ts +29 -0
- package/dist/artifacts/step-effect.js +28 -0
- package/dist/hooks/hook-events.d.ts +311 -0
- package/dist/hooks/hook-events.js +127 -0
- package/dist/hooks/hooks-entry.d.ts +9 -0
- package/dist/hooks/hooks-entry.js +9 -0
- package/dist/{brand.d.ts → identity/brand.d.ts} +7 -0
- package/dist/{contract-fingerprint.d.ts → identity/contract-fingerprint.d.ts} +21 -3
- package/dist/{contract-fingerprint.js → identity/contract-fingerprint.js} +22 -4
- package/dist/{document-identity.d.ts → identity/document-identity.d.ts} +4 -5
- package/dist/{document-identity.js → identity/document-identity.js} +4 -5
- package/dist/{source-constants.d.ts → identity/source-constants.d.ts} +4 -4
- package/dist/{source-constants.js → identity/source-constants.js} +4 -4
- package/dist/index.d.ts +69 -42
- package/dist/index.js +78 -44
- package/dist/onboarding.d.ts +114 -0
- package/dist/onboarding.js +141 -0
- package/dist/realm/registry.d.ts +212 -0
- package/dist/realm/registry.js +302 -0
- package/dist/{dev-server-registry.d.ts → registry/dev-server-registry.d.ts} +4 -5
- package/dist/{dev-server-registry.js → registry/dev-server-registry.js} +28 -19
- package/dist/{project-registry.d.ts → registry/project-registry.d.ts} +5 -5
- package/dist/{project-registry.js → registry/project-registry.js} +5 -5
- package/dist/schema/command-name.json +31 -0
- package/dist/schema/event-message.json +1 -0
- package/dist/schema/event-payloads.json +791 -0
- package/dist/schema/event-type.json +1 -0
- package/dist/schema/hello-message.json +76 -2
- package/dist/schema/reticle-event.json +1 -0
- package/dist/schema/reticle-message.json +77 -2
- package/dist/telemetry-entry.d.ts +15 -0
- package/dist/telemetry-entry.js +15 -0
- package/dist/telemetry-feedback.d.ts +13 -14
- package/dist/telemetry-feedback.js +11 -12
- package/dist/telemetry-license.d.ts +1 -1
- package/dist/telemetry-license.js +1 -1
- package/dist/telemetry-refusal.d.ts +11 -11
- package/dist/telemetry-refusal.js +7 -8
- package/dist/telemetry-session.d.ts +49 -57
- package/dist/telemetry-session.js +47 -55
- package/dist/telemetry.d.ts +229 -198
- package/dist/telemetry.js +83 -98
- package/dist/tour-entry.d.ts +10 -0
- package/dist/tour-entry.js +10 -0
- package/dist/tour.d.ts +125 -0
- package/dist/tour.js +165 -0
- package/dist/{consequence.d.ts → verdict/consequence.d.ts} +35 -11
- package/dist/{consequence.js → verdict/consequence.js} +9 -22
- package/dist/{finding-fingerprint.js → verdict/finding-fingerprint.js} +1 -1
- package/dist/{findings.d.ts → verdict/findings.d.ts} +149 -41
- package/dist/{findings.js → verdict/findings.js} +169 -48
- package/dist/{instrumentation-gap.d.ts → verdict/instrumentation-gap.d.ts} +22 -14
- package/dist/{instrumentation-gap.js → verdict/instrumentation-gap.js} +23 -15
- package/dist/{intent.d.ts → verdict/intent.d.ts} +41 -52
- package/dist/{intent.js → verdict/intent.js} +11 -22
- package/dist/verdict/revision.d.ts +44 -0
- package/dist/verdict/revision.js +53 -0
- package/dist/{run-context.d.ts → verdict/run-context.d.ts} +13 -34
- package/dist/{run-context.js → verdict/run-context.js} +15 -36
- package/dist/{security.js → verdict/security.js} +12 -21
- package/dist/{verification-run.d.ts → verdict/verification-run.d.ts} +369 -93
- package/dist/{verification-run.js → verdict/verification-run.js} +157 -21
- package/dist/{verified-constants.d.ts → verdict/verified-constants.d.ts} +36 -13
- package/dist/{verified-constants.js → verdict/verified-constants.js} +36 -13
- package/dist/verdict/verify-progress.d.ts +129 -0
- package/dist/verdict/verify-progress.js +74 -0
- package/dist/wire/channel.d.ts +46 -0
- package/dist/wire/channel.js +95 -0
- package/dist/{constants.d.ts → wire/constants/constants.d.ts} +124 -28
- package/dist/{constants.js → wire/constants/constants.js} +137 -28
- package/dist/{session-constants.d.ts → wire/constants/session-constants.d.ts} +9 -2
- package/dist/{session-constants.js → wire/constants/session-constants.js} +9 -2
- package/dist/{desktop-contract.js → wire/desktop-contract.js} +1 -1
- package/dist/{event-classification.js → wire/event-classification.js} +1 -1
- package/dist/{event-payloads.d.ts → wire/event-payloads.d.ts} +229 -17
- package/dist/{event-payloads.js → wire/event-payloads.js} +61 -3
- package/dist/{event-priority.d.ts → wire/event-priority.d.ts} +1 -4
- package/dist/{event-priority.js → wire/event-priority.js} +2 -5
- package/dist/wire/global-press.d.ts +30 -0
- package/dist/wire/global-press.js +54 -0
- package/dist/{messages.d.ts → wire/messages.d.ts} +290 -38
- package/dist/{messages.js → wire/messages.js} +93 -5
- package/dist/wire/narrow.d.ts +39 -0
- package/dist/wire/narrow.js +45 -0
- package/dist/{net.d.ts → wire/net.d.ts} +49 -10
- package/dist/{net.js → wire/net.js} +49 -10
- package/dist/wire/platform.d.ts +37 -0
- package/dist/wire/platform.js +36 -0
- package/dist/{redaction.d.ts → wire/redaction.d.ts} +30 -0
- package/dist/wire/redaction.js +274 -0
- package/dist/wire/tool-names.d.ts +133 -0
- package/dist/wire/tool-names.js +142 -0
- package/dist/{toon.js → wire/toon.js} +1 -1
- package/dist/{types.d.ts → wire/types.d.ts} +106 -66
- package/dist/{types.js → wire/types.js} +24 -4
- package/dist/{no-session-reason.d.ts → words/no-session-reason.d.ts} +7 -3
- package/dist/{no-session-reason.js → words/no-session-reason.js} +7 -3
- package/dist/{notices.d.ts → words/notices.d.ts} +24 -12
- package/dist/{notices.js → words/notices.js} +27 -12
- package/package.json +22 -5
- package/dist/flow-types.d.ts +0 -1473
- package/dist/flow-types.js +0 -195
- package/dist/redaction.js +0 -149
- /package/dist/{brand.js → identity/brand.js} +0 -0
- /package/dist/{edit-epoch.d.ts → identity/edit-epoch.d.ts} +0 -0
- /package/dist/{edit-epoch.js → identity/edit-epoch.js} +0 -0
- /package/dist/{project-id.d.ts → identity/project-id.d.ts} +0 -0
- /package/dist/{project-id.js → identity/project-id.js} +0 -0
- /package/dist/{daemon-registry.d.ts → registry/daemon-registry.d.ts} +0 -0
- /package/dist/{daemon-registry.js → registry/daemon-registry.js} +0 -0
- /package/dist/{finding-fingerprint.d.ts → verdict/finding-fingerprint.d.ts} +0 -0
- /package/dist/{security.d.ts → verdict/security.d.ts} +0 -0
- /package/dist/{desktop-contract.d.ts → wire/desktop-contract.d.ts} +0 -0
- /package/dist/{event-classification.d.ts → wire/event-classification.d.ts} +0 -0
- /package/dist/{state-select.d.ts → wire/state-select.d.ts} +0 -0
- /package/dist/{state-select.js → wire/state-select.js} +0 -0
- /package/dist/{toon.d.ts → wire/toon.d.ts} +0 -0
- /package/dist/{browser-misdirect.d.ts → words/browser-misdirect.d.ts} +0 -0
- /package/dist/{browser-misdirect.js → words/browser-misdirect.js} +0 -0
- /package/dist/{unreachable-notice.d.ts → words/unreachable-notice.d.ts} +0 -0
- /package/dist/{unreachable-notice.js → words/unreachable-notice.js} +0 -0
- /package/dist/{upgrade.d.ts → words/upgrade.d.ts} +0 -0
- /package/dist/{upgrade.js → words/upgrade.js} +0 -0
|
@@ -0,0 +1,3736 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { FlowStepTool } from './flow-step-tool.js';
|
|
3
|
+
import { StepEffect } from './step-effect.js';
|
|
4
|
+
export { CROSS_STEP_ADDRESS, FlowStepTool } from './flow-step-tool.js';
|
|
5
|
+
import { ActionType } from '../wire/constants/constants.js';
|
|
6
|
+
import type { Contradiction } from '../verdict/findings.js';
|
|
7
|
+
import { type DriftReason, type HealStatus, type ReplayStatus, type SuiteIsolation } from './flow-constants.js';
|
|
8
|
+
/**
|
|
9
|
+
* The MCP tool names that can appear as a recorded flow step's `tool`. These are the ONLY tool names
|
|
10
|
+
* that cross the wire into a persisted flow file — the browser recorder stamps them, the server replays
|
|
11
|
+
* them, and FlowStep types them — so they live in core, the wire contract. The full agent-facing tool
|
|
12
|
+
* surface stays server-side (ReticleTool); ReticleTool references THESE for the flow-persisted three, so
|
|
13
|
+
* there is one source of truth and a rename cannot silently desync the recorder from the replayer (a
|
|
14
|
+
* tool rename once killed four e2e specs — this closes the browser/server half of that drift).
|
|
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
|
+
kind: "testid";
|
|
39
|
+
value: string;
|
|
40
|
+
source?: {
|
|
41
|
+
file: string;
|
|
42
|
+
line: number;
|
|
43
|
+
column?: number | undefined;
|
|
44
|
+
} | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
kind: "testid";
|
|
47
|
+
value: string;
|
|
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
|
+
kind: "signal";
|
|
70
|
+
name: string;
|
|
71
|
+
}, {
|
|
72
|
+
kind: "signal";
|
|
73
|
+
name: string;
|
|
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
|
+
role?: string | undefined;
|
|
95
|
+
component?: string | undefined;
|
|
96
|
+
source?: {
|
|
97
|
+
file: string;
|
|
98
|
+
line: number;
|
|
99
|
+
column?: number | undefined;
|
|
100
|
+
} | undefined;
|
|
101
|
+
name?: string | undefined;
|
|
102
|
+
}, {
|
|
103
|
+
kind: "component";
|
|
104
|
+
role?: string | undefined;
|
|
105
|
+
component?: string | undefined;
|
|
106
|
+
source?: {
|
|
107
|
+
file: string;
|
|
108
|
+
line: number;
|
|
109
|
+
column?: number | undefined;
|
|
110
|
+
} | 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
|
+
/**
|
|
125
|
+
* The route the step must have reached — the consequence of a NAVIGATION.
|
|
126
|
+
*
|
|
127
|
+
* Absent until now, and its absence was not a corner case: navigation is one of the commonest
|
|
128
|
+
* journeys there is, and every route-asserted drive saved a flow that could never go red. Found
|
|
129
|
+
* by driving a real app, where `act_and_wait { until: { kind: "route" } }` returned
|
|
130
|
+
* `verified: "yes"` and the flow saved from that same drive graded `assertion-free`.
|
|
131
|
+
*
|
|
132
|
+
* Additive and optional, so a flow file written before it still parses and FLOW_FILE_VERSION
|
|
133
|
+
* stays 1 — the same treatment `signalData` and `signalCount` had.
|
|
134
|
+
*/
|
|
135
|
+
route: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
pathname: z.ZodOptional<z.ZodString>;
|
|
137
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
pathname?: string | undefined;
|
|
140
|
+
contains?: string | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
pathname?: string | undefined;
|
|
143
|
+
contains?: string | undefined;
|
|
144
|
+
}>>;
|
|
145
|
+
signal: z.ZodOptional<z.ZodString>;
|
|
146
|
+
/**
|
|
147
|
+
* Optional payload shape an `assert-signal` annotation requires the signal
|
|
148
|
+
* to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
|
|
149
|
+
* bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
|
|
150
|
+
*/
|
|
151
|
+
signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
152
|
+
/**
|
|
153
|
+
* Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
|
|
154
|
+
* only way a saved flow can keep a cardinality the agent actually asserted. Without it a
|
|
155
|
+
* `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
|
|
156
|
+
* one made: the replayed flow then goes green on the double-fire it was recorded to catch.
|
|
157
|
+
* Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
|
|
158
|
+
*/
|
|
159
|
+
signalCount: z.ZodOptional<z.ZodNumber>;
|
|
160
|
+
net: z.ZodOptional<z.ZodObject<{
|
|
161
|
+
method: z.ZodOptional<z.ZodString>;
|
|
162
|
+
urlContains: z.ZodOptional<z.ZodString>;
|
|
163
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
/**
|
|
165
|
+
* Exact number of matching requests since the action — turns presence into a cardinality
|
|
166
|
+
* assertion. Catches the double-submit / useEffect-double-fire / retry-storm regression class:
|
|
167
|
+
* the request fired (presence passes) but fired the WRONG number of times. Omit = presence (≥1).
|
|
168
|
+
*/
|
|
169
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
}, "strict", z.ZodTypeAny, {
|
|
171
|
+
status?: number | undefined;
|
|
172
|
+
method?: string | undefined;
|
|
173
|
+
urlContains?: string | undefined;
|
|
174
|
+
count?: number | undefined;
|
|
175
|
+
}, {
|
|
176
|
+
status?: number | undefined;
|
|
177
|
+
method?: string | undefined;
|
|
178
|
+
urlContains?: string | undefined;
|
|
179
|
+
count?: number | undefined;
|
|
180
|
+
}>>;
|
|
181
|
+
/**
|
|
182
|
+
* Console golden end-condition: assert the action logged (or, with absent:true, did NOT log) a
|
|
183
|
+
* console message at `level` (default 'error'). `absent:true` is the common case — "the action
|
|
184
|
+
* completed with a clean console" — catching the regression where an action throws a caught error
|
|
185
|
+
* / logs an uncaught rejection while the UI still renders fine (a presence check passes it).
|
|
186
|
+
*/
|
|
187
|
+
console: z.ZodOptional<z.ZodObject<{
|
|
188
|
+
level: z.ZodOptional<z.ZodString>;
|
|
189
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
+
}, "strict", z.ZodTypeAny, {
|
|
191
|
+
level?: string | undefined;
|
|
192
|
+
absent?: boolean | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
level?: string | undefined;
|
|
195
|
+
absent?: boolean | undefined;
|
|
196
|
+
}>>;
|
|
197
|
+
element: z.ZodOptional<z.ZodObject<{
|
|
198
|
+
testid: z.ZodOptional<z.ZodString>;
|
|
199
|
+
role: z.ZodOptional<z.ZodString>;
|
|
200
|
+
name: z.ZodOptional<z.ZodString>;
|
|
201
|
+
}, "strict", z.ZodTypeAny, {
|
|
202
|
+
role?: string | undefined;
|
|
203
|
+
testid?: string | undefined;
|
|
204
|
+
name?: string | undefined;
|
|
205
|
+
}, {
|
|
206
|
+
role?: string | undefined;
|
|
207
|
+
testid?: string | undefined;
|
|
208
|
+
name?: string | undefined;
|
|
209
|
+
}>>;
|
|
210
|
+
/**
|
|
211
|
+
* Rendered text as an end-condition, using the shapes the assert surface already accepts.
|
|
212
|
+
*
|
|
213
|
+
* The gap this closes: an app with no testids, no `reticle.signal`, no registrable store and no
|
|
214
|
+
* network call on the interaction under test -- a discount price computed and rendered, a
|
|
215
|
+
* formatted total, a derived label -- could not produce an asserted flow AT ALL. Everything the
|
|
216
|
+
* vocabulary offered needed a channel that app does not have, so the only honest outcome was
|
|
217
|
+
* `assertion-free`, which is a permanent green (#811).
|
|
218
|
+
*
|
|
219
|
+
* Derived-DOM rendering is a large share of what actually breaks in a UI, and it was the share
|
|
220
|
+
* that could not be pinned.
|
|
221
|
+
*
|
|
222
|
+
* Classified PRESENCE, not consequence, and that is not a technicality: text is read from the
|
|
223
|
+
* DOM, so a locator healed to the wrong element can still satisfy it. It earns `presence-only`,
|
|
224
|
+
* which is a real grade above `assertion-free` and honestly below `signal`/`net`/`state`.
|
|
225
|
+
*/
|
|
226
|
+
text: z.ZodOptional<z.ZodObject<{
|
|
227
|
+
contains: z.ZodString;
|
|
228
|
+
/** Narrow the search to a container, exactly as the `text` predicate's `scope` does. */
|
|
229
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
230
|
+
/** Assert the text is GONE — the regression check for a cleared error or a dismissed toast. */
|
|
231
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
232
|
+
/** Require the match to be visible, not merely present in the DOM. */
|
|
233
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
}, "strict", z.ZodTypeAny, {
|
|
235
|
+
contains: string;
|
|
236
|
+
visible?: boolean | undefined;
|
|
237
|
+
absent?: boolean | undefined;
|
|
238
|
+
scope?: string | undefined;
|
|
239
|
+
}, {
|
|
240
|
+
contains: string;
|
|
241
|
+
visible?: boolean | undefined;
|
|
242
|
+
absent?: boolean | undefined;
|
|
243
|
+
scope?: string | undefined;
|
|
244
|
+
}>>;
|
|
245
|
+
/**
|
|
246
|
+
* Assert a registered store's value — the source of truth no DOM/network read can reach. Compiles
|
|
247
|
+
* to the predicate engine's `state` predicate. Additive/optional — a flow without it still parses
|
|
248
|
+
* and the on-disk version stays FLOW_FILE_VERSION 1. `equals` accepts a literal, omitted = presence,
|
|
249
|
+
* or a `{ $gte | $contains | $length }` operator pattern.
|
|
250
|
+
*/
|
|
251
|
+
state: z.ZodOptional<z.ZodObject<{
|
|
252
|
+
store: z.ZodOptional<z.ZodString>;
|
|
253
|
+
path: z.ZodString;
|
|
254
|
+
equals: z.ZodOptional<z.ZodUnknown>;
|
|
255
|
+
/**
|
|
256
|
+
* Treat this as an INVARIANT that must still hold AFTER the action settles, rather than a
|
|
257
|
+
* condition to wait for. Set it for a blast-radius check ("this unrelated path must NOT have
|
|
258
|
+
* moved") — without it a wait-until-true read passes before an over-reaching side-effect lands.
|
|
259
|
+
*/
|
|
260
|
+
hold: z.ZodOptional<z.ZodBoolean>;
|
|
261
|
+
}, "strict", z.ZodTypeAny, {
|
|
262
|
+
path: string;
|
|
263
|
+
store?: string | undefined;
|
|
264
|
+
equals?: unknown;
|
|
265
|
+
hold?: boolean | undefined;
|
|
266
|
+
}, {
|
|
267
|
+
path: string;
|
|
268
|
+
store?: string | undefined;
|
|
269
|
+
equals?: unknown;
|
|
270
|
+
hold?: boolean | undefined;
|
|
271
|
+
}>>;
|
|
272
|
+
}, "strict", z.ZodTypeAny, {
|
|
273
|
+
signal?: string | undefined;
|
|
274
|
+
text?: {
|
|
275
|
+
contains: string;
|
|
276
|
+
visible?: boolean | undefined;
|
|
277
|
+
absent?: boolean | undefined;
|
|
278
|
+
scope?: string | undefined;
|
|
279
|
+
} | undefined;
|
|
280
|
+
net?: {
|
|
281
|
+
status?: number | undefined;
|
|
282
|
+
method?: string | undefined;
|
|
283
|
+
urlContains?: string | undefined;
|
|
284
|
+
count?: number | undefined;
|
|
285
|
+
} | undefined;
|
|
286
|
+
state?: {
|
|
287
|
+
path: string;
|
|
288
|
+
store?: string | undefined;
|
|
289
|
+
equals?: unknown;
|
|
290
|
+
hold?: boolean | undefined;
|
|
291
|
+
} | undefined;
|
|
292
|
+
element?: {
|
|
293
|
+
role?: string | undefined;
|
|
294
|
+
testid?: string | undefined;
|
|
295
|
+
name?: string | undefined;
|
|
296
|
+
} | undefined;
|
|
297
|
+
route?: {
|
|
298
|
+
pathname?: string | undefined;
|
|
299
|
+
contains?: string | undefined;
|
|
300
|
+
} | undefined;
|
|
301
|
+
console?: {
|
|
302
|
+
level?: string | undefined;
|
|
303
|
+
absent?: boolean | undefined;
|
|
304
|
+
} | undefined;
|
|
305
|
+
signalData?: Record<string, unknown> | undefined;
|
|
306
|
+
signalCount?: number | undefined;
|
|
307
|
+
}, {
|
|
308
|
+
signal?: string | undefined;
|
|
309
|
+
text?: {
|
|
310
|
+
contains: string;
|
|
311
|
+
visible?: boolean | undefined;
|
|
312
|
+
absent?: boolean | undefined;
|
|
313
|
+
scope?: string | undefined;
|
|
314
|
+
} | undefined;
|
|
315
|
+
net?: {
|
|
316
|
+
status?: number | undefined;
|
|
317
|
+
method?: string | undefined;
|
|
318
|
+
urlContains?: string | undefined;
|
|
319
|
+
count?: number | undefined;
|
|
320
|
+
} | undefined;
|
|
321
|
+
state?: {
|
|
322
|
+
path: string;
|
|
323
|
+
store?: string | undefined;
|
|
324
|
+
equals?: unknown;
|
|
325
|
+
hold?: boolean | undefined;
|
|
326
|
+
} | undefined;
|
|
327
|
+
element?: {
|
|
328
|
+
role?: string | undefined;
|
|
329
|
+
testid?: string | undefined;
|
|
330
|
+
name?: string | undefined;
|
|
331
|
+
} | undefined;
|
|
332
|
+
route?: {
|
|
333
|
+
pathname?: string | undefined;
|
|
334
|
+
contains?: string | undefined;
|
|
335
|
+
} | undefined;
|
|
336
|
+
console?: {
|
|
337
|
+
level?: string | undefined;
|
|
338
|
+
absent?: boolean | undefined;
|
|
339
|
+
} | undefined;
|
|
340
|
+
signalData?: Record<string, unknown> | undefined;
|
|
341
|
+
signalCount?: number | undefined;
|
|
342
|
+
}>;
|
|
343
|
+
export type FlowExpect = z.infer<typeof FlowExpectSchema>;
|
|
344
|
+
/** One step of a flow: an anchored action (+ optional expectation). */
|
|
345
|
+
export interface FlowStep {
|
|
346
|
+
/** FlowStepTool.ACT | FlowStepTool.ACT_SEQUENCE (core, shared with ReticleTool). */
|
|
347
|
+
tool: string;
|
|
348
|
+
anchor: FlowAnchor;
|
|
349
|
+
/**
|
|
350
|
+
* Where this step's element came from in the source, when the build stamped one.
|
|
351
|
+
*
|
|
352
|
+
* Beside the anchor rather than inside it: only a COMPONENT anchor had room for a source, and a
|
|
353
|
+
* recorder prefers a TESTID anchor whenever the element has one — so the commonest flow could
|
|
354
|
+
* never say which files it covers, and a scoped re-verify had nothing to scope by.
|
|
355
|
+
*/
|
|
356
|
+
source?: {
|
|
357
|
+
file: string;
|
|
358
|
+
line?: number;
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* A name for this step that survives editing the flow.
|
|
362
|
+
*
|
|
363
|
+
* Resume targets a step, and targeting it by POSITION breaks the moment one is inserted, removed
|
|
364
|
+
* or healed: "resume from 4" quietly means a different step than it did yesterday, and nothing
|
|
365
|
+
* reports the shift. Optional and back-compat — a flow without ids resumes by index exactly as
|
|
366
|
+
* before, which is every flow recorded before this shipped.
|
|
367
|
+
*/
|
|
368
|
+
id?: string;
|
|
369
|
+
/** What this step does to the subject; absent means unknown. See StepEffect. */
|
|
370
|
+
effect?: StepEffect;
|
|
371
|
+
action?: ActionType;
|
|
372
|
+
args?: Record<string, unknown>;
|
|
373
|
+
expect?: FlowExpect;
|
|
374
|
+
/** true when the anchor is best-effort (no testid was resolvable at record time). NOT dropped. */
|
|
375
|
+
degraded?: boolean;
|
|
376
|
+
/**
|
|
377
|
+
* How long THIS step's `expect` waits for its consequence, in ms. Overrides the flow's
|
|
378
|
+
* `signalTimeoutMs` and the built-in FLOW_SIGNAL_TIMEOUT_MS default.
|
|
379
|
+
*
|
|
380
|
+
* Not a tuning knob: the wait decides whether an honest flow can ever be green. A step whose
|
|
381
|
+
* consequence legitimately takes longer than the default drifts with `signal_not_observed` and
|
|
382
|
+
* reports a working feature as NO LONGER TRUE, and the only other ways to green it are to weaken
|
|
383
|
+
* or delete the assertion, which the rules forbid.
|
|
384
|
+
*
|
|
385
|
+
* Replay must not be stricter than the tool that recorded the step: `act_and_wait` takes a
|
|
386
|
+
* `timeout_ms`, so a recorded step can carry one too.
|
|
387
|
+
*/
|
|
388
|
+
timeoutMs?: number;
|
|
389
|
+
/** sub-steps for an act_sequence, each independently anchored. */
|
|
390
|
+
steps?: FlowStep[];
|
|
391
|
+
/**
|
|
392
|
+
* The flow this step runs, when `tool` is `FlowStepTool.INVOKE`.
|
|
393
|
+
*
|
|
394
|
+
* A name, not a copy. Inlining the sub-journey's steps here would produce a composite-shaped file
|
|
395
|
+
* with none of composition's value — the drift would still report a position in the outer flow,
|
|
396
|
+
* repair would still have to happen in every copy, and the sub-journey could not be reused.
|
|
397
|
+
*/
|
|
398
|
+
invoke?: string;
|
|
399
|
+
}
|
|
400
|
+
export declare const FlowStepSchema: z.ZodType<FlowStep>;
|
|
401
|
+
/**
|
|
402
|
+
* A legible-drift record returned when an anchor misses at replay.
|
|
403
|
+
* The "whose fault is it" payload: what was expected, why it's gone, and the closest surviving
|
|
404
|
+
* anchor (a concrete fix suggestion). Never a bare "command failed".
|
|
405
|
+
*/
|
|
406
|
+
export interface Drift {
|
|
407
|
+
/** Named reason kind (testid not found / signal not observed). */
|
|
408
|
+
reasonKind: DriftReason;
|
|
409
|
+
/** Human sentence, e.g. `testid "chat-send" not found`. */
|
|
410
|
+
reason: string;
|
|
411
|
+
/** The missed anchor value (the testid string, or the signal name). */
|
|
412
|
+
anchor: string;
|
|
413
|
+
/** Closest present testid via the live near-miss; null only when the page has no testids (or signal drift). */
|
|
414
|
+
nearest: string | null;
|
|
415
|
+
/**
|
|
416
|
+
* True when two or more present testids tie at the minimum edit distance, so `nearest` is an
|
|
417
|
+
* arbitrary pick. An ambiguous drift is NEVER auto-healed (a wrong rebind ships a bug green) —
|
|
418
|
+
* it is surfaced for a human/agent to choose. Absent ⇒ unambiguous.
|
|
419
|
+
*/
|
|
420
|
+
ambiguous?: boolean;
|
|
421
|
+
}
|
|
422
|
+
/** The per-step result of re-resolving + running one anchored step. */
|
|
423
|
+
/**
|
|
424
|
+
* Counts of what an app did inside one window, and the width of that window.
|
|
425
|
+
*
|
|
426
|
+
* Defined HERE because it is part of the artifact contract, and consumed by the engine that computes
|
|
427
|
+
* it: core is the bottom of the graph and everything depends on it, so one shape lives in one place
|
|
428
|
+
* rather than being declared twice and drifting.
|
|
429
|
+
*/
|
|
430
|
+
export interface ReactionSummary {
|
|
431
|
+
total: number;
|
|
432
|
+
network: number;
|
|
433
|
+
domAdded: number;
|
|
434
|
+
domRemoved: number;
|
|
435
|
+
domChanged: number;
|
|
436
|
+
routeChanges: number;
|
|
437
|
+
consoleErrors: number;
|
|
438
|
+
animations: number;
|
|
439
|
+
signals: number;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* The digest's counts: `total` always, every other counter only when it is NON-ZERO.
|
|
443
|
+
*
|
|
444
|
+
* This shape is sparse and the full `ReactionSummary` above is not, on purpose. The digest ships on
|
|
445
|
+
* every step of every replay and on every `act_and_wait`; the full report does not. Across a
|
|
446
|
+
* four-step replay 25 of 36 counters are typically zero — every step spelling out `"network":0,
|
|
447
|
+
* "domAdded":0,"routeChanges":0,…` whether or not anything moved.
|
|
448
|
+
*
|
|
449
|
+
* Omitting a zero is a ROUTE cut and never an evidence cut: an absent counter IS zero, so the reader
|
|
450
|
+
* answers the same question from the same facts. Read one as `summary.network ?? 0`.
|
|
451
|
+
*
|
|
452
|
+
* `total` is unconditional because "the window was empty" is itself evidence, and a summary with no
|
|
453
|
+
* keys could not be told apart from one that was never computed.
|
|
454
|
+
*/
|
|
455
|
+
export type ReactionSummaryDigest = {
|
|
456
|
+
total: number;
|
|
457
|
+
} & Partial<Omit<ReactionSummary, 'total'>>;
|
|
458
|
+
/** The lean reaction report: the window and the counts, without the per-event timeline. */
|
|
459
|
+
export interface ReactionDigest {
|
|
460
|
+
window_ms: number;
|
|
461
|
+
summary: ReactionSummaryDigest;
|
|
462
|
+
}
|
|
463
|
+
export interface FlowStepResult {
|
|
464
|
+
/** 0-based index of this step in the flow. */
|
|
465
|
+
step: number;
|
|
466
|
+
/**
|
|
467
|
+
* The tool the step runs — FlowStepTool.ACT | ACT_SEQUENCE | the synthetic success oracle.
|
|
468
|
+
*
|
|
469
|
+
* OMITTED when it is `ACT`, which 137/137 steps in this repo's corpus are. Read it as
|
|
470
|
+
* `tool ?? FlowStepTool.ACT`. Every reader only ever asks "is this the success oracle?", and a
|
|
471
|
+
* missing field is correctly falsy against that — so the coercion fails in the safe direction.
|
|
472
|
+
*/
|
|
473
|
+
tool?: string;
|
|
474
|
+
/** The testid/signal value the step is bound to (the re-resolved anchor). */
|
|
475
|
+
anchor: string;
|
|
476
|
+
/**
|
|
477
|
+
* Where this step lives, rendered, when the flow is a COMPOSITE — `signin#0 (invoked from full#1)`.
|
|
478
|
+
*
|
|
479
|
+
* Absent for a flat flow, where `step` is already the whole answer and an address on every row
|
|
480
|
+
* would be noise on every replay of every flow.
|
|
481
|
+
*/
|
|
482
|
+
at?: string;
|
|
483
|
+
/**
|
|
484
|
+
* The route (pathname) the page was on when this step ran — the "which page" of the journey.
|
|
485
|
+
* Additive/optional: present when a route is observable, absent in route-less contexts (e.g. a
|
|
486
|
+
* fake session with no route events). Lets a replay result read as a page-by-page journey.
|
|
487
|
+
*/
|
|
488
|
+
page?: string;
|
|
489
|
+
/**
|
|
490
|
+
* A compact summary of the observable CONSEQUENCE in the window right after this step ran — the
|
|
491
|
+
* "what happened" of the journey: a route change, a domain signal (e.g. a modal opening), a
|
|
492
|
+
* network call, or console errors. Additive/optional and intentionally terse (token-cheap). It
|
|
493
|
+
* captures what had landed by the time the action settled, so a very-late async effect may not
|
|
494
|
+
* appear; the asserted consequence (expect/success) is the authoritative pass/fail signal.
|
|
495
|
+
*/
|
|
496
|
+
consequence?: string;
|
|
497
|
+
/**
|
|
498
|
+
* Wall-clock ms this step took (dispatch → post-settle), from the session's injected elapsed clock.
|
|
499
|
+
* Additive/optional: absent in contexts with no advancing clock. Feeds per-step run-to-run perf diffs.
|
|
500
|
+
*/
|
|
501
|
+
durationMs?: number;
|
|
502
|
+
/**
|
|
503
|
+
* The event-stream span this step's evidence lives in — its drill address.
|
|
504
|
+
*
|
|
505
|
+
* `reticle_observe` already accepts `{ since, until }` and returns "the span between action A and
|
|
506
|
+
* B", so a step that carries its own window is a step somebody can ask about afterwards without
|
|
507
|
+
* re-driving anything. Without it the evidence is captured and has no address, which is why a
|
|
508
|
+
* deterministic run could say a step passed and nothing more.
|
|
509
|
+
*
|
|
510
|
+
* Bounded on BOTH ends deliberately. A `since` alone returns everything from that point to now, so
|
|
511
|
+
* on a long flow step two's window would include steps three through twenty-five — and an agent
|
|
512
|
+
* reading it would attribute the whole tail to one click.
|
|
513
|
+
*
|
|
514
|
+
* Additive/optional, and omitted rather than zero-width where no clock advanced: a `{since: 0,
|
|
515
|
+
* until: 0}` would read as "this step caused nothing" instead of "nothing here measures time".
|
|
516
|
+
*/
|
|
517
|
+
window?: {
|
|
518
|
+
since: number;
|
|
519
|
+
until: number;
|
|
520
|
+
};
|
|
521
|
+
/**
|
|
522
|
+
* What the app DID in that window, as counts.
|
|
523
|
+
*
|
|
524
|
+
* `consequence` beside it is a sentence — readable, and not scannable. Twenty-five sentences is
|
|
525
|
+
* prose somebody has to read; twenty-five of these is a surface they can skim for the one row that
|
|
526
|
+
* is unlike the others, which is the whole difference between a step ledger and a wall of text.
|
|
527
|
+
*
|
|
528
|
+
* The counts, not the events. The per-event timeline is the expensive half and it is one
|
|
529
|
+
* `reticle_observe { since, until }` away using this step's own `window`, so the cheap form is
|
|
530
|
+
* what travels and the full form is addressable rather than sent.
|
|
531
|
+
*/
|
|
532
|
+
digest?: ReactionDigest;
|
|
533
|
+
/**
|
|
534
|
+
* Channels that DISAGREE about what this step did — reported even when the step passed.
|
|
535
|
+
*
|
|
536
|
+
* That is the entire point. A step whose anchor resolved, whose action fired and whose declared
|
|
537
|
+
* consequence held, while a request in the same window failed, is the false green this product
|
|
538
|
+
* exists to catch. The detectors run independently of the assertion, so a green step with an entry
|
|
539
|
+
* here is a finding, not a contradiction in terms.
|
|
540
|
+
*
|
|
541
|
+
* Omitted when the channels agree, never an empty array: a field that is always present teaches a
|
|
542
|
+
* reader to skim past it, and the whole value here is that its presence is the signal.
|
|
543
|
+
*/
|
|
544
|
+
contradictions?: Contradiction[];
|
|
545
|
+
ok: boolean;
|
|
546
|
+
error?: string;
|
|
547
|
+
note?: string;
|
|
548
|
+
/** Present iff this step stopped on an anchor miss. */
|
|
549
|
+
drift?: Drift;
|
|
550
|
+
/**
|
|
551
|
+
* A confidence-scored nearest-match rebind for this drifted step (additive,
|
|
552
|
+
* optional). Set only for a confident testid drift.
|
|
553
|
+
*/
|
|
554
|
+
proposal?: HealProposal;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* The autonomy decision envelope — the feedback a human used to give, made machine-actionable. From
|
|
558
|
+
* a replay result it states the verdict, what changed, WHERE in the source to look (file:line, from a
|
|
559
|
+
* component anchor), a suggested fix, and the single next action — so a coding agent decides its next
|
|
560
|
+
* move without a human in the loop. Terse by design (token-cheap).
|
|
561
|
+
*/
|
|
562
|
+
export interface ReplayDecision {
|
|
563
|
+
/** pass = intent held; drift = a locator/anchor missed; fail = an action or the success oracle failed. */
|
|
564
|
+
verdict: 'pass' | 'drift' | 'fail';
|
|
565
|
+
/** One-line human/agent summary of the outcome. */
|
|
566
|
+
summary: string;
|
|
567
|
+
/** What regressed (the drift reason or failure), when not a pass. */
|
|
568
|
+
whatChanged?: string;
|
|
569
|
+
/** Where to look — `file:line` from the failing step's source anchor, or the page route. */
|
|
570
|
+
whereInSource?: string;
|
|
571
|
+
/** A concrete fix hint (e.g. rebind to the nearest surviving anchor). */
|
|
572
|
+
suggestedFix?: string;
|
|
573
|
+
/** The single next action the agent should take. */
|
|
574
|
+
nextAction: string;
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* One flow's line in a suite verdict — pass counts as a name; a failure carries the actionable
|
|
578
|
+
* decision fields so the agent can fix it without re-querying.
|
|
579
|
+
*/
|
|
580
|
+
export interface SuiteFlowResult {
|
|
581
|
+
flow: string;
|
|
582
|
+
/**
|
|
583
|
+
* The flow never ran: its file failed to load, or its leased context never came up. Nothing was
|
|
584
|
+
* learned about the app, so this row is not a regression — it is Reticle reporting its own failure
|
|
585
|
+
* in the same array as the app's. Measured: one sweep emitted 8 `flow-regression` bug_found events
|
|
586
|
+
* off rows like these, from a suite where no flow ever executed.
|
|
587
|
+
*/
|
|
588
|
+
couldNotRun?: boolean;
|
|
589
|
+
verdict: 'pass' | 'drift' | 'fail';
|
|
590
|
+
whatChanged?: string;
|
|
591
|
+
whereInSource?: string;
|
|
592
|
+
nextAction?: string;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* The consolidated verdict of replaying EVERY known flow — the autonomous loop's "did I break
|
|
596
|
+
* anything, and what do I fix" answer in one deterministic call. Passing flows are counted; only
|
|
597
|
+
* failures carry detail (token-cheap). `status` is fail if any flow drifted or errored.
|
|
598
|
+
*/
|
|
599
|
+
export interface SuiteVerdict {
|
|
600
|
+
/**
|
|
601
|
+
* `unverifiable` means the suite contained flows that CANNOT FAIL, so "pass" would be a lie.
|
|
602
|
+
*
|
|
603
|
+
* A recorded flow with no steps, or one that asserts no observable consequence, replays green no
|
|
604
|
+
* matter what the app does. Reporting `pass` for it is a false green in the exact feature sold as
|
|
605
|
+
* the regression suite — measured: a flow saved as `{steps: [], intent: "..."}`, which `flow_save`
|
|
606
|
+
* had ALREADY graded assertion-free with a warning, came back "all 1 flow pass".
|
|
607
|
+
*/
|
|
608
|
+
status: 'pass' | 'fail' | 'unverifiable';
|
|
609
|
+
total: number;
|
|
610
|
+
passed: number;
|
|
611
|
+
failed: number;
|
|
612
|
+
summary: string;
|
|
613
|
+
/** Only the failing flows, with their decision (verdict, what changed, where, next action). */
|
|
614
|
+
failures: SuiteFlowResult[];
|
|
615
|
+
/**
|
|
616
|
+
* How the flows were kept apart — see `SuiteIsolation`.
|
|
617
|
+
*
|
|
618
|
+
* Absent when the caller did not say. Present, it is the difference between two counts that can
|
|
619
|
+
* be compared and two that cannot: a shared-session pass may be inherited from an earlier flow.
|
|
620
|
+
*/
|
|
621
|
+
isolation?: SuiteIsolation;
|
|
622
|
+
/**
|
|
623
|
+
* Flows that replayed without error but assert nothing, so their green means nothing. Counted
|
|
624
|
+
* apart from `passed` — a number that includes them is not a count of anything verified.
|
|
625
|
+
*/
|
|
626
|
+
unverifiable?: {
|
|
627
|
+
flow: string;
|
|
628
|
+
reason: string;
|
|
629
|
+
}[];
|
|
630
|
+
/**
|
|
631
|
+
* Flows that have both passed AND failed on UNCHANGED code — intermittent, not regressions.
|
|
632
|
+
*
|
|
633
|
+
* A flake and a regression demand opposite responses: one is chased, the other is quarantined. The
|
|
634
|
+
* ledger that answers this already existed and was written only by the CLI, so an agent replaying a
|
|
635
|
+
* suite a hundred times could never learn which of its failures were noise. Omitted entirely when
|
|
636
|
+
* the ledger has not seen enough runs to say.
|
|
637
|
+
*/
|
|
638
|
+
flaky?: string[];
|
|
639
|
+
/**
|
|
640
|
+
* How much of what the suite DROVE it actually proved.
|
|
641
|
+
*
|
|
642
|
+
* `unverifiable` above catches a flow that asserts nothing at all. It cannot catch the commoner
|
|
643
|
+
* shape: a flow of twelve steps where three declare a consequence and nine do not. That flow
|
|
644
|
+
* passes, counts in `passed`, and nine of its steps would have replayed green whether or not the
|
|
645
|
+
* feature worked.
|
|
646
|
+
*
|
|
647
|
+
* So the count travels. Sixty-three steps driven and forty-seven declared is not "75% verified" —
|
|
648
|
+
* it is verified for forty-seven and silent about sixteen, and only a number carrying both lets a
|
|
649
|
+
* reader tell those apart. Omitted when no flow file was available to count, because an invented
|
|
650
|
+
* zero would read as "nothing was declared" rather than "nothing was counted".
|
|
651
|
+
*/
|
|
652
|
+
coverage?: {
|
|
653
|
+
steps: number;
|
|
654
|
+
declared: number;
|
|
655
|
+
};
|
|
656
|
+
/**
|
|
657
|
+
* Known routes this run never opened.
|
|
658
|
+
*
|
|
659
|
+
* `coverage` above counts what the suite DROVE. Neither it nor anything else here notices a route
|
|
660
|
+
* no flow goes near — so a selection replaying two of eleven flows reports "all 2 flows pass",
|
|
661
|
+
* which is true and says nothing about the nine routes that were not looked at.
|
|
662
|
+
*
|
|
663
|
+
* Known means seen before, not enumerated from the app: every flow the project holds contributes
|
|
664
|
+
* the route it starts on. Omitted when the caller knows of no routes, because "0 unreached" from
|
|
665
|
+
* an empty ledger reads as a clean sweep rather than as an unanswered question.
|
|
666
|
+
*/
|
|
667
|
+
unreached?: string[];
|
|
668
|
+
/**
|
|
669
|
+
* Every channel disagreement the suite saw, including on flows that PASSED.
|
|
670
|
+
*
|
|
671
|
+
* The step-level rule already says a contradiction is reported regardless of `ok`, for the reason
|
|
672
|
+
* that a step whose action fired and whose consequence held, while a request in the same window
|
|
673
|
+
* failed, is the false green this product exists to catch. The suite verdict returned only its
|
|
674
|
+
* failures, so on a green run every one of those was computed, attached to a step, and discarded
|
|
675
|
+
* at exactly the moment somebody would have read it — a nightly run of a hundred steps reporting
|
|
676
|
+
* "all 12 flows pass".
|
|
677
|
+
*
|
|
678
|
+
* Carrying them also means a green suite is not reported as `pass`: see `status`.
|
|
679
|
+
*/
|
|
680
|
+
contradictions?: SuiteContradiction[];
|
|
681
|
+
}
|
|
682
|
+
/** A step-level contradiction, addressed back to the flow and step that produced it. */
|
|
683
|
+
export interface SuiteContradiction extends Contradiction {
|
|
684
|
+
flow: string;
|
|
685
|
+
/** Index within the flow, so the reader can drill straight to the step's own window. */
|
|
686
|
+
step: number;
|
|
687
|
+
}
|
|
688
|
+
/** The reticle_flow_replay envelope. */
|
|
689
|
+
export interface FlowReplayResult {
|
|
690
|
+
name: string;
|
|
691
|
+
status: ReplayStatus;
|
|
692
|
+
/**
|
|
693
|
+
* Contradictions that span steps — found by re-running the detectors over the WHOLE replay, minus
|
|
694
|
+
* everything a step already reported.
|
|
695
|
+
*
|
|
696
|
+
* A step's window closes when the step ends, so a request fired at step 2 and still unanswered at
|
|
697
|
+
* step 5 sits outside every per-step window. It is exactly the shape a long journey produces and
|
|
698
|
+
* exactly the shape a per-step view cannot see.
|
|
699
|
+
*
|
|
700
|
+
* Omitted when the whole-span pass adds nothing over the steps.
|
|
701
|
+
*/
|
|
702
|
+
crossStep?: Contradiction[];
|
|
703
|
+
/**
|
|
704
|
+
* What this flow knows after this run — every defect it has seen, and whether it is still open.
|
|
705
|
+
*
|
|
706
|
+
* Written back to the flow file so the next replay starts from it. This is how a flow gets
|
|
707
|
+
* stricter without anybody writing a new assertion: a defect observed, then observed GONE, becomes
|
|
708
|
+
* something the app can never quietly reacquire.
|
|
709
|
+
*/
|
|
710
|
+
learned?: {
|
|
711
|
+
kind: string;
|
|
712
|
+
step: number;
|
|
713
|
+
state: 'open' | 'guarded';
|
|
714
|
+
cleanRuns?: number | undefined;
|
|
715
|
+
}[];
|
|
716
|
+
/** Defects this run saw disappear. The app got better here. */
|
|
717
|
+
promoted?: string[];
|
|
718
|
+
/** Guarded defects that came back. The app got worse here, and only this flow would have known. */
|
|
719
|
+
regressed?: string[];
|
|
720
|
+
steps: FlowStepResult[];
|
|
721
|
+
/** The machine-actionable decision derived from this replay (autonomy layer). */
|
|
722
|
+
decision?: ReplayDecision;
|
|
723
|
+
/** Set when status === 'error' (load failure or resolved action failure). */
|
|
724
|
+
error?: {
|
|
725
|
+
code: string;
|
|
726
|
+
message: string;
|
|
727
|
+
};
|
|
728
|
+
/**
|
|
729
|
+
* Set when the replay STOPPED before the end of the flow.
|
|
730
|
+
*
|
|
731
|
+
* Replay breaks on the first failing step, so a flow that halted returns fewer step results than
|
|
732
|
+
* it has steps — and nothing said so. A caller reading a two-step flow's one result saw a step
|
|
733
|
+
* that was simply absent, which was reported as replay "silently skipping" an action. It does not
|
|
734
|
+
* skip; it stops, and now it says where and how much it never reached. Omitted entirely when every
|
|
735
|
+
* step ran, so a clean pass carries no extra bytes.
|
|
736
|
+
*/
|
|
737
|
+
halted?: {
|
|
738
|
+
atStep: number;
|
|
739
|
+
notAttempted: number;
|
|
740
|
+
};
|
|
741
|
+
/**
|
|
742
|
+
* Set on an `ok` replay whose flow cannot fail: it asserts no observable consequence, or has no
|
|
743
|
+
* steps at all. The replay genuinely completed, so the status stays `ok` — but a bare `ok` read
|
|
744
|
+
* as proof the feature works is exactly the false confidence `flow-risk.ts` argues against, and
|
|
745
|
+
* `reticle_flow_verify` already refuses to count these as passes. This carries the same reason,
|
|
746
|
+
* from the same function, to the single-flow caller who would otherwise never see it.
|
|
747
|
+
*/
|
|
748
|
+
unverifiable?: {
|
|
749
|
+
reason: string;
|
|
750
|
+
};
|
|
751
|
+
/**
|
|
752
|
+
* The confident rebind proposals aggregated across drifted steps (additive,
|
|
753
|
+
* optional — present only when at least one drifted step has a confident nearest match).
|
|
754
|
+
*/
|
|
755
|
+
proposals?: HealProposal[];
|
|
756
|
+
/**
|
|
757
|
+
* The push-default deviation report over this replay's route segments (ranked deviations vs the learned
|
|
758
|
+
* envelope, or a fall-back note below N=3 runs). Additive; present when segments were observed.
|
|
759
|
+
*/
|
|
760
|
+
deviation?: unknown;
|
|
761
|
+
/**
|
|
762
|
+
* What the project already knows about this flow, fetched from shared memory on the agent's
|
|
763
|
+
* behalf.
|
|
764
|
+
*
|
|
765
|
+
* Present only when the project is linked, memory sync is on, and the team has actually captured
|
|
766
|
+
* something about this flow. Shared memory an agent has to remember to consult is never consulted,
|
|
767
|
+
* so the verification asks on the agent's behalf — the difference between memory the platform
|
|
768
|
+
* stores and memory the platform uses.
|
|
769
|
+
*
|
|
770
|
+
* Deliberately additive and deliberately small: a verdict whose own result has been pushed below
|
|
771
|
+
* a wall of statements is a worse verdict.
|
|
772
|
+
*/
|
|
773
|
+
knows?: {
|
|
774
|
+
statement: string;
|
|
775
|
+
status: string;
|
|
776
|
+
}[];
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* The on-disk flow file: diffable, git-tracked, anchor-resolved.
|
|
780
|
+
* The optional `dynamic` field (both `dynamic` + `success` are optional, so a
|
|
781
|
+
* file with neither still parses — back-compat is locked by a test).
|
|
782
|
+
*/
|
|
783
|
+
export declare const FlowFileSchema: z.ZodObject<{
|
|
784
|
+
version: z.ZodLiteral<1>;
|
|
785
|
+
name: z.ZodString;
|
|
786
|
+
/**
|
|
787
|
+
* The business goal this flow exists to verify, one line (e.g. "ship a deploy to production").
|
|
788
|
+
* Optional + back-compat (a flow without it still parses). Set via an `intent` annotation. The
|
|
789
|
+
* point of "intent + outcome oracle": a flow that declares an intent should also assert an
|
|
790
|
+
* observable business OUTCOME (a consequence success-state), or it claims to verify a goal it
|
|
791
|
+
* cannot actually check — flow-classify flags that gap.
|
|
792
|
+
*/
|
|
793
|
+
intent: z.ZodOptional<z.ZodString>;
|
|
794
|
+
/**
|
|
795
|
+
* The intent-ledger row this flow discharges — the id in `.reticle/intent.json`.
|
|
796
|
+
*
|
|
797
|
+
* `intent` above is the prose a recorder captured; this is the LINK to the ledger that already
|
|
798
|
+
* models declared → bound → proved and records which verdict discharged what. Without it there
|
|
799
|
+
* would be two ways to say what a change is for, which is the defect this codebase keeps paying
|
|
800
|
+
* for: a flow's goal and an intent's statement would drift apart with nothing to reconcile them.
|
|
801
|
+
*
|
|
802
|
+
* Set at save time from the flow's own prose, or written by hand to point a flow at an intent
|
|
803
|
+
* declared earlier via `reticle_intent` — a flow can prove something somebody else declared.
|
|
804
|
+
* Optional + back-compat: a flow without it replays exactly as before, and the on-disk version
|
|
805
|
+
* stays FLOW_FILE_VERSION 1.
|
|
806
|
+
*/
|
|
807
|
+
intentId: z.ZodOptional<z.ZodString>;
|
|
808
|
+
/**
|
|
809
|
+
* The project the flow was recorded against (the connecting session's HELLO `projectId`), stamped at
|
|
810
|
+
* save time. Scopes a flow to its app so a shared daemon's HUD lists only the current project's flows
|
|
811
|
+
* instead of every project that ever saved to that daemon. Optional + back-compat: a flow with no
|
|
812
|
+
* projectId is treated as global (visible everywhere), so pre-existing files parse and still show.
|
|
813
|
+
*/
|
|
814
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
815
|
+
/**
|
|
816
|
+
* The route (pathname) the journey started on, captured at record time. Replay navigates here
|
|
817
|
+
* before step 1 so a flow whose first anchor lives on another page doesn't drift on step 1 ("a
|
|
818
|
+
* step no longer matches") just because replay began on the wrong page. Optional + back-compat: a
|
|
819
|
+
* flow without it (or recorded before this shipped) replays from the current page as before, and
|
|
820
|
+
* the on-disk version stays FLOW_FILE_VERSION 1.
|
|
821
|
+
*/
|
|
822
|
+
startPath: z.ZodOptional<z.ZodString>;
|
|
823
|
+
fixture: z.ZodOptional<z.ZodString>;
|
|
824
|
+
/**
|
|
825
|
+
* What must already be true for this flow to mean anything, and what it leaves true.
|
|
826
|
+
*
|
|
827
|
+
* These are the two halves of composition. Replaying flows back to back only works when the state
|
|
828
|
+
* one leaves is the state the next expects, and nothing said so — so a suite either got lucky or
|
|
829
|
+
* produced a failure that looked like a regression and was a missing precondition. `requires` lets
|
|
830
|
+
* a replay report THAT instead: not met is `unknown` (nothing ran, nothing proved), never a
|
|
831
|
+
* failure, which is the same honesty rule an uncovered change already follows.
|
|
832
|
+
*
|
|
833
|
+
* `ensures` is the other side, and is what makes A-then-B checkable before either runs.
|
|
834
|
+
*
|
|
835
|
+
* Both optional and both absent from every flow recorded before this shipped, where absent means
|
|
836
|
+
* what it has always meant: replay from wherever the app already is, and let the steps speak.
|
|
837
|
+
* Same predicate shape as a step's `expect`, deliberately — a precondition is just a consequence
|
|
838
|
+
* somebody else's flow was responsible for.
|
|
839
|
+
*/
|
|
840
|
+
requires: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
841
|
+
/**
|
|
842
|
+
* The route the step must have reached — the consequence of a NAVIGATION.
|
|
843
|
+
*
|
|
844
|
+
* Absent until now, and its absence was not a corner case: navigation is one of the commonest
|
|
845
|
+
* journeys there is, and every route-asserted drive saved a flow that could never go red. Found
|
|
846
|
+
* by driving a real app, where `act_and_wait { until: { kind: "route" } }` returned
|
|
847
|
+
* `verified: "yes"` and the flow saved from that same drive graded `assertion-free`.
|
|
848
|
+
*
|
|
849
|
+
* Additive and optional, so a flow file written before it still parses and FLOW_FILE_VERSION
|
|
850
|
+
* stays 1 — the same treatment `signalData` and `signalCount` had.
|
|
851
|
+
*/
|
|
852
|
+
route: z.ZodOptional<z.ZodObject<{
|
|
853
|
+
pathname: z.ZodOptional<z.ZodString>;
|
|
854
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
855
|
+
}, "strip", z.ZodTypeAny, {
|
|
856
|
+
pathname?: string | undefined;
|
|
857
|
+
contains?: string | undefined;
|
|
858
|
+
}, {
|
|
859
|
+
pathname?: string | undefined;
|
|
860
|
+
contains?: string | undefined;
|
|
861
|
+
}>>;
|
|
862
|
+
signal: z.ZodOptional<z.ZodString>;
|
|
863
|
+
/**
|
|
864
|
+
* Optional payload shape an `assert-signal` annotation requires the signal
|
|
865
|
+
* to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
|
|
866
|
+
* bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
|
|
867
|
+
*/
|
|
868
|
+
signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
869
|
+
/**
|
|
870
|
+
* Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
|
|
871
|
+
* only way a saved flow can keep a cardinality the agent actually asserted. Without it a
|
|
872
|
+
* `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
|
|
873
|
+
* one made: the replayed flow then goes green on the double-fire it was recorded to catch.
|
|
874
|
+
* Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
|
|
875
|
+
*/
|
|
876
|
+
signalCount: z.ZodOptional<z.ZodNumber>;
|
|
877
|
+
net: z.ZodOptional<z.ZodObject<{
|
|
878
|
+
method: z.ZodOptional<z.ZodString>;
|
|
879
|
+
urlContains: z.ZodOptional<z.ZodString>;
|
|
880
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
881
|
+
/**
|
|
882
|
+
* Exact number of matching requests since the action — turns presence into a cardinality
|
|
883
|
+
* assertion. Catches the double-submit / useEffect-double-fire / retry-storm regression class:
|
|
884
|
+
* the request fired (presence passes) but fired the WRONG number of times. Omit = presence (≥1).
|
|
885
|
+
*/
|
|
886
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
887
|
+
}, "strict", z.ZodTypeAny, {
|
|
888
|
+
status?: number | undefined;
|
|
889
|
+
method?: string | undefined;
|
|
890
|
+
urlContains?: string | undefined;
|
|
891
|
+
count?: number | undefined;
|
|
892
|
+
}, {
|
|
893
|
+
status?: number | undefined;
|
|
894
|
+
method?: string | undefined;
|
|
895
|
+
urlContains?: string | undefined;
|
|
896
|
+
count?: number | undefined;
|
|
897
|
+
}>>;
|
|
898
|
+
/**
|
|
899
|
+
* Console golden end-condition: assert the action logged (or, with absent:true, did NOT log) a
|
|
900
|
+
* console message at `level` (default 'error'). `absent:true` is the common case — "the action
|
|
901
|
+
* completed with a clean console" — catching the regression where an action throws a caught error
|
|
902
|
+
* / logs an uncaught rejection while the UI still renders fine (a presence check passes it).
|
|
903
|
+
*/
|
|
904
|
+
console: z.ZodOptional<z.ZodObject<{
|
|
905
|
+
level: z.ZodOptional<z.ZodString>;
|
|
906
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
907
|
+
}, "strict", z.ZodTypeAny, {
|
|
908
|
+
level?: string | undefined;
|
|
909
|
+
absent?: boolean | undefined;
|
|
910
|
+
}, {
|
|
911
|
+
level?: string | undefined;
|
|
912
|
+
absent?: boolean | undefined;
|
|
913
|
+
}>>;
|
|
914
|
+
element: z.ZodOptional<z.ZodObject<{
|
|
915
|
+
testid: z.ZodOptional<z.ZodString>;
|
|
916
|
+
role: z.ZodOptional<z.ZodString>;
|
|
917
|
+
name: z.ZodOptional<z.ZodString>;
|
|
918
|
+
}, "strict", z.ZodTypeAny, {
|
|
919
|
+
role?: string | undefined;
|
|
920
|
+
testid?: string | undefined;
|
|
921
|
+
name?: string | undefined;
|
|
922
|
+
}, {
|
|
923
|
+
role?: string | undefined;
|
|
924
|
+
testid?: string | undefined;
|
|
925
|
+
name?: string | undefined;
|
|
926
|
+
}>>;
|
|
927
|
+
/**
|
|
928
|
+
* Rendered text as an end-condition, using the shapes the assert surface already accepts.
|
|
929
|
+
*
|
|
930
|
+
* The gap this closes: an app with no testids, no `reticle.signal`, no registrable store and no
|
|
931
|
+
* network call on the interaction under test -- a discount price computed and rendered, a
|
|
932
|
+
* formatted total, a derived label -- could not produce an asserted flow AT ALL. Everything the
|
|
933
|
+
* vocabulary offered needed a channel that app does not have, so the only honest outcome was
|
|
934
|
+
* `assertion-free`, which is a permanent green (#811).
|
|
935
|
+
*
|
|
936
|
+
* Derived-DOM rendering is a large share of what actually breaks in a UI, and it was the share
|
|
937
|
+
* that could not be pinned.
|
|
938
|
+
*
|
|
939
|
+
* Classified PRESENCE, not consequence, and that is not a technicality: text is read from the
|
|
940
|
+
* DOM, so a locator healed to the wrong element can still satisfy it. It earns `presence-only`,
|
|
941
|
+
* which is a real grade above `assertion-free` and honestly below `signal`/`net`/`state`.
|
|
942
|
+
*/
|
|
943
|
+
text: z.ZodOptional<z.ZodObject<{
|
|
944
|
+
contains: z.ZodString;
|
|
945
|
+
/** Narrow the search to a container, exactly as the `text` predicate's `scope` does. */
|
|
946
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
947
|
+
/** Assert the text is GONE — the regression check for a cleared error or a dismissed toast. */
|
|
948
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
949
|
+
/** Require the match to be visible, not merely present in the DOM. */
|
|
950
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
951
|
+
}, "strict", z.ZodTypeAny, {
|
|
952
|
+
contains: string;
|
|
953
|
+
visible?: boolean | undefined;
|
|
954
|
+
absent?: boolean | undefined;
|
|
955
|
+
scope?: string | undefined;
|
|
956
|
+
}, {
|
|
957
|
+
contains: string;
|
|
958
|
+
visible?: boolean | undefined;
|
|
959
|
+
absent?: boolean | undefined;
|
|
960
|
+
scope?: string | undefined;
|
|
961
|
+
}>>;
|
|
962
|
+
/**
|
|
963
|
+
* Assert a registered store's value — the source of truth no DOM/network read can reach. Compiles
|
|
964
|
+
* to the predicate engine's `state` predicate. Additive/optional — a flow without it still parses
|
|
965
|
+
* and the on-disk version stays FLOW_FILE_VERSION 1. `equals` accepts a literal, omitted = presence,
|
|
966
|
+
* or a `{ $gte | $contains | $length }` operator pattern.
|
|
967
|
+
*/
|
|
968
|
+
state: z.ZodOptional<z.ZodObject<{
|
|
969
|
+
store: z.ZodOptional<z.ZodString>;
|
|
970
|
+
path: z.ZodString;
|
|
971
|
+
equals: z.ZodOptional<z.ZodUnknown>;
|
|
972
|
+
/**
|
|
973
|
+
* Treat this as an INVARIANT that must still hold AFTER the action settles, rather than a
|
|
974
|
+
* condition to wait for. Set it for a blast-radius check ("this unrelated path must NOT have
|
|
975
|
+
* moved") — without it a wait-until-true read passes before an over-reaching side-effect lands.
|
|
976
|
+
*/
|
|
977
|
+
hold: z.ZodOptional<z.ZodBoolean>;
|
|
978
|
+
}, "strict", z.ZodTypeAny, {
|
|
979
|
+
path: string;
|
|
980
|
+
store?: string | undefined;
|
|
981
|
+
equals?: unknown;
|
|
982
|
+
hold?: boolean | undefined;
|
|
983
|
+
}, {
|
|
984
|
+
path: string;
|
|
985
|
+
store?: string | undefined;
|
|
986
|
+
equals?: unknown;
|
|
987
|
+
hold?: boolean | undefined;
|
|
988
|
+
}>>;
|
|
989
|
+
}, "strict", z.ZodTypeAny, {
|
|
990
|
+
signal?: string | undefined;
|
|
991
|
+
text?: {
|
|
992
|
+
contains: string;
|
|
993
|
+
visible?: boolean | undefined;
|
|
994
|
+
absent?: boolean | undefined;
|
|
995
|
+
scope?: string | undefined;
|
|
996
|
+
} | undefined;
|
|
997
|
+
net?: {
|
|
998
|
+
status?: number | undefined;
|
|
999
|
+
method?: string | undefined;
|
|
1000
|
+
urlContains?: string | undefined;
|
|
1001
|
+
count?: number | undefined;
|
|
1002
|
+
} | undefined;
|
|
1003
|
+
state?: {
|
|
1004
|
+
path: string;
|
|
1005
|
+
store?: string | undefined;
|
|
1006
|
+
equals?: unknown;
|
|
1007
|
+
hold?: boolean | undefined;
|
|
1008
|
+
} | undefined;
|
|
1009
|
+
element?: {
|
|
1010
|
+
role?: string | undefined;
|
|
1011
|
+
testid?: string | undefined;
|
|
1012
|
+
name?: string | undefined;
|
|
1013
|
+
} | undefined;
|
|
1014
|
+
route?: {
|
|
1015
|
+
pathname?: string | undefined;
|
|
1016
|
+
contains?: string | undefined;
|
|
1017
|
+
} | undefined;
|
|
1018
|
+
console?: {
|
|
1019
|
+
level?: string | undefined;
|
|
1020
|
+
absent?: boolean | undefined;
|
|
1021
|
+
} | undefined;
|
|
1022
|
+
signalData?: Record<string, unknown> | undefined;
|
|
1023
|
+
signalCount?: number | undefined;
|
|
1024
|
+
}, {
|
|
1025
|
+
signal?: string | undefined;
|
|
1026
|
+
text?: {
|
|
1027
|
+
contains: string;
|
|
1028
|
+
visible?: boolean | undefined;
|
|
1029
|
+
absent?: boolean | undefined;
|
|
1030
|
+
scope?: string | undefined;
|
|
1031
|
+
} | undefined;
|
|
1032
|
+
net?: {
|
|
1033
|
+
status?: number | undefined;
|
|
1034
|
+
method?: string | undefined;
|
|
1035
|
+
urlContains?: string | undefined;
|
|
1036
|
+
count?: number | undefined;
|
|
1037
|
+
} | undefined;
|
|
1038
|
+
state?: {
|
|
1039
|
+
path: string;
|
|
1040
|
+
store?: string | undefined;
|
|
1041
|
+
equals?: unknown;
|
|
1042
|
+
hold?: boolean | undefined;
|
|
1043
|
+
} | undefined;
|
|
1044
|
+
element?: {
|
|
1045
|
+
role?: string | undefined;
|
|
1046
|
+
testid?: string | undefined;
|
|
1047
|
+
name?: string | undefined;
|
|
1048
|
+
} | undefined;
|
|
1049
|
+
route?: {
|
|
1050
|
+
pathname?: string | undefined;
|
|
1051
|
+
contains?: string | undefined;
|
|
1052
|
+
} | undefined;
|
|
1053
|
+
console?: {
|
|
1054
|
+
level?: string | undefined;
|
|
1055
|
+
absent?: boolean | undefined;
|
|
1056
|
+
} | undefined;
|
|
1057
|
+
signalData?: Record<string, unknown> | undefined;
|
|
1058
|
+
signalCount?: number | undefined;
|
|
1059
|
+
}>, "many">>;
|
|
1060
|
+
ensures: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1061
|
+
/**
|
|
1062
|
+
* The route the step must have reached — the consequence of a NAVIGATION.
|
|
1063
|
+
*
|
|
1064
|
+
* Absent until now, and its absence was not a corner case: navigation is one of the commonest
|
|
1065
|
+
* journeys there is, and every route-asserted drive saved a flow that could never go red. Found
|
|
1066
|
+
* by driving a real app, where `act_and_wait { until: { kind: "route" } }` returned
|
|
1067
|
+
* `verified: "yes"` and the flow saved from that same drive graded `assertion-free`.
|
|
1068
|
+
*
|
|
1069
|
+
* Additive and optional, so a flow file written before it still parses and FLOW_FILE_VERSION
|
|
1070
|
+
* stays 1 — the same treatment `signalData` and `signalCount` had.
|
|
1071
|
+
*/
|
|
1072
|
+
route: z.ZodOptional<z.ZodObject<{
|
|
1073
|
+
pathname: z.ZodOptional<z.ZodString>;
|
|
1074
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
1075
|
+
}, "strip", z.ZodTypeAny, {
|
|
1076
|
+
pathname?: string | undefined;
|
|
1077
|
+
contains?: string | undefined;
|
|
1078
|
+
}, {
|
|
1079
|
+
pathname?: string | undefined;
|
|
1080
|
+
contains?: string | undefined;
|
|
1081
|
+
}>>;
|
|
1082
|
+
signal: z.ZodOptional<z.ZodString>;
|
|
1083
|
+
/**
|
|
1084
|
+
* Optional payload shape an `assert-signal` annotation requires the signal
|
|
1085
|
+
* to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
|
|
1086
|
+
* bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
|
|
1087
|
+
*/
|
|
1088
|
+
signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1089
|
+
/**
|
|
1090
|
+
* Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
|
|
1091
|
+
* only way a saved flow can keep a cardinality the agent actually asserted. Without it a
|
|
1092
|
+
* `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
|
|
1093
|
+
* one made: the replayed flow then goes green on the double-fire it was recorded to catch.
|
|
1094
|
+
* Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
|
|
1095
|
+
*/
|
|
1096
|
+
signalCount: z.ZodOptional<z.ZodNumber>;
|
|
1097
|
+
net: z.ZodOptional<z.ZodObject<{
|
|
1098
|
+
method: z.ZodOptional<z.ZodString>;
|
|
1099
|
+
urlContains: z.ZodOptional<z.ZodString>;
|
|
1100
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
1101
|
+
/**
|
|
1102
|
+
* Exact number of matching requests since the action — turns presence into a cardinality
|
|
1103
|
+
* assertion. Catches the double-submit / useEffect-double-fire / retry-storm regression class:
|
|
1104
|
+
* the request fired (presence passes) but fired the WRONG number of times. Omit = presence (≥1).
|
|
1105
|
+
*/
|
|
1106
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
1107
|
+
}, "strict", z.ZodTypeAny, {
|
|
1108
|
+
status?: number | undefined;
|
|
1109
|
+
method?: string | undefined;
|
|
1110
|
+
urlContains?: string | undefined;
|
|
1111
|
+
count?: number | undefined;
|
|
1112
|
+
}, {
|
|
1113
|
+
status?: number | undefined;
|
|
1114
|
+
method?: string | undefined;
|
|
1115
|
+
urlContains?: string | undefined;
|
|
1116
|
+
count?: number | undefined;
|
|
1117
|
+
}>>;
|
|
1118
|
+
/**
|
|
1119
|
+
* Console golden end-condition: assert the action logged (or, with absent:true, did NOT log) a
|
|
1120
|
+
* console message at `level` (default 'error'). `absent:true` is the common case — "the action
|
|
1121
|
+
* completed with a clean console" — catching the regression where an action throws a caught error
|
|
1122
|
+
* / logs an uncaught rejection while the UI still renders fine (a presence check passes it).
|
|
1123
|
+
*/
|
|
1124
|
+
console: z.ZodOptional<z.ZodObject<{
|
|
1125
|
+
level: z.ZodOptional<z.ZodString>;
|
|
1126
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
1127
|
+
}, "strict", z.ZodTypeAny, {
|
|
1128
|
+
level?: string | undefined;
|
|
1129
|
+
absent?: boolean | undefined;
|
|
1130
|
+
}, {
|
|
1131
|
+
level?: string | undefined;
|
|
1132
|
+
absent?: boolean | undefined;
|
|
1133
|
+
}>>;
|
|
1134
|
+
element: z.ZodOptional<z.ZodObject<{
|
|
1135
|
+
testid: z.ZodOptional<z.ZodString>;
|
|
1136
|
+
role: z.ZodOptional<z.ZodString>;
|
|
1137
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1138
|
+
}, "strict", z.ZodTypeAny, {
|
|
1139
|
+
role?: string | undefined;
|
|
1140
|
+
testid?: string | undefined;
|
|
1141
|
+
name?: string | undefined;
|
|
1142
|
+
}, {
|
|
1143
|
+
role?: string | undefined;
|
|
1144
|
+
testid?: string | undefined;
|
|
1145
|
+
name?: string | undefined;
|
|
1146
|
+
}>>;
|
|
1147
|
+
/**
|
|
1148
|
+
* Rendered text as an end-condition, using the shapes the assert surface already accepts.
|
|
1149
|
+
*
|
|
1150
|
+
* The gap this closes: an app with no testids, no `reticle.signal`, no registrable store and no
|
|
1151
|
+
* network call on the interaction under test -- a discount price computed and rendered, a
|
|
1152
|
+
* formatted total, a derived label -- could not produce an asserted flow AT ALL. Everything the
|
|
1153
|
+
* vocabulary offered needed a channel that app does not have, so the only honest outcome was
|
|
1154
|
+
* `assertion-free`, which is a permanent green (#811).
|
|
1155
|
+
*
|
|
1156
|
+
* Derived-DOM rendering is a large share of what actually breaks in a UI, and it was the share
|
|
1157
|
+
* that could not be pinned.
|
|
1158
|
+
*
|
|
1159
|
+
* Classified PRESENCE, not consequence, and that is not a technicality: text is read from the
|
|
1160
|
+
* DOM, so a locator healed to the wrong element can still satisfy it. It earns `presence-only`,
|
|
1161
|
+
* which is a real grade above `assertion-free` and honestly below `signal`/`net`/`state`.
|
|
1162
|
+
*/
|
|
1163
|
+
text: z.ZodOptional<z.ZodObject<{
|
|
1164
|
+
contains: z.ZodString;
|
|
1165
|
+
/** Narrow the search to a container, exactly as the `text` predicate's `scope` does. */
|
|
1166
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
1167
|
+
/** Assert the text is GONE — the regression check for a cleared error or a dismissed toast. */
|
|
1168
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
1169
|
+
/** Require the match to be visible, not merely present in the DOM. */
|
|
1170
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
1171
|
+
}, "strict", z.ZodTypeAny, {
|
|
1172
|
+
contains: string;
|
|
1173
|
+
visible?: boolean | undefined;
|
|
1174
|
+
absent?: boolean | undefined;
|
|
1175
|
+
scope?: string | undefined;
|
|
1176
|
+
}, {
|
|
1177
|
+
contains: string;
|
|
1178
|
+
visible?: boolean | undefined;
|
|
1179
|
+
absent?: boolean | undefined;
|
|
1180
|
+
scope?: string | undefined;
|
|
1181
|
+
}>>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Assert a registered store's value — the source of truth no DOM/network read can reach. Compiles
|
|
1184
|
+
* to the predicate engine's `state` predicate. Additive/optional — a flow without it still parses
|
|
1185
|
+
* and the on-disk version stays FLOW_FILE_VERSION 1. `equals` accepts a literal, omitted = presence,
|
|
1186
|
+
* or a `{ $gte | $contains | $length }` operator pattern.
|
|
1187
|
+
*/
|
|
1188
|
+
state: z.ZodOptional<z.ZodObject<{
|
|
1189
|
+
store: z.ZodOptional<z.ZodString>;
|
|
1190
|
+
path: z.ZodString;
|
|
1191
|
+
equals: z.ZodOptional<z.ZodUnknown>;
|
|
1192
|
+
/**
|
|
1193
|
+
* Treat this as an INVARIANT that must still hold AFTER the action settles, rather than a
|
|
1194
|
+
* condition to wait for. Set it for a blast-radius check ("this unrelated path must NOT have
|
|
1195
|
+
* moved") — without it a wait-until-true read passes before an over-reaching side-effect lands.
|
|
1196
|
+
*/
|
|
1197
|
+
hold: z.ZodOptional<z.ZodBoolean>;
|
|
1198
|
+
}, "strict", z.ZodTypeAny, {
|
|
1199
|
+
path: string;
|
|
1200
|
+
store?: string | undefined;
|
|
1201
|
+
equals?: unknown;
|
|
1202
|
+
hold?: boolean | undefined;
|
|
1203
|
+
}, {
|
|
1204
|
+
path: string;
|
|
1205
|
+
store?: string | undefined;
|
|
1206
|
+
equals?: unknown;
|
|
1207
|
+
hold?: boolean | undefined;
|
|
1208
|
+
}>>;
|
|
1209
|
+
}, "strict", z.ZodTypeAny, {
|
|
1210
|
+
signal?: string | undefined;
|
|
1211
|
+
text?: {
|
|
1212
|
+
contains: string;
|
|
1213
|
+
visible?: boolean | undefined;
|
|
1214
|
+
absent?: boolean | undefined;
|
|
1215
|
+
scope?: string | undefined;
|
|
1216
|
+
} | undefined;
|
|
1217
|
+
net?: {
|
|
1218
|
+
status?: number | undefined;
|
|
1219
|
+
method?: string | undefined;
|
|
1220
|
+
urlContains?: string | undefined;
|
|
1221
|
+
count?: number | undefined;
|
|
1222
|
+
} | undefined;
|
|
1223
|
+
state?: {
|
|
1224
|
+
path: string;
|
|
1225
|
+
store?: string | undefined;
|
|
1226
|
+
equals?: unknown;
|
|
1227
|
+
hold?: boolean | undefined;
|
|
1228
|
+
} | undefined;
|
|
1229
|
+
element?: {
|
|
1230
|
+
role?: string | undefined;
|
|
1231
|
+
testid?: string | undefined;
|
|
1232
|
+
name?: string | undefined;
|
|
1233
|
+
} | undefined;
|
|
1234
|
+
route?: {
|
|
1235
|
+
pathname?: string | undefined;
|
|
1236
|
+
contains?: string | undefined;
|
|
1237
|
+
} | undefined;
|
|
1238
|
+
console?: {
|
|
1239
|
+
level?: string | undefined;
|
|
1240
|
+
absent?: boolean | undefined;
|
|
1241
|
+
} | undefined;
|
|
1242
|
+
signalData?: Record<string, unknown> | undefined;
|
|
1243
|
+
signalCount?: number | undefined;
|
|
1244
|
+
}, {
|
|
1245
|
+
signal?: string | undefined;
|
|
1246
|
+
text?: {
|
|
1247
|
+
contains: string;
|
|
1248
|
+
visible?: boolean | undefined;
|
|
1249
|
+
absent?: boolean | undefined;
|
|
1250
|
+
scope?: string | undefined;
|
|
1251
|
+
} | undefined;
|
|
1252
|
+
net?: {
|
|
1253
|
+
status?: number | undefined;
|
|
1254
|
+
method?: string | undefined;
|
|
1255
|
+
urlContains?: string | undefined;
|
|
1256
|
+
count?: number | undefined;
|
|
1257
|
+
} | undefined;
|
|
1258
|
+
state?: {
|
|
1259
|
+
path: string;
|
|
1260
|
+
store?: string | undefined;
|
|
1261
|
+
equals?: unknown;
|
|
1262
|
+
hold?: boolean | undefined;
|
|
1263
|
+
} | undefined;
|
|
1264
|
+
element?: {
|
|
1265
|
+
role?: string | undefined;
|
|
1266
|
+
testid?: string | undefined;
|
|
1267
|
+
name?: string | undefined;
|
|
1268
|
+
} | undefined;
|
|
1269
|
+
route?: {
|
|
1270
|
+
pathname?: string | undefined;
|
|
1271
|
+
contains?: string | undefined;
|
|
1272
|
+
} | undefined;
|
|
1273
|
+
console?: {
|
|
1274
|
+
level?: string | undefined;
|
|
1275
|
+
absent?: boolean | undefined;
|
|
1276
|
+
} | undefined;
|
|
1277
|
+
signalData?: Record<string, unknown> | undefined;
|
|
1278
|
+
signalCount?: number | undefined;
|
|
1279
|
+
}>, "many">>;
|
|
1280
|
+
/** From the injected clock (ms) — deterministic in tests, byte-stable on disk. */
|
|
1281
|
+
createdAt: z.ZodNumber;
|
|
1282
|
+
steps: z.ZodArray<z.ZodType<FlowStep, z.ZodTypeDef, FlowStep>, "many">;
|
|
1283
|
+
/**
|
|
1284
|
+
* How long every step of this flow waits for its declared consequence, in ms. A step's own
|
|
1285
|
+
* `timeoutMs` wins over it; absent both, FLOW_SIGNAL_TIMEOUT_MS applies.
|
|
1286
|
+
*
|
|
1287
|
+
* Flow-level because slowness is usually a property of the APP, not of one control — a remote
|
|
1288
|
+
* database, a model-backed endpoint, a cold container. Optional + back-compat: a flow without it
|
|
1289
|
+
* replays exactly as before and the on-disk version stays FLOW_FILE_VERSION 1.
|
|
1290
|
+
*/
|
|
1291
|
+
signalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1292
|
+
success: z.ZodOptional<z.ZodObject<{
|
|
1293
|
+
/**
|
|
1294
|
+
* The route the step must have reached — the consequence of a NAVIGATION.
|
|
1295
|
+
*
|
|
1296
|
+
* Absent until now, and its absence was not a corner case: navigation is one of the commonest
|
|
1297
|
+
* journeys there is, and every route-asserted drive saved a flow that could never go red. Found
|
|
1298
|
+
* by driving a real app, where `act_and_wait { until: { kind: "route" } }` returned
|
|
1299
|
+
* `verified: "yes"` and the flow saved from that same drive graded `assertion-free`.
|
|
1300
|
+
*
|
|
1301
|
+
* Additive and optional, so a flow file written before it still parses and FLOW_FILE_VERSION
|
|
1302
|
+
* stays 1 — the same treatment `signalData` and `signalCount` had.
|
|
1303
|
+
*/
|
|
1304
|
+
route: z.ZodOptional<z.ZodObject<{
|
|
1305
|
+
pathname: z.ZodOptional<z.ZodString>;
|
|
1306
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
1307
|
+
}, "strip", z.ZodTypeAny, {
|
|
1308
|
+
pathname?: string | undefined;
|
|
1309
|
+
contains?: string | undefined;
|
|
1310
|
+
}, {
|
|
1311
|
+
pathname?: string | undefined;
|
|
1312
|
+
contains?: string | undefined;
|
|
1313
|
+
}>>;
|
|
1314
|
+
signal: z.ZodOptional<z.ZodString>;
|
|
1315
|
+
/**
|
|
1316
|
+
* Optional payload shape an `assert-signal` annotation requires the signal
|
|
1317
|
+
* to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
|
|
1318
|
+
* bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
|
|
1319
|
+
*/
|
|
1320
|
+
signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1321
|
+
/**
|
|
1322
|
+
* Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
|
|
1323
|
+
* only way a saved flow can keep a cardinality the agent actually asserted. Without it a
|
|
1324
|
+
* `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
|
|
1325
|
+
* one made: the replayed flow then goes green on the double-fire it was recorded to catch.
|
|
1326
|
+
* Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
|
|
1327
|
+
*/
|
|
1328
|
+
signalCount: z.ZodOptional<z.ZodNumber>;
|
|
1329
|
+
net: z.ZodOptional<z.ZodObject<{
|
|
1330
|
+
method: z.ZodOptional<z.ZodString>;
|
|
1331
|
+
urlContains: z.ZodOptional<z.ZodString>;
|
|
1332
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
1333
|
+
/**
|
|
1334
|
+
* Exact number of matching requests since the action — turns presence into a cardinality
|
|
1335
|
+
* assertion. Catches the double-submit / useEffect-double-fire / retry-storm regression class:
|
|
1336
|
+
* the request fired (presence passes) but fired the WRONG number of times. Omit = presence (≥1).
|
|
1337
|
+
*/
|
|
1338
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
1339
|
+
}, "strict", z.ZodTypeAny, {
|
|
1340
|
+
status?: number | undefined;
|
|
1341
|
+
method?: string | undefined;
|
|
1342
|
+
urlContains?: string | undefined;
|
|
1343
|
+
count?: number | undefined;
|
|
1344
|
+
}, {
|
|
1345
|
+
status?: number | undefined;
|
|
1346
|
+
method?: string | undefined;
|
|
1347
|
+
urlContains?: string | undefined;
|
|
1348
|
+
count?: number | undefined;
|
|
1349
|
+
}>>;
|
|
1350
|
+
/**
|
|
1351
|
+
* Console golden end-condition: assert the action logged (or, with absent:true, did NOT log) a
|
|
1352
|
+
* console message at `level` (default 'error'). `absent:true` is the common case — "the action
|
|
1353
|
+
* completed with a clean console" — catching the regression where an action throws a caught error
|
|
1354
|
+
* / logs an uncaught rejection while the UI still renders fine (a presence check passes it).
|
|
1355
|
+
*/
|
|
1356
|
+
console: z.ZodOptional<z.ZodObject<{
|
|
1357
|
+
level: z.ZodOptional<z.ZodString>;
|
|
1358
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
1359
|
+
}, "strict", z.ZodTypeAny, {
|
|
1360
|
+
level?: string | undefined;
|
|
1361
|
+
absent?: boolean | undefined;
|
|
1362
|
+
}, {
|
|
1363
|
+
level?: string | undefined;
|
|
1364
|
+
absent?: boolean | undefined;
|
|
1365
|
+
}>>;
|
|
1366
|
+
element: z.ZodOptional<z.ZodObject<{
|
|
1367
|
+
testid: z.ZodOptional<z.ZodString>;
|
|
1368
|
+
role: z.ZodOptional<z.ZodString>;
|
|
1369
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1370
|
+
}, "strict", z.ZodTypeAny, {
|
|
1371
|
+
role?: string | undefined;
|
|
1372
|
+
testid?: string | undefined;
|
|
1373
|
+
name?: string | undefined;
|
|
1374
|
+
}, {
|
|
1375
|
+
role?: string | undefined;
|
|
1376
|
+
testid?: string | undefined;
|
|
1377
|
+
name?: string | undefined;
|
|
1378
|
+
}>>;
|
|
1379
|
+
/**
|
|
1380
|
+
* Rendered text as an end-condition, using the shapes the assert surface already accepts.
|
|
1381
|
+
*
|
|
1382
|
+
* The gap this closes: an app with no testids, no `reticle.signal`, no registrable store and no
|
|
1383
|
+
* network call on the interaction under test -- a discount price computed and rendered, a
|
|
1384
|
+
* formatted total, a derived label -- could not produce an asserted flow AT ALL. Everything the
|
|
1385
|
+
* vocabulary offered needed a channel that app does not have, so the only honest outcome was
|
|
1386
|
+
* `assertion-free`, which is a permanent green (#811).
|
|
1387
|
+
*
|
|
1388
|
+
* Derived-DOM rendering is a large share of what actually breaks in a UI, and it was the share
|
|
1389
|
+
* that could not be pinned.
|
|
1390
|
+
*
|
|
1391
|
+
* Classified PRESENCE, not consequence, and that is not a technicality: text is read from the
|
|
1392
|
+
* DOM, so a locator healed to the wrong element can still satisfy it. It earns `presence-only`,
|
|
1393
|
+
* which is a real grade above `assertion-free` and honestly below `signal`/`net`/`state`.
|
|
1394
|
+
*/
|
|
1395
|
+
text: z.ZodOptional<z.ZodObject<{
|
|
1396
|
+
contains: z.ZodString;
|
|
1397
|
+
/** Narrow the search to a container, exactly as the `text` predicate's `scope` does. */
|
|
1398
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
1399
|
+
/** Assert the text is GONE — the regression check for a cleared error or a dismissed toast. */
|
|
1400
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
1401
|
+
/** Require the match to be visible, not merely present in the DOM. */
|
|
1402
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
1403
|
+
}, "strict", z.ZodTypeAny, {
|
|
1404
|
+
contains: string;
|
|
1405
|
+
visible?: boolean | undefined;
|
|
1406
|
+
absent?: boolean | undefined;
|
|
1407
|
+
scope?: string | undefined;
|
|
1408
|
+
}, {
|
|
1409
|
+
contains: string;
|
|
1410
|
+
visible?: boolean | undefined;
|
|
1411
|
+
absent?: boolean | undefined;
|
|
1412
|
+
scope?: string | undefined;
|
|
1413
|
+
}>>;
|
|
1414
|
+
/**
|
|
1415
|
+
* Assert a registered store's value — the source of truth no DOM/network read can reach. Compiles
|
|
1416
|
+
* to the predicate engine's `state` predicate. Additive/optional — a flow without it still parses
|
|
1417
|
+
* and the on-disk version stays FLOW_FILE_VERSION 1. `equals` accepts a literal, omitted = presence,
|
|
1418
|
+
* or a `{ $gte | $contains | $length }` operator pattern.
|
|
1419
|
+
*/
|
|
1420
|
+
state: z.ZodOptional<z.ZodObject<{
|
|
1421
|
+
store: z.ZodOptional<z.ZodString>;
|
|
1422
|
+
path: z.ZodString;
|
|
1423
|
+
equals: z.ZodOptional<z.ZodUnknown>;
|
|
1424
|
+
/**
|
|
1425
|
+
* Treat this as an INVARIANT that must still hold AFTER the action settles, rather than a
|
|
1426
|
+
* condition to wait for. Set it for a blast-radius check ("this unrelated path must NOT have
|
|
1427
|
+
* moved") — without it a wait-until-true read passes before an over-reaching side-effect lands.
|
|
1428
|
+
*/
|
|
1429
|
+
hold: z.ZodOptional<z.ZodBoolean>;
|
|
1430
|
+
}, "strict", z.ZodTypeAny, {
|
|
1431
|
+
path: string;
|
|
1432
|
+
store?: string | undefined;
|
|
1433
|
+
equals?: unknown;
|
|
1434
|
+
hold?: boolean | undefined;
|
|
1435
|
+
}, {
|
|
1436
|
+
path: string;
|
|
1437
|
+
store?: string | undefined;
|
|
1438
|
+
equals?: unknown;
|
|
1439
|
+
hold?: boolean | undefined;
|
|
1440
|
+
}>>;
|
|
1441
|
+
}, "strict", z.ZodTypeAny, {
|
|
1442
|
+
signal?: string | undefined;
|
|
1443
|
+
text?: {
|
|
1444
|
+
contains: string;
|
|
1445
|
+
visible?: boolean | undefined;
|
|
1446
|
+
absent?: boolean | undefined;
|
|
1447
|
+
scope?: string | undefined;
|
|
1448
|
+
} | undefined;
|
|
1449
|
+
net?: {
|
|
1450
|
+
status?: number | undefined;
|
|
1451
|
+
method?: string | undefined;
|
|
1452
|
+
urlContains?: string | undefined;
|
|
1453
|
+
count?: number | undefined;
|
|
1454
|
+
} | undefined;
|
|
1455
|
+
state?: {
|
|
1456
|
+
path: string;
|
|
1457
|
+
store?: string | undefined;
|
|
1458
|
+
equals?: unknown;
|
|
1459
|
+
hold?: boolean | undefined;
|
|
1460
|
+
} | undefined;
|
|
1461
|
+
element?: {
|
|
1462
|
+
role?: string | undefined;
|
|
1463
|
+
testid?: string | undefined;
|
|
1464
|
+
name?: string | undefined;
|
|
1465
|
+
} | undefined;
|
|
1466
|
+
route?: {
|
|
1467
|
+
pathname?: string | undefined;
|
|
1468
|
+
contains?: string | undefined;
|
|
1469
|
+
} | undefined;
|
|
1470
|
+
console?: {
|
|
1471
|
+
level?: string | undefined;
|
|
1472
|
+
absent?: boolean | undefined;
|
|
1473
|
+
} | undefined;
|
|
1474
|
+
signalData?: Record<string, unknown> | undefined;
|
|
1475
|
+
signalCount?: number | undefined;
|
|
1476
|
+
}, {
|
|
1477
|
+
signal?: string | undefined;
|
|
1478
|
+
text?: {
|
|
1479
|
+
contains: string;
|
|
1480
|
+
visible?: boolean | undefined;
|
|
1481
|
+
absent?: boolean | undefined;
|
|
1482
|
+
scope?: string | undefined;
|
|
1483
|
+
} | undefined;
|
|
1484
|
+
net?: {
|
|
1485
|
+
status?: number | undefined;
|
|
1486
|
+
method?: string | undefined;
|
|
1487
|
+
urlContains?: string | undefined;
|
|
1488
|
+
count?: number | undefined;
|
|
1489
|
+
} | undefined;
|
|
1490
|
+
state?: {
|
|
1491
|
+
path: string;
|
|
1492
|
+
store?: string | undefined;
|
|
1493
|
+
equals?: unknown;
|
|
1494
|
+
hold?: boolean | undefined;
|
|
1495
|
+
} | undefined;
|
|
1496
|
+
element?: {
|
|
1497
|
+
role?: string | undefined;
|
|
1498
|
+
testid?: string | undefined;
|
|
1499
|
+
name?: string | undefined;
|
|
1500
|
+
} | undefined;
|
|
1501
|
+
route?: {
|
|
1502
|
+
pathname?: string | undefined;
|
|
1503
|
+
contains?: string | undefined;
|
|
1504
|
+
} | undefined;
|
|
1505
|
+
console?: {
|
|
1506
|
+
level?: string | undefined;
|
|
1507
|
+
absent?: boolean | undefined;
|
|
1508
|
+
} | undefined;
|
|
1509
|
+
signalData?: Record<string, unknown> | undefined;
|
|
1510
|
+
signalCount?: number | undefined;
|
|
1511
|
+
}>>;
|
|
1512
|
+
/**
|
|
1513
|
+
* Anchors whose CONTENT must not be asserted (e.g. LLM output). Replay asserts
|
|
1514
|
+
* presence, not words. Compiled from a `mark-dynamic` annotation.
|
|
1515
|
+
*/
|
|
1516
|
+
dynamic: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
1517
|
+
kind: z.ZodLiteral<"testid">;
|
|
1518
|
+
value: z.ZodString;
|
|
1519
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
1520
|
+
file: z.ZodString;
|
|
1521
|
+
line: z.ZodNumber;
|
|
1522
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
1523
|
+
}, "strip", z.ZodTypeAny, {
|
|
1524
|
+
file: string;
|
|
1525
|
+
line: number;
|
|
1526
|
+
column?: number | undefined;
|
|
1527
|
+
}, {
|
|
1528
|
+
file: string;
|
|
1529
|
+
line: number;
|
|
1530
|
+
column?: number | undefined;
|
|
1531
|
+
}>>;
|
|
1532
|
+
}, "strip", z.ZodTypeAny, {
|
|
1533
|
+
kind: "testid";
|
|
1534
|
+
value: string;
|
|
1535
|
+
source?: {
|
|
1536
|
+
file: string;
|
|
1537
|
+
line: number;
|
|
1538
|
+
column?: number | undefined;
|
|
1539
|
+
} | undefined;
|
|
1540
|
+
}, {
|
|
1541
|
+
kind: "testid";
|
|
1542
|
+
value: string;
|
|
1543
|
+
source?: {
|
|
1544
|
+
file: string;
|
|
1545
|
+
line: number;
|
|
1546
|
+
column?: number | undefined;
|
|
1547
|
+
} | undefined;
|
|
1548
|
+
}>, z.ZodObject<{
|
|
1549
|
+
kind: z.ZodLiteral<"role">;
|
|
1550
|
+
role: z.ZodString;
|
|
1551
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1552
|
+
}, "strip", z.ZodTypeAny, {
|
|
1553
|
+
role: string;
|
|
1554
|
+
kind: "role";
|
|
1555
|
+
name?: string | undefined;
|
|
1556
|
+
}, {
|
|
1557
|
+
role: string;
|
|
1558
|
+
kind: "role";
|
|
1559
|
+
name?: string | undefined;
|
|
1560
|
+
}>, z.ZodObject<{
|
|
1561
|
+
kind: z.ZodLiteral<"signal">;
|
|
1562
|
+
name: z.ZodString;
|
|
1563
|
+
}, "strip", z.ZodTypeAny, {
|
|
1564
|
+
kind: "signal";
|
|
1565
|
+
name: string;
|
|
1566
|
+
}, {
|
|
1567
|
+
kind: "signal";
|
|
1568
|
+
name: string;
|
|
1569
|
+
}>, z.ZodObject<{
|
|
1570
|
+
kind: z.ZodLiteral<"component">;
|
|
1571
|
+
component: z.ZodOptional<z.ZodString>;
|
|
1572
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
1573
|
+
file: z.ZodString;
|
|
1574
|
+
line: z.ZodNumber;
|
|
1575
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
1576
|
+
}, "strip", z.ZodTypeAny, {
|
|
1577
|
+
file: string;
|
|
1578
|
+
line: number;
|
|
1579
|
+
column?: number | undefined;
|
|
1580
|
+
}, {
|
|
1581
|
+
file: string;
|
|
1582
|
+
line: number;
|
|
1583
|
+
column?: number | undefined;
|
|
1584
|
+
}>>;
|
|
1585
|
+
role: z.ZodOptional<z.ZodString>;
|
|
1586
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1587
|
+
}, "strip", z.ZodTypeAny, {
|
|
1588
|
+
kind: "component";
|
|
1589
|
+
role?: string | undefined;
|
|
1590
|
+
component?: string | undefined;
|
|
1591
|
+
source?: {
|
|
1592
|
+
file: string;
|
|
1593
|
+
line: number;
|
|
1594
|
+
column?: number | undefined;
|
|
1595
|
+
} | undefined;
|
|
1596
|
+
name?: string | undefined;
|
|
1597
|
+
}, {
|
|
1598
|
+
kind: "component";
|
|
1599
|
+
role?: string | undefined;
|
|
1600
|
+
component?: string | undefined;
|
|
1601
|
+
source?: {
|
|
1602
|
+
file: string;
|
|
1603
|
+
line: number;
|
|
1604
|
+
column?: number | undefined;
|
|
1605
|
+
} | undefined;
|
|
1606
|
+
name?: string | undefined;
|
|
1607
|
+
}>]>, "many">>;
|
|
1608
|
+
/**
|
|
1609
|
+
* Free-form labels a suite selects on — `smoke`, `checkout`, `slow`.
|
|
1610
|
+
*
|
|
1611
|
+
* Not an enum: the useful sets are the ones a team invents for its own product, and a closed list
|
|
1612
|
+
* would mean shipping somebody's release process in the contract. Optional and back-compat, so
|
|
1613
|
+
* every flow already on disk keeps loading.
|
|
1614
|
+
*/
|
|
1615
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1616
|
+
/**
|
|
1617
|
+
* Flows that must run, and pass, before this one.
|
|
1618
|
+
*
|
|
1619
|
+
* By name, because a name is what every other caller addresses a flow by. A prerequisite that is
|
|
1620
|
+
* not in the run is reported rather than assumed satisfied: a checkout flow whose login was
|
|
1621
|
+
* filtered out by a label would otherwise fail for a reason that has nothing to do with checkout.
|
|
1622
|
+
*/
|
|
1623
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1624
|
+
/** Whether a suite runs this flow. Absent means active — see FlowStatus. */
|
|
1625
|
+
status: z.ZodOptional<z.ZodEnum<["active", "quarantined", "draft"]>>;
|
|
1626
|
+
/**
|
|
1627
|
+
* What this flow has learned from being run, as opposed to what a person wrote on it.
|
|
1628
|
+
*
|
|
1629
|
+
* Distinct from `knownBugs` above, and the difference is who is speaking. A known bug is a HUMAN
|
|
1630
|
+
* excusing a failing assertion with a traceable id. A learned guard is the SYSTEM remembering a
|
|
1631
|
+
* defect it observed: `open` while the defect is still happening, `guarded` once a run stopped
|
|
1632
|
+
* showing it. Only the second state asserts anything, and its return is a regression.
|
|
1633
|
+
*
|
|
1634
|
+
* The ordering is the safety property. A contradiction seen right now is not an assertion:
|
|
1635
|
+
* asserting "must not happen" while it happens makes the flow red over an accepted defect and
|
|
1636
|
+
* trains the reader to ignore it, and asserting "does happen" pins broken behaviour so the check
|
|
1637
|
+
* fires when somebody FIXES the bug. See `learnFromRun` in the engine for the rule.
|
|
1638
|
+
*/
|
|
1639
|
+
learned: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1640
|
+
kind: z.ZodString;
|
|
1641
|
+
step: z.ZodNumber;
|
|
1642
|
+
state: z.ZodEnum<["open", "guarded"]>;
|
|
1643
|
+
/** Consecutive runs that did not show it. One quiet run is not a fix; see learnFromRun. */
|
|
1644
|
+
cleanRuns: z.ZodOptional<z.ZodNumber>;
|
|
1645
|
+
}, "strip", z.ZodTypeAny, {
|
|
1646
|
+
state: "open" | "guarded";
|
|
1647
|
+
step: number;
|
|
1648
|
+
kind: string;
|
|
1649
|
+
cleanRuns?: number | undefined;
|
|
1650
|
+
}, {
|
|
1651
|
+
state: "open" | "guarded";
|
|
1652
|
+
step: number;
|
|
1653
|
+
kind: string;
|
|
1654
|
+
cleanRuns?: number | undefined;
|
|
1655
|
+
}>, "many">>;
|
|
1656
|
+
/**
|
|
1657
|
+
* Bugs this flow is KNOWN to expose, so a red for a filed reason is not re-investigated.
|
|
1658
|
+
*
|
|
1659
|
+
* Without it, a suite red for a known cause is indistinguishable from one that just broke: either
|
|
1660
|
+
* somebody re-opens an investigation into a bug already filed, or the flow gets quarantined and
|
|
1661
|
+
* stops watching the rest of the journey it covers.
|
|
1662
|
+
*
|
|
1663
|
+
* `assertions` is what keeps the note honest. A known-bug note is a claim about code, and code
|
|
1664
|
+
* moves; a note recorded against assertions that have since changed explains away a NEW failure
|
|
1665
|
+
* with an OLD excuse, which is a false green in a different costume. `staleKnownBugs` reports any
|
|
1666
|
+
* note whose assertions no longer all exist, rather than trusting it.
|
|
1667
|
+
*/
|
|
1668
|
+
knownBugs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1669
|
+
/** Required: an unattributable excuse is worse than none. An issue key, a URL, anything traceable. */
|
|
1670
|
+
id: z.ZodString;
|
|
1671
|
+
summary: z.ZodString;
|
|
1672
|
+
/** Which of this flow's assertions the note was written against. */
|
|
1673
|
+
assertions: z.ZodArray<z.ZodString, "many">;
|
|
1674
|
+
}, "strip", z.ZodTypeAny, {
|
|
1675
|
+
id: string;
|
|
1676
|
+
summary: string;
|
|
1677
|
+
assertions: string[];
|
|
1678
|
+
}, {
|
|
1679
|
+
id: string;
|
|
1680
|
+
summary: string;
|
|
1681
|
+
assertions: string[];
|
|
1682
|
+
}>, "many">>;
|
|
1683
|
+
/**
|
|
1684
|
+
* Why this flow is out of the suite, who owns getting it back, and since when.
|
|
1685
|
+
*
|
|
1686
|
+
* Required in full when quarantined, because a quarantine without a reason and an owner is a
|
|
1687
|
+
* silent skip wearing a label: it removes the failure from the verdict AND the reason to ever fix
|
|
1688
|
+
* it. `until` is the optional half — a date somebody has to look at it again.
|
|
1689
|
+
*/
|
|
1690
|
+
quarantine: z.ZodOptional<z.ZodObject<{
|
|
1691
|
+
reason: z.ZodString;
|
|
1692
|
+
since: z.ZodString;
|
|
1693
|
+
owner: z.ZodString;
|
|
1694
|
+
until: z.ZodOptional<z.ZodString>;
|
|
1695
|
+
}, "strip", z.ZodTypeAny, {
|
|
1696
|
+
reason: string;
|
|
1697
|
+
since: string;
|
|
1698
|
+
owner: string;
|
|
1699
|
+
until?: string | undefined;
|
|
1700
|
+
}, {
|
|
1701
|
+
reason: string;
|
|
1702
|
+
since: string;
|
|
1703
|
+
owner: string;
|
|
1704
|
+
until?: string | undefined;
|
|
1705
|
+
}>>;
|
|
1706
|
+
}, "strip", z.ZodTypeAny, {
|
|
1707
|
+
name: string;
|
|
1708
|
+
steps: FlowStep[];
|
|
1709
|
+
version: 1;
|
|
1710
|
+
createdAt: number;
|
|
1711
|
+
status?: "active" | "quarantined" | "draft" | undefined;
|
|
1712
|
+
intent?: string | undefined;
|
|
1713
|
+
intentId?: string | undefined;
|
|
1714
|
+
projectId?: string | undefined;
|
|
1715
|
+
startPath?: string | undefined;
|
|
1716
|
+
fixture?: string | undefined;
|
|
1717
|
+
requires?: {
|
|
1718
|
+
signal?: string | undefined;
|
|
1719
|
+
text?: {
|
|
1720
|
+
contains: string;
|
|
1721
|
+
visible?: boolean | undefined;
|
|
1722
|
+
absent?: boolean | undefined;
|
|
1723
|
+
scope?: string | undefined;
|
|
1724
|
+
} | undefined;
|
|
1725
|
+
net?: {
|
|
1726
|
+
status?: number | undefined;
|
|
1727
|
+
method?: string | undefined;
|
|
1728
|
+
urlContains?: string | undefined;
|
|
1729
|
+
count?: number | undefined;
|
|
1730
|
+
} | undefined;
|
|
1731
|
+
state?: {
|
|
1732
|
+
path: string;
|
|
1733
|
+
store?: string | undefined;
|
|
1734
|
+
equals?: unknown;
|
|
1735
|
+
hold?: boolean | undefined;
|
|
1736
|
+
} | undefined;
|
|
1737
|
+
element?: {
|
|
1738
|
+
role?: string | undefined;
|
|
1739
|
+
testid?: string | undefined;
|
|
1740
|
+
name?: string | undefined;
|
|
1741
|
+
} | undefined;
|
|
1742
|
+
route?: {
|
|
1743
|
+
pathname?: string | undefined;
|
|
1744
|
+
contains?: string | undefined;
|
|
1745
|
+
} | undefined;
|
|
1746
|
+
console?: {
|
|
1747
|
+
level?: string | undefined;
|
|
1748
|
+
absent?: boolean | undefined;
|
|
1749
|
+
} | undefined;
|
|
1750
|
+
signalData?: Record<string, unknown> | undefined;
|
|
1751
|
+
signalCount?: number | undefined;
|
|
1752
|
+
}[] | undefined;
|
|
1753
|
+
ensures?: {
|
|
1754
|
+
signal?: string | undefined;
|
|
1755
|
+
text?: {
|
|
1756
|
+
contains: string;
|
|
1757
|
+
visible?: boolean | undefined;
|
|
1758
|
+
absent?: boolean | undefined;
|
|
1759
|
+
scope?: string | undefined;
|
|
1760
|
+
} | undefined;
|
|
1761
|
+
net?: {
|
|
1762
|
+
status?: number | undefined;
|
|
1763
|
+
method?: string | undefined;
|
|
1764
|
+
urlContains?: string | undefined;
|
|
1765
|
+
count?: number | undefined;
|
|
1766
|
+
} | undefined;
|
|
1767
|
+
state?: {
|
|
1768
|
+
path: string;
|
|
1769
|
+
store?: string | undefined;
|
|
1770
|
+
equals?: unknown;
|
|
1771
|
+
hold?: boolean | undefined;
|
|
1772
|
+
} | undefined;
|
|
1773
|
+
element?: {
|
|
1774
|
+
role?: string | undefined;
|
|
1775
|
+
testid?: string | undefined;
|
|
1776
|
+
name?: string | undefined;
|
|
1777
|
+
} | undefined;
|
|
1778
|
+
route?: {
|
|
1779
|
+
pathname?: string | undefined;
|
|
1780
|
+
contains?: string | undefined;
|
|
1781
|
+
} | undefined;
|
|
1782
|
+
console?: {
|
|
1783
|
+
level?: string | undefined;
|
|
1784
|
+
absent?: boolean | undefined;
|
|
1785
|
+
} | undefined;
|
|
1786
|
+
signalData?: Record<string, unknown> | undefined;
|
|
1787
|
+
signalCount?: number | undefined;
|
|
1788
|
+
}[] | undefined;
|
|
1789
|
+
signalTimeoutMs?: number | undefined;
|
|
1790
|
+
success?: {
|
|
1791
|
+
signal?: string | undefined;
|
|
1792
|
+
text?: {
|
|
1793
|
+
contains: string;
|
|
1794
|
+
visible?: boolean | undefined;
|
|
1795
|
+
absent?: boolean | undefined;
|
|
1796
|
+
scope?: string | undefined;
|
|
1797
|
+
} | undefined;
|
|
1798
|
+
net?: {
|
|
1799
|
+
status?: number | undefined;
|
|
1800
|
+
method?: string | undefined;
|
|
1801
|
+
urlContains?: string | undefined;
|
|
1802
|
+
count?: number | undefined;
|
|
1803
|
+
} | undefined;
|
|
1804
|
+
state?: {
|
|
1805
|
+
path: string;
|
|
1806
|
+
store?: string | undefined;
|
|
1807
|
+
equals?: unknown;
|
|
1808
|
+
hold?: boolean | undefined;
|
|
1809
|
+
} | undefined;
|
|
1810
|
+
element?: {
|
|
1811
|
+
role?: string | undefined;
|
|
1812
|
+
testid?: string | undefined;
|
|
1813
|
+
name?: string | undefined;
|
|
1814
|
+
} | undefined;
|
|
1815
|
+
route?: {
|
|
1816
|
+
pathname?: string | undefined;
|
|
1817
|
+
contains?: string | undefined;
|
|
1818
|
+
} | undefined;
|
|
1819
|
+
console?: {
|
|
1820
|
+
level?: string | undefined;
|
|
1821
|
+
absent?: boolean | undefined;
|
|
1822
|
+
} | undefined;
|
|
1823
|
+
signalData?: Record<string, unknown> | undefined;
|
|
1824
|
+
signalCount?: number | undefined;
|
|
1825
|
+
} | undefined;
|
|
1826
|
+
dynamic?: ({
|
|
1827
|
+
kind: "testid";
|
|
1828
|
+
value: string;
|
|
1829
|
+
source?: {
|
|
1830
|
+
file: string;
|
|
1831
|
+
line: number;
|
|
1832
|
+
column?: number | undefined;
|
|
1833
|
+
} | undefined;
|
|
1834
|
+
} | {
|
|
1835
|
+
role: string;
|
|
1836
|
+
kind: "role";
|
|
1837
|
+
name?: string | undefined;
|
|
1838
|
+
} | {
|
|
1839
|
+
kind: "signal";
|
|
1840
|
+
name: string;
|
|
1841
|
+
} | {
|
|
1842
|
+
kind: "component";
|
|
1843
|
+
role?: string | undefined;
|
|
1844
|
+
component?: string | undefined;
|
|
1845
|
+
source?: {
|
|
1846
|
+
file: string;
|
|
1847
|
+
line: number;
|
|
1848
|
+
column?: number | undefined;
|
|
1849
|
+
} | undefined;
|
|
1850
|
+
name?: string | undefined;
|
|
1851
|
+
})[] | undefined;
|
|
1852
|
+
labels?: string[] | undefined;
|
|
1853
|
+
needs?: string[] | undefined;
|
|
1854
|
+
learned?: {
|
|
1855
|
+
state: "open" | "guarded";
|
|
1856
|
+
step: number;
|
|
1857
|
+
kind: string;
|
|
1858
|
+
cleanRuns?: number | undefined;
|
|
1859
|
+
}[] | undefined;
|
|
1860
|
+
knownBugs?: {
|
|
1861
|
+
id: string;
|
|
1862
|
+
summary: string;
|
|
1863
|
+
assertions: string[];
|
|
1864
|
+
}[] | undefined;
|
|
1865
|
+
quarantine?: {
|
|
1866
|
+
reason: string;
|
|
1867
|
+
since: string;
|
|
1868
|
+
owner: string;
|
|
1869
|
+
until?: string | undefined;
|
|
1870
|
+
} | undefined;
|
|
1871
|
+
}, {
|
|
1872
|
+
name: string;
|
|
1873
|
+
steps: FlowStep[];
|
|
1874
|
+
version: 1;
|
|
1875
|
+
createdAt: number;
|
|
1876
|
+
status?: "active" | "quarantined" | "draft" | undefined;
|
|
1877
|
+
intent?: string | undefined;
|
|
1878
|
+
intentId?: string | undefined;
|
|
1879
|
+
projectId?: string | undefined;
|
|
1880
|
+
startPath?: string | undefined;
|
|
1881
|
+
fixture?: string | undefined;
|
|
1882
|
+
requires?: {
|
|
1883
|
+
signal?: string | undefined;
|
|
1884
|
+
text?: {
|
|
1885
|
+
contains: string;
|
|
1886
|
+
visible?: boolean | undefined;
|
|
1887
|
+
absent?: boolean | undefined;
|
|
1888
|
+
scope?: string | undefined;
|
|
1889
|
+
} | undefined;
|
|
1890
|
+
net?: {
|
|
1891
|
+
status?: number | undefined;
|
|
1892
|
+
method?: string | undefined;
|
|
1893
|
+
urlContains?: string | undefined;
|
|
1894
|
+
count?: number | undefined;
|
|
1895
|
+
} | undefined;
|
|
1896
|
+
state?: {
|
|
1897
|
+
path: string;
|
|
1898
|
+
store?: string | undefined;
|
|
1899
|
+
equals?: unknown;
|
|
1900
|
+
hold?: boolean | undefined;
|
|
1901
|
+
} | undefined;
|
|
1902
|
+
element?: {
|
|
1903
|
+
role?: string | undefined;
|
|
1904
|
+
testid?: string | undefined;
|
|
1905
|
+
name?: string | undefined;
|
|
1906
|
+
} | undefined;
|
|
1907
|
+
route?: {
|
|
1908
|
+
pathname?: string | undefined;
|
|
1909
|
+
contains?: string | undefined;
|
|
1910
|
+
} | undefined;
|
|
1911
|
+
console?: {
|
|
1912
|
+
level?: string | undefined;
|
|
1913
|
+
absent?: boolean | undefined;
|
|
1914
|
+
} | undefined;
|
|
1915
|
+
signalData?: Record<string, unknown> | undefined;
|
|
1916
|
+
signalCount?: number | undefined;
|
|
1917
|
+
}[] | undefined;
|
|
1918
|
+
ensures?: {
|
|
1919
|
+
signal?: string | undefined;
|
|
1920
|
+
text?: {
|
|
1921
|
+
contains: string;
|
|
1922
|
+
visible?: boolean | undefined;
|
|
1923
|
+
absent?: boolean | undefined;
|
|
1924
|
+
scope?: string | undefined;
|
|
1925
|
+
} | undefined;
|
|
1926
|
+
net?: {
|
|
1927
|
+
status?: number | undefined;
|
|
1928
|
+
method?: string | undefined;
|
|
1929
|
+
urlContains?: string | undefined;
|
|
1930
|
+
count?: number | undefined;
|
|
1931
|
+
} | undefined;
|
|
1932
|
+
state?: {
|
|
1933
|
+
path: string;
|
|
1934
|
+
store?: string | undefined;
|
|
1935
|
+
equals?: unknown;
|
|
1936
|
+
hold?: boolean | undefined;
|
|
1937
|
+
} | undefined;
|
|
1938
|
+
element?: {
|
|
1939
|
+
role?: string | undefined;
|
|
1940
|
+
testid?: string | undefined;
|
|
1941
|
+
name?: string | undefined;
|
|
1942
|
+
} | undefined;
|
|
1943
|
+
route?: {
|
|
1944
|
+
pathname?: string | undefined;
|
|
1945
|
+
contains?: string | undefined;
|
|
1946
|
+
} | undefined;
|
|
1947
|
+
console?: {
|
|
1948
|
+
level?: string | undefined;
|
|
1949
|
+
absent?: boolean | undefined;
|
|
1950
|
+
} | undefined;
|
|
1951
|
+
signalData?: Record<string, unknown> | undefined;
|
|
1952
|
+
signalCount?: number | undefined;
|
|
1953
|
+
}[] | undefined;
|
|
1954
|
+
signalTimeoutMs?: number | undefined;
|
|
1955
|
+
success?: {
|
|
1956
|
+
signal?: string | undefined;
|
|
1957
|
+
text?: {
|
|
1958
|
+
contains: string;
|
|
1959
|
+
visible?: boolean | undefined;
|
|
1960
|
+
absent?: boolean | undefined;
|
|
1961
|
+
scope?: string | undefined;
|
|
1962
|
+
} | undefined;
|
|
1963
|
+
net?: {
|
|
1964
|
+
status?: number | undefined;
|
|
1965
|
+
method?: string | undefined;
|
|
1966
|
+
urlContains?: string | undefined;
|
|
1967
|
+
count?: number | undefined;
|
|
1968
|
+
} | undefined;
|
|
1969
|
+
state?: {
|
|
1970
|
+
path: string;
|
|
1971
|
+
store?: string | undefined;
|
|
1972
|
+
equals?: unknown;
|
|
1973
|
+
hold?: boolean | undefined;
|
|
1974
|
+
} | undefined;
|
|
1975
|
+
element?: {
|
|
1976
|
+
role?: string | undefined;
|
|
1977
|
+
testid?: string | undefined;
|
|
1978
|
+
name?: string | undefined;
|
|
1979
|
+
} | undefined;
|
|
1980
|
+
route?: {
|
|
1981
|
+
pathname?: string | undefined;
|
|
1982
|
+
contains?: string | undefined;
|
|
1983
|
+
} | undefined;
|
|
1984
|
+
console?: {
|
|
1985
|
+
level?: string | undefined;
|
|
1986
|
+
absent?: boolean | undefined;
|
|
1987
|
+
} | undefined;
|
|
1988
|
+
signalData?: Record<string, unknown> | undefined;
|
|
1989
|
+
signalCount?: number | undefined;
|
|
1990
|
+
} | undefined;
|
|
1991
|
+
dynamic?: ({
|
|
1992
|
+
kind: "testid";
|
|
1993
|
+
value: string;
|
|
1994
|
+
source?: {
|
|
1995
|
+
file: string;
|
|
1996
|
+
line: number;
|
|
1997
|
+
column?: number | undefined;
|
|
1998
|
+
} | undefined;
|
|
1999
|
+
} | {
|
|
2000
|
+
role: string;
|
|
2001
|
+
kind: "role";
|
|
2002
|
+
name?: string | undefined;
|
|
2003
|
+
} | {
|
|
2004
|
+
kind: "signal";
|
|
2005
|
+
name: string;
|
|
2006
|
+
} | {
|
|
2007
|
+
kind: "component";
|
|
2008
|
+
role?: string | undefined;
|
|
2009
|
+
component?: string | undefined;
|
|
2010
|
+
source?: {
|
|
2011
|
+
file: string;
|
|
2012
|
+
line: number;
|
|
2013
|
+
column?: number | undefined;
|
|
2014
|
+
} | undefined;
|
|
2015
|
+
name?: string | undefined;
|
|
2016
|
+
})[] | undefined;
|
|
2017
|
+
labels?: string[] | undefined;
|
|
2018
|
+
needs?: string[] | undefined;
|
|
2019
|
+
learned?: {
|
|
2020
|
+
state: "open" | "guarded";
|
|
2021
|
+
step: number;
|
|
2022
|
+
kind: string;
|
|
2023
|
+
cleanRuns?: number | undefined;
|
|
2024
|
+
}[] | undefined;
|
|
2025
|
+
knownBugs?: {
|
|
2026
|
+
id: string;
|
|
2027
|
+
summary: string;
|
|
2028
|
+
assertions: string[];
|
|
2029
|
+
}[] | undefined;
|
|
2030
|
+
quarantine?: {
|
|
2031
|
+
reason: string;
|
|
2032
|
+
since: string;
|
|
2033
|
+
owner: string;
|
|
2034
|
+
until?: string | undefined;
|
|
2035
|
+
} | undefined;
|
|
2036
|
+
}>;
|
|
2037
|
+
export type FlowFile = z.infer<typeof FlowFileSchema>;
|
|
2038
|
+
/**
|
|
2039
|
+
* Is this flow excluded from the suite's verdict?
|
|
2040
|
+
*
|
|
2041
|
+
* Quarantine takes a flow out of the verdict, which is a real power, and the failure mode is not a
|
|
2042
|
+
* malformed file — it is a flow quietly leaving the suite and nobody noticing it went. So this fails
|
|
2043
|
+
* TOWARD running it: an incomplete quarantine is treated as no quarantine at all. Whoever wants a
|
|
2044
|
+
* flow out has to say why, who owns getting it back, and since when.
|
|
2045
|
+
*
|
|
2046
|
+
* A function rather than a schema rule, deliberately. The conditional form would be a zod
|
|
2047
|
+
* `.refine()` — this package has none, and a refinement does not survive into the generated JSON
|
|
2048
|
+
* Schema, so an implementation reading the contract from `schema/` would never see it. "Does this
|
|
2049
|
+
* file parse" and "is this flow actually excluded" are two different questions; this is the second.
|
|
2050
|
+
*
|
|
2051
|
+
* The status is the decision and the block is the paperwork: a leftover note without the status
|
|
2052
|
+
* excludes nothing, so tidying a flow back into the suite is one field.
|
|
2053
|
+
*/
|
|
2054
|
+
export declare function isQuarantined(flow: Pick<FlowFile, 'status' | 'quarantine'>): boolean;
|
|
2055
|
+
/**
|
|
2056
|
+
* The in-page → wire payload for a finished human recording. The browser
|
|
2057
|
+
* compiles captured interactions into a FlowFile-shaped object (resolving semantic anchors at
|
|
2058
|
+
* capture time) and emits it as ONE EventType.FLOW_RECORDED event; the server persists it.
|
|
2059
|
+
*/
|
|
2060
|
+
export declare const RecordedFlowSchema: z.ZodObject<{
|
|
2061
|
+
name: z.ZodString;
|
|
2062
|
+
flow: z.ZodObject<{
|
|
2063
|
+
version: z.ZodLiteral<1>;
|
|
2064
|
+
name: z.ZodString;
|
|
2065
|
+
/**
|
|
2066
|
+
* The business goal this flow exists to verify, one line (e.g. "ship a deploy to production").
|
|
2067
|
+
* Optional + back-compat (a flow without it still parses). Set via an `intent` annotation. The
|
|
2068
|
+
* point of "intent + outcome oracle": a flow that declares an intent should also assert an
|
|
2069
|
+
* observable business OUTCOME (a consequence success-state), or it claims to verify a goal it
|
|
2070
|
+
* cannot actually check — flow-classify flags that gap.
|
|
2071
|
+
*/
|
|
2072
|
+
intent: z.ZodOptional<z.ZodString>;
|
|
2073
|
+
/**
|
|
2074
|
+
* The intent-ledger row this flow discharges — the id in `.reticle/intent.json`.
|
|
2075
|
+
*
|
|
2076
|
+
* `intent` above is the prose a recorder captured; this is the LINK to the ledger that already
|
|
2077
|
+
* models declared → bound → proved and records which verdict discharged what. Without it there
|
|
2078
|
+
* would be two ways to say what a change is for, which is the defect this codebase keeps paying
|
|
2079
|
+
* for: a flow's goal and an intent's statement would drift apart with nothing to reconcile them.
|
|
2080
|
+
*
|
|
2081
|
+
* Set at save time from the flow's own prose, or written by hand to point a flow at an intent
|
|
2082
|
+
* declared earlier via `reticle_intent` — a flow can prove something somebody else declared.
|
|
2083
|
+
* Optional + back-compat: a flow without it replays exactly as before, and the on-disk version
|
|
2084
|
+
* stays FLOW_FILE_VERSION 1.
|
|
2085
|
+
*/
|
|
2086
|
+
intentId: z.ZodOptional<z.ZodString>;
|
|
2087
|
+
/**
|
|
2088
|
+
* The project the flow was recorded against (the connecting session's HELLO `projectId`), stamped at
|
|
2089
|
+
* save time. Scopes a flow to its app so a shared daemon's HUD lists only the current project's flows
|
|
2090
|
+
* instead of every project that ever saved to that daemon. Optional + back-compat: a flow with no
|
|
2091
|
+
* projectId is treated as global (visible everywhere), so pre-existing files parse and still show.
|
|
2092
|
+
*/
|
|
2093
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
2094
|
+
/**
|
|
2095
|
+
* The route (pathname) the journey started on, captured at record time. Replay navigates here
|
|
2096
|
+
* before step 1 so a flow whose first anchor lives on another page doesn't drift on step 1 ("a
|
|
2097
|
+
* step no longer matches") just because replay began on the wrong page. Optional + back-compat: a
|
|
2098
|
+
* flow without it (or recorded before this shipped) replays from the current page as before, and
|
|
2099
|
+
* the on-disk version stays FLOW_FILE_VERSION 1.
|
|
2100
|
+
*/
|
|
2101
|
+
startPath: z.ZodOptional<z.ZodString>;
|
|
2102
|
+
fixture: z.ZodOptional<z.ZodString>;
|
|
2103
|
+
/**
|
|
2104
|
+
* What must already be true for this flow to mean anything, and what it leaves true.
|
|
2105
|
+
*
|
|
2106
|
+
* These are the two halves of composition. Replaying flows back to back only works when the state
|
|
2107
|
+
* one leaves is the state the next expects, and nothing said so — so a suite either got lucky or
|
|
2108
|
+
* produced a failure that looked like a regression and was a missing precondition. `requires` lets
|
|
2109
|
+
* a replay report THAT instead: not met is `unknown` (nothing ran, nothing proved), never a
|
|
2110
|
+
* failure, which is the same honesty rule an uncovered change already follows.
|
|
2111
|
+
*
|
|
2112
|
+
* `ensures` is the other side, and is what makes A-then-B checkable before either runs.
|
|
2113
|
+
*
|
|
2114
|
+
* Both optional and both absent from every flow recorded before this shipped, where absent means
|
|
2115
|
+
* what it has always meant: replay from wherever the app already is, and let the steps speak.
|
|
2116
|
+
* Same predicate shape as a step's `expect`, deliberately — a precondition is just a consequence
|
|
2117
|
+
* somebody else's flow was responsible for.
|
|
2118
|
+
*/
|
|
2119
|
+
requires: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2120
|
+
/**
|
|
2121
|
+
* The route the step must have reached — the consequence of a NAVIGATION.
|
|
2122
|
+
*
|
|
2123
|
+
* Absent until now, and its absence was not a corner case: navigation is one of the commonest
|
|
2124
|
+
* journeys there is, and every route-asserted drive saved a flow that could never go red. Found
|
|
2125
|
+
* by driving a real app, where `act_and_wait { until: { kind: "route" } }` returned
|
|
2126
|
+
* `verified: "yes"` and the flow saved from that same drive graded `assertion-free`.
|
|
2127
|
+
*
|
|
2128
|
+
* Additive and optional, so a flow file written before it still parses and FLOW_FILE_VERSION
|
|
2129
|
+
* stays 1 — the same treatment `signalData` and `signalCount` had.
|
|
2130
|
+
*/
|
|
2131
|
+
route: z.ZodOptional<z.ZodObject<{
|
|
2132
|
+
pathname: z.ZodOptional<z.ZodString>;
|
|
2133
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
2134
|
+
}, "strip", z.ZodTypeAny, {
|
|
2135
|
+
pathname?: string | undefined;
|
|
2136
|
+
contains?: string | undefined;
|
|
2137
|
+
}, {
|
|
2138
|
+
pathname?: string | undefined;
|
|
2139
|
+
contains?: string | undefined;
|
|
2140
|
+
}>>;
|
|
2141
|
+
signal: z.ZodOptional<z.ZodString>;
|
|
2142
|
+
/**
|
|
2143
|
+
* Optional payload shape an `assert-signal` annotation requires the signal
|
|
2144
|
+
* to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
|
|
2145
|
+
* bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
|
|
2146
|
+
*/
|
|
2147
|
+
signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2148
|
+
/**
|
|
2149
|
+
* Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
|
|
2150
|
+
* only way a saved flow can keep a cardinality the agent actually asserted. Without it a
|
|
2151
|
+
* `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
|
|
2152
|
+
* one made: the replayed flow then goes green on the double-fire it was recorded to catch.
|
|
2153
|
+
* Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
|
|
2154
|
+
*/
|
|
2155
|
+
signalCount: z.ZodOptional<z.ZodNumber>;
|
|
2156
|
+
net: z.ZodOptional<z.ZodObject<{
|
|
2157
|
+
method: z.ZodOptional<z.ZodString>;
|
|
2158
|
+
urlContains: z.ZodOptional<z.ZodString>;
|
|
2159
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
2160
|
+
/**
|
|
2161
|
+
* Exact number of matching requests since the action — turns presence into a cardinality
|
|
2162
|
+
* assertion. Catches the double-submit / useEffect-double-fire / retry-storm regression class:
|
|
2163
|
+
* the request fired (presence passes) but fired the WRONG number of times. Omit = presence (≥1).
|
|
2164
|
+
*/
|
|
2165
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
2166
|
+
}, "strict", z.ZodTypeAny, {
|
|
2167
|
+
status?: number | undefined;
|
|
2168
|
+
method?: string | undefined;
|
|
2169
|
+
urlContains?: string | undefined;
|
|
2170
|
+
count?: number | undefined;
|
|
2171
|
+
}, {
|
|
2172
|
+
status?: number | undefined;
|
|
2173
|
+
method?: string | undefined;
|
|
2174
|
+
urlContains?: string | undefined;
|
|
2175
|
+
count?: number | undefined;
|
|
2176
|
+
}>>;
|
|
2177
|
+
/**
|
|
2178
|
+
* Console golden end-condition: assert the action logged (or, with absent:true, did NOT log) a
|
|
2179
|
+
* console message at `level` (default 'error'). `absent:true` is the common case — "the action
|
|
2180
|
+
* completed with a clean console" — catching the regression where an action throws a caught error
|
|
2181
|
+
* / logs an uncaught rejection while the UI still renders fine (a presence check passes it).
|
|
2182
|
+
*/
|
|
2183
|
+
console: z.ZodOptional<z.ZodObject<{
|
|
2184
|
+
level: z.ZodOptional<z.ZodString>;
|
|
2185
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
2186
|
+
}, "strict", z.ZodTypeAny, {
|
|
2187
|
+
level?: string | undefined;
|
|
2188
|
+
absent?: boolean | undefined;
|
|
2189
|
+
}, {
|
|
2190
|
+
level?: string | undefined;
|
|
2191
|
+
absent?: boolean | undefined;
|
|
2192
|
+
}>>;
|
|
2193
|
+
element: z.ZodOptional<z.ZodObject<{
|
|
2194
|
+
testid: z.ZodOptional<z.ZodString>;
|
|
2195
|
+
role: z.ZodOptional<z.ZodString>;
|
|
2196
|
+
name: z.ZodOptional<z.ZodString>;
|
|
2197
|
+
}, "strict", z.ZodTypeAny, {
|
|
2198
|
+
role?: string | undefined;
|
|
2199
|
+
testid?: string | undefined;
|
|
2200
|
+
name?: string | undefined;
|
|
2201
|
+
}, {
|
|
2202
|
+
role?: string | undefined;
|
|
2203
|
+
testid?: string | undefined;
|
|
2204
|
+
name?: string | undefined;
|
|
2205
|
+
}>>;
|
|
2206
|
+
/**
|
|
2207
|
+
* Rendered text as an end-condition, using the shapes the assert surface already accepts.
|
|
2208
|
+
*
|
|
2209
|
+
* The gap this closes: an app with no testids, no `reticle.signal`, no registrable store and no
|
|
2210
|
+
* network call on the interaction under test -- a discount price computed and rendered, a
|
|
2211
|
+
* formatted total, a derived label -- could not produce an asserted flow AT ALL. Everything the
|
|
2212
|
+
* vocabulary offered needed a channel that app does not have, so the only honest outcome was
|
|
2213
|
+
* `assertion-free`, which is a permanent green (#811).
|
|
2214
|
+
*
|
|
2215
|
+
* Derived-DOM rendering is a large share of what actually breaks in a UI, and it was the share
|
|
2216
|
+
* that could not be pinned.
|
|
2217
|
+
*
|
|
2218
|
+
* Classified PRESENCE, not consequence, and that is not a technicality: text is read from the
|
|
2219
|
+
* DOM, so a locator healed to the wrong element can still satisfy it. It earns `presence-only`,
|
|
2220
|
+
* which is a real grade above `assertion-free` and honestly below `signal`/`net`/`state`.
|
|
2221
|
+
*/
|
|
2222
|
+
text: z.ZodOptional<z.ZodObject<{
|
|
2223
|
+
contains: z.ZodString;
|
|
2224
|
+
/** Narrow the search to a container, exactly as the `text` predicate's `scope` does. */
|
|
2225
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2226
|
+
/** Assert the text is GONE — the regression check for a cleared error or a dismissed toast. */
|
|
2227
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
2228
|
+
/** Require the match to be visible, not merely present in the DOM. */
|
|
2229
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
2230
|
+
}, "strict", z.ZodTypeAny, {
|
|
2231
|
+
contains: string;
|
|
2232
|
+
visible?: boolean | undefined;
|
|
2233
|
+
absent?: boolean | undefined;
|
|
2234
|
+
scope?: string | undefined;
|
|
2235
|
+
}, {
|
|
2236
|
+
contains: string;
|
|
2237
|
+
visible?: boolean | undefined;
|
|
2238
|
+
absent?: boolean | undefined;
|
|
2239
|
+
scope?: string | undefined;
|
|
2240
|
+
}>>;
|
|
2241
|
+
/**
|
|
2242
|
+
* Assert a registered store's value — the source of truth no DOM/network read can reach. Compiles
|
|
2243
|
+
* to the predicate engine's `state` predicate. Additive/optional — a flow without it still parses
|
|
2244
|
+
* and the on-disk version stays FLOW_FILE_VERSION 1. `equals` accepts a literal, omitted = presence,
|
|
2245
|
+
* or a `{ $gte | $contains | $length }` operator pattern.
|
|
2246
|
+
*/
|
|
2247
|
+
state: z.ZodOptional<z.ZodObject<{
|
|
2248
|
+
store: z.ZodOptional<z.ZodString>;
|
|
2249
|
+
path: z.ZodString;
|
|
2250
|
+
equals: z.ZodOptional<z.ZodUnknown>;
|
|
2251
|
+
/**
|
|
2252
|
+
* Treat this as an INVARIANT that must still hold AFTER the action settles, rather than a
|
|
2253
|
+
* condition to wait for. Set it for a blast-radius check ("this unrelated path must NOT have
|
|
2254
|
+
* moved") — without it a wait-until-true read passes before an over-reaching side-effect lands.
|
|
2255
|
+
*/
|
|
2256
|
+
hold: z.ZodOptional<z.ZodBoolean>;
|
|
2257
|
+
}, "strict", z.ZodTypeAny, {
|
|
2258
|
+
path: string;
|
|
2259
|
+
store?: string | undefined;
|
|
2260
|
+
equals?: unknown;
|
|
2261
|
+
hold?: boolean | undefined;
|
|
2262
|
+
}, {
|
|
2263
|
+
path: string;
|
|
2264
|
+
store?: string | undefined;
|
|
2265
|
+
equals?: unknown;
|
|
2266
|
+
hold?: boolean | undefined;
|
|
2267
|
+
}>>;
|
|
2268
|
+
}, "strict", z.ZodTypeAny, {
|
|
2269
|
+
signal?: string | undefined;
|
|
2270
|
+
text?: {
|
|
2271
|
+
contains: string;
|
|
2272
|
+
visible?: boolean | undefined;
|
|
2273
|
+
absent?: boolean | undefined;
|
|
2274
|
+
scope?: string | undefined;
|
|
2275
|
+
} | undefined;
|
|
2276
|
+
net?: {
|
|
2277
|
+
status?: number | undefined;
|
|
2278
|
+
method?: string | undefined;
|
|
2279
|
+
urlContains?: string | undefined;
|
|
2280
|
+
count?: number | undefined;
|
|
2281
|
+
} | undefined;
|
|
2282
|
+
state?: {
|
|
2283
|
+
path: string;
|
|
2284
|
+
store?: string | undefined;
|
|
2285
|
+
equals?: unknown;
|
|
2286
|
+
hold?: boolean | undefined;
|
|
2287
|
+
} | undefined;
|
|
2288
|
+
element?: {
|
|
2289
|
+
role?: string | undefined;
|
|
2290
|
+
testid?: string | undefined;
|
|
2291
|
+
name?: string | undefined;
|
|
2292
|
+
} | undefined;
|
|
2293
|
+
route?: {
|
|
2294
|
+
pathname?: string | undefined;
|
|
2295
|
+
contains?: string | undefined;
|
|
2296
|
+
} | undefined;
|
|
2297
|
+
console?: {
|
|
2298
|
+
level?: string | undefined;
|
|
2299
|
+
absent?: boolean | undefined;
|
|
2300
|
+
} | undefined;
|
|
2301
|
+
signalData?: Record<string, unknown> | undefined;
|
|
2302
|
+
signalCount?: number | undefined;
|
|
2303
|
+
}, {
|
|
2304
|
+
signal?: string | undefined;
|
|
2305
|
+
text?: {
|
|
2306
|
+
contains: string;
|
|
2307
|
+
visible?: boolean | undefined;
|
|
2308
|
+
absent?: boolean | undefined;
|
|
2309
|
+
scope?: string | undefined;
|
|
2310
|
+
} | undefined;
|
|
2311
|
+
net?: {
|
|
2312
|
+
status?: number | undefined;
|
|
2313
|
+
method?: string | undefined;
|
|
2314
|
+
urlContains?: string | undefined;
|
|
2315
|
+
count?: number | undefined;
|
|
2316
|
+
} | undefined;
|
|
2317
|
+
state?: {
|
|
2318
|
+
path: string;
|
|
2319
|
+
store?: string | undefined;
|
|
2320
|
+
equals?: unknown;
|
|
2321
|
+
hold?: boolean | undefined;
|
|
2322
|
+
} | undefined;
|
|
2323
|
+
element?: {
|
|
2324
|
+
role?: string | undefined;
|
|
2325
|
+
testid?: string | undefined;
|
|
2326
|
+
name?: string | undefined;
|
|
2327
|
+
} | undefined;
|
|
2328
|
+
route?: {
|
|
2329
|
+
pathname?: string | undefined;
|
|
2330
|
+
contains?: string | undefined;
|
|
2331
|
+
} | undefined;
|
|
2332
|
+
console?: {
|
|
2333
|
+
level?: string | undefined;
|
|
2334
|
+
absent?: boolean | undefined;
|
|
2335
|
+
} | undefined;
|
|
2336
|
+
signalData?: Record<string, unknown> | undefined;
|
|
2337
|
+
signalCount?: number | undefined;
|
|
2338
|
+
}>, "many">>;
|
|
2339
|
+
ensures: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2340
|
+
/**
|
|
2341
|
+
* The route the step must have reached — the consequence of a NAVIGATION.
|
|
2342
|
+
*
|
|
2343
|
+
* Absent until now, and its absence was not a corner case: navigation is one of the commonest
|
|
2344
|
+
* journeys there is, and every route-asserted drive saved a flow that could never go red. Found
|
|
2345
|
+
* by driving a real app, where `act_and_wait { until: { kind: "route" } }` returned
|
|
2346
|
+
* `verified: "yes"` and the flow saved from that same drive graded `assertion-free`.
|
|
2347
|
+
*
|
|
2348
|
+
* Additive and optional, so a flow file written before it still parses and FLOW_FILE_VERSION
|
|
2349
|
+
* stays 1 — the same treatment `signalData` and `signalCount` had.
|
|
2350
|
+
*/
|
|
2351
|
+
route: z.ZodOptional<z.ZodObject<{
|
|
2352
|
+
pathname: z.ZodOptional<z.ZodString>;
|
|
2353
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
2354
|
+
}, "strip", z.ZodTypeAny, {
|
|
2355
|
+
pathname?: string | undefined;
|
|
2356
|
+
contains?: string | undefined;
|
|
2357
|
+
}, {
|
|
2358
|
+
pathname?: string | undefined;
|
|
2359
|
+
contains?: string | undefined;
|
|
2360
|
+
}>>;
|
|
2361
|
+
signal: z.ZodOptional<z.ZodString>;
|
|
2362
|
+
/**
|
|
2363
|
+
* Optional payload shape an `assert-signal` annotation requires the signal
|
|
2364
|
+
* to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
|
|
2365
|
+
* bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
|
|
2366
|
+
*/
|
|
2367
|
+
signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2368
|
+
/**
|
|
2369
|
+
* Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
|
|
2370
|
+
* only way a saved flow can keep a cardinality the agent actually asserted. Without it a
|
|
2371
|
+
* `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
|
|
2372
|
+
* one made: the replayed flow then goes green on the double-fire it was recorded to catch.
|
|
2373
|
+
* Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
|
|
2374
|
+
*/
|
|
2375
|
+
signalCount: z.ZodOptional<z.ZodNumber>;
|
|
2376
|
+
net: z.ZodOptional<z.ZodObject<{
|
|
2377
|
+
method: z.ZodOptional<z.ZodString>;
|
|
2378
|
+
urlContains: z.ZodOptional<z.ZodString>;
|
|
2379
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
2380
|
+
/**
|
|
2381
|
+
* Exact number of matching requests since the action — turns presence into a cardinality
|
|
2382
|
+
* assertion. Catches the double-submit / useEffect-double-fire / retry-storm regression class:
|
|
2383
|
+
* the request fired (presence passes) but fired the WRONG number of times. Omit = presence (≥1).
|
|
2384
|
+
*/
|
|
2385
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
2386
|
+
}, "strict", z.ZodTypeAny, {
|
|
2387
|
+
status?: number | undefined;
|
|
2388
|
+
method?: string | undefined;
|
|
2389
|
+
urlContains?: string | undefined;
|
|
2390
|
+
count?: number | undefined;
|
|
2391
|
+
}, {
|
|
2392
|
+
status?: number | undefined;
|
|
2393
|
+
method?: string | undefined;
|
|
2394
|
+
urlContains?: string | undefined;
|
|
2395
|
+
count?: number | undefined;
|
|
2396
|
+
}>>;
|
|
2397
|
+
/**
|
|
2398
|
+
* Console golden end-condition: assert the action logged (or, with absent:true, did NOT log) a
|
|
2399
|
+
* console message at `level` (default 'error'). `absent:true` is the common case — "the action
|
|
2400
|
+
* completed with a clean console" — catching the regression where an action throws a caught error
|
|
2401
|
+
* / logs an uncaught rejection while the UI still renders fine (a presence check passes it).
|
|
2402
|
+
*/
|
|
2403
|
+
console: z.ZodOptional<z.ZodObject<{
|
|
2404
|
+
level: z.ZodOptional<z.ZodString>;
|
|
2405
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
2406
|
+
}, "strict", z.ZodTypeAny, {
|
|
2407
|
+
level?: string | undefined;
|
|
2408
|
+
absent?: boolean | undefined;
|
|
2409
|
+
}, {
|
|
2410
|
+
level?: string | undefined;
|
|
2411
|
+
absent?: boolean | undefined;
|
|
2412
|
+
}>>;
|
|
2413
|
+
element: z.ZodOptional<z.ZodObject<{
|
|
2414
|
+
testid: z.ZodOptional<z.ZodString>;
|
|
2415
|
+
role: z.ZodOptional<z.ZodString>;
|
|
2416
|
+
name: z.ZodOptional<z.ZodString>;
|
|
2417
|
+
}, "strict", z.ZodTypeAny, {
|
|
2418
|
+
role?: string | undefined;
|
|
2419
|
+
testid?: string | undefined;
|
|
2420
|
+
name?: string | undefined;
|
|
2421
|
+
}, {
|
|
2422
|
+
role?: string | undefined;
|
|
2423
|
+
testid?: string | undefined;
|
|
2424
|
+
name?: string | undefined;
|
|
2425
|
+
}>>;
|
|
2426
|
+
/**
|
|
2427
|
+
* Rendered text as an end-condition, using the shapes the assert surface already accepts.
|
|
2428
|
+
*
|
|
2429
|
+
* The gap this closes: an app with no testids, no `reticle.signal`, no registrable store and no
|
|
2430
|
+
* network call on the interaction under test -- a discount price computed and rendered, a
|
|
2431
|
+
* formatted total, a derived label -- could not produce an asserted flow AT ALL. Everything the
|
|
2432
|
+
* vocabulary offered needed a channel that app does not have, so the only honest outcome was
|
|
2433
|
+
* `assertion-free`, which is a permanent green (#811).
|
|
2434
|
+
*
|
|
2435
|
+
* Derived-DOM rendering is a large share of what actually breaks in a UI, and it was the share
|
|
2436
|
+
* that could not be pinned.
|
|
2437
|
+
*
|
|
2438
|
+
* Classified PRESENCE, not consequence, and that is not a technicality: text is read from the
|
|
2439
|
+
* DOM, so a locator healed to the wrong element can still satisfy it. It earns `presence-only`,
|
|
2440
|
+
* which is a real grade above `assertion-free` and honestly below `signal`/`net`/`state`.
|
|
2441
|
+
*/
|
|
2442
|
+
text: z.ZodOptional<z.ZodObject<{
|
|
2443
|
+
contains: z.ZodString;
|
|
2444
|
+
/** Narrow the search to a container, exactly as the `text` predicate's `scope` does. */
|
|
2445
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2446
|
+
/** Assert the text is GONE — the regression check for a cleared error or a dismissed toast. */
|
|
2447
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
2448
|
+
/** Require the match to be visible, not merely present in the DOM. */
|
|
2449
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
2450
|
+
}, "strict", z.ZodTypeAny, {
|
|
2451
|
+
contains: string;
|
|
2452
|
+
visible?: boolean | undefined;
|
|
2453
|
+
absent?: boolean | undefined;
|
|
2454
|
+
scope?: string | undefined;
|
|
2455
|
+
}, {
|
|
2456
|
+
contains: string;
|
|
2457
|
+
visible?: boolean | undefined;
|
|
2458
|
+
absent?: boolean | undefined;
|
|
2459
|
+
scope?: string | undefined;
|
|
2460
|
+
}>>;
|
|
2461
|
+
/**
|
|
2462
|
+
* Assert a registered store's value — the source of truth no DOM/network read can reach. Compiles
|
|
2463
|
+
* to the predicate engine's `state` predicate. Additive/optional — a flow without it still parses
|
|
2464
|
+
* and the on-disk version stays FLOW_FILE_VERSION 1. `equals` accepts a literal, omitted = presence,
|
|
2465
|
+
* or a `{ $gte | $contains | $length }` operator pattern.
|
|
2466
|
+
*/
|
|
2467
|
+
state: z.ZodOptional<z.ZodObject<{
|
|
2468
|
+
store: z.ZodOptional<z.ZodString>;
|
|
2469
|
+
path: z.ZodString;
|
|
2470
|
+
equals: z.ZodOptional<z.ZodUnknown>;
|
|
2471
|
+
/**
|
|
2472
|
+
* Treat this as an INVARIANT that must still hold AFTER the action settles, rather than a
|
|
2473
|
+
* condition to wait for. Set it for a blast-radius check ("this unrelated path must NOT have
|
|
2474
|
+
* moved") — without it a wait-until-true read passes before an over-reaching side-effect lands.
|
|
2475
|
+
*/
|
|
2476
|
+
hold: z.ZodOptional<z.ZodBoolean>;
|
|
2477
|
+
}, "strict", z.ZodTypeAny, {
|
|
2478
|
+
path: string;
|
|
2479
|
+
store?: string | undefined;
|
|
2480
|
+
equals?: unknown;
|
|
2481
|
+
hold?: boolean | undefined;
|
|
2482
|
+
}, {
|
|
2483
|
+
path: string;
|
|
2484
|
+
store?: string | undefined;
|
|
2485
|
+
equals?: unknown;
|
|
2486
|
+
hold?: boolean | undefined;
|
|
2487
|
+
}>>;
|
|
2488
|
+
}, "strict", z.ZodTypeAny, {
|
|
2489
|
+
signal?: string | undefined;
|
|
2490
|
+
text?: {
|
|
2491
|
+
contains: string;
|
|
2492
|
+
visible?: boolean | undefined;
|
|
2493
|
+
absent?: boolean | undefined;
|
|
2494
|
+
scope?: string | undefined;
|
|
2495
|
+
} | undefined;
|
|
2496
|
+
net?: {
|
|
2497
|
+
status?: number | undefined;
|
|
2498
|
+
method?: string | undefined;
|
|
2499
|
+
urlContains?: string | undefined;
|
|
2500
|
+
count?: number | undefined;
|
|
2501
|
+
} | undefined;
|
|
2502
|
+
state?: {
|
|
2503
|
+
path: string;
|
|
2504
|
+
store?: string | undefined;
|
|
2505
|
+
equals?: unknown;
|
|
2506
|
+
hold?: boolean | undefined;
|
|
2507
|
+
} | undefined;
|
|
2508
|
+
element?: {
|
|
2509
|
+
role?: string | undefined;
|
|
2510
|
+
testid?: string | undefined;
|
|
2511
|
+
name?: string | undefined;
|
|
2512
|
+
} | undefined;
|
|
2513
|
+
route?: {
|
|
2514
|
+
pathname?: string | undefined;
|
|
2515
|
+
contains?: string | undefined;
|
|
2516
|
+
} | undefined;
|
|
2517
|
+
console?: {
|
|
2518
|
+
level?: string | undefined;
|
|
2519
|
+
absent?: boolean | undefined;
|
|
2520
|
+
} | undefined;
|
|
2521
|
+
signalData?: Record<string, unknown> | undefined;
|
|
2522
|
+
signalCount?: number | undefined;
|
|
2523
|
+
}, {
|
|
2524
|
+
signal?: string | undefined;
|
|
2525
|
+
text?: {
|
|
2526
|
+
contains: string;
|
|
2527
|
+
visible?: boolean | undefined;
|
|
2528
|
+
absent?: boolean | undefined;
|
|
2529
|
+
scope?: string | undefined;
|
|
2530
|
+
} | undefined;
|
|
2531
|
+
net?: {
|
|
2532
|
+
status?: number | undefined;
|
|
2533
|
+
method?: string | undefined;
|
|
2534
|
+
urlContains?: string | undefined;
|
|
2535
|
+
count?: number | undefined;
|
|
2536
|
+
} | undefined;
|
|
2537
|
+
state?: {
|
|
2538
|
+
path: string;
|
|
2539
|
+
store?: string | undefined;
|
|
2540
|
+
equals?: unknown;
|
|
2541
|
+
hold?: boolean | undefined;
|
|
2542
|
+
} | undefined;
|
|
2543
|
+
element?: {
|
|
2544
|
+
role?: string | undefined;
|
|
2545
|
+
testid?: string | undefined;
|
|
2546
|
+
name?: string | undefined;
|
|
2547
|
+
} | undefined;
|
|
2548
|
+
route?: {
|
|
2549
|
+
pathname?: string | undefined;
|
|
2550
|
+
contains?: string | undefined;
|
|
2551
|
+
} | undefined;
|
|
2552
|
+
console?: {
|
|
2553
|
+
level?: string | undefined;
|
|
2554
|
+
absent?: boolean | undefined;
|
|
2555
|
+
} | undefined;
|
|
2556
|
+
signalData?: Record<string, unknown> | undefined;
|
|
2557
|
+
signalCount?: number | undefined;
|
|
2558
|
+
}>, "many">>;
|
|
2559
|
+
/** From the injected clock (ms) — deterministic in tests, byte-stable on disk. */
|
|
2560
|
+
createdAt: z.ZodNumber;
|
|
2561
|
+
steps: z.ZodArray<z.ZodType<FlowStep, z.ZodTypeDef, FlowStep>, "many">;
|
|
2562
|
+
/**
|
|
2563
|
+
* How long every step of this flow waits for its declared consequence, in ms. A step's own
|
|
2564
|
+
* `timeoutMs` wins over it; absent both, FLOW_SIGNAL_TIMEOUT_MS applies.
|
|
2565
|
+
*
|
|
2566
|
+
* Flow-level because slowness is usually a property of the APP, not of one control — a remote
|
|
2567
|
+
* database, a model-backed endpoint, a cold container. Optional + back-compat: a flow without it
|
|
2568
|
+
* replays exactly as before and the on-disk version stays FLOW_FILE_VERSION 1.
|
|
2569
|
+
*/
|
|
2570
|
+
signalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
2571
|
+
success: z.ZodOptional<z.ZodObject<{
|
|
2572
|
+
/**
|
|
2573
|
+
* The route the step must have reached — the consequence of a NAVIGATION.
|
|
2574
|
+
*
|
|
2575
|
+
* Absent until now, and its absence was not a corner case: navigation is one of the commonest
|
|
2576
|
+
* journeys there is, and every route-asserted drive saved a flow that could never go red. Found
|
|
2577
|
+
* by driving a real app, where `act_and_wait { until: { kind: "route" } }` returned
|
|
2578
|
+
* `verified: "yes"` and the flow saved from that same drive graded `assertion-free`.
|
|
2579
|
+
*
|
|
2580
|
+
* Additive and optional, so a flow file written before it still parses and FLOW_FILE_VERSION
|
|
2581
|
+
* stays 1 — the same treatment `signalData` and `signalCount` had.
|
|
2582
|
+
*/
|
|
2583
|
+
route: z.ZodOptional<z.ZodObject<{
|
|
2584
|
+
pathname: z.ZodOptional<z.ZodString>;
|
|
2585
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
2586
|
+
}, "strip", z.ZodTypeAny, {
|
|
2587
|
+
pathname?: string | undefined;
|
|
2588
|
+
contains?: string | undefined;
|
|
2589
|
+
}, {
|
|
2590
|
+
pathname?: string | undefined;
|
|
2591
|
+
contains?: string | undefined;
|
|
2592
|
+
}>>;
|
|
2593
|
+
signal: z.ZodOptional<z.ZodString>;
|
|
2594
|
+
/**
|
|
2595
|
+
* Optional payload shape an `assert-signal` annotation requires the signal
|
|
2596
|
+
* to match (the predicate DSL's signal.dataMatches). Additive/optional — a flow file with a
|
|
2597
|
+
* bare `signal` still parses, and the on-disk version stays FLOW_FILE_VERSION 1.
|
|
2598
|
+
*/
|
|
2599
|
+
signalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2600
|
+
/**
|
|
2601
|
+
* Exact number of times the signal must have fired — the signal-side twin of `net.count`, and the
|
|
2602
|
+
* only way a saved flow can keep a cardinality the agent actually asserted. Without it a
|
|
2603
|
+
* `count: 1` drive would be recorded as bare presence, which is a strictly WEAKER claim than the
|
|
2604
|
+
* one made: the replayed flow then goes green on the double-fire it was recorded to catch.
|
|
2605
|
+
* Additive/optional — a flow file with a bare `signal` still parses, and FLOW_FILE_VERSION stays 1.
|
|
2606
|
+
*/
|
|
2607
|
+
signalCount: z.ZodOptional<z.ZodNumber>;
|
|
2608
|
+
net: z.ZodOptional<z.ZodObject<{
|
|
2609
|
+
method: z.ZodOptional<z.ZodString>;
|
|
2610
|
+
urlContains: z.ZodOptional<z.ZodString>;
|
|
2611
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
2612
|
+
/**
|
|
2613
|
+
* Exact number of matching requests since the action — turns presence into a cardinality
|
|
2614
|
+
* assertion. Catches the double-submit / useEffect-double-fire / retry-storm regression class:
|
|
2615
|
+
* the request fired (presence passes) but fired the WRONG number of times. Omit = presence (≥1).
|
|
2616
|
+
*/
|
|
2617
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
2618
|
+
}, "strict", z.ZodTypeAny, {
|
|
2619
|
+
status?: number | undefined;
|
|
2620
|
+
method?: string | undefined;
|
|
2621
|
+
urlContains?: string | undefined;
|
|
2622
|
+
count?: number | undefined;
|
|
2623
|
+
}, {
|
|
2624
|
+
status?: number | undefined;
|
|
2625
|
+
method?: string | undefined;
|
|
2626
|
+
urlContains?: string | undefined;
|
|
2627
|
+
count?: number | undefined;
|
|
2628
|
+
}>>;
|
|
2629
|
+
/**
|
|
2630
|
+
* Console golden end-condition: assert the action logged (or, with absent:true, did NOT log) a
|
|
2631
|
+
* console message at `level` (default 'error'). `absent:true` is the common case — "the action
|
|
2632
|
+
* completed with a clean console" — catching the regression where an action throws a caught error
|
|
2633
|
+
* / logs an uncaught rejection while the UI still renders fine (a presence check passes it).
|
|
2634
|
+
*/
|
|
2635
|
+
console: z.ZodOptional<z.ZodObject<{
|
|
2636
|
+
level: z.ZodOptional<z.ZodString>;
|
|
2637
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
2638
|
+
}, "strict", z.ZodTypeAny, {
|
|
2639
|
+
level?: string | undefined;
|
|
2640
|
+
absent?: boolean | undefined;
|
|
2641
|
+
}, {
|
|
2642
|
+
level?: string | undefined;
|
|
2643
|
+
absent?: boolean | undefined;
|
|
2644
|
+
}>>;
|
|
2645
|
+
element: z.ZodOptional<z.ZodObject<{
|
|
2646
|
+
testid: z.ZodOptional<z.ZodString>;
|
|
2647
|
+
role: z.ZodOptional<z.ZodString>;
|
|
2648
|
+
name: z.ZodOptional<z.ZodString>;
|
|
2649
|
+
}, "strict", z.ZodTypeAny, {
|
|
2650
|
+
role?: string | undefined;
|
|
2651
|
+
testid?: string | undefined;
|
|
2652
|
+
name?: string | undefined;
|
|
2653
|
+
}, {
|
|
2654
|
+
role?: string | undefined;
|
|
2655
|
+
testid?: string | undefined;
|
|
2656
|
+
name?: string | undefined;
|
|
2657
|
+
}>>;
|
|
2658
|
+
/**
|
|
2659
|
+
* Rendered text as an end-condition, using the shapes the assert surface already accepts.
|
|
2660
|
+
*
|
|
2661
|
+
* The gap this closes: an app with no testids, no `reticle.signal`, no registrable store and no
|
|
2662
|
+
* network call on the interaction under test -- a discount price computed and rendered, a
|
|
2663
|
+
* formatted total, a derived label -- could not produce an asserted flow AT ALL. Everything the
|
|
2664
|
+
* vocabulary offered needed a channel that app does not have, so the only honest outcome was
|
|
2665
|
+
* `assertion-free`, which is a permanent green (#811).
|
|
2666
|
+
*
|
|
2667
|
+
* Derived-DOM rendering is a large share of what actually breaks in a UI, and it was the share
|
|
2668
|
+
* that could not be pinned.
|
|
2669
|
+
*
|
|
2670
|
+
* Classified PRESENCE, not consequence, and that is not a technicality: text is read from the
|
|
2671
|
+
* DOM, so a locator healed to the wrong element can still satisfy it. It earns `presence-only`,
|
|
2672
|
+
* which is a real grade above `assertion-free` and honestly below `signal`/`net`/`state`.
|
|
2673
|
+
*/
|
|
2674
|
+
text: z.ZodOptional<z.ZodObject<{
|
|
2675
|
+
contains: z.ZodString;
|
|
2676
|
+
/** Narrow the search to a container, exactly as the `text` predicate's `scope` does. */
|
|
2677
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2678
|
+
/** Assert the text is GONE — the regression check for a cleared error or a dismissed toast. */
|
|
2679
|
+
absent: z.ZodOptional<z.ZodBoolean>;
|
|
2680
|
+
/** Require the match to be visible, not merely present in the DOM. */
|
|
2681
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
2682
|
+
}, "strict", z.ZodTypeAny, {
|
|
2683
|
+
contains: string;
|
|
2684
|
+
visible?: boolean | undefined;
|
|
2685
|
+
absent?: boolean | undefined;
|
|
2686
|
+
scope?: string | undefined;
|
|
2687
|
+
}, {
|
|
2688
|
+
contains: string;
|
|
2689
|
+
visible?: boolean | undefined;
|
|
2690
|
+
absent?: boolean | undefined;
|
|
2691
|
+
scope?: string | undefined;
|
|
2692
|
+
}>>;
|
|
2693
|
+
/**
|
|
2694
|
+
* Assert a registered store's value — the source of truth no DOM/network read can reach. Compiles
|
|
2695
|
+
* to the predicate engine's `state` predicate. Additive/optional — a flow without it still parses
|
|
2696
|
+
* and the on-disk version stays FLOW_FILE_VERSION 1. `equals` accepts a literal, omitted = presence,
|
|
2697
|
+
* or a `{ $gte | $contains | $length }` operator pattern.
|
|
2698
|
+
*/
|
|
2699
|
+
state: z.ZodOptional<z.ZodObject<{
|
|
2700
|
+
store: z.ZodOptional<z.ZodString>;
|
|
2701
|
+
path: z.ZodString;
|
|
2702
|
+
equals: z.ZodOptional<z.ZodUnknown>;
|
|
2703
|
+
/**
|
|
2704
|
+
* Treat this as an INVARIANT that must still hold AFTER the action settles, rather than a
|
|
2705
|
+
* condition to wait for. Set it for a blast-radius check ("this unrelated path must NOT have
|
|
2706
|
+
* moved") — without it a wait-until-true read passes before an over-reaching side-effect lands.
|
|
2707
|
+
*/
|
|
2708
|
+
hold: z.ZodOptional<z.ZodBoolean>;
|
|
2709
|
+
}, "strict", z.ZodTypeAny, {
|
|
2710
|
+
path: string;
|
|
2711
|
+
store?: string | undefined;
|
|
2712
|
+
equals?: unknown;
|
|
2713
|
+
hold?: boolean | undefined;
|
|
2714
|
+
}, {
|
|
2715
|
+
path: string;
|
|
2716
|
+
store?: string | undefined;
|
|
2717
|
+
equals?: unknown;
|
|
2718
|
+
hold?: boolean | undefined;
|
|
2719
|
+
}>>;
|
|
2720
|
+
}, "strict", z.ZodTypeAny, {
|
|
2721
|
+
signal?: string | undefined;
|
|
2722
|
+
text?: {
|
|
2723
|
+
contains: string;
|
|
2724
|
+
visible?: boolean | undefined;
|
|
2725
|
+
absent?: boolean | undefined;
|
|
2726
|
+
scope?: string | undefined;
|
|
2727
|
+
} | undefined;
|
|
2728
|
+
net?: {
|
|
2729
|
+
status?: number | undefined;
|
|
2730
|
+
method?: string | undefined;
|
|
2731
|
+
urlContains?: string | undefined;
|
|
2732
|
+
count?: number | undefined;
|
|
2733
|
+
} | undefined;
|
|
2734
|
+
state?: {
|
|
2735
|
+
path: string;
|
|
2736
|
+
store?: string | undefined;
|
|
2737
|
+
equals?: unknown;
|
|
2738
|
+
hold?: boolean | undefined;
|
|
2739
|
+
} | undefined;
|
|
2740
|
+
element?: {
|
|
2741
|
+
role?: string | undefined;
|
|
2742
|
+
testid?: string | undefined;
|
|
2743
|
+
name?: string | undefined;
|
|
2744
|
+
} | undefined;
|
|
2745
|
+
route?: {
|
|
2746
|
+
pathname?: string | undefined;
|
|
2747
|
+
contains?: string | undefined;
|
|
2748
|
+
} | undefined;
|
|
2749
|
+
console?: {
|
|
2750
|
+
level?: string | undefined;
|
|
2751
|
+
absent?: boolean | undefined;
|
|
2752
|
+
} | undefined;
|
|
2753
|
+
signalData?: Record<string, unknown> | undefined;
|
|
2754
|
+
signalCount?: number | undefined;
|
|
2755
|
+
}, {
|
|
2756
|
+
signal?: string | undefined;
|
|
2757
|
+
text?: {
|
|
2758
|
+
contains: string;
|
|
2759
|
+
visible?: boolean | undefined;
|
|
2760
|
+
absent?: boolean | undefined;
|
|
2761
|
+
scope?: string | undefined;
|
|
2762
|
+
} | undefined;
|
|
2763
|
+
net?: {
|
|
2764
|
+
status?: number | undefined;
|
|
2765
|
+
method?: string | undefined;
|
|
2766
|
+
urlContains?: string | undefined;
|
|
2767
|
+
count?: number | undefined;
|
|
2768
|
+
} | undefined;
|
|
2769
|
+
state?: {
|
|
2770
|
+
path: string;
|
|
2771
|
+
store?: string | undefined;
|
|
2772
|
+
equals?: unknown;
|
|
2773
|
+
hold?: boolean | undefined;
|
|
2774
|
+
} | undefined;
|
|
2775
|
+
element?: {
|
|
2776
|
+
role?: string | undefined;
|
|
2777
|
+
testid?: string | undefined;
|
|
2778
|
+
name?: string | undefined;
|
|
2779
|
+
} | undefined;
|
|
2780
|
+
route?: {
|
|
2781
|
+
pathname?: string | undefined;
|
|
2782
|
+
contains?: string | undefined;
|
|
2783
|
+
} | undefined;
|
|
2784
|
+
console?: {
|
|
2785
|
+
level?: string | undefined;
|
|
2786
|
+
absent?: boolean | undefined;
|
|
2787
|
+
} | undefined;
|
|
2788
|
+
signalData?: Record<string, unknown> | undefined;
|
|
2789
|
+
signalCount?: number | undefined;
|
|
2790
|
+
}>>;
|
|
2791
|
+
/**
|
|
2792
|
+
* Anchors whose CONTENT must not be asserted (e.g. LLM output). Replay asserts
|
|
2793
|
+
* presence, not words. Compiled from a `mark-dynamic` annotation.
|
|
2794
|
+
*/
|
|
2795
|
+
dynamic: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
2796
|
+
kind: z.ZodLiteral<"testid">;
|
|
2797
|
+
value: z.ZodString;
|
|
2798
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
2799
|
+
file: z.ZodString;
|
|
2800
|
+
line: z.ZodNumber;
|
|
2801
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
2802
|
+
}, "strip", z.ZodTypeAny, {
|
|
2803
|
+
file: string;
|
|
2804
|
+
line: number;
|
|
2805
|
+
column?: number | undefined;
|
|
2806
|
+
}, {
|
|
2807
|
+
file: string;
|
|
2808
|
+
line: number;
|
|
2809
|
+
column?: number | undefined;
|
|
2810
|
+
}>>;
|
|
2811
|
+
}, "strip", z.ZodTypeAny, {
|
|
2812
|
+
kind: "testid";
|
|
2813
|
+
value: string;
|
|
2814
|
+
source?: {
|
|
2815
|
+
file: string;
|
|
2816
|
+
line: number;
|
|
2817
|
+
column?: number | undefined;
|
|
2818
|
+
} | undefined;
|
|
2819
|
+
}, {
|
|
2820
|
+
kind: "testid";
|
|
2821
|
+
value: string;
|
|
2822
|
+
source?: {
|
|
2823
|
+
file: string;
|
|
2824
|
+
line: number;
|
|
2825
|
+
column?: number | undefined;
|
|
2826
|
+
} | undefined;
|
|
2827
|
+
}>, z.ZodObject<{
|
|
2828
|
+
kind: z.ZodLiteral<"role">;
|
|
2829
|
+
role: z.ZodString;
|
|
2830
|
+
name: z.ZodOptional<z.ZodString>;
|
|
2831
|
+
}, "strip", z.ZodTypeAny, {
|
|
2832
|
+
role: string;
|
|
2833
|
+
kind: "role";
|
|
2834
|
+
name?: string | undefined;
|
|
2835
|
+
}, {
|
|
2836
|
+
role: string;
|
|
2837
|
+
kind: "role";
|
|
2838
|
+
name?: string | undefined;
|
|
2839
|
+
}>, z.ZodObject<{
|
|
2840
|
+
kind: z.ZodLiteral<"signal">;
|
|
2841
|
+
name: z.ZodString;
|
|
2842
|
+
}, "strip", z.ZodTypeAny, {
|
|
2843
|
+
kind: "signal";
|
|
2844
|
+
name: string;
|
|
2845
|
+
}, {
|
|
2846
|
+
kind: "signal";
|
|
2847
|
+
name: string;
|
|
2848
|
+
}>, z.ZodObject<{
|
|
2849
|
+
kind: z.ZodLiteral<"component">;
|
|
2850
|
+
component: z.ZodOptional<z.ZodString>;
|
|
2851
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
2852
|
+
file: z.ZodString;
|
|
2853
|
+
line: z.ZodNumber;
|
|
2854
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
2855
|
+
}, "strip", z.ZodTypeAny, {
|
|
2856
|
+
file: string;
|
|
2857
|
+
line: number;
|
|
2858
|
+
column?: number | undefined;
|
|
2859
|
+
}, {
|
|
2860
|
+
file: string;
|
|
2861
|
+
line: number;
|
|
2862
|
+
column?: number | undefined;
|
|
2863
|
+
}>>;
|
|
2864
|
+
role: z.ZodOptional<z.ZodString>;
|
|
2865
|
+
name: z.ZodOptional<z.ZodString>;
|
|
2866
|
+
}, "strip", z.ZodTypeAny, {
|
|
2867
|
+
kind: "component";
|
|
2868
|
+
role?: string | undefined;
|
|
2869
|
+
component?: string | undefined;
|
|
2870
|
+
source?: {
|
|
2871
|
+
file: string;
|
|
2872
|
+
line: number;
|
|
2873
|
+
column?: number | undefined;
|
|
2874
|
+
} | undefined;
|
|
2875
|
+
name?: string | undefined;
|
|
2876
|
+
}, {
|
|
2877
|
+
kind: "component";
|
|
2878
|
+
role?: string | undefined;
|
|
2879
|
+
component?: string | undefined;
|
|
2880
|
+
source?: {
|
|
2881
|
+
file: string;
|
|
2882
|
+
line: number;
|
|
2883
|
+
column?: number | undefined;
|
|
2884
|
+
} | undefined;
|
|
2885
|
+
name?: string | undefined;
|
|
2886
|
+
}>]>, "many">>;
|
|
2887
|
+
/**
|
|
2888
|
+
* Free-form labels a suite selects on — `smoke`, `checkout`, `slow`.
|
|
2889
|
+
*
|
|
2890
|
+
* Not an enum: the useful sets are the ones a team invents for its own product, and a closed list
|
|
2891
|
+
* would mean shipping somebody's release process in the contract. Optional and back-compat, so
|
|
2892
|
+
* every flow already on disk keeps loading.
|
|
2893
|
+
*/
|
|
2894
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2895
|
+
/**
|
|
2896
|
+
* Flows that must run, and pass, before this one.
|
|
2897
|
+
*
|
|
2898
|
+
* By name, because a name is what every other caller addresses a flow by. A prerequisite that is
|
|
2899
|
+
* not in the run is reported rather than assumed satisfied: a checkout flow whose login was
|
|
2900
|
+
* filtered out by a label would otherwise fail for a reason that has nothing to do with checkout.
|
|
2901
|
+
*/
|
|
2902
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2903
|
+
/** Whether a suite runs this flow. Absent means active — see FlowStatus. */
|
|
2904
|
+
status: z.ZodOptional<z.ZodEnum<["active", "quarantined", "draft"]>>;
|
|
2905
|
+
/**
|
|
2906
|
+
* What this flow has learned from being run, as opposed to what a person wrote on it.
|
|
2907
|
+
*
|
|
2908
|
+
* Distinct from `knownBugs` above, and the difference is who is speaking. A known bug is a HUMAN
|
|
2909
|
+
* excusing a failing assertion with a traceable id. A learned guard is the SYSTEM remembering a
|
|
2910
|
+
* defect it observed: `open` while the defect is still happening, `guarded` once a run stopped
|
|
2911
|
+
* showing it. Only the second state asserts anything, and its return is a regression.
|
|
2912
|
+
*
|
|
2913
|
+
* The ordering is the safety property. A contradiction seen right now is not an assertion:
|
|
2914
|
+
* asserting "must not happen" while it happens makes the flow red over an accepted defect and
|
|
2915
|
+
* trains the reader to ignore it, and asserting "does happen" pins broken behaviour so the check
|
|
2916
|
+
* fires when somebody FIXES the bug. See `learnFromRun` in the engine for the rule.
|
|
2917
|
+
*/
|
|
2918
|
+
learned: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2919
|
+
kind: z.ZodString;
|
|
2920
|
+
step: z.ZodNumber;
|
|
2921
|
+
state: z.ZodEnum<["open", "guarded"]>;
|
|
2922
|
+
/** Consecutive runs that did not show it. One quiet run is not a fix; see learnFromRun. */
|
|
2923
|
+
cleanRuns: z.ZodOptional<z.ZodNumber>;
|
|
2924
|
+
}, "strip", z.ZodTypeAny, {
|
|
2925
|
+
state: "open" | "guarded";
|
|
2926
|
+
step: number;
|
|
2927
|
+
kind: string;
|
|
2928
|
+
cleanRuns?: number | undefined;
|
|
2929
|
+
}, {
|
|
2930
|
+
state: "open" | "guarded";
|
|
2931
|
+
step: number;
|
|
2932
|
+
kind: string;
|
|
2933
|
+
cleanRuns?: number | undefined;
|
|
2934
|
+
}>, "many">>;
|
|
2935
|
+
/**
|
|
2936
|
+
* Bugs this flow is KNOWN to expose, so a red for a filed reason is not re-investigated.
|
|
2937
|
+
*
|
|
2938
|
+
* Without it, a suite red for a known cause is indistinguishable from one that just broke: either
|
|
2939
|
+
* somebody re-opens an investigation into a bug already filed, or the flow gets quarantined and
|
|
2940
|
+
* stops watching the rest of the journey it covers.
|
|
2941
|
+
*
|
|
2942
|
+
* `assertions` is what keeps the note honest. A known-bug note is a claim about code, and code
|
|
2943
|
+
* moves; a note recorded against assertions that have since changed explains away a NEW failure
|
|
2944
|
+
* with an OLD excuse, which is a false green in a different costume. `staleKnownBugs` reports any
|
|
2945
|
+
* note whose assertions no longer all exist, rather than trusting it.
|
|
2946
|
+
*/
|
|
2947
|
+
knownBugs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2948
|
+
/** Required: an unattributable excuse is worse than none. An issue key, a URL, anything traceable. */
|
|
2949
|
+
id: z.ZodString;
|
|
2950
|
+
summary: z.ZodString;
|
|
2951
|
+
/** Which of this flow's assertions the note was written against. */
|
|
2952
|
+
assertions: z.ZodArray<z.ZodString, "many">;
|
|
2953
|
+
}, "strip", z.ZodTypeAny, {
|
|
2954
|
+
id: string;
|
|
2955
|
+
summary: string;
|
|
2956
|
+
assertions: string[];
|
|
2957
|
+
}, {
|
|
2958
|
+
id: string;
|
|
2959
|
+
summary: string;
|
|
2960
|
+
assertions: string[];
|
|
2961
|
+
}>, "many">>;
|
|
2962
|
+
/**
|
|
2963
|
+
* Why this flow is out of the suite, who owns getting it back, and since when.
|
|
2964
|
+
*
|
|
2965
|
+
* Required in full when quarantined, because a quarantine without a reason and an owner is a
|
|
2966
|
+
* silent skip wearing a label: it removes the failure from the verdict AND the reason to ever fix
|
|
2967
|
+
* it. `until` is the optional half — a date somebody has to look at it again.
|
|
2968
|
+
*/
|
|
2969
|
+
quarantine: z.ZodOptional<z.ZodObject<{
|
|
2970
|
+
reason: z.ZodString;
|
|
2971
|
+
since: z.ZodString;
|
|
2972
|
+
owner: z.ZodString;
|
|
2973
|
+
until: z.ZodOptional<z.ZodString>;
|
|
2974
|
+
}, "strip", z.ZodTypeAny, {
|
|
2975
|
+
reason: string;
|
|
2976
|
+
since: string;
|
|
2977
|
+
owner: string;
|
|
2978
|
+
until?: string | undefined;
|
|
2979
|
+
}, {
|
|
2980
|
+
reason: string;
|
|
2981
|
+
since: string;
|
|
2982
|
+
owner: string;
|
|
2983
|
+
until?: string | undefined;
|
|
2984
|
+
}>>;
|
|
2985
|
+
}, "strip", z.ZodTypeAny, {
|
|
2986
|
+
name: string;
|
|
2987
|
+
steps: FlowStep[];
|
|
2988
|
+
version: 1;
|
|
2989
|
+
createdAt: number;
|
|
2990
|
+
status?: "active" | "quarantined" | "draft" | undefined;
|
|
2991
|
+
intent?: string | undefined;
|
|
2992
|
+
intentId?: string | undefined;
|
|
2993
|
+
projectId?: string | undefined;
|
|
2994
|
+
startPath?: string | undefined;
|
|
2995
|
+
fixture?: string | undefined;
|
|
2996
|
+
requires?: {
|
|
2997
|
+
signal?: string | undefined;
|
|
2998
|
+
text?: {
|
|
2999
|
+
contains: string;
|
|
3000
|
+
visible?: boolean | undefined;
|
|
3001
|
+
absent?: boolean | undefined;
|
|
3002
|
+
scope?: string | undefined;
|
|
3003
|
+
} | undefined;
|
|
3004
|
+
net?: {
|
|
3005
|
+
status?: number | undefined;
|
|
3006
|
+
method?: string | undefined;
|
|
3007
|
+
urlContains?: string | undefined;
|
|
3008
|
+
count?: number | undefined;
|
|
3009
|
+
} | undefined;
|
|
3010
|
+
state?: {
|
|
3011
|
+
path: string;
|
|
3012
|
+
store?: string | undefined;
|
|
3013
|
+
equals?: unknown;
|
|
3014
|
+
hold?: boolean | undefined;
|
|
3015
|
+
} | undefined;
|
|
3016
|
+
element?: {
|
|
3017
|
+
role?: string | undefined;
|
|
3018
|
+
testid?: string | undefined;
|
|
3019
|
+
name?: string | undefined;
|
|
3020
|
+
} | undefined;
|
|
3021
|
+
route?: {
|
|
3022
|
+
pathname?: string | undefined;
|
|
3023
|
+
contains?: string | undefined;
|
|
3024
|
+
} | undefined;
|
|
3025
|
+
console?: {
|
|
3026
|
+
level?: string | undefined;
|
|
3027
|
+
absent?: boolean | undefined;
|
|
3028
|
+
} | undefined;
|
|
3029
|
+
signalData?: Record<string, unknown> | undefined;
|
|
3030
|
+
signalCount?: number | undefined;
|
|
3031
|
+
}[] | undefined;
|
|
3032
|
+
ensures?: {
|
|
3033
|
+
signal?: string | undefined;
|
|
3034
|
+
text?: {
|
|
3035
|
+
contains: string;
|
|
3036
|
+
visible?: boolean | undefined;
|
|
3037
|
+
absent?: boolean | undefined;
|
|
3038
|
+
scope?: string | undefined;
|
|
3039
|
+
} | undefined;
|
|
3040
|
+
net?: {
|
|
3041
|
+
status?: number | undefined;
|
|
3042
|
+
method?: string | undefined;
|
|
3043
|
+
urlContains?: string | undefined;
|
|
3044
|
+
count?: number | undefined;
|
|
3045
|
+
} | undefined;
|
|
3046
|
+
state?: {
|
|
3047
|
+
path: string;
|
|
3048
|
+
store?: string | undefined;
|
|
3049
|
+
equals?: unknown;
|
|
3050
|
+
hold?: boolean | undefined;
|
|
3051
|
+
} | undefined;
|
|
3052
|
+
element?: {
|
|
3053
|
+
role?: string | undefined;
|
|
3054
|
+
testid?: string | undefined;
|
|
3055
|
+
name?: string | undefined;
|
|
3056
|
+
} | undefined;
|
|
3057
|
+
route?: {
|
|
3058
|
+
pathname?: string | undefined;
|
|
3059
|
+
contains?: string | undefined;
|
|
3060
|
+
} | undefined;
|
|
3061
|
+
console?: {
|
|
3062
|
+
level?: string | undefined;
|
|
3063
|
+
absent?: boolean | undefined;
|
|
3064
|
+
} | undefined;
|
|
3065
|
+
signalData?: Record<string, unknown> | undefined;
|
|
3066
|
+
signalCount?: number | undefined;
|
|
3067
|
+
}[] | undefined;
|
|
3068
|
+
signalTimeoutMs?: number | undefined;
|
|
3069
|
+
success?: {
|
|
3070
|
+
signal?: string | undefined;
|
|
3071
|
+
text?: {
|
|
3072
|
+
contains: string;
|
|
3073
|
+
visible?: boolean | undefined;
|
|
3074
|
+
absent?: boolean | undefined;
|
|
3075
|
+
scope?: string | undefined;
|
|
3076
|
+
} | undefined;
|
|
3077
|
+
net?: {
|
|
3078
|
+
status?: number | undefined;
|
|
3079
|
+
method?: string | undefined;
|
|
3080
|
+
urlContains?: string | undefined;
|
|
3081
|
+
count?: number | undefined;
|
|
3082
|
+
} | undefined;
|
|
3083
|
+
state?: {
|
|
3084
|
+
path: string;
|
|
3085
|
+
store?: string | undefined;
|
|
3086
|
+
equals?: unknown;
|
|
3087
|
+
hold?: boolean | undefined;
|
|
3088
|
+
} | undefined;
|
|
3089
|
+
element?: {
|
|
3090
|
+
role?: string | undefined;
|
|
3091
|
+
testid?: string | undefined;
|
|
3092
|
+
name?: string | undefined;
|
|
3093
|
+
} | undefined;
|
|
3094
|
+
route?: {
|
|
3095
|
+
pathname?: string | undefined;
|
|
3096
|
+
contains?: string | undefined;
|
|
3097
|
+
} | undefined;
|
|
3098
|
+
console?: {
|
|
3099
|
+
level?: string | undefined;
|
|
3100
|
+
absent?: boolean | undefined;
|
|
3101
|
+
} | undefined;
|
|
3102
|
+
signalData?: Record<string, unknown> | undefined;
|
|
3103
|
+
signalCount?: number | undefined;
|
|
3104
|
+
} | undefined;
|
|
3105
|
+
dynamic?: ({
|
|
3106
|
+
kind: "testid";
|
|
3107
|
+
value: string;
|
|
3108
|
+
source?: {
|
|
3109
|
+
file: string;
|
|
3110
|
+
line: number;
|
|
3111
|
+
column?: number | undefined;
|
|
3112
|
+
} | undefined;
|
|
3113
|
+
} | {
|
|
3114
|
+
role: string;
|
|
3115
|
+
kind: "role";
|
|
3116
|
+
name?: string | undefined;
|
|
3117
|
+
} | {
|
|
3118
|
+
kind: "signal";
|
|
3119
|
+
name: string;
|
|
3120
|
+
} | {
|
|
3121
|
+
kind: "component";
|
|
3122
|
+
role?: string | undefined;
|
|
3123
|
+
component?: string | undefined;
|
|
3124
|
+
source?: {
|
|
3125
|
+
file: string;
|
|
3126
|
+
line: number;
|
|
3127
|
+
column?: number | undefined;
|
|
3128
|
+
} | undefined;
|
|
3129
|
+
name?: string | undefined;
|
|
3130
|
+
})[] | undefined;
|
|
3131
|
+
labels?: string[] | undefined;
|
|
3132
|
+
needs?: string[] | undefined;
|
|
3133
|
+
learned?: {
|
|
3134
|
+
state: "open" | "guarded";
|
|
3135
|
+
step: number;
|
|
3136
|
+
kind: string;
|
|
3137
|
+
cleanRuns?: number | undefined;
|
|
3138
|
+
}[] | undefined;
|
|
3139
|
+
knownBugs?: {
|
|
3140
|
+
id: string;
|
|
3141
|
+
summary: string;
|
|
3142
|
+
assertions: string[];
|
|
3143
|
+
}[] | undefined;
|
|
3144
|
+
quarantine?: {
|
|
3145
|
+
reason: string;
|
|
3146
|
+
since: string;
|
|
3147
|
+
owner: string;
|
|
3148
|
+
until?: string | undefined;
|
|
3149
|
+
} | undefined;
|
|
3150
|
+
}, {
|
|
3151
|
+
name: string;
|
|
3152
|
+
steps: FlowStep[];
|
|
3153
|
+
version: 1;
|
|
3154
|
+
createdAt: number;
|
|
3155
|
+
status?: "active" | "quarantined" | "draft" | undefined;
|
|
3156
|
+
intent?: string | undefined;
|
|
3157
|
+
intentId?: string | undefined;
|
|
3158
|
+
projectId?: string | undefined;
|
|
3159
|
+
startPath?: string | undefined;
|
|
3160
|
+
fixture?: string | undefined;
|
|
3161
|
+
requires?: {
|
|
3162
|
+
signal?: string | undefined;
|
|
3163
|
+
text?: {
|
|
3164
|
+
contains: string;
|
|
3165
|
+
visible?: boolean | undefined;
|
|
3166
|
+
absent?: boolean | undefined;
|
|
3167
|
+
scope?: string | undefined;
|
|
3168
|
+
} | undefined;
|
|
3169
|
+
net?: {
|
|
3170
|
+
status?: number | undefined;
|
|
3171
|
+
method?: string | undefined;
|
|
3172
|
+
urlContains?: string | undefined;
|
|
3173
|
+
count?: number | undefined;
|
|
3174
|
+
} | undefined;
|
|
3175
|
+
state?: {
|
|
3176
|
+
path: string;
|
|
3177
|
+
store?: string | undefined;
|
|
3178
|
+
equals?: unknown;
|
|
3179
|
+
hold?: boolean | undefined;
|
|
3180
|
+
} | undefined;
|
|
3181
|
+
element?: {
|
|
3182
|
+
role?: string | undefined;
|
|
3183
|
+
testid?: string | undefined;
|
|
3184
|
+
name?: string | undefined;
|
|
3185
|
+
} | undefined;
|
|
3186
|
+
route?: {
|
|
3187
|
+
pathname?: string | undefined;
|
|
3188
|
+
contains?: string | undefined;
|
|
3189
|
+
} | undefined;
|
|
3190
|
+
console?: {
|
|
3191
|
+
level?: string | undefined;
|
|
3192
|
+
absent?: boolean | undefined;
|
|
3193
|
+
} | undefined;
|
|
3194
|
+
signalData?: Record<string, unknown> | undefined;
|
|
3195
|
+
signalCount?: number | undefined;
|
|
3196
|
+
}[] | undefined;
|
|
3197
|
+
ensures?: {
|
|
3198
|
+
signal?: string | undefined;
|
|
3199
|
+
text?: {
|
|
3200
|
+
contains: string;
|
|
3201
|
+
visible?: boolean | undefined;
|
|
3202
|
+
absent?: boolean | undefined;
|
|
3203
|
+
scope?: string | undefined;
|
|
3204
|
+
} | undefined;
|
|
3205
|
+
net?: {
|
|
3206
|
+
status?: number | undefined;
|
|
3207
|
+
method?: string | undefined;
|
|
3208
|
+
urlContains?: string | undefined;
|
|
3209
|
+
count?: number | undefined;
|
|
3210
|
+
} | undefined;
|
|
3211
|
+
state?: {
|
|
3212
|
+
path: string;
|
|
3213
|
+
store?: string | undefined;
|
|
3214
|
+
equals?: unknown;
|
|
3215
|
+
hold?: boolean | undefined;
|
|
3216
|
+
} | undefined;
|
|
3217
|
+
element?: {
|
|
3218
|
+
role?: string | undefined;
|
|
3219
|
+
testid?: string | undefined;
|
|
3220
|
+
name?: string | undefined;
|
|
3221
|
+
} | undefined;
|
|
3222
|
+
route?: {
|
|
3223
|
+
pathname?: string | undefined;
|
|
3224
|
+
contains?: string | undefined;
|
|
3225
|
+
} | undefined;
|
|
3226
|
+
console?: {
|
|
3227
|
+
level?: string | undefined;
|
|
3228
|
+
absent?: boolean | undefined;
|
|
3229
|
+
} | undefined;
|
|
3230
|
+
signalData?: Record<string, unknown> | undefined;
|
|
3231
|
+
signalCount?: number | undefined;
|
|
3232
|
+
}[] | undefined;
|
|
3233
|
+
signalTimeoutMs?: number | undefined;
|
|
3234
|
+
success?: {
|
|
3235
|
+
signal?: string | undefined;
|
|
3236
|
+
text?: {
|
|
3237
|
+
contains: string;
|
|
3238
|
+
visible?: boolean | undefined;
|
|
3239
|
+
absent?: boolean | undefined;
|
|
3240
|
+
scope?: string | undefined;
|
|
3241
|
+
} | undefined;
|
|
3242
|
+
net?: {
|
|
3243
|
+
status?: number | undefined;
|
|
3244
|
+
method?: string | undefined;
|
|
3245
|
+
urlContains?: string | undefined;
|
|
3246
|
+
count?: number | undefined;
|
|
3247
|
+
} | undefined;
|
|
3248
|
+
state?: {
|
|
3249
|
+
path: string;
|
|
3250
|
+
store?: string | undefined;
|
|
3251
|
+
equals?: unknown;
|
|
3252
|
+
hold?: boolean | undefined;
|
|
3253
|
+
} | undefined;
|
|
3254
|
+
element?: {
|
|
3255
|
+
role?: string | undefined;
|
|
3256
|
+
testid?: string | undefined;
|
|
3257
|
+
name?: string | undefined;
|
|
3258
|
+
} | undefined;
|
|
3259
|
+
route?: {
|
|
3260
|
+
pathname?: string | undefined;
|
|
3261
|
+
contains?: string | undefined;
|
|
3262
|
+
} | undefined;
|
|
3263
|
+
console?: {
|
|
3264
|
+
level?: string | undefined;
|
|
3265
|
+
absent?: boolean | undefined;
|
|
3266
|
+
} | undefined;
|
|
3267
|
+
signalData?: Record<string, unknown> | undefined;
|
|
3268
|
+
signalCount?: number | undefined;
|
|
3269
|
+
} | undefined;
|
|
3270
|
+
dynamic?: ({
|
|
3271
|
+
kind: "testid";
|
|
3272
|
+
value: string;
|
|
3273
|
+
source?: {
|
|
3274
|
+
file: string;
|
|
3275
|
+
line: number;
|
|
3276
|
+
column?: number | undefined;
|
|
3277
|
+
} | undefined;
|
|
3278
|
+
} | {
|
|
3279
|
+
role: string;
|
|
3280
|
+
kind: "role";
|
|
3281
|
+
name?: string | undefined;
|
|
3282
|
+
} | {
|
|
3283
|
+
kind: "signal";
|
|
3284
|
+
name: string;
|
|
3285
|
+
} | {
|
|
3286
|
+
kind: "component";
|
|
3287
|
+
role?: string | undefined;
|
|
3288
|
+
component?: string | undefined;
|
|
3289
|
+
source?: {
|
|
3290
|
+
file: string;
|
|
3291
|
+
line: number;
|
|
3292
|
+
column?: number | undefined;
|
|
3293
|
+
} | undefined;
|
|
3294
|
+
name?: string | undefined;
|
|
3295
|
+
})[] | undefined;
|
|
3296
|
+
labels?: string[] | undefined;
|
|
3297
|
+
needs?: string[] | undefined;
|
|
3298
|
+
learned?: {
|
|
3299
|
+
state: "open" | "guarded";
|
|
3300
|
+
step: number;
|
|
3301
|
+
kind: string;
|
|
3302
|
+
cleanRuns?: number | undefined;
|
|
3303
|
+
}[] | undefined;
|
|
3304
|
+
knownBugs?: {
|
|
3305
|
+
id: string;
|
|
3306
|
+
summary: string;
|
|
3307
|
+
assertions: string[];
|
|
3308
|
+
}[] | undefined;
|
|
3309
|
+
quarantine?: {
|
|
3310
|
+
reason: string;
|
|
3311
|
+
since: string;
|
|
3312
|
+
owner: string;
|
|
3313
|
+
until?: string | undefined;
|
|
3314
|
+
} | undefined;
|
|
3315
|
+
}>;
|
|
3316
|
+
}, "strip", z.ZodTypeAny, {
|
|
3317
|
+
flow: {
|
|
3318
|
+
name: string;
|
|
3319
|
+
steps: FlowStep[];
|
|
3320
|
+
version: 1;
|
|
3321
|
+
createdAt: number;
|
|
3322
|
+
status?: "active" | "quarantined" | "draft" | undefined;
|
|
3323
|
+
intent?: string | undefined;
|
|
3324
|
+
intentId?: string | undefined;
|
|
3325
|
+
projectId?: string | undefined;
|
|
3326
|
+
startPath?: string | undefined;
|
|
3327
|
+
fixture?: string | undefined;
|
|
3328
|
+
requires?: {
|
|
3329
|
+
signal?: string | undefined;
|
|
3330
|
+
text?: {
|
|
3331
|
+
contains: string;
|
|
3332
|
+
visible?: boolean | undefined;
|
|
3333
|
+
absent?: boolean | undefined;
|
|
3334
|
+
scope?: string | undefined;
|
|
3335
|
+
} | undefined;
|
|
3336
|
+
net?: {
|
|
3337
|
+
status?: number | undefined;
|
|
3338
|
+
method?: string | undefined;
|
|
3339
|
+
urlContains?: string | undefined;
|
|
3340
|
+
count?: number | undefined;
|
|
3341
|
+
} | undefined;
|
|
3342
|
+
state?: {
|
|
3343
|
+
path: string;
|
|
3344
|
+
store?: string | undefined;
|
|
3345
|
+
equals?: unknown;
|
|
3346
|
+
hold?: boolean | undefined;
|
|
3347
|
+
} | undefined;
|
|
3348
|
+
element?: {
|
|
3349
|
+
role?: string | undefined;
|
|
3350
|
+
testid?: string | undefined;
|
|
3351
|
+
name?: string | undefined;
|
|
3352
|
+
} | undefined;
|
|
3353
|
+
route?: {
|
|
3354
|
+
pathname?: string | undefined;
|
|
3355
|
+
contains?: string | undefined;
|
|
3356
|
+
} | undefined;
|
|
3357
|
+
console?: {
|
|
3358
|
+
level?: string | undefined;
|
|
3359
|
+
absent?: boolean | undefined;
|
|
3360
|
+
} | undefined;
|
|
3361
|
+
signalData?: Record<string, unknown> | undefined;
|
|
3362
|
+
signalCount?: number | undefined;
|
|
3363
|
+
}[] | undefined;
|
|
3364
|
+
ensures?: {
|
|
3365
|
+
signal?: string | undefined;
|
|
3366
|
+
text?: {
|
|
3367
|
+
contains: string;
|
|
3368
|
+
visible?: boolean | undefined;
|
|
3369
|
+
absent?: boolean | undefined;
|
|
3370
|
+
scope?: string | undefined;
|
|
3371
|
+
} | undefined;
|
|
3372
|
+
net?: {
|
|
3373
|
+
status?: number | undefined;
|
|
3374
|
+
method?: string | undefined;
|
|
3375
|
+
urlContains?: string | undefined;
|
|
3376
|
+
count?: number | undefined;
|
|
3377
|
+
} | undefined;
|
|
3378
|
+
state?: {
|
|
3379
|
+
path: string;
|
|
3380
|
+
store?: string | undefined;
|
|
3381
|
+
equals?: unknown;
|
|
3382
|
+
hold?: boolean | undefined;
|
|
3383
|
+
} | undefined;
|
|
3384
|
+
element?: {
|
|
3385
|
+
role?: string | undefined;
|
|
3386
|
+
testid?: string | undefined;
|
|
3387
|
+
name?: string | undefined;
|
|
3388
|
+
} | undefined;
|
|
3389
|
+
route?: {
|
|
3390
|
+
pathname?: string | undefined;
|
|
3391
|
+
contains?: string | undefined;
|
|
3392
|
+
} | undefined;
|
|
3393
|
+
console?: {
|
|
3394
|
+
level?: string | undefined;
|
|
3395
|
+
absent?: boolean | undefined;
|
|
3396
|
+
} | undefined;
|
|
3397
|
+
signalData?: Record<string, unknown> | undefined;
|
|
3398
|
+
signalCount?: number | undefined;
|
|
3399
|
+
}[] | undefined;
|
|
3400
|
+
signalTimeoutMs?: number | undefined;
|
|
3401
|
+
success?: {
|
|
3402
|
+
signal?: string | undefined;
|
|
3403
|
+
text?: {
|
|
3404
|
+
contains: string;
|
|
3405
|
+
visible?: boolean | undefined;
|
|
3406
|
+
absent?: boolean | undefined;
|
|
3407
|
+
scope?: string | undefined;
|
|
3408
|
+
} | undefined;
|
|
3409
|
+
net?: {
|
|
3410
|
+
status?: number | undefined;
|
|
3411
|
+
method?: string | undefined;
|
|
3412
|
+
urlContains?: string | undefined;
|
|
3413
|
+
count?: number | undefined;
|
|
3414
|
+
} | undefined;
|
|
3415
|
+
state?: {
|
|
3416
|
+
path: string;
|
|
3417
|
+
store?: string | undefined;
|
|
3418
|
+
equals?: unknown;
|
|
3419
|
+
hold?: boolean | undefined;
|
|
3420
|
+
} | undefined;
|
|
3421
|
+
element?: {
|
|
3422
|
+
role?: string | undefined;
|
|
3423
|
+
testid?: string | undefined;
|
|
3424
|
+
name?: string | undefined;
|
|
3425
|
+
} | undefined;
|
|
3426
|
+
route?: {
|
|
3427
|
+
pathname?: string | undefined;
|
|
3428
|
+
contains?: string | undefined;
|
|
3429
|
+
} | undefined;
|
|
3430
|
+
console?: {
|
|
3431
|
+
level?: string | undefined;
|
|
3432
|
+
absent?: boolean | undefined;
|
|
3433
|
+
} | undefined;
|
|
3434
|
+
signalData?: Record<string, unknown> | undefined;
|
|
3435
|
+
signalCount?: number | undefined;
|
|
3436
|
+
} | undefined;
|
|
3437
|
+
dynamic?: ({
|
|
3438
|
+
kind: "testid";
|
|
3439
|
+
value: string;
|
|
3440
|
+
source?: {
|
|
3441
|
+
file: string;
|
|
3442
|
+
line: number;
|
|
3443
|
+
column?: number | undefined;
|
|
3444
|
+
} | undefined;
|
|
3445
|
+
} | {
|
|
3446
|
+
role: string;
|
|
3447
|
+
kind: "role";
|
|
3448
|
+
name?: string | undefined;
|
|
3449
|
+
} | {
|
|
3450
|
+
kind: "signal";
|
|
3451
|
+
name: string;
|
|
3452
|
+
} | {
|
|
3453
|
+
kind: "component";
|
|
3454
|
+
role?: string | undefined;
|
|
3455
|
+
component?: string | undefined;
|
|
3456
|
+
source?: {
|
|
3457
|
+
file: string;
|
|
3458
|
+
line: number;
|
|
3459
|
+
column?: number | undefined;
|
|
3460
|
+
} | undefined;
|
|
3461
|
+
name?: string | undefined;
|
|
3462
|
+
})[] | undefined;
|
|
3463
|
+
labels?: string[] | undefined;
|
|
3464
|
+
needs?: string[] | undefined;
|
|
3465
|
+
learned?: {
|
|
3466
|
+
state: "open" | "guarded";
|
|
3467
|
+
step: number;
|
|
3468
|
+
kind: string;
|
|
3469
|
+
cleanRuns?: number | undefined;
|
|
3470
|
+
}[] | undefined;
|
|
3471
|
+
knownBugs?: {
|
|
3472
|
+
id: string;
|
|
3473
|
+
summary: string;
|
|
3474
|
+
assertions: string[];
|
|
3475
|
+
}[] | undefined;
|
|
3476
|
+
quarantine?: {
|
|
3477
|
+
reason: string;
|
|
3478
|
+
since: string;
|
|
3479
|
+
owner: string;
|
|
3480
|
+
until?: string | undefined;
|
|
3481
|
+
} | undefined;
|
|
3482
|
+
};
|
|
3483
|
+
name: string;
|
|
3484
|
+
}, {
|
|
3485
|
+
flow: {
|
|
3486
|
+
name: string;
|
|
3487
|
+
steps: FlowStep[];
|
|
3488
|
+
version: 1;
|
|
3489
|
+
createdAt: number;
|
|
3490
|
+
status?: "active" | "quarantined" | "draft" | undefined;
|
|
3491
|
+
intent?: string | undefined;
|
|
3492
|
+
intentId?: string | undefined;
|
|
3493
|
+
projectId?: string | undefined;
|
|
3494
|
+
startPath?: string | undefined;
|
|
3495
|
+
fixture?: string | undefined;
|
|
3496
|
+
requires?: {
|
|
3497
|
+
signal?: string | undefined;
|
|
3498
|
+
text?: {
|
|
3499
|
+
contains: string;
|
|
3500
|
+
visible?: boolean | undefined;
|
|
3501
|
+
absent?: boolean | undefined;
|
|
3502
|
+
scope?: string | undefined;
|
|
3503
|
+
} | undefined;
|
|
3504
|
+
net?: {
|
|
3505
|
+
status?: number | undefined;
|
|
3506
|
+
method?: string | undefined;
|
|
3507
|
+
urlContains?: string | undefined;
|
|
3508
|
+
count?: number | undefined;
|
|
3509
|
+
} | undefined;
|
|
3510
|
+
state?: {
|
|
3511
|
+
path: string;
|
|
3512
|
+
store?: string | undefined;
|
|
3513
|
+
equals?: unknown;
|
|
3514
|
+
hold?: boolean | undefined;
|
|
3515
|
+
} | undefined;
|
|
3516
|
+
element?: {
|
|
3517
|
+
role?: string | undefined;
|
|
3518
|
+
testid?: string | undefined;
|
|
3519
|
+
name?: string | undefined;
|
|
3520
|
+
} | undefined;
|
|
3521
|
+
route?: {
|
|
3522
|
+
pathname?: string | undefined;
|
|
3523
|
+
contains?: string | undefined;
|
|
3524
|
+
} | undefined;
|
|
3525
|
+
console?: {
|
|
3526
|
+
level?: string | undefined;
|
|
3527
|
+
absent?: boolean | undefined;
|
|
3528
|
+
} | undefined;
|
|
3529
|
+
signalData?: Record<string, unknown> | undefined;
|
|
3530
|
+
signalCount?: number | undefined;
|
|
3531
|
+
}[] | undefined;
|
|
3532
|
+
ensures?: {
|
|
3533
|
+
signal?: string | undefined;
|
|
3534
|
+
text?: {
|
|
3535
|
+
contains: string;
|
|
3536
|
+
visible?: boolean | undefined;
|
|
3537
|
+
absent?: boolean | undefined;
|
|
3538
|
+
scope?: string | undefined;
|
|
3539
|
+
} | undefined;
|
|
3540
|
+
net?: {
|
|
3541
|
+
status?: number | undefined;
|
|
3542
|
+
method?: string | undefined;
|
|
3543
|
+
urlContains?: string | undefined;
|
|
3544
|
+
count?: number | undefined;
|
|
3545
|
+
} | undefined;
|
|
3546
|
+
state?: {
|
|
3547
|
+
path: string;
|
|
3548
|
+
store?: string | undefined;
|
|
3549
|
+
equals?: unknown;
|
|
3550
|
+
hold?: boolean | undefined;
|
|
3551
|
+
} | undefined;
|
|
3552
|
+
element?: {
|
|
3553
|
+
role?: string | undefined;
|
|
3554
|
+
testid?: string | undefined;
|
|
3555
|
+
name?: string | undefined;
|
|
3556
|
+
} | undefined;
|
|
3557
|
+
route?: {
|
|
3558
|
+
pathname?: string | undefined;
|
|
3559
|
+
contains?: string | undefined;
|
|
3560
|
+
} | undefined;
|
|
3561
|
+
console?: {
|
|
3562
|
+
level?: string | undefined;
|
|
3563
|
+
absent?: boolean | undefined;
|
|
3564
|
+
} | undefined;
|
|
3565
|
+
signalData?: Record<string, unknown> | undefined;
|
|
3566
|
+
signalCount?: number | undefined;
|
|
3567
|
+
}[] | undefined;
|
|
3568
|
+
signalTimeoutMs?: number | undefined;
|
|
3569
|
+
success?: {
|
|
3570
|
+
signal?: string | undefined;
|
|
3571
|
+
text?: {
|
|
3572
|
+
contains: string;
|
|
3573
|
+
visible?: boolean | undefined;
|
|
3574
|
+
absent?: boolean | undefined;
|
|
3575
|
+
scope?: string | undefined;
|
|
3576
|
+
} | undefined;
|
|
3577
|
+
net?: {
|
|
3578
|
+
status?: number | undefined;
|
|
3579
|
+
method?: string | undefined;
|
|
3580
|
+
urlContains?: string | undefined;
|
|
3581
|
+
count?: number | undefined;
|
|
3582
|
+
} | undefined;
|
|
3583
|
+
state?: {
|
|
3584
|
+
path: string;
|
|
3585
|
+
store?: string | undefined;
|
|
3586
|
+
equals?: unknown;
|
|
3587
|
+
hold?: boolean | undefined;
|
|
3588
|
+
} | undefined;
|
|
3589
|
+
element?: {
|
|
3590
|
+
role?: string | undefined;
|
|
3591
|
+
testid?: string | undefined;
|
|
3592
|
+
name?: string | undefined;
|
|
3593
|
+
} | undefined;
|
|
3594
|
+
route?: {
|
|
3595
|
+
pathname?: string | undefined;
|
|
3596
|
+
contains?: string | undefined;
|
|
3597
|
+
} | undefined;
|
|
3598
|
+
console?: {
|
|
3599
|
+
level?: string | undefined;
|
|
3600
|
+
absent?: boolean | undefined;
|
|
3601
|
+
} | undefined;
|
|
3602
|
+
signalData?: Record<string, unknown> | undefined;
|
|
3603
|
+
signalCount?: number | undefined;
|
|
3604
|
+
} | undefined;
|
|
3605
|
+
dynamic?: ({
|
|
3606
|
+
kind: "testid";
|
|
3607
|
+
value: string;
|
|
3608
|
+
source?: {
|
|
3609
|
+
file: string;
|
|
3610
|
+
line: number;
|
|
3611
|
+
column?: number | undefined;
|
|
3612
|
+
} | undefined;
|
|
3613
|
+
} | {
|
|
3614
|
+
role: string;
|
|
3615
|
+
kind: "role";
|
|
3616
|
+
name?: string | undefined;
|
|
3617
|
+
} | {
|
|
3618
|
+
kind: "signal";
|
|
3619
|
+
name: string;
|
|
3620
|
+
} | {
|
|
3621
|
+
kind: "component";
|
|
3622
|
+
role?: string | undefined;
|
|
3623
|
+
component?: string | undefined;
|
|
3624
|
+
source?: {
|
|
3625
|
+
file: string;
|
|
3626
|
+
line: number;
|
|
3627
|
+
column?: number | undefined;
|
|
3628
|
+
} | undefined;
|
|
3629
|
+
name?: string | undefined;
|
|
3630
|
+
})[] | undefined;
|
|
3631
|
+
labels?: string[] | undefined;
|
|
3632
|
+
needs?: string[] | undefined;
|
|
3633
|
+
learned?: {
|
|
3634
|
+
state: "open" | "guarded";
|
|
3635
|
+
step: number;
|
|
3636
|
+
kind: string;
|
|
3637
|
+
cleanRuns?: number | undefined;
|
|
3638
|
+
}[] | undefined;
|
|
3639
|
+
knownBugs?: {
|
|
3640
|
+
id: string;
|
|
3641
|
+
summary: string;
|
|
3642
|
+
assertions: string[];
|
|
3643
|
+
}[] | undefined;
|
|
3644
|
+
quarantine?: {
|
|
3645
|
+
reason: string;
|
|
3646
|
+
since: string;
|
|
3647
|
+
owner: string;
|
|
3648
|
+
until?: string | undefined;
|
|
3649
|
+
} | undefined;
|
|
3650
|
+
};
|
|
3651
|
+
name: string;
|
|
3652
|
+
}>;
|
|
3653
|
+
/** A concrete, confidence-scored rebind proposed for one drifted step. */
|
|
3654
|
+
export interface HealProposal {
|
|
3655
|
+
/** 0-based step index in the flow. */
|
|
3656
|
+
step: number;
|
|
3657
|
+
/** Old (missing) testid anchor value. */
|
|
3658
|
+
from: string;
|
|
3659
|
+
/** Proposed nearest present testid. */
|
|
3660
|
+
to: string;
|
|
3661
|
+
/** Normalized (0,1]; >= HEAL_CONFIDENCE_MIN to be applicable. */
|
|
3662
|
+
confidence: number;
|
|
3663
|
+
}
|
|
3664
|
+
/** One applied rebind (a HealProposal that was written to disk). */
|
|
3665
|
+
export interface HealChange {
|
|
3666
|
+
step: number;
|
|
3667
|
+
from: string;
|
|
3668
|
+
to: string;
|
|
3669
|
+
}
|
|
3670
|
+
/** The reticle_flow_heal envelope. */
|
|
3671
|
+
export interface FlowHealResult {
|
|
3672
|
+
name: string;
|
|
3673
|
+
status: HealStatus;
|
|
3674
|
+
/** Whether the file was rewritten (true only when status === 'healed'). */
|
|
3675
|
+
applied: boolean;
|
|
3676
|
+
/** Confident, applicable rebinds. With apply:false these are the dry-run diff. */
|
|
3677
|
+
proposals: HealProposal[];
|
|
3678
|
+
/** Anchors actually written (empty unless applied). */
|
|
3679
|
+
changed: HealChange[];
|
|
3680
|
+
/** Human one-liner for the agent (e.g. "nothing to heal", floor explanation). */
|
|
3681
|
+
message: string;
|
|
3682
|
+
error?: {
|
|
3683
|
+
code: string;
|
|
3684
|
+
message: string;
|
|
3685
|
+
};
|
|
3686
|
+
}
|
|
3687
|
+
export type RecordedFlow = z.infer<typeof RecordedFlowSchema>;
|
|
3688
|
+
/**
|
|
3689
|
+
* One replayable-flow chip on the in-page HUD.
|
|
3690
|
+
*
|
|
3691
|
+
* Crosses the bridge: the daemon builds these from the flows on disk and pushes them with
|
|
3692
|
+
* `ReticleCommand.FLOWS`; the presenter panel renders one ▶ button per chip. It lived as two
|
|
3693
|
+
* identical `interface FlowChip` declarations — one in the server, one in the browser — which is the
|
|
3694
|
+
* shape that drifts silently, because nothing links the two and no test crosses the boundary.
|
|
3695
|
+
*
|
|
3696
|
+
* A TYPE and not a zod schema on purpose: the browser SDK ships into the user's app and carries no
|
|
3697
|
+
* zod, so the receiving side narrows the raw wire value by hand. The type is what both ends agree on.
|
|
3698
|
+
*/
|
|
3699
|
+
export interface FlowChip {
|
|
3700
|
+
name: string;
|
|
3701
|
+
/** The testid the flow's first step anchors to, when it has one — the panel hides chips that cannot start on the current page. */
|
|
3702
|
+
start?: string;
|
|
3703
|
+
}
|
|
3704
|
+
/** One recorded known bug, as stored on a flow. */
|
|
3705
|
+
export type KnownBug = NonNullable<FlowFile['knownBugs']>[number];
|
|
3706
|
+
/**
|
|
3707
|
+
* Known-bug notes that can no longer be believed.
|
|
3708
|
+
*
|
|
3709
|
+
* A note survives only while EVERY assertion it named is still present. Anything else — an
|
|
3710
|
+
* assertion renamed, removed, or a note that named none at all — is reported rather than trusted,
|
|
3711
|
+
* because the failure mode is silent and expensive: an old excuse attached to a new break reads as
|
|
3712
|
+
* "known issue" and nobody looks again.
|
|
3713
|
+
*
|
|
3714
|
+
* A note naming no assertions is always stale. It cannot be checked against anything, so it cannot
|
|
3715
|
+
* be relied on to explain anything.
|
|
3716
|
+
*/
|
|
3717
|
+
export declare function staleKnownBugs(notes: readonly KnownBug[] | undefined, currentAssertions: readonly string[]): KnownBug[];
|
|
3718
|
+
/** True when a FlowExpect asserts at least one consequence (any of the ConsequenceKind fields set). */
|
|
3719
|
+
export declare function flowExpectHasConsequence(expect: FlowExpect | undefined): boolean;
|
|
3720
|
+
/**
|
|
3721
|
+
* True when a FlowExpect checks ONLY presence — an element, rendered text or a route, no consequence.
|
|
3722
|
+
*
|
|
3723
|
+
* `text` counts here for the same reason `element` does, and leaving it out would have been the
|
|
3724
|
+
* expensive kind of omission: a text-only expect would have been neither a consequence nor
|
|
3725
|
+
* presence-only, so it would have fallen through to `assertion-free` — a permanent green wearing
|
|
3726
|
+
* an assertion (#811). `route` is here for exactly that reason and no other.
|
|
3727
|
+
*
|
|
3728
|
+
* PRESENCE rather than a consequence, deliberately, and it is a close call. A route change is
|
|
3729
|
+
* observed on a channel rather than queried from the DOM, so unlike `element` it cannot be
|
|
3730
|
+
* satisfied by a healed-but-wrong locator — an argument for promoting it. What settles it the other
|
|
3731
|
+
* way is that the LIVE verdict already grades a route assertion `presence`, and one of the two had
|
|
3732
|
+
* to follow the other: a flow that graded stronger on disk than the drive that produced it would be
|
|
3733
|
+
* a saved claim nobody made. Promoting both is a defensible change and a separate one, with the
|
|
3734
|
+
* false-green question — can the route commit while the view does not render? — answered first.
|
|
3735
|
+
*/
|
|
3736
|
+
export declare function flowExpectIsPresenceOnly(expect: FlowExpect | undefined): boolean;
|