@reticlehq/engine 3.1.0 → 3.3.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/disagreement/body-failures.js +32 -12
- package/dist/disagreement/contradiction-evidence.d.ts +1 -1
- package/dist/disagreement/contradiction-evidence.js +3 -3
- package/dist/disagreement/contradiction-types.d.ts +6 -0
- package/dist/disagreement/contradictions.js +101 -50
- package/dist/evidence/already-true.js +9 -2
- package/dist/evidence/baseline.d.ts +21 -0
- package/dist/evidence/baseline.js +129 -0
- package/dist/evidence/body-capture-remedy.js +6 -1
- package/dist/evidence/honesty.d.ts +10 -0
- package/dist/evidence/honesty.js +4 -0
- package/dist/evidence/verified.d.ts +7 -0
- package/dist/evidence/verified.js +35 -1
- package/dist/question/declared.js +2 -1
- package/dist/question/lineage.d.ts +14 -5
- package/dist/question/lineage.js +65 -10
- package/dist/question/predicate/body-key-fragment.d.ts +25 -0
- package/dist/question/predicate/body-key-fragment.js +57 -0
- package/dist/question/predicate/predicate-element.d.ts +3 -2
- package/dist/question/predicate/predicate-element.js +68 -3
- package/dist/question/predicate/predicate-eval-kit.d.ts +21 -0
- package/dist/question/predicate/predicate-eval-kit.js +28 -1
- package/dist/question/predicate/predicate-eval.d.ts +6 -0
- package/dist/question/predicate/predicate-eval.js +89 -26
- package/dist/question/predicate/predicate-precheck.d.ts +7 -0
- package/dist/question/predicate/predicate-precheck.js +81 -0
- package/dist/question/predicate/predicate-request-body.d.ts +1 -1
- package/dist/question/predicate/predicate-request-body.js +10 -19
- package/dist/question/predicate/predicate-route.d.ts +2 -1
- package/dist/question/predicate/predicate-schema.d.ts +12 -91
- package/dist/question/predicate/predicate-schema.js +15 -267
- package/dist/question/predicate/predicate-session.d.ts +15 -1
- package/dist/question/predicate/predicate-session.js +25 -1
- package/dist/question/predicate/predicate-state.d.ts +15 -0
- package/dist/question/predicate/predicate-state.js +317 -0
- package/dist/question/predicate/predicate.d.ts +17 -3
- package/dist/question/predicate/predicate.js +139 -328
- package/dist/question/predicate/property.d.ts +24 -73
- package/dist/question/predicate/property.js +134 -20
- package/dist/window/json-salvage.d.ts +2 -1
- package/dist/window/json-salvage.js +2 -1
- package/package.json +2 -2
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `state` predicate: everything that reads a registered store.
|
|
3
|
+
*
|
|
4
|
+
* Split out of `predicate.ts` when it crossed the file cap, and it is a cohesive unit on its own
|
|
5
|
+
* terms — one command (`STATE_READ`), one kind, and the whole scoped-vs-whole-store negotiation
|
|
6
|
+
* that exists because an older SDK ignores `path` and answers with the entire store. Nothing else
|
|
7
|
+
* in the predicate layer talks to that command.
|
|
8
|
+
*/
|
|
9
|
+
import { PredicateKind, ReticleCommand, capDepth, selectPath } from '@reticlehq/core';
|
|
10
|
+
import { matchValue } from './predicate-eval.js';
|
|
11
|
+
import { satisfiesProperty } from './property.js';
|
|
12
|
+
/** One name, or none — two candidates is a question, not an answer. */
|
|
13
|
+
function oneOf(names) {
|
|
14
|
+
return 1 === names.length ? names[0] : undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* `readState`'s truncation report, when the caps actually fired.
|
|
18
|
+
*
|
|
19
|
+
* Its PRESENCE is the warning — the field is omitted entirely on an intact read, which is what lets
|
|
20
|
+
* "the list is short" stay distinguishable from "I shortened the list".
|
|
21
|
+
*/
|
|
22
|
+
function truncationOf(result) {
|
|
23
|
+
if ('object' !== typeof result || null === result)
|
|
24
|
+
return undefined;
|
|
25
|
+
const report = result.truncation;
|
|
26
|
+
return 'object' === typeof report && null !== report
|
|
27
|
+
? report
|
|
28
|
+
: undefined;
|
|
29
|
+
}
|
|
30
|
+
/** A scoped `readState` reply, narrowed to the shape `selectPath` would have produced. */
|
|
31
|
+
function asSelection(result) {
|
|
32
|
+
if ('object' !== typeof result || null === result)
|
|
33
|
+
return undefined;
|
|
34
|
+
const record = result;
|
|
35
|
+
return 'boolean' === typeof record.found
|
|
36
|
+
? { found: record.found, value: record.value }
|
|
37
|
+
: undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A NAMED store needs no whole-store read. `reticle_state`'s scoped mode selects the path out of the
|
|
41
|
+
* RAW store IN-PAGE and returns only it, so the assertion resolves in one round trip against a payload
|
|
42
|
+
* the size of the value — not the store. The unnamed case below still needs the wide read, because
|
|
43
|
+
* that is how it discovers WHICH store carries the path; only the named branch changes.
|
|
44
|
+
*
|
|
45
|
+
* A scoped read answers `found: false` for both "no such store" and "no such path", so the two are
|
|
46
|
+
* kept distinct here using the `storeNames` list the reply always carries — otherwise the payload gets
|
|
47
|
+
* cheaper while the message gets worse.
|
|
48
|
+
*/
|
|
49
|
+
async function evalStateNamed(session, p, storeName, baseline) {
|
|
50
|
+
const scoped = await session.command(ReticleCommand.STATE_READ, {
|
|
51
|
+
store: storeName,
|
|
52
|
+
path: p.path,
|
|
53
|
+
});
|
|
54
|
+
if (!scoped.ok) {
|
|
55
|
+
return {
|
|
56
|
+
pass: false,
|
|
57
|
+
failureReason: 'state read failed',
|
|
58
|
+
observed: 'the store could not be read',
|
|
59
|
+
expected: 'a readable registered store',
|
|
60
|
+
assertion: 'state.unreadable',
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const reply = (scoped.result ?? {});
|
|
64
|
+
const names = Array.isArray(reply.storeNames) ? reply.storeNames : [];
|
|
65
|
+
// Resolve the value. A CURRENT SDK honours the scoped read and answers `{ found, value }` selected
|
|
66
|
+
// in-page — the whole point of this path. An OLDER SDK (version skew) or any transport that ignores
|
|
67
|
+
// `path` answers the whole-store shape `{ stores }`; walk the path server-side there so the verdict
|
|
68
|
+
// stays correct across SDK versions. The scoped win is simply unavailable on the old ones.
|
|
69
|
+
const scopedSel = asSelection(scoped.result);
|
|
70
|
+
const wholeStores = reply.stores;
|
|
71
|
+
const scopedKeys = Array.isArray(reply.availableKeys)
|
|
72
|
+
? reply.availableKeys
|
|
73
|
+
: undefined;
|
|
74
|
+
let selection;
|
|
75
|
+
if (scopedSel !== undefined) {
|
|
76
|
+
selection =
|
|
77
|
+
scopedKeys === undefined
|
|
78
|
+
? { found: scopedSel.found, value: scopedSel.value }
|
|
79
|
+
: { found: scopedSel.found, value: scopedSel.value, availableKeys: scopedKeys };
|
|
80
|
+
}
|
|
81
|
+
else if (wholeStores !== undefined) {
|
|
82
|
+
selection = selectPath(wholeStores[storeName], p.path);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
selection = { found: false };
|
|
86
|
+
}
|
|
87
|
+
// "no store named X" and "X has no such path" both surface as found:false; keep them distinct using
|
|
88
|
+
// the store list the reply carries, or the message regresses while the payload improves.
|
|
89
|
+
const storeAbsent = wholeStores !== undefined
|
|
90
|
+
? !(storeName in wholeStores)
|
|
91
|
+
: names.length > 0 && !names.includes(storeName);
|
|
92
|
+
if (!selection.found && storeAbsent) {
|
|
93
|
+
return {
|
|
94
|
+
pass: false,
|
|
95
|
+
failureReason: `no store named '${storeName}' is registered (${names.join(', ')})`,
|
|
96
|
+
observed: `store '${storeName}' is not registered`,
|
|
97
|
+
expected: `a registered store named '${storeName}'`,
|
|
98
|
+
assertion: 'state.store-missing',
|
|
99
|
+
evidence: { searchedStores: names },
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// A scoped sub-tree can itself be too big for the caps; a comparison against a value known to be
|
|
103
|
+
// incomplete is an unanswered question, not a failure. Same rule the whole-store path applies.
|
|
104
|
+
if (truncationOf(scoped.result) !== undefined) {
|
|
105
|
+
const reason = `state '${p.path}' could not be read intact — the transport caps truncated it, so the ` +
|
|
106
|
+
'value was never compared. Assert a narrower path, or a smaller field inside it';
|
|
107
|
+
return { pass: false, failureReason: reason, inconclusive: reason };
|
|
108
|
+
}
|
|
109
|
+
if (!selection.found) {
|
|
110
|
+
return {
|
|
111
|
+
pass: false,
|
|
112
|
+
failureReason: `state path '${p.path}' not found in store '${storeName}'`,
|
|
113
|
+
observed: `no path '${p.path}' in store '${storeName}'`,
|
|
114
|
+
expected: `store '${storeName}' to expose '${p.path}'`,
|
|
115
|
+
assertion: 'state.path-missing',
|
|
116
|
+
evidence: { availableKeys: selection.availableKeys },
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/*
|
|
120
|
+
* A PROPERTY assertion runs before equality and can stand alone.
|
|
121
|
+
*
|
|
122
|
+
* `satisfies` is what makes a generated value verifiable at all: its exact bytes differ every run
|
|
123
|
+
* and are right every time, so `equals` can only ever be wrong about it. Both may be supplied and
|
|
124
|
+
* then both must hold — `satisfies` narrows, it never excuses.
|
|
125
|
+
*/
|
|
126
|
+
if (p.satisfies !== undefined) {
|
|
127
|
+
const r = satisfiesProperty(selection.value, p.satisfies, baseline);
|
|
128
|
+
if (true === r.unevaluated) {
|
|
129
|
+
// Nothing was compared. `pass` stays false because nothing was proven, but a false nobody
|
|
130
|
+
// could have made true is not a defect in the app — it is a reading we failed to take.
|
|
131
|
+
return { pass: false, failureReason: r.because, inconclusive: r.because };
|
|
132
|
+
}
|
|
133
|
+
if (!r.ok) {
|
|
134
|
+
return {
|
|
135
|
+
pass: false,
|
|
136
|
+
failureReason: `state '${p.path}' ${r.because}`,
|
|
137
|
+
observed: `${p.path} = ${JSON.stringify(capDepth(selection.value, 0))}`,
|
|
138
|
+
expected: `${p.path} to satisfy ${p.satisfies.property}`,
|
|
139
|
+
assertion: `state.${p.satisfies.property}`,
|
|
140
|
+
evidence: { store: storeName, path: p.path, value: capDepth(selection.value, 1) },
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
if (p.equals === undefined) {
|
|
144
|
+
return {
|
|
145
|
+
pass: true,
|
|
146
|
+
evidence: {
|
|
147
|
+
store: storeName,
|
|
148
|
+
path: p.path,
|
|
149
|
+
value: capDepth(selection.value, 1),
|
|
150
|
+
satisfied: r.because,
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const want = p.equals === undefined ? '*' : p.equals;
|
|
156
|
+
if (matchValue(selection.value, want)) {
|
|
157
|
+
return {
|
|
158
|
+
pass: true,
|
|
159
|
+
evidence: { store: storeName, path: p.path, value: capDepth(selection.value, 1) },
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
pass: false,
|
|
164
|
+
failureReason: `state '${p.path}' is ${JSON.stringify(capDepth(selection.value, 0))}, expected ${JSON.stringify(want)}`,
|
|
165
|
+
observed: `${p.path} = ${JSON.stringify(capDepth(selection.value, 0))}`,
|
|
166
|
+
expected: `${p.path} = ${JSON.stringify(want)}`,
|
|
167
|
+
assertion: 'state.equals',
|
|
168
|
+
evidence: { store: storeName, path: p.path, value: capDepth(selection.value, 1) },
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
export async function evalState(session, p, baseline) {
|
|
172
|
+
// Named store: one scoped read, no whole-store payload (issue #336).
|
|
173
|
+
if (p.store !== undefined)
|
|
174
|
+
return await evalStateNamed(session, p, p.store, baseline);
|
|
175
|
+
const res = await session.command(ReticleCommand.STATE_READ, {});
|
|
176
|
+
if (!res.ok) {
|
|
177
|
+
return {
|
|
178
|
+
pass: false,
|
|
179
|
+
failureReason: 'state read failed',
|
|
180
|
+
observed: 'the store could not be read',
|
|
181
|
+
expected: 'a readable registered store',
|
|
182
|
+
assertion: 'state.unreadable',
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
const stores = (res.result ?? {}).stores ?? {};
|
|
186
|
+
const names = Object.keys(stores);
|
|
187
|
+
// Ambiguity is about the PATH, not the store count.
|
|
188
|
+
//
|
|
189
|
+
// Registering more than one store is normal — an app store, a query cache, and the render meter
|
|
190
|
+
// Reticle registers itself — and asking "which of these three?" when only one of them HAS the
|
|
191
|
+
// path is a question with one possible answer. It was costing a real verdict: a bench-app drive
|
|
192
|
+
// asserting `{path:'view'}` returned `unknown` while the same response body carried the matching
|
|
193
|
+
// `view` state diff. `unknown` is not a pass, so that is a verification that did not happen.
|
|
194
|
+
//
|
|
195
|
+
// So narrow to the stores that actually carry the path, and refuse only when THOSE collide.
|
|
196
|
+
const candidates = p.store === undefined ? names.filter((n) => selectPath(stores[n], p.path).found) : [];
|
|
197
|
+
const storeName = p.store ?? (1 === names.length ? names[0] : oneOf(candidates));
|
|
198
|
+
if (storeName === undefined) {
|
|
199
|
+
// With no store registered there is nothing to read, and with two stores that both carry the
|
|
200
|
+
// path there is no way to pick — neither is a finding about the app, no assertion was evaluated,
|
|
201
|
+
// so both are inconclusive rather than failed: an unevaluated predicate is never a failure.
|
|
202
|
+
//
|
|
203
|
+
// Zero candidates is the one case that is NOT a question: every registered store was searched
|
|
204
|
+
// and none exposes the path, so the assertion cannot hold anywhere. That is the same verdict a
|
|
205
|
+
// named store has always produced for a missing path, and it falls through to it below.
|
|
206
|
+
if (0 === names.length) {
|
|
207
|
+
const reason = 'no registered store to read state from';
|
|
208
|
+
return { pass: false, failureReason: reason, inconclusive: reason };
|
|
209
|
+
}
|
|
210
|
+
if (candidates.length > 1) {
|
|
211
|
+
// Names the stores that actually collide. Listing all of them made the reader weigh
|
|
212
|
+
// candidates that could never have matched.
|
|
213
|
+
const reason = `multiple stores (${candidates.join(', ')}) expose '${p.path}'; name one with \`store\``;
|
|
214
|
+
return { pass: false, failureReason: reason, inconclusive: reason };
|
|
215
|
+
}
|
|
216
|
+
return {
|
|
217
|
+
pass: false,
|
|
218
|
+
failureReason: `state path '${p.path}' not found in any registered store (${names.join(', ')})`,
|
|
219
|
+
observed: `no path '${p.path}' in ${names.join(', ')}`,
|
|
220
|
+
expected: `some registered store to expose '${p.path}'`,
|
|
221
|
+
assertion: 'state.path-missing',
|
|
222
|
+
evidence: { searchedStores: names },
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
let selection = selectPath(stores[storeName], p.path);
|
|
226
|
+
// The whole-store read walks into a value the transport caps may already have mangled.
|
|
227
|
+
//
|
|
228
|
+
// `readState` has a SCOPED mode that selects the path out of the RAW store before sanitising, added
|
|
229
|
+
// precisely so a large or deep path still resolves. This path was not using it, so a store with one
|
|
230
|
+
// big collection in it truncated the small value sitting beside it, and the comparison then ran
|
|
231
|
+
// against the literal string "[TRUNCATED]" and returned a confident `no`. Measured on the Atlas
|
|
232
|
+
// fixture: a one-element array reported as a failed assertion while the same payload's state diffs
|
|
233
|
+
// showed the assertion holding.
|
|
234
|
+
//
|
|
235
|
+
// Re-read only when a cap actually fired, so an intact read costs exactly what it did before.
|
|
236
|
+
if (truncationOf(res.result) !== undefined) {
|
|
237
|
+
const scoped = await session.command(ReticleCommand.STATE_READ, {
|
|
238
|
+
store: storeName,
|
|
239
|
+
path: p.path,
|
|
240
|
+
});
|
|
241
|
+
const result = scoped.ok ? scoped.result : undefined;
|
|
242
|
+
const scopedTruncation = truncationOf(result);
|
|
243
|
+
if (scopedTruncation !== undefined) {
|
|
244
|
+
// Even the raw sub-tree was too big. Nothing here knows what the value IS, so nothing here can
|
|
245
|
+
// say the assertion failed — that would be an accusation the evidence does not support.
|
|
246
|
+
const reason = `state '${p.path}' could not be read intact — the transport caps truncated it, so the ` +
|
|
247
|
+
'value was never compared. Assert a narrower path, or a smaller field inside it';
|
|
248
|
+
return { pass: false, failureReason: reason, inconclusive: reason };
|
|
249
|
+
}
|
|
250
|
+
if (result !== undefined) {
|
|
251
|
+
const scopedSelection = asSelection(result);
|
|
252
|
+
if (scopedSelection !== undefined)
|
|
253
|
+
selection = scopedSelection;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (!selection.found) {
|
|
257
|
+
return {
|
|
258
|
+
pass: false,
|
|
259
|
+
failureReason: `state path '${p.path}' not found in store '${storeName}'`,
|
|
260
|
+
observed: `no path '${p.path}' in store '${storeName}'`,
|
|
261
|
+
expected: `store '${storeName}' to expose '${p.path}'`,
|
|
262
|
+
assertion: 'state.path-missing',
|
|
263
|
+
evidence: { availableKeys: selection.availableKeys },
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
/*
|
|
267
|
+
* A PROPERTY assertion runs before equality and can stand alone.
|
|
268
|
+
*
|
|
269
|
+
* `satisfies` is what makes a generated value verifiable at all: its exact bytes differ every run
|
|
270
|
+
* and are right every time, so `equals` can only ever be wrong about it. Both may be supplied and
|
|
271
|
+
* then both must hold — `satisfies` narrows, it never excuses.
|
|
272
|
+
*/
|
|
273
|
+
if (p.satisfies !== undefined) {
|
|
274
|
+
const r = satisfiesProperty(selection.value, p.satisfies, baseline);
|
|
275
|
+
if (true === r.unevaluated) {
|
|
276
|
+
// Nothing was compared. `pass` stays false because nothing was proven, but a false nobody
|
|
277
|
+
// could have made true is not a defect in the app — it is a reading we failed to take.
|
|
278
|
+
return { pass: false, failureReason: r.because, inconclusive: r.because };
|
|
279
|
+
}
|
|
280
|
+
if (!r.ok) {
|
|
281
|
+
return {
|
|
282
|
+
pass: false,
|
|
283
|
+
failureReason: `state '${p.path}' ${r.because}`,
|
|
284
|
+
observed: `${p.path} = ${JSON.stringify(capDepth(selection.value, 0))}`,
|
|
285
|
+
expected: `${p.path} to satisfy ${p.satisfies.property}`,
|
|
286
|
+
assertion: `state.${p.satisfies.property}`,
|
|
287
|
+
evidence: { store: storeName, path: p.path, value: capDepth(selection.value, 1) },
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
if (p.equals === undefined) {
|
|
291
|
+
return {
|
|
292
|
+
pass: true,
|
|
293
|
+
evidence: {
|
|
294
|
+
store: storeName,
|
|
295
|
+
path: p.path,
|
|
296
|
+
value: capDepth(selection.value, 1),
|
|
297
|
+
satisfied: r.because,
|
|
298
|
+
},
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
const want = p.equals === undefined ? '*' : p.equals;
|
|
303
|
+
if (matchValue(selection.value, want)) {
|
|
304
|
+
return {
|
|
305
|
+
pass: true,
|
|
306
|
+
evidence: { store: storeName, path: p.path, value: capDepth(selection.value, 1) },
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
return {
|
|
310
|
+
pass: false,
|
|
311
|
+
failureReason: `state '${p.path}' is ${JSON.stringify(capDepth(selection.value, 0))}, expected ${JSON.stringify(want)}`,
|
|
312
|
+
observed: `${p.path} = ${JSON.stringify(capDepth(selection.value, 0))}`,
|
|
313
|
+
expected: `${p.path} = ${JSON.stringify(want)}`,
|
|
314
|
+
assertion: 'state.equals',
|
|
315
|
+
evidence: { store: storeName, path: p.path, value: capDepth(selection.value, 1) },
|
|
316
|
+
};
|
|
317
|
+
}
|
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
import { PredicateKind } from '@reticlehq/core';
|
|
2
|
+
import type { Baseline } from './property.js';
|
|
3
|
+
/** Pre-action readings, keyed by the leaf predicate that needs one. See `evaluatePredicate`. */
|
|
4
|
+
export type Baselines = ReadonlyMap<Predicate, Baseline>;
|
|
2
5
|
import type { ExpectedLink } from '@reticlehq/core';
|
|
3
6
|
import { PredicateSchema, type Predicate, type EvalResult } from './predicate-eval.js';
|
|
4
7
|
export { PredicateSchema, PredicateKind };
|
|
5
8
|
export type { Predicate, EvalResult };
|
|
6
|
-
import type
|
|
9
|
+
import { type PredicateSession } from './predicate-session.js';
|
|
7
10
|
export type { PredicateSession } from './predicate-session.js';
|
|
8
|
-
export declare function evaluatePredicate(session: PredicateSession, predicate: Predicate, since?: number, diagnose?: boolean
|
|
11
|
+
export declare function evaluatePredicate(session: PredicateSession, predicate: Predicate, since?: number, diagnose?: boolean,
|
|
12
|
+
/**
|
|
13
|
+
* The readings taken BEFORE the action, keyed by the leaf that asked for one.
|
|
14
|
+
*
|
|
15
|
+
* Only the relative properties (`changed`/`unchanged`/`increased`/`decreased`) look at it, and a
|
|
16
|
+
* leaf with none evaluates as `inconclusive` rather than false — nothing was compared, so a
|
|
17
|
+
* `false` would blame the app for a reading nobody took. Keyed by the predicate OBJECT because
|
|
18
|
+
* the same parsed tree is evaluated before and after, so identity is exact and needs no path.
|
|
19
|
+
*/
|
|
20
|
+
baselines?: Baselines): Promise<EvalResult>;
|
|
9
21
|
/**
|
|
10
22
|
* Evaluate now, else wait for it to become true (on each event + a poll) until timeout. `since` is
|
|
11
23
|
* the event-time floor (see evaluatePredicate) so a waiter cannot resolve on a stale buffered event.
|
|
12
24
|
*/
|
|
13
|
-
export declare function waitForPredicate(session: PredicateSession, predicate: Predicate, timeoutMs: number, since?: number
|
|
25
|
+
export declare function waitForPredicate(session: PredicateSession, predicate: Predicate, timeoutMs: number, since?: number,
|
|
26
|
+
/** Pre-action readings, for the relative properties. See `evaluatePredicate`. */
|
|
27
|
+
baselines?: Baselines): Promise<EvalResult>;
|
|
14
28
|
/**
|
|
15
29
|
* The ExpectedLinks a GREEN verdict actually PROVED — not merely the ones it declared. Identical to
|
|
16
30
|
* predicateToExpectedLinks except for `anyOf`: an OR greens on a SINGLE branch, so only the branch that
|