@reticlehq/core 3.2.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +1 -1
  2. package/dist/artifacts/flow-composition.d.ts +3 -2
  3. package/dist/artifacts/flow-constants.d.ts +68 -2
  4. package/dist/artifacts/flow-constants.js +84 -2
  5. package/dist/artifacts/flow-expect-flat.d.ts +260 -0
  6. package/dist/artifacts/flow-expect-flat.js +284 -0
  7. package/dist/artifacts/flow-mutation-target.d.ts +0 -1
  8. package/dist/artifacts/flow-mutation-target.js +30 -2
  9. package/dist/artifacts/flow-step-tool.d.ts +2 -0
  10. package/dist/artifacts/flow-types.d.ts +1285 -1343
  11. package/dist/artifacts/flow-types.js +111 -140
  12. package/dist/artifacts/impact.d.ts +48 -20
  13. package/dist/artifacts/impact.js +11 -0
  14. package/dist/artifacts/journal.d.ts +34 -6
  15. package/dist/artifacts/journal.js +13 -0
  16. package/dist/hooks/hook-events.d.ts +18 -18
  17. package/dist/hud-entry.d.ts +9 -0
  18. package/dist/hud-entry.js +9 -0
  19. package/dist/identity/source-constants.d.ts +11 -0
  20. package/dist/identity/source-constants.js +11 -0
  21. package/dist/index.d.ts +9 -0
  22. package/dist/index.js +25 -1
  23. package/dist/onboarding.d.ts +2 -2
  24. package/dist/realm/registry.d.ts +0 -8
  25. package/dist/realm/registry.js +1 -11
  26. package/dist/registry/daemon-registry.d.ts +14 -4
  27. package/dist/registry/daemon-registry.js +20 -4
  28. package/dist/schema/event-message.json +3 -1
  29. package/dist/schema/event-payloads.json +72 -0
  30. package/dist/schema/event-type.json +3 -1
  31. package/dist/schema/reticle-event.json +3 -1
  32. package/dist/schema/reticle-message.json +3 -1
  33. package/dist/source-constants.cjs +1 -0
  34. package/dist/source-constants.d.cts +1 -0
  35. package/dist/telemetry-feedback.d.ts +6 -6
  36. package/dist/telemetry-refusal.d.ts +5 -4
  37. package/dist/telemetry-session.d.ts +25 -2
  38. package/dist/telemetry-session.js +13 -0
  39. package/dist/telemetry.d.ts +130 -102
  40. package/dist/verdict/compare-source.d.ts +80 -0
  41. package/dist/verdict/compare-source.js +93 -0
  42. package/dist/verdict/consequence.d.ts +12 -0
  43. package/dist/verdict/consequence.js +15 -0
  44. package/dist/verdict/instrumentation-gap.js +1 -1
  45. package/dist/verdict/intent.d.ts +24 -0
  46. package/dist/verdict/intent.js +66 -10
  47. package/dist/verdict/predicate-tree.d.ts +82 -0
  48. package/dist/verdict/predicate-tree.js +186 -0
  49. package/dist/verdict/predicate.d.ts +138 -0
  50. package/dist/verdict/predicate.js +430 -0
  51. package/dist/verdict/property-assertion.d.ts +191 -0
  52. package/dist/verdict/property-assertion.js +42 -0
  53. package/dist/verdict/security.js +16 -4
  54. package/dist/verdict/verdict-attribution.d.ts +52 -0
  55. package/dist/verdict/verdict-attribution.js +87 -0
  56. package/dist/verdict/verification-run.d.ts +330 -83
  57. package/dist/verdict/verification-run.js +44 -1
  58. package/dist/verdict/verified-constants.d.ts +9 -0
  59. package/dist/verdict/verified-constants.js +9 -0
  60. package/dist/wire/channel.d.ts +10 -0
  61. package/dist/wire/channel.js +25 -0
  62. package/dist/wire/constants/constants.d.ts +65 -102
  63. package/dist/wire/constants/constants.js +79 -101
  64. package/dist/wire/constants/discovery.d.ts +25 -0
  65. package/dist/wire/constants/discovery.js +25 -0
  66. package/dist/wire/constants/event-types.d.ts +122 -0
  67. package/dist/wire/constants/event-types.js +121 -0
  68. package/dist/wire/constants/hud-controls.d.ts +19 -0
  69. package/dist/wire/constants/hud-controls.js +95 -0
  70. package/dist/wire/constants/hud-use.d.ts +27 -0
  71. package/dist/wire/constants/hud-use.js +24 -0
  72. package/dist/wire/constants/session-constants.d.ts +10 -0
  73. package/dist/wire/constants/session-constants.js +10 -0
  74. package/dist/wire/event-payloads.d.ts +72 -13
  75. package/dist/wire/event-payloads.js +26 -4
  76. package/dist/wire/messages.d.ts +97 -56
  77. package/dist/wire/messages.js +17 -0
  78. package/dist/wire/net.d.ts +35 -0
  79. package/dist/wire/net.js +41 -0
  80. package/dist/wire/redaction.js +17 -0
  81. package/dist/wire/state-select.d.ts +2 -1
  82. package/dist/wire/state-select.js +56 -3
  83. package/dist/wire/toon.d.ts +1 -1
  84. package/dist/wire/toon.js +30 -8
  85. package/dist/wire/types.d.ts +119 -94
  86. package/dist/wire/types.js +23 -1
  87. package/dist/words/no-session-reason.d.ts +7 -0
  88. package/dist/words/no-session-reason.js +7 -0
  89. package/dist/words/notices.d.ts +7 -0
  90. package/dist/words/notices.js +9 -2
  91. package/package.json +7 -2
@@ -0,0 +1,191 @@
1
+ /**
2
+ * A property assertion: what a caller may claim about a value other than its exact bytes.
3
+ *
4
+ * The contract half only. `satisfiesProperty` — the function that DECIDES whether a reading has a
5
+ * property — stays in the engine, with the baseline plumbing and the `show`/`numberIn` helpers it
6
+ * reasons with. This file is what a flow file on disk can legally contain.
7
+ *
8
+ * Split out of the engine with the rest of the predicate contract, and for the same reason: a saved
9
+ * flow carries one of these now, so core has to be able to parse what it reads.
10
+ */
11
+ import { z } from 'zod';
12
+ import { MeasureOp } from 'open-verification';
13
+ export type PropertyAssertion =
14
+ /** Produced something at all — the honest floor for any generated output. */
15
+ {
16
+ readonly property: 'nonEmpty';
17
+ }
18
+ /** A classification landed inside the allowed set. Exact membership, no coercion. */
19
+ | {
20
+ readonly property: 'oneOf';
21
+ readonly values: readonly unknown[];
22
+ }
23
+ /** A number near enough to an expected one — inclusive on the bound. */
24
+ | {
25
+ readonly property: 'withinTolerance';
26
+ readonly of: number;
27
+ readonly tolerance: number;
28
+ }
29
+ /** The shape of the output, as a regular expression over its string form. */
30
+ | {
31
+ readonly property: 'matchesPattern';
32
+ readonly pattern: string;
33
+ }
34
+ /** The right KIND of thing: `array` and `object` are distinguished, which `typeof` cannot do. */
35
+ | {
36
+ readonly property: 'type';
37
+ readonly is: 'string' | 'number' | 'boolean' | 'array' | 'object';
38
+ } | {
39
+ readonly property: 'changed';
40
+ } | {
41
+ readonly property: 'unchanged';
42
+ } | {
43
+ readonly property: 'increased';
44
+ readonly by?: Delta;
45
+ } | {
46
+ readonly property: 'decreased';
47
+ readonly by?: Delta;
48
+ };
49
+ /** How far a reading moved, in the protocol's comparison vocabulary. Tolerance defaults to exact. */
50
+ export interface Delta {
51
+ readonly op: MeasureOp;
52
+ readonly value: number;
53
+ readonly tolerance?: number;
54
+ }
55
+ /**
56
+ * The reading taken BEFORE the action, when one was taken.
57
+ *
58
+ * A wrapper rather than a bare value because `undefined` is a legitimate reading — a store path
59
+ * that held nothing — and "the path was empty" and "nobody looked" must not collapse into the same
60
+ * answer. The first is a comparison; the second is a refusal to pretend one happened.
61
+ */
62
+ export interface Baseline {
63
+ readonly taken: true;
64
+ readonly value: unknown;
65
+ }
66
+ export declare const propertyAssertionSchema: z.ZodDiscriminatedUnion<"property", [z.ZodObject<{
67
+ property: z.ZodLiteral<"nonEmpty">;
68
+ }, "strict", z.ZodTypeAny, {
69
+ property: "nonEmpty";
70
+ }, {
71
+ property: "nonEmpty";
72
+ }>, z.ZodObject<{
73
+ property: z.ZodLiteral<"oneOf">;
74
+ values: z.ZodArray<z.ZodUnknown, "many">;
75
+ }, "strict", z.ZodTypeAny, {
76
+ values: unknown[];
77
+ property: "oneOf";
78
+ }, {
79
+ values: unknown[];
80
+ property: "oneOf";
81
+ }>, z.ZodObject<{
82
+ property: z.ZodLiteral<"withinTolerance">;
83
+ of: z.ZodNumber;
84
+ tolerance: z.ZodNumber;
85
+ }, "strict", z.ZodTypeAny, {
86
+ tolerance: number;
87
+ property: "withinTolerance";
88
+ of: number;
89
+ }, {
90
+ tolerance: number;
91
+ property: "withinTolerance";
92
+ of: number;
93
+ }>, z.ZodObject<{
94
+ property: z.ZodLiteral<"matchesPattern">;
95
+ pattern: z.ZodString;
96
+ }, "strict", z.ZodTypeAny, {
97
+ property: "matchesPattern";
98
+ pattern: string;
99
+ }, {
100
+ property: "matchesPattern";
101
+ pattern: string;
102
+ }>, z.ZodObject<{
103
+ property: z.ZodLiteral<"type">;
104
+ is: z.ZodEnum<["string", "number", "boolean", "array", "object"]>;
105
+ }, "strict", z.ZodTypeAny, {
106
+ property: "type";
107
+ is: "string" | "number" | "boolean" | "object" | "array";
108
+ }, {
109
+ property: "type";
110
+ is: "string" | "number" | "boolean" | "object" | "array";
111
+ }>, z.ZodObject<{
112
+ property: z.ZodLiteral<"changed">;
113
+ }, "strict", z.ZodTypeAny, {
114
+ property: "changed";
115
+ }, {
116
+ property: "changed";
117
+ }>, z.ZodObject<{
118
+ property: z.ZodLiteral<"unchanged">;
119
+ }, "strict", z.ZodTypeAny, {
120
+ property: "unchanged";
121
+ }, {
122
+ property: "unchanged";
123
+ }>, z.ZodObject<{
124
+ property: z.ZodLiteral<"increased">;
125
+ by: z.ZodOptional<z.ZodObject<{
126
+ op: z.ZodNativeEnum<{
127
+ readonly EQUALS: "equals";
128
+ readonly AT_LEAST: "at-least";
129
+ readonly AT_MOST: "at-most";
130
+ }>;
131
+ value: z.ZodNumber;
132
+ /** Never negative — a negative tolerance NARROWS the band, which is a different claim by accident. */
133
+ tolerance: z.ZodOptional<z.ZodNumber>;
134
+ }, "strict", z.ZodTypeAny, {
135
+ value: number;
136
+ op: "equals" | "at-least" | "at-most";
137
+ tolerance?: number | undefined;
138
+ }, {
139
+ value: number;
140
+ op: "equals" | "at-least" | "at-most";
141
+ tolerance?: number | undefined;
142
+ }>>;
143
+ }, "strict", z.ZodTypeAny, {
144
+ property: "increased";
145
+ by?: {
146
+ value: number;
147
+ op: "equals" | "at-least" | "at-most";
148
+ tolerance?: number | undefined;
149
+ } | undefined;
150
+ }, {
151
+ property: "increased";
152
+ by?: {
153
+ value: number;
154
+ op: "equals" | "at-least" | "at-most";
155
+ tolerance?: number | undefined;
156
+ } | undefined;
157
+ }>, z.ZodObject<{
158
+ property: z.ZodLiteral<"decreased">;
159
+ by: z.ZodOptional<z.ZodObject<{
160
+ op: z.ZodNativeEnum<{
161
+ readonly EQUALS: "equals";
162
+ readonly AT_LEAST: "at-least";
163
+ readonly AT_MOST: "at-most";
164
+ }>;
165
+ value: z.ZodNumber;
166
+ /** Never negative — a negative tolerance NARROWS the band, which is a different claim by accident. */
167
+ tolerance: z.ZodOptional<z.ZodNumber>;
168
+ }, "strict", z.ZodTypeAny, {
169
+ value: number;
170
+ op: "equals" | "at-least" | "at-most";
171
+ tolerance?: number | undefined;
172
+ }, {
173
+ value: number;
174
+ op: "equals" | "at-least" | "at-most";
175
+ tolerance?: number | undefined;
176
+ }>>;
177
+ }, "strict", z.ZodTypeAny, {
178
+ property: "decreased";
179
+ by?: {
180
+ value: number;
181
+ op: "equals" | "at-least" | "at-most";
182
+ tolerance?: number | undefined;
183
+ } | undefined;
184
+ }, {
185
+ property: "decreased";
186
+ by?: {
187
+ value: number;
188
+ op: "equals" | "at-least" | "at-most";
189
+ tolerance?: number | undefined;
190
+ } | undefined;
191
+ }>]>;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * A property assertion: what a caller may claim about a value other than its exact bytes.
3
+ *
4
+ * The contract half only. `satisfiesProperty` — the function that DECIDES whether a reading has a
5
+ * property — stays in the engine, with the baseline plumbing and the `show`/`numberIn` helpers it
6
+ * reasons with. This file is what a flow file on disk can legally contain.
7
+ *
8
+ * Split out of the engine with the rest of the predicate contract, and for the same reason: a saved
9
+ * flow carries one of these now, so core has to be able to parse what it reads.
10
+ */
11
+ import { z } from 'zod';
12
+ import { MeasureOp } from 'open-verification';
13
+ const deltaSchema = z
14
+ .object({
15
+ op: z.nativeEnum(MeasureOp),
16
+ value: z.number().finite(),
17
+ /** Never negative — a negative tolerance NARROWS the band, which is a different claim by accident. */
18
+ tolerance: z.number().finite().nonnegative().optional(),
19
+ })
20
+ .strict();
21
+ export const propertyAssertionSchema = z.discriminatedUnion('property', [
22
+ z.object({ property: z.literal('nonEmpty') }).strict(),
23
+ z.object({ property: z.literal('oneOf'), values: z.array(z.unknown()).min(1) }).strict(),
24
+ z
25
+ .object({
26
+ property: z.literal('withinTolerance'),
27
+ of: z.number().finite(),
28
+ tolerance: z.number().finite().nonnegative(),
29
+ })
30
+ .strict(),
31
+ z.object({ property: z.literal('matchesPattern'), pattern: z.string().min(1) }).strict(),
32
+ z
33
+ .object({
34
+ property: z.literal('type'),
35
+ is: z.enum(['string', 'number', 'boolean', 'array', 'object']),
36
+ })
37
+ .strict(),
38
+ z.object({ property: z.literal('changed') }).strict(),
39
+ z.object({ property: z.literal('unchanged') }).strict(),
40
+ z.object({ property: z.literal('increased'), by: deltaSchema.optional() }).strict(),
41
+ z.object({ property: z.literal('decreased'), by: deltaSchema.optional() }).strict(),
42
+ ]);
@@ -29,10 +29,22 @@
29
29
  */
30
30
  const DANGEROUS_ACTION = /\b(delete|remove|destroy|erase|drop|terminate|revoke|reset|close account|cancel subscription|purchase|buy|pay|payment|place order|confirm order|send money|send funds|transfer|withdraw|refund)\b/i;
31
31
  /**
32
- * Roles that pick a value from a list, not perform an action. Selecting "Payment" as a document
33
- * type is not a payment. `menuitem` is deliberately not here: a menu item labelled Delete still is.
32
+ * Roles that pick a VALUE, not perform an action. Selecting "Payment" as a document type is not a
33
+ * payment, and choosing "Refund" from a reason group is not a refund -- the act those choices feed
34
+ * is the submit that follows, and that control is judged on its own terms.
35
+ *
36
+ * `radio` joins `option` on exactly that argument. Reported from the field alongside the other
37
+ * false positives in the same session: choosing "Inlet" from two radio-like choices was blocked,
38
+ * and the reporter's summary is the cost -- "I ended up passing confirmDangerous: true reflexively
39
+ * on every action, which is how a safety guard becomes decoration". A guard that fires on picking a
40
+ * value is not protecting the destructive action either.
41
+ *
42
+ * `checkbox` is deliberately NOT here. It is a value picker too, but it is also the shape a
43
+ * one-click irreversible confirmation takes ("Delete this repository" with no separate submit), and
44
+ * this guard is asymmetric on purpose: a false block costs a round trip, a missed block cannot be
45
+ * undone. `menuitem` stays out for the reason it always did -- a menu item labelled Delete IS one.
34
46
  */
35
- const VALUE_PICKER_ROLE = 'option';
47
+ const VALUE_PICKER_ROLES = new Set(['option', 'radio']);
36
48
  /** The hostnames that ARE loopback outright, with no parsing: the name, and IPv6 ::1 both ways. */
37
49
  const LOOPBACK_HOSTNAMES = ['localhost', '::1', '0:0:0:0:0:0:0:1'];
38
50
  /** IPv4 loopback is the whole 127.0.0.0/8 block, so the first octet is the entire test. */
@@ -107,7 +119,7 @@ export function isOpaqueOrigin(origin) {
107
119
  * role (a tool name, a click with no role on the descriptor) omit it and the text decides.
108
120
  */
109
121
  export function isDangerousActionText(text, role) {
110
- if (role !== undefined && role.trim().toLowerCase() === VALUE_PICKER_ROLE)
122
+ if (role !== undefined && VALUE_PICKER_ROLES.has(role.trim().toLowerCase()))
111
123
  return false;
112
124
  return DANGEROUS_ACTION.test(text.replace(/[_-]+/g, ' '));
113
125
  }
@@ -0,0 +1,52 @@
1
+ import { VerifiedReason } from './verified-constants.js';
2
+ /**
3
+ * WHOSE problem an unproved verdict is.
4
+ *
5
+ * `verified` says whether the claim held. `verifiedReason` says which clause decided it. Neither
6
+ * says who should act, and for `unknown` that is the only question the reader has. Three of the
7
+ * reasons below arrive as the same word today - "the backend answered 202 and has not finished",
8
+ * "the page SDK and the daemon are on different contracts", and "the capture was truncated" - and
9
+ * they need three opposite next moves: wait, fix Reticle's setup, look again with better coverage.
10
+ *
11
+ * Four owners, because four are what the evidence can actually distinguish. A fifth would be a word
12
+ * nobody could act on differently, and the whole point of this field is that each value implies a
13
+ * different move.
14
+ *
15
+ * NOT `BugAttribution`, and the two must not be merged. That one answers "we found a defect — whose
16
+ * defect is it?" over app/request/reticle/unclassified. This one answers "we could NOT decide — who
17
+ * can act?", which is a question about the absence of a verdict rather than about a finding, and it
18
+ * has to distinguish a thing that resolves by WAITING (`environment`) from a thing that resolves by
19
+ * LOOKING AGAIN (`could-not-see`). `BugAttribution` has no member for either, because a bug is never
20
+ * either of them. Named apart on purpose: one vocabulary stretched over two questions is how both
21
+ * end up wrong.
22
+ */
23
+ export declare const VerdictAttribution: {
24
+ /** The app under test is wrong. The assertion failed, or two channels disagree about it. */
25
+ readonly CODE: "code";
26
+ /**
27
+ * Nothing is wrong yet: something outside the app's own code has not finished or never settled.
28
+ *
29
+ * The one class that resolves by WAITING, which is why it must not read as a defect. An agent that
30
+ * treats "the server is still working" as a failure re-drives a system that was fine.
31
+ */
32
+ readonly ENVIRONMENT: "environment";
33
+ /**
34
+ * Reticle, or how it was driven. Our own pieces disagreeing, a window we closed too early, a claim
35
+ * the caller declared that could never have proved anything.
36
+ *
37
+ * Named honestly on purpose. A tool that reports its own failures as the app's is the confident
38
+ * wrong answer this project exists to remove, and it is the class a user can most easily fix once
39
+ * they are told it is theirs.
40
+ */
41
+ readonly HARNESS: "harness";
42
+ /**
43
+ * The evidence needed was missing. Not a failure of the app, and not a failure of the run - a gap
44
+ * in what was observable, which is the one that says LOOK AGAIN rather than GO FIX SOMETHING.
45
+ */
46
+ readonly COULD_NOT_SEE: "could-not-see";
47
+ /** The claim was proved. There is no owner to name, and the field is omitted rather than carrying this. */
48
+ readonly NONE: "none";
49
+ };
50
+ export type VerdictAttribution = (typeof VerdictAttribution)[keyof typeof VerdictAttribution];
51
+ /** Who owns this verdict reason, or `undefined` for a reason nobody has classified. */
52
+ export declare function verdictAttributionOf(reason: VerifiedReason): VerdictAttribution | undefined;
@@ -0,0 +1,87 @@
1
+ import { VerifiedReason } from './verified-constants.js';
2
+ /**
3
+ * WHOSE problem an unproved verdict is.
4
+ *
5
+ * `verified` says whether the claim held. `verifiedReason` says which clause decided it. Neither
6
+ * says who should act, and for `unknown` that is the only question the reader has. Three of the
7
+ * reasons below arrive as the same word today - "the backend answered 202 and has not finished",
8
+ * "the page SDK and the daemon are on different contracts", and "the capture was truncated" - and
9
+ * they need three opposite next moves: wait, fix Reticle's setup, look again with better coverage.
10
+ *
11
+ * Four owners, because four are what the evidence can actually distinguish. A fifth would be a word
12
+ * nobody could act on differently, and the whole point of this field is that each value implies a
13
+ * different move.
14
+ *
15
+ * NOT `BugAttribution`, and the two must not be merged. That one answers "we found a defect — whose
16
+ * defect is it?" over app/request/reticle/unclassified. This one answers "we could NOT decide — who
17
+ * can act?", which is a question about the absence of a verdict rather than about a finding, and it
18
+ * has to distinguish a thing that resolves by WAITING (`environment`) from a thing that resolves by
19
+ * LOOKING AGAIN (`could-not-see`). `BugAttribution` has no member for either, because a bug is never
20
+ * either of them. Named apart on purpose: one vocabulary stretched over two questions is how both
21
+ * end up wrong.
22
+ */
23
+ export const VerdictAttribution = {
24
+ /** The app under test is wrong. The assertion failed, or two channels disagree about it. */
25
+ CODE: 'code',
26
+ /**
27
+ * Nothing is wrong yet: something outside the app's own code has not finished or never settled.
28
+ *
29
+ * The one class that resolves by WAITING, which is why it must not read as a defect. An agent that
30
+ * treats "the server is still working" as a failure re-drives a system that was fine.
31
+ */
32
+ ENVIRONMENT: 'environment',
33
+ /**
34
+ * Reticle, or how it was driven. Our own pieces disagreeing, a window we closed too early, a claim
35
+ * the caller declared that could never have proved anything.
36
+ *
37
+ * Named honestly on purpose. A tool that reports its own failures as the app's is the confident
38
+ * wrong answer this project exists to remove, and it is the class a user can most easily fix once
39
+ * they are told it is theirs.
40
+ */
41
+ HARNESS: 'harness',
42
+ /**
43
+ * The evidence needed was missing. Not a failure of the app, and not a failure of the run - a gap
44
+ * in what was observable, which is the one that says LOOK AGAIN rather than GO FIX SOMETHING.
45
+ */
46
+ COULD_NOT_SEE: 'could-not-see',
47
+ /** The claim was proved. There is no owner to name, and the field is omitted rather than carrying this. */
48
+ NONE: 'none',
49
+ };
50
+ /**
51
+ * Every reason the verdict ladder can produce, and whose problem it is.
52
+ *
53
+ * Total over `VerifiedReason` by design, and guarded as exhaustive by equality: a new clause cannot
54
+ * ship without somebody deciding who owns it. That is a thirty-second decision while the clause is
55
+ * being written, and an archaeology problem a year later - the same argument the `.reticle`
56
+ * partition makes, for the same reason.
57
+ *
58
+ * Derived from the reason rather than decided separately. A second decision is a second thing that
59
+ * can disagree with the first, and the reason already carries everything this needs.
60
+ */
61
+ const OWNER = {
62
+ // The app was actually disproved — the only two that are.
63
+ [VerifiedReason.ASSERTION_FAILED]: VerdictAttribution.CODE,
64
+ [VerifiedReason.CONTRADICTED]: VerdictAttribution.CODE,
65
+ // Still working. Waiting is the move.
66
+ [VerifiedReason.OUTCOME_PENDING]: VerdictAttribution.ENVIRONMENT,
67
+ [VerifiedReason.UNSETTLED]: VerdictAttribution.ENVIRONMENT,
68
+ // Ours, or the caller's — either way not the app's.
69
+ [VerifiedReason.VERSION_SKEW]: VerdictAttribution.HARNESS,
70
+ [VerifiedReason.WINDOW_CLOSED_EARLY]: VerdictAttribution.HARNESS,
71
+ [VerifiedReason.NOTHING_DECLARED]: VerdictAttribution.HARNESS,
72
+ [VerifiedReason.VACUOUS_GRADE]: VerdictAttribution.HARNESS,
73
+ [VerifiedReason.ALREADY_TRUE]: VerdictAttribution.HARNESS,
74
+ // The evidence was not there to read.
75
+ [VerifiedReason.CAPABILITY_ABSENT]: VerdictAttribution.COULD_NOT_SEE,
76
+ [VerifiedReason.OBSERVATION_LOST]: VerdictAttribution.COULD_NOT_SEE,
77
+ [VerifiedReason.UNCLEAN_CAPTURE]: VerdictAttribution.COULD_NOT_SEE,
78
+ [VerifiedReason.EVIDENCE_INCOMPLETE]: VerdictAttribution.COULD_NOT_SEE,
79
+ [VerifiedReason.ABSENCE_BLIND_SPOT]: VerdictAttribution.COULD_NOT_SEE,
80
+ [VerifiedReason.OUTCOME_UNREAD]: VerdictAttribution.COULD_NOT_SEE,
81
+ [VerifiedReason.INCONCLUSIVE]: VerdictAttribution.COULD_NOT_SEE,
82
+ [VerifiedReason.PROVED]: VerdictAttribution.NONE,
83
+ };
84
+ /** Who owns this verdict reason, or `undefined` for a reason nobody has classified. */
85
+ export function verdictAttributionOf(reason) {
86
+ return OWNER[reason];
87
+ }