@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
package/dist/tour.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The onboarding tour, once, for both surfaces that show it.
|
|
3
|
+
*
|
|
4
|
+
* The CLI prints it at the end of `reticle setup install`; the browser SDK renders it as a carousel
|
|
5
|
+
* over the user's own running app, beside the HUD. Those are two audiences in two media, and the
|
|
6
|
+
* rule that governs them is the one `tutorial.ts` already stated about its own two audiences: what
|
|
7
|
+
* they MUST share is the order and the claims, because two routes through one product is how a
|
|
8
|
+
* support answer stops matching what anybody actually did.
|
|
9
|
+
*
|
|
10
|
+
* So the steps live here, in the package both ends already depend on, and neither renderer owns
|
|
11
|
+
* them. `@reticlehq/server` cannot be imported by the browser and `@reticlehq/browser` cannot be
|
|
12
|
+
* imported by the server; core is the only place a shared sentence can sit without inventing an
|
|
13
|
+
* edge between them.
|
|
14
|
+
*
|
|
15
|
+
* The sequence is not arbitrary. It ends at a VERDICT because a tour that ends at "you can see the
|
|
16
|
+
* page now" has taught the least valuable half: looking is not verifying, and an agent that learns
|
|
17
|
+
* only to look will report that it looked. And it declares the consequence BEFORE acting, because
|
|
18
|
+
* that ordering IS the idea being taught — naming what should happen first is the difference
|
|
19
|
+
* between a check and a rationalisation written afterwards.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* What a slide points at when the tour is drawn over a real page.
|
|
23
|
+
*
|
|
24
|
+
* The HUD is addressable because Reticle put it there, and so is every control inside it. The APP is
|
|
25
|
+
* addressable only as a WHOLE — "here is the thing being snapshotted" — which needs a region, not a
|
|
26
|
+
* control. The line is about authorship rather than size: a tour may ring any control it rendered
|
|
27
|
+
* itself, and may never ring a button in the app, because that would be a guess about unseen markup.
|
|
28
|
+
*
|
|
29
|
+
* It matters that the tour points at the app at least once. The pitch is verifying YOUR RUNNING
|
|
30
|
+
* APP from the inside, and a tour drawn entirely over a dimmed page reads as a modal that happens
|
|
31
|
+
* to sit on top of one.
|
|
32
|
+
*/
|
|
33
|
+
export const TourAnchor = {
|
|
34
|
+
/** No target: the slide is prose, centred. */
|
|
35
|
+
NONE: 'none',
|
|
36
|
+
/** Reticle's own in-page HUD. */
|
|
37
|
+
HUD: 'hud',
|
|
38
|
+
/** The app's own content region — `<main>`, else the framework's mount node. */
|
|
39
|
+
APP: 'app',
|
|
40
|
+
/** One control in the HUD's toolbar. Ours, so naming it is not a guess. */
|
|
41
|
+
HUD_CHAT: 'hud-chat',
|
|
42
|
+
HUD_ANNOTATE: 'hud-annotate',
|
|
43
|
+
HUD_IMPACT: 'hud-impact',
|
|
44
|
+
HUD_SETTINGS: 'hud-settings',
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* The prompts the last slide hands over.
|
|
48
|
+
*
|
|
49
|
+
* A tour that ends with "now go and try it" ends at the point where somebody has to invent the
|
|
50
|
+
* next move themselves, which is where they stop. These are the moves, written out, ready to paste
|
|
51
|
+
* into whichever agent they use.
|
|
52
|
+
*
|
|
53
|
+
* THREE rather than one, and short rather than thorough. The single prompt this replaced was a
|
|
54
|
+
* paragraph that named a verdict as the finish line — correct, and not a sentence anybody types
|
|
55
|
+
* twice. What people actually send an agent is one line, so a handoff written in a register they
|
|
56
|
+
* will never reuse teaches the register as much as the task. Each of these is a line somebody
|
|
57
|
+
* would plausibly type on their own the second time, which is the only version of this slide that
|
|
58
|
+
* survives contact with the week after the install.
|
|
59
|
+
*
|
|
60
|
+
* Every one of them names something the product does: driving one flow to a verdict, the `/reticle`
|
|
61
|
+
* command `init` writes into the project, and the autonomous crawl. The flows they name — login,
|
|
62
|
+
* checkout — are examples of the SHAPE, since this tour runs over an unknown app; the
|
|
63
|
+
* capability behind each is real, which is the part a tour must not get wrong.
|
|
64
|
+
*/
|
|
65
|
+
export const TOUR_HANDOFF_PROMPTS = [
|
|
66
|
+
{
|
|
67
|
+
label: 'Verify one flow',
|
|
68
|
+
text: 'verify the login flow with Reticle, and tell me the verdict',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: 'Check what is proved',
|
|
72
|
+
text: '/reticle',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: 'Let it loose',
|
|
76
|
+
text: 'monkey-test the checkout flow with Reticle and tell me what breaks',
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
export const TOUR_STEPS = [
|
|
80
|
+
{
|
|
81
|
+
id: 'connect',
|
|
82
|
+
title: 'Yayyy! It is connected',
|
|
83
|
+
// The ring points at the HUD, so the prose has to make the HUD the evidence: it is mounted only
|
|
84
|
+
// on a connected session and never appears without one. Naming the call's output as the proof
|
|
85
|
+
// instead sends a reader to the panel for a claim the panel does not make.
|
|
86
|
+
say: 'That panel is Reticle. Seeing it is your proof the SDK is connected to your app.',
|
|
87
|
+
why: 'It only mounts on a connected session, so it cannot show up without one. Having the tools is not the same as being set up.',
|
|
88
|
+
// The merged surface has no `reticle_sessions`. It answers -32602 and names the replacement, so
|
|
89
|
+
// a reader who pasted the old name lost a round trip to a tour that was teaching a dead call.
|
|
90
|
+
call: 'reticle_session { action: "list" }',
|
|
91
|
+
anchor: TourAnchor.HUD,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: 'look',
|
|
95
|
+
title: 'Look, without pixels',
|
|
96
|
+
say: 'Take a semantic snapshot. You get the controls and their refs, not pixels, so you can point at things by name.',
|
|
97
|
+
why: 'A ref is stable across snapshots, which is what lets you plan several steps before spending any of them.',
|
|
98
|
+
// Likewise merged: `reticle_snapshot` is now `reticle_look { action: "page" }`.
|
|
99
|
+
call: 'reticle_look { action: "page" }',
|
|
100
|
+
// The one slide that points at the app itself, and the only one where that is the subject: a
|
|
101
|
+
// snapshot is OF this region. Without it the tour never once directs attention at the thing it
|
|
102
|
+
// spends five slides talking about.
|
|
103
|
+
anchor: TourAnchor.APP,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: 'declare',
|
|
107
|
+
title: 'Say it first',
|
|
108
|
+
say: 'Decide what should happen BEFORE you touch anything. "Clicking Pay makes the receipt appear" is a claim that can be wrong.',
|
|
109
|
+
why: 'This is the whole idea. A consequence named first is a check; the same sentence written after the fact is a rationalisation, and it is the difference between a verdict and a story.',
|
|
110
|
+
// Every other slide's block is something you can run; this one was a comment — a placeholder on
|
|
111
|
+
// the most important screen in the tour. It now shows the distinction it is teaching, because
|
|
112
|
+
// "name the consequence" means nothing until you see one next to a wait that proves nothing.
|
|
113
|
+
call: 'until: { signal: "order:placed" } // a consequence — not until: { ms: 500 }',
|
|
114
|
+
anchor: TourAnchor.NONE,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: 'verdict',
|
|
118
|
+
title: 'Act, and prove it',
|
|
119
|
+
say: 'Act and prove in one call. The answer says verified yes / no / unknown, and `because` names the evidence that decided it.',
|
|
120
|
+
why: 'Only `reticle_act_and_wait` and `reticle_assert` produce a verdict. A drive that ends without one has no result, however many tools it used — and "unknown" is an honest answer, not a pass.',
|
|
121
|
+
call: 'reticle_act_and_wait { ref, action: "click", until: { signal: "order:placed" } }',
|
|
122
|
+
anchor: TourAnchor.HUD,
|
|
123
|
+
},
|
|
124
|
+
];
|
|
125
|
+
/**
|
|
126
|
+
* The HUD's own controls, one card each, in the order somebody meets them.
|
|
127
|
+
*
|
|
128
|
+
* Browser-only. The CLI renders the shared steps into a terminal, where "click the Impact button" is
|
|
129
|
+
* an instruction nobody can follow, so a card about a control in a panel cannot sit in the list both
|
|
130
|
+
* surfaces print. The same reasoning already keeps the handoff out of `TOUR_STEPS`.
|
|
131
|
+
*
|
|
132
|
+
* They carry no `why`. A terminal step needs one because it has nothing beside it; these have a ring
|
|
133
|
+
* on the button they describe and an invitation to press it, and a second paragraph explaining a
|
|
134
|
+
* button somebody is about to click is the kind of text people stop reading tours over.
|
|
135
|
+
*/
|
|
136
|
+
export const TOUR_HUD_STEPS = [
|
|
137
|
+
{
|
|
138
|
+
id: 'hud-chat',
|
|
139
|
+
title: 'Activity Panel',
|
|
140
|
+
say: 'Watch what your agent is doing in your app, as it happens.',
|
|
141
|
+
anchor: TourAnchor.HUD_CHAT,
|
|
142
|
+
tryIt: 'Open it.',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: 'hud-annotate',
|
|
146
|
+
title: 'Annotate',
|
|
147
|
+
say: 'Click anywhere in your app to drop a numbered pin with a note. Hand the pins to your agent and it fixes them.',
|
|
148
|
+
anchor: TourAnchor.HUD_ANNOTATE,
|
|
149
|
+
tryIt: 'Turn it on, then click something in your app.',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: 'hud-impact',
|
|
153
|
+
title: "What's the impact?",
|
|
154
|
+
say: 'Everything Reticle has done here. Every bug it caught, every metric.',
|
|
155
|
+
anchor: TourAnchor.HUD_IMPACT,
|
|
156
|
+
tryIt: 'Take a look.',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: 'hud-settings',
|
|
160
|
+
title: 'Make it yours',
|
|
161
|
+
say: 'Change how Reticle looks and behaves.',
|
|
162
|
+
anchor: TourAnchor.HUD_SETTINGS,
|
|
163
|
+
tryIt: 'Open it.',
|
|
164
|
+
},
|
|
165
|
+
];
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { FlowExpect } from './flow-types.js';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
2
|
+
* A verification "kind" is either a CONSEQUENCE — the app provably did something that a locator
|
|
3
|
+
* healed to the WRONG element, or a stale render, cannot fake — or a mere PRESENCE check, which such
|
|
4
|
+
* a wrong locator CAN still satisfy. The classification decides when "green" actually means the
|
|
5
|
+
* feature worked.
|
|
6
|
+
*
|
|
7
|
+
* The vocabulary lives here because three separate graders depend on it (flow classification, ad-hoc
|
|
8
|
+
* assert grading, flow-success compilation), and a contributor must not be able to strengthen one and
|
|
9
|
+
* silently leave the others weaker.
|
|
9
10
|
*/
|
|
10
11
|
/** Kinds whose satisfaction proves an observable outcome — a wrong/healed element cannot fake them. */
|
|
11
12
|
export declare const ConsequenceKind: {
|
|
@@ -47,11 +48,34 @@ export declare const PredicateKind: {
|
|
|
47
48
|
readonly NOT: "not";
|
|
48
49
|
};
|
|
49
50
|
export type PredicateKind = (typeof PredicateKind)[keyof typeof PredicateKind];
|
|
51
|
+
export declare const CONSEQUENCE_KINDS: ReadonlySet<string>;
|
|
50
52
|
/** True when `kind` (a predicate/expect kind) asserts a consequence (signal/net/state). */
|
|
51
53
|
export declare function isConsequenceKind(kind: string): boolean;
|
|
52
54
|
/** True when `kind` is a weak presence check (element/text). */
|
|
53
55
|
export declare function isPresenceKind(kind: string): boolean;
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
/**
|
|
57
|
+
* One thing an app can be shown to have done, named in a way both sides agree on.
|
|
58
|
+
*
|
|
59
|
+
* Two separate parts of Reticle need this exact shape. The rules that decide a verdict produce it
|
|
60
|
+
* when they read a declared consequence; the part that explains a red verdict walks it, step by
|
|
61
|
+
* step, to say which link in the chain broke. Neither one owns it, so it lives here with the rest of
|
|
62
|
+
* the shared vocabulary, and neither has to reach into the other to say the same thing.
|
|
63
|
+
*
|
|
64
|
+
* It is exactly `ConsequenceKind` spelled out, so the two can never drift apart.
|
|
65
|
+
*
|
|
66
|
+
* Examples:
|
|
67
|
+
* { kind: ConsequenceKind.SIGNAL, name: 'cart:updated' }
|
|
68
|
+
* { kind: ConsequenceKind.NET, urlContains: '/api/save', status: 200 }
|
|
69
|
+
* { kind: ConsequenceKind.STATE, name: 'cart.items' }
|
|
70
|
+
*/
|
|
71
|
+
export type ExpectedLink = {
|
|
72
|
+
kind: typeof ConsequenceKind.SIGNAL;
|
|
73
|
+
name: string;
|
|
74
|
+
} | {
|
|
75
|
+
kind: typeof ConsequenceKind.NET;
|
|
76
|
+
urlContains: string;
|
|
77
|
+
status?: number;
|
|
78
|
+
} | {
|
|
79
|
+
kind: typeof ConsequenceKind.STATE;
|
|
80
|
+
name: string;
|
|
81
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
2
|
+
* A verification "kind" is either a CONSEQUENCE — the app provably did something that a locator
|
|
3
|
+
* healed to the WRONG element, or a stale render, cannot fake — or a mere PRESENCE check, which such
|
|
4
|
+
* a wrong locator CAN still satisfy. The classification decides when "green" actually means the
|
|
5
|
+
* feature worked.
|
|
6
|
+
*
|
|
7
|
+
* The vocabulary lives here because three separate graders depend on it (flow classification, ad-hoc
|
|
8
|
+
* assert grading, flow-success compilation), and a contributor must not be able to strengthen one and
|
|
9
|
+
* silently leave the others weaker.
|
|
8
10
|
*/
|
|
9
11
|
/** Kinds whose satisfaction proves an observable outcome — a wrong/healed element cannot fake them. */
|
|
10
12
|
export const ConsequenceKind = {
|
|
@@ -43,7 +45,7 @@ export const PredicateKind = {
|
|
|
43
45
|
ANY_OF: 'anyOf',
|
|
44
46
|
NOT: 'not',
|
|
45
47
|
};
|
|
46
|
-
const CONSEQUENCE_KINDS = new Set(Object.values(ConsequenceKind));
|
|
48
|
+
export const CONSEQUENCE_KINDS = new Set(Object.values(ConsequenceKind));
|
|
47
49
|
const PRESENCE_KINDS = new Set(Object.values(PresenceKind));
|
|
48
50
|
/** True when `kind` (a predicate/expect kind) asserts a consequence (signal/net/state). */
|
|
49
51
|
export function isConsequenceKind(kind) {
|
|
@@ -53,18 +55,3 @@ export function isConsequenceKind(kind) {
|
|
|
53
55
|
export function isPresenceKind(kind) {
|
|
54
56
|
return PRESENCE_KINDS.has(kind);
|
|
55
57
|
}
|
|
56
|
-
/** True when a FlowExpect asserts at least one consequence (any of the ConsequenceKind fields set). */
|
|
57
|
-
export function flowExpectHasConsequence(expect) {
|
|
58
|
-
if (expect === undefined)
|
|
59
|
-
return false;
|
|
60
|
-
const fields = expect;
|
|
61
|
-
for (const kind of CONSEQUENCE_KINDS) {
|
|
62
|
-
if (fields[kind] !== undefined)
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
/** True when a FlowExpect checks ONLY element presence — no consequence field is set. */
|
|
68
|
-
export function flowExpectIsPresenceOnly(expect) {
|
|
69
|
-
return expect !== undefined && expect.element !== undefined && !flowExpectHasConsequence(expect);
|
|
70
|
-
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* The hash travels in `bug_found`; the inputs (route, selector) never do. Same pattern as
|
|
6
6
|
* `projectId`: hash the identifying bits, send only the hash, let the analytics side group by it.
|
|
7
7
|
*/
|
|
8
|
-
import { fnv1a } from '
|
|
8
|
+
import { fnv1a } from '../identity/contract-fingerprint.js';
|
|
9
9
|
/**
|
|
10
10
|
* Produce a short hex fingerprint that identifies a finding stably across sessions.
|
|
11
11
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What a verification can FIND — the vocabulary of faults and contradictions shared by the crawl,
|
|
3
|
-
* the contradiction hunter and the tools that report them.
|
|
4
|
-
* file under the size cap.
|
|
3
|
+
* the contradiction hunter and the tools that report them.
|
|
5
4
|
*/
|
|
5
|
+
import { ChannelId } from '../wire/channel.js';
|
|
6
6
|
/**
|
|
7
7
|
* Cross-channel contradictions: two observation channels making INCOMPATIBLE claims about the same
|
|
8
8
|
* action. This is the bug class a human structurally cannot see, because a human has one channel
|
|
@@ -13,6 +13,27 @@
|
|
|
13
13
|
* and the app is wrong. Contrast `CrawlAnomalyKind`, whose members are all SINGLE-channel facts (an
|
|
14
14
|
* error was logged; a request failed) — those are findable by reading one stream.
|
|
15
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* Two channels disagreeing about the same action — the shape every rule reports.
|
|
18
|
+
*
|
|
19
|
+
* Lives here, beside the kinds, because it is part of the artifact contract: a replayed step and a
|
|
20
|
+
* driven one both carry these, and a shape declared twice is a shape that drifts.
|
|
21
|
+
*
|
|
22
|
+
* `kind` is typed `string`, not `ContradictionKind`, because the vocabulary is open at the EDGE. The
|
|
23
|
+
* enum below enumerates what the engine's own rules emit and every one of those is still checked
|
|
24
|
+
* against it; a rule registered by a consumer emits kinds this package has never heard of and must
|
|
25
|
+
* not have to be added here to be reportable. A shared closed enum is exactly how a consumer's
|
|
26
|
+
* private vocabulary ends up shipped in the free product by accident.
|
|
27
|
+
*/
|
|
28
|
+
export interface Contradiction {
|
|
29
|
+
kind: string;
|
|
30
|
+
/** What one channel asserted — the optimistic half. */
|
|
31
|
+
claim: string;
|
|
32
|
+
/** What the other channel asserted — the half that contradicts it. */
|
|
33
|
+
counter: string;
|
|
34
|
+
/** Concrete evidence, so the agent can go straight to the call or the control. */
|
|
35
|
+
detail: string;
|
|
36
|
+
}
|
|
16
37
|
export declare const ContradictionKind: {
|
|
17
38
|
/** The screen moved forward while a request in the same window failed — the swallowed rejection. */
|
|
18
39
|
readonly UI_ADVANCED_REQUEST_FAILED: "ui-advanced-request-failed";
|
|
@@ -29,7 +50,7 @@ export declare const ContradictionKind: {
|
|
|
29
50
|
* "dispatched but the app did NOTHING (no DOM/net/route/signal)", so firing a signal was enough to
|
|
30
51
|
* rescue a control that did nothing at all. That is the hole. An app whose signal is emitted from
|
|
31
52
|
* the value it was ASKED for rather than the one it COMMITTED gets a verdict at signal grade —
|
|
32
|
-
* the strongest
|
|
53
|
+
* the strongest grade there is — for a click that changed nothing. On the bench fixture: a
|
|
33
54
|
* modal that never opened came back `verified: "yes" / proved`.
|
|
34
55
|
*
|
|
35
56
|
* Absence-derived on purpose (see below). "Nothing corroborated it" is not "it did not happen":
|
|
@@ -37,6 +58,20 @@ export declare const ContradictionKind: {
|
|
|
37
58
|
* so the false green cannot stand, without asserting a fault nobody proved.
|
|
38
59
|
*/
|
|
39
60
|
readonly SIGNAL_WITHOUT_CONSEQUENCE: "signal-without-consequence";
|
|
61
|
+
/**
|
|
62
|
+
* The store committed and the screen never moved.
|
|
63
|
+
*
|
|
64
|
+
* `response-ignored` covers *a write succeeded and nothing moved*; `action-had-no-effect` covers
|
|
65
|
+
* *the click did nothing at all*. Neither covers the commonest render defect there is: state
|
|
66
|
+
* commits and the component that should have re-rendered does not — a memo with a stale
|
|
67
|
+
* comparator, a key that never changes, a selector reading the wrong slice. The app is internally
|
|
68
|
+
* consistent and the user is looking at the old value.
|
|
69
|
+
*
|
|
70
|
+
* Absence-derived, for the same reason as the entry above: a store holds plenty that was never
|
|
71
|
+
* meant to paint — an analytics flag, a timer, a cached token — so "nothing rendered" is not proof
|
|
72
|
+
* of a fault. It removes the false green and never invents a NO.
|
|
73
|
+
*/
|
|
74
|
+
readonly STATE_VS_RENDER: "state-vs-render";
|
|
40
75
|
/**
|
|
41
76
|
* A write succeeded on the server and nothing moved in THIS document — because the page opened
|
|
42
77
|
* another browsing context (an OAuth popup is the archetype) and the consequence lives there,
|
|
@@ -46,6 +81,18 @@ export declare const ContradictionKind: {
|
|
|
46
81
|
readonly CONSEQUENCE_ELSEWHERE: "consequence-elsewhere";
|
|
47
82
|
/** The same write fired more than once in one action — double-submit / retry storm. */
|
|
48
83
|
readonly DUPLICATE_REQUEST: "duplicate-request";
|
|
84
|
+
/**
|
|
85
|
+
* The same write fired repeatedly on an endpoint the assertion never named.
|
|
86
|
+
*
|
|
87
|
+
* A poll that bursts, a batched analytics beacon, a retry loop the caller was not asking about.
|
|
88
|
+
* The finding is real and worth reporting; what it is NOT is evidence about the consequence the
|
|
89
|
+
* caller declared. An app that polls could not produce a verdict at all -- every assertion that
|
|
90
|
+
* had already seen its consequence came back `unknown` behind writes it never mentioned (#673).
|
|
91
|
+
*
|
|
92
|
+
* ADVISORY, so it rides out in `contradictions` and decides nothing. `DUPLICATE_REQUEST` proper
|
|
93
|
+
* -- a burst on an endpoint the assertion DID name -- keeps its downgrade.
|
|
94
|
+
*/
|
|
95
|
+
readonly DUPLICATE_REQUEST_UNRELATED: "duplicate-request-unrelated";
|
|
49
96
|
/**
|
|
50
97
|
* Two reads of the same endpoint were in flight together and settled OUT OF ORDER, so the one the
|
|
51
98
|
* user asked for first is the one that landed last — and the screen is showing it.
|
|
@@ -84,7 +131,7 @@ export declare const ContradictionKind: {
|
|
|
84
131
|
* PATCH honouring a subset, an enum falling back to a default. The status is 2xx, the body reports
|
|
85
132
|
* no failure, the UI advanced, the page settled — so every channel except the payload agrees the
|
|
86
133
|
* save worked, and the screen goes on showing the value the user typed rather than the value that
|
|
87
|
-
* was stored
|
|
134
|
+
* was stored — a write asking for `locale: fr` and echoing `locale: en`.
|
|
88
135
|
*/
|
|
89
136
|
readonly WRITE_FIELD_IGNORED: "write-field-ignored";
|
|
90
137
|
/** The UI advanced while a request was still in flight, so `settled` was reported over a live call. */
|
|
@@ -103,9 +150,8 @@ export declare const ContradictionKind: {
|
|
|
103
150
|
* `dispatched: true, settled: true`, and every observation channel reports an empty window. The
|
|
104
151
|
* settle half is the trap — a page that does nothing is quiet, and quiet is exactly what `settled`
|
|
105
152
|
* tests for, so `until: { kind: 'settled' }` PASSES on a dead click and the verdict read
|
|
106
|
-
* `verified: "yes", because: "no channel disagreeing"`.
|
|
107
|
-
*
|
|
108
|
-
* beside it: zero events, store unchanged, green verdict.
|
|
153
|
+
* `verified: "yes", because: "no channel disagreeing"`. The shape that produces it: a `by: 'text'`
|
|
154
|
+
* query resolves a `styled.div` instead of the button beside it, and the click lands on nothing.
|
|
109
155
|
*/
|
|
110
156
|
readonly ACTION_HAD_NO_EFFECT: "action-had-no-effect";
|
|
111
157
|
/**
|
|
@@ -113,24 +159,40 @@ export declare const ContradictionKind: {
|
|
|
113
159
|
* The URL says you arrived somewhere; the page is blank.
|
|
114
160
|
*
|
|
115
161
|
* This is the class every "did the control work" heuristic misses, because the control DID work:
|
|
116
|
-
* it navigated.
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* is REVEALED from DOM that already existed emits `route.change` + `dom.attr` and nothing else,
|
|
129
|
-
* which is byte-for-byte the window a blank destination emits. No event-only rule separates them.
|
|
130
|
-
* Over-warning is the safe direction here (a false alarm costs a glance; a blank page shipped as
|
|
131
|
-
* working does not), so it is reported with that ceiling stated rather than tuned into silence.
|
|
162
|
+
* it navigated. A crawler counting dead controls reports none, correctly by its own definition,
|
|
163
|
+
* since a route change IS activity.
|
|
164
|
+
*
|
|
165
|
+
* The discriminator: a working nav emits `domAdded: 1, network: 2`; a blank one emits
|
|
166
|
+
* `domAdded: 0, domRemoved: 0, network: 0`. A real transition either fetches something or renders
|
|
167
|
+
* something.
|
|
168
|
+
*
|
|
169
|
+
* THE LIMIT IS REAL, and is not fixable by tuning: a route whose view is REVEALED from DOM that
|
|
170
|
+
* already existed emits `route.change` + `dom.attr` and nothing else, which is byte-for-byte the
|
|
171
|
+
* window a blank destination emits. No event-only rule separates them. Over-warning is the safe
|
|
172
|
+
* direction (a false alarm costs a glance; a blank page shipped as working does not), so this is
|
|
173
|
+
* reported with the ceiling stated rather than tuned into silence.
|
|
132
174
|
*/
|
|
133
175
|
readonly ROUTE_RENDERED_NOTHING: "route-rendered-nothing";
|
|
176
|
+
/**
|
|
177
|
+
* The route changed, nothing was rendered for it, AND the window holds a console error — the same
|
|
178
|
+
* shape as `ROUTE_RENDERED_NOTHING`, but with positive evidence of WHY the destination is blank,
|
|
179
|
+
* not merely its absence.
|
|
180
|
+
*
|
|
181
|
+
* `ROUTE_RENDERED_NOTHING` is deliberately absence-derived: a route that renders nothing might be a
|
|
182
|
+
* false positive (a view revealed from DOM that already existed — the 1-in-11 case measured on its
|
|
183
|
+
* own doc comment), so it downgrades to UNKNOWN rather than assert a fault nobody proved. That
|
|
184
|
+
* caution is wrong for THIS case. A console error in the same window is not an absence of
|
|
185
|
+
* evidence, it is a specific, positive claim — the destination crashed, and the app's own error
|
|
186
|
+
* boundary or console said so. Reported `unknown` anyway once, when a route-rendered-nothing
|
|
187
|
+
* window also carried a React hooks error: the console errors and the empty destination were both
|
|
188
|
+
* in hand, and the honest answer was available and not given.
|
|
189
|
+
*
|
|
190
|
+
* NOT in `ABSENCE_DERIVED_CONTRADICTIONS` — this is exactly the "evidence AGAINST the action"
|
|
191
|
+
* category that set exists to distinguish itself from, and it is graded `NO` for the same reason
|
|
192
|
+
* `ui-advanced-request-failed` is: a definitive verdict is available and inconclusive is a weaker,
|
|
193
|
+
* wrong answer to give when it is.
|
|
194
|
+
*/
|
|
195
|
+
readonly ROUTE_RENDERED_NOTHING_CRASHED: "route-rendered-nothing-crashed";
|
|
134
196
|
/**
|
|
135
197
|
* Everything this window held belongs to a document that has SINCE been replaced.
|
|
136
198
|
*
|
|
@@ -175,26 +237,22 @@ export type ContradictionKind = (typeof ContradictionKind)[keyof typeof Contradi
|
|
|
175
237
|
/**
|
|
176
238
|
* Contradictions inferred from the ABSENCE of evidence in a window whose end Reticle itself chose.
|
|
177
239
|
*
|
|
178
|
-
* The distinction
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* `
|
|
189
|
-
*
|
|
190
|
-
* verdict was still `no`, because one POST had not settled. A timing observation overruled a
|
|
191
|
-
* consequence observation, which inverts the grade hierarchy the verifier is built on.
|
|
240
|
+
* The distinction decides whether Reticle is entitled to say an action FAILED. The other kinds are
|
|
241
|
+
* POSITIVELY observed — a request came back 500 while the UI advanced, a signal fired carrying data
|
|
242
|
+
* that disagrees with the DOM, a written field echoed a different value — and they must keep
|
|
243
|
+
* outranking a passing assertion, because a green assertion on top of a failed write is the bug
|
|
244
|
+
* class this product exists to catch.
|
|
245
|
+
*
|
|
246
|
+
* These five say only "the thing I expected had not happened YET when I stopped looking", and the
|
|
247
|
+
* window closes the moment the predicate first passes — on an app that navigates optimistically,
|
|
248
|
+
* routinely before the network drains. Letting one assert NO makes a timing observation overrule a
|
|
249
|
+
* consequence observation, which inverts the grade hierarchy the verifier is built on: the bench app
|
|
250
|
+
* produces a `no` over a fired signal with matching data, changed state, a stored token and a clean
|
|
251
|
+
* capture, because one POST had not settled.
|
|
192
252
|
*
|
|
193
253
|
* A false negative is not the mirror of a false positive here. A false positive stops an agent
|
|
194
254
|
* early; a false NEGATIVE makes it redo work that already succeeded, or stop trusting the verdict
|
|
195
|
-
* channel — and the verdict channel is the product.
|
|
196
|
-
* reason: every `attribution: 'app'` on `request-never-settled` turned out to be a misattribution.
|
|
197
|
-
* We removed the field and left the verdict.
|
|
255
|
+
* channel — and the verdict channel is the product.
|
|
198
256
|
*
|
|
199
257
|
* So these downgrade a verdict to UNKNOWN rather than asserting NO. The finding is still reported in
|
|
200
258
|
* `contradictions` either way — nothing is hidden, and an agent that wants to wait and re-check has
|
|
@@ -203,6 +261,27 @@ export type ContradictionKind = (typeof ContradictionKind)[keyof typeof Contradi
|
|
|
203
261
|
export declare const ABSENCE_DERIVED_CONTRADICTIONS: ReadonlySet<ContradictionKind>;
|
|
204
262
|
/** True when this kind was inferred from absence rather than positively observed. */
|
|
205
263
|
export declare function isAbsenceDerived(kind: string): boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Findings that are REPORTED and decide nothing.
|
|
266
|
+
*
|
|
267
|
+
* The two existing tiers both move a verdict: OBSERVED answers `no`, ABSENCE_DERIVED downgrades to
|
|
268
|
+
* `unknown`. Neither fits a fact that is true, worth telling the caller, and simply not about the
|
|
269
|
+
* question the caller asked.
|
|
270
|
+
*
|
|
271
|
+
* That gap had a cost. An app that polls on an interval could not produce a verdict at all: a camera
|
|
272
|
+
* scan loop POSTing until it acquired a lock had every assertion -- ones that had already seen the
|
|
273
|
+
* person recognised, the heading, the 200s -- come back `unknown`, because writes the assertion
|
|
274
|
+
* never mentioned counted against it. The caller then reports `pass: true` with correct evidence and
|
|
275
|
+
* has to explain in prose that Reticle's own verdict is wrong, which erodes the reason to have a
|
|
276
|
+
* verdict (#673).
|
|
277
|
+
*
|
|
278
|
+
* The bar for adding a kind here is high, and it is not "this rule is noisy". It is that the finding
|
|
279
|
+
* cannot, even in principle, be evidence about the declared consequence -- because it concerns
|
|
280
|
+
* traffic the assertion did not name.
|
|
281
|
+
*/
|
|
282
|
+
export declare const ADVISORY_CONTRADICTIONS: ReadonlySet<ContradictionKind>;
|
|
283
|
+
/** True when this kind is reported alongside a verdict without changing it. */
|
|
284
|
+
export declare function isAdvisory(kind: string): boolean;
|
|
206
285
|
/**
|
|
207
286
|
* How much authority a finding carries — the distinction above, said out loud on the finding itself.
|
|
208
287
|
*
|
|
@@ -220,9 +299,18 @@ export declare const FindingTier: {
|
|
|
220
299
|
readonly OBSERVED: "observed";
|
|
221
300
|
/**
|
|
222
301
|
* Inferred from something NOT having happened yet, in a window whose end Reticle chose. It may
|
|
223
|
-
* become true a moment later. It is a statement about
|
|
302
|
+
* become true a moment later. It is a statement about the window's timing at least as much as
|
|
303
|
+
* about the app.
|
|
224
304
|
*/
|
|
225
305
|
readonly ABSENCE_DERIVED: "absence-derived";
|
|
306
|
+
/**
|
|
307
|
+
* True, reported, and not about the question asked. Traffic the assertion never named.
|
|
308
|
+
*
|
|
309
|
+
* Distinct from ABSENCE_DERIVED, which IS about the declared consequence and says the timing was
|
|
310
|
+
* inconclusive about it. This one is about something else entirely, so downgrading on it answers a
|
|
311
|
+
* question nobody put.
|
|
312
|
+
*/
|
|
313
|
+
readonly ADVISORY: "advisory";
|
|
226
314
|
};
|
|
227
315
|
export type FindingTier = (typeof FindingTier)[keyof typeof FindingTier];
|
|
228
316
|
/**
|
|
@@ -245,6 +333,26 @@ export declare function tierOfFinding(kind: string): FindingTier;
|
|
|
245
333
|
* write. Narrowing to writes is what keeps the rules from crying wolf on ordinary reads.
|
|
246
334
|
*/
|
|
247
335
|
export declare const MUTATING_METHODS: readonly string[];
|
|
336
|
+
/**
|
|
337
|
+
* Which two channels each contradiction sets against each other.
|
|
338
|
+
*
|
|
339
|
+
* `Record<ContradictionKind, ...>` on purpose: a new kind does not compile until somebody says what
|
|
340
|
+
* it compares. That is the point -- the independence rule is only checkable if the pairing is
|
|
341
|
+
* written down, and until now it was carried in the head of whoever added the rule.
|
|
342
|
+
*
|
|
343
|
+
* The pairing is causal, not observational: it names where each side of the disagreement was
|
|
344
|
+
* PRODUCED. A screenshot is `ui` even though it is taken out of process, because the pixels came
|
|
345
|
+
* from the render the action caused.
|
|
346
|
+
*/
|
|
347
|
+
export declare const CONTRADICTION_CHANNELS: Record<ContradictionKind, readonly [ChannelId, ChannelId]>;
|
|
348
|
+
/**
|
|
349
|
+
* May this kind of disagreement be reported as a fault in the app?
|
|
350
|
+
*
|
|
351
|
+
* False when both sides come from the app's own actuation path. Such a disagreement is real and
|
|
352
|
+
* worth reporting -- the app contradicted itself -- but it is not evidence that the action failed,
|
|
353
|
+
* and treating it as such is how a verdict channel earns a reputation for crying wolf.
|
|
354
|
+
*/
|
|
355
|
+
export declare function contradictionCanConvict(kind: ContradictionKind): boolean;
|
|
248
356
|
export declare const CrawlAnomalyKind: {
|
|
249
357
|
readonly CONSOLE_ERROR: "console-error";
|
|
250
358
|
readonly FAILED_REQUEST: "failed-request";
|