@reticlehq/core 2.8.0 → 2.9.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/types.d.ts CHANGED
@@ -2,7 +2,16 @@ import type { Ref } from './brand.js';
2
2
  import { z } from 'zod';
3
3
  import { type AnnotationErrorCode, type AnnotationTarget, ElementState } from './constants.js';
4
4
  import type { FlowExpect } from './flow-types.js';
5
- /** A query describing which element(s) to find, Testing-Library style. */
5
+ /**
6
+ * A query describing which element(s) to find, Testing-Library style.
7
+ *
8
+ * Strict, for the same reason the predicate union that wraps it is: a key nobody spells is a schema
9
+ * error naming the key, never a stripped field. Reported from the field —
10
+ * `{ kind: 'element', query: { css: "a[href='…']" } }` parsed, `css` was dropped, the empty query
11
+ * that survived matched nothing, and the verdict read "no element matched {}" about an element that
12
+ * was on the page. A stripped locator here is a false RED, and an agent that believes it goes and
13
+ * "fixes" correct code.
14
+ */
6
15
  export declare const ElementQuerySchema: z.ZodObject<{
7
16
  by: z.ZodOptional<z.ZodNativeEnum<{
8
17
  readonly ROLE: "role";
@@ -33,7 +42,7 @@ export declare const ElementQuerySchema: z.ZodObject<{
33
42
  file: z.ZodString;
34
43
  line: z.ZodNumber;
35
44
  column: z.ZodOptional<z.ZodNumber>;
36
- }, "strip", z.ZodTypeAny, {
45
+ }, "strict", z.ZodTypeAny, {
37
46
  file: string;
38
47
  line: number;
39
48
  column?: number | undefined;
@@ -54,7 +63,7 @@ export declare const ElementQuerySchema: z.ZodObject<{
54
63
  * verification was handed back to the human. Requires `scope`.
55
64
  */
56
65
  self: z.ZodOptional<z.ZodBoolean>;
57
- }, "strip", z.ZodTypeAny, {
66
+ }, "strict", z.ZodTypeAny, {
58
67
  testid?: string | undefined;
59
68
  role?: string | undefined;
60
69
  component?: string | undefined;
package/dist/types.js CHANGED
@@ -2,8 +2,18 @@ import { z } from 'zod';
2
2
  import { AnnotationKind, CONTRACT_FILE_VERSION, ElementState, QueryBy, RunKind, RunStatus, } from './constants.js';
3
3
  import { PROJECT_FILE_VERSION } from './flow-constants.js';
4
4
  import { RiskSurface } from './verification-run.js';
5
- /** A query describing which element(s) to find, Testing-Library style. */
6
- export const ElementQuerySchema = z.object({
5
+ /**
6
+ * A query describing which element(s) to find, Testing-Library style.
7
+ *
8
+ * Strict, for the same reason the predicate union that wraps it is: a key nobody spells is a schema
9
+ * error naming the key, never a stripped field. Reported from the field —
10
+ * `{ kind: 'element', query: { css: "a[href='…']" } }` parsed, `css` was dropped, the empty query
11
+ * that survived matched nothing, and the verdict read "no element matched {}" about an element that
12
+ * was on the page. A stripped locator here is a false RED, and an agent that believes it goes and
13
+ * "fixes" correct code.
14
+ */
15
+ export const ElementQuerySchema = z
16
+ .object({
7
17
  by: z.nativeEnum(QueryBy).optional(),
8
18
  value: z.string().optional(),
9
19
  role: z.string().optional(),
@@ -23,6 +33,7 @@ export const ElementQuerySchema = z.object({
23
33
  /** Source location of the target element (auto-anchor resolution) — the precise, granular match. */
24
34
  source: z
25
35
  .object({ file: z.string(), line: z.number(), column: z.number().optional() })
36
+ .strict()
26
37
  .optional(),
27
38
  /** CSS selector or ref to scope the search. */
28
39
  scope: z.string().optional(),
@@ -36,7 +47,8 @@ export const ElementQuerySchema = z.object({
36
47
  * verification was handed back to the human. Requires `scope`.
37
48
  */
38
49
  self: z.boolean().optional(),
39
- });
50
+ })
51
+ .strict();
40
52
  /** One named flow advertised by the app (mirrors the browser CapabilityFlow). */
41
53
  export const CapabilityFlowSchema = z.object({
42
54
  name: z.string(),
@@ -70,8 +70,21 @@ export declare const VerifiedReason: {
70
70
  readonly OUTCOME_UNREAD: "outcome_unread";
71
71
  /** The page never settled, so the reaction window may have closed early. */
72
72
  readonly UNSETTLED: "unsettled";
73
+ /**
74
+ * The assertion held, but a channel's outcome had not been observed when the window closed — an
75
+ * ABSENCE-derived finding (see ABSENCE_DERIVED_CONTRADICTIONS), not evidence against the action.
76
+ *
77
+ * Split out of UNSETTLED because that word is a claim about idle, and this clause fires
78
+ * independently of whether the page went idle. One field report was, verbatim, "internally
79
+ * contradictory": `verifiedReason: "unsettled"` beside `settled: true`, a passing nested verdict,
80
+ * the requested POST at 200 and a clean console. Both halves came from this rule, and a verdict
81
+ * whose own evidence block denies its stated reason is a verdict nobody can act on.
82
+ */
83
+ readonly EVIDENCE_INCOMPLETE: "evidence_incomplete";
73
84
  /** Held at a real grade over a clean capture with no channel disagreeing. */
74
85
  readonly PROVED: "proved";
86
+ /** A passing absence assertion targeted a region Reticle could not observe. */
87
+ readonly ABSENCE_BLIND_SPOT: "absence_blind_spot";
75
88
  };
76
89
  export type VerifiedReason = (typeof VerifiedReason)[keyof typeof VerifiedReason];
77
90
  /**
@@ -176,5 +189,19 @@ export declare const BlindSpotKind: {
176
189
  * is declared, and the verdict over it reports partial coverage.
177
190
  */
178
191
  readonly VERDICTLESS_SEND: "verdictless-send";
192
+ /**
193
+ * No SUBSCRIBABLE store is registered, so the app's own state is unobservable.
194
+ *
195
+ * Without it, "the store did not change" and "nothing was watching the store" are the same empty
196
+ * `stateDiffs` — and the first reading is a confident wrong answer. It is the common case, not an
197
+ * exotic one: `init` writes a capabilities file that registers nothing until someone edits it, and
198
+ * a store passed as a bare getter is readable but silent, so an app can hold state, change it on
199
+ * every click, and report an empty state channel forever with no error anywhere.
200
+ *
201
+ * BOUNDING, never impeaching (see `impeachesCapture`): what WAS observed — DOM, network, console,
202
+ * storage — is observed completely. Only the state channel is dark, and it lights up the moment a
203
+ * subscribable store registers, which is when the SDK emits this kind with count 0.
204
+ */
205
+ readonly UNWATCHED_STATE: "unwatched-state";
179
206
  };
180
207
  export type BlindSpotKind = (typeof BlindSpotKind)[keyof typeof BlindSpotKind];
@@ -69,8 +69,21 @@ export const VerifiedReason = {
69
69
  OUTCOME_UNREAD: 'outcome_unread',
70
70
  /** The page never settled, so the reaction window may have closed early. */
71
71
  UNSETTLED: 'unsettled',
72
+ /**
73
+ * The assertion held, but a channel's outcome had not been observed when the window closed — an
74
+ * ABSENCE-derived finding (see ABSENCE_DERIVED_CONTRADICTIONS), not evidence against the action.
75
+ *
76
+ * Split out of UNSETTLED because that word is a claim about idle, and this clause fires
77
+ * independently of whether the page went idle. One field report was, verbatim, "internally
78
+ * contradictory": `verifiedReason: "unsettled"` beside `settled: true`, a passing nested verdict,
79
+ * the requested POST at 200 and a clean console. Both halves came from this rule, and a verdict
80
+ * whose own evidence block denies its stated reason is a verdict nobody can act on.
81
+ */
82
+ EVIDENCE_INCOMPLETE: 'evidence_incomplete',
72
83
  /** Held at a real grade over a clean capture with no channel disagreeing. */
73
84
  PROVED: 'proved',
85
+ /** A passing absence assertion targeted a region Reticle could not observe. */
86
+ ABSENCE_BLIND_SPOT: 'absence_blind_spot',
74
87
  };
75
88
  /**
76
89
  * WHAT made a capture unclean — the closed vocabulary behind `UNCLEAN_CAPTURE`.
@@ -173,4 +186,18 @@ export const BlindSpotKind = {
173
186
  * is declared, and the verdict over it reports partial coverage.
174
187
  */
175
188
  VERDICTLESS_SEND: 'verdictless-send',
189
+ /**
190
+ * No SUBSCRIBABLE store is registered, so the app's own state is unobservable.
191
+ *
192
+ * Without it, "the store did not change" and "nothing was watching the store" are the same empty
193
+ * `stateDiffs` — and the first reading is a confident wrong answer. It is the common case, not an
194
+ * exotic one: `init` writes a capabilities file that registers nothing until someone edits it, and
195
+ * a store passed as a bare getter is readable but silent, so an app can hold state, change it on
196
+ * every click, and report an empty state channel forever with no error anywhere.
197
+ *
198
+ * BOUNDING, never impeaching (see `impeachesCapture`): what WAS observed — DOM, network, console,
199
+ * storage — is observed completely. Only the state channel is dark, and it lights up the moment a
200
+ * subscribable store registers, which is when the SDK emits this kind with count 0.
201
+ */
202
+ UNWATCHED_STATE: 'unwatched-state',
176
203
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/core",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "description": "The Reticle foundation: the shared wire contract — types, zod schemas, constants, messages, and the isomorphic kernel that every Reticle package (browser SDK, server, kits, test harness) imports. Depends only on zod.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",