@reticlehq/core 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.
Files changed (82) hide show
  1. package/dist/artifacts/flow-composition.d.ts +3 -2
  2. package/dist/artifacts/flow-constants.d.ts +59 -2
  3. package/dist/artifacts/flow-constants.js +63 -3
  4. package/dist/artifacts/flow-expect-flat.d.ts +260 -0
  5. package/dist/artifacts/flow-expect-flat.js +284 -0
  6. package/dist/artifacts/flow-mutation-target.d.ts +0 -1
  7. package/dist/artifacts/flow-mutation-target.js +26 -2
  8. package/dist/artifacts/flow-step-tool.d.ts +2 -0
  9. package/dist/artifacts/flow-types.d.ts +1071 -1225
  10. package/dist/artifacts/flow-types.js +96 -140
  11. package/dist/artifacts/impact.d.ts +200 -20
  12. package/dist/artifacts/impact.js +72 -0
  13. package/dist/artifacts/journal.d.ts +85 -6
  14. package/dist/artifacts/journal.js +51 -1
  15. package/dist/hooks/hook-events.d.ts +18 -18
  16. package/dist/hud-entry.d.ts +9 -0
  17. package/dist/hud-entry.js +9 -0
  18. package/dist/identity/brand.d.ts +46 -0
  19. package/dist/identity/brand.js +7 -0
  20. package/dist/identity/source-constants.d.ts +11 -0
  21. package/dist/identity/source-constants.js +11 -0
  22. package/dist/index.d.ts +9 -0
  23. package/dist/index.js +26 -2
  24. package/dist/onboarding.d.ts +2 -2
  25. package/dist/realm/registry.d.ts +0 -8
  26. package/dist/realm/registry.js +1 -11
  27. package/dist/schema/event-message.json +3 -1
  28. package/dist/schema/event-payloads.json +74 -1
  29. package/dist/schema/event-type.json +3 -1
  30. package/dist/schema/reticle-event.json +3 -1
  31. package/dist/schema/reticle-message.json +3 -1
  32. package/dist/source-constants.cjs +1 -0
  33. package/dist/source-constants.d.cts +1 -0
  34. package/dist/telemetry-feedback.d.ts +6 -6
  35. package/dist/telemetry-refusal.d.ts +2 -2
  36. package/dist/telemetry-session.d.ts +25 -2
  37. package/dist/telemetry-session.js +13 -0
  38. package/dist/telemetry.d.ts +184 -102
  39. package/dist/telemetry.js +29 -1
  40. package/dist/verdict/consequence.d.ts +10 -0
  41. package/dist/verdict/consequence.js +13 -0
  42. package/dist/verdict/intent.d.ts +36 -12
  43. package/dist/verdict/intent.js +66 -10
  44. package/dist/verdict/predicate-tree.d.ts +47 -0
  45. package/dist/verdict/predicate-tree.js +146 -0
  46. package/dist/verdict/predicate.d.ts +129 -0
  47. package/dist/verdict/predicate.js +394 -0
  48. package/dist/verdict/property-assertion.d.ts +191 -0
  49. package/dist/verdict/property-assertion.js +42 -0
  50. package/dist/verdict/security.js +16 -4
  51. package/dist/verdict/verdict-attribution.d.ts +52 -0
  52. package/dist/verdict/verdict-attribution.js +87 -0
  53. package/dist/verdict/verification-run.d.ts +98 -84
  54. package/dist/verdict/verification-run.js +8 -1
  55. package/dist/verdict/verified-constants.d.ts +18 -0
  56. package/dist/verdict/verified-constants.js +18 -0
  57. package/dist/wire/constants/constants.d.ts +108 -98
  58. package/dist/wire/constants/constants.js +116 -97
  59. package/dist/wire/constants/discovery.d.ts +25 -0
  60. package/dist/wire/constants/discovery.js +25 -0
  61. package/dist/wire/constants/event-types.d.ts +122 -0
  62. package/dist/wire/constants/event-types.js +121 -0
  63. package/dist/wire/constants/hud-controls.d.ts +19 -0
  64. package/dist/wire/constants/hud-controls.js +95 -0
  65. package/dist/wire/constants/hud-use.d.ts +27 -0
  66. package/dist/wire/constants/hud-use.js +24 -0
  67. package/dist/wire/constants/session-constants.d.ts +24 -0
  68. package/dist/wire/constants/session-constants.js +24 -0
  69. package/dist/wire/event-payloads.d.ts +70 -10
  70. package/dist/wire/event-payloads.js +20 -1
  71. package/dist/wire/messages.d.ts +90 -48
  72. package/dist/wire/messages.js +17 -0
  73. package/dist/wire/net.d.ts +42 -0
  74. package/dist/wire/net.js +48 -0
  75. package/dist/wire/snapshot-tree.d.ts +33 -0
  76. package/dist/wire/snapshot-tree.js +43 -0
  77. package/dist/wire/state-select.d.ts +2 -1
  78. package/dist/wire/state-select.js +56 -3
  79. package/dist/wire/toon.js +28 -7
  80. package/dist/wire/types.d.ts +91 -66
  81. package/dist/wire/types.js +23 -1
  82. package/package.json +5 -1
@@ -1,8 +1,25 @@
1
1
  import type { Ref } from '../identity/brand.js';
2
+ import type { Predicate } from '../verdict/predicate.js';
2
3
  import { z } from 'zod';
3
4
  import { ElementState } from './constants/constants.js';
4
5
  import { type AnnotationErrorCode, type AnnotationTarget } from '../artifacts/flow-constants.js';
5
- import type { FlowExpect } from '../artifacts/flow-types.js';
6
+ /**
7
+ * Attribute NAMES to project. `name=value` is refused, never quietly half-honoured.
8
+ *
9
+ * `attrs` has only ever been a projection: the browser reads each string with `getAttribute` and
10
+ * omits what is absent (adapters/realm/browser/src/dom/query.ts). So `["data-status=complete"]`
11
+ * looked up an attribute literally called `data-status=complete`, found none anywhere, and left the
12
+ * verdict resting on the locator alone — reported from the field (#1057) as three contradictory
13
+ * values all answering `verified:"yes"` on one element, one of them used to call a pipeline stage
14
+ * finished while it was still running.
15
+ *
16
+ * REFUSED rather than taught to match, because `attrs` is a projection list and a filter list is a
17
+ * different thing: `["href", "data-status=done"]` would have to mean both at once, and an `=` is
18
+ * legal inside an attribute value, so any split is a guess. The value comparison already exists as
19
+ * the query's own `value` residual, and the projected map answers everything else. A predicate that
20
+ * cannot express a value is honest; one that pretends to is a false green.
21
+ */
22
+ export declare const AttrNamesSchema: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
6
23
  /**
7
24
  * A query describing which element(s) to find, Testing-Library style.
8
25
  *
@@ -37,7 +54,7 @@ export declare const ElementQuerySchema: z.ZodObject<{
37
54
  * Attribute names to project onto each match (e.g. `['href']` to inventory links, `['src']` for
38
55
  * images). Without this the descriptor carries only semantics, so URLs are unreachable.
39
56
  */
40
- attrs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
57
+ attrs: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
41
58
  /** Source location of the target element (auto-anchor resolution) — the precise, granular match. */
42
59
  source: z.ZodOptional<z.ZodObject<{
43
60
  file: z.ZodString;
@@ -66,42 +83,42 @@ export declare const ElementQuerySchema: z.ZodObject<{
66
83
  */
67
84
  self: z.ZodOptional<z.ZodBoolean>;
68
85
  }, "strict", z.ZodTypeAny, {
86
+ testid?: string | undefined;
69
87
  role?: string | undefined;
88
+ component?: string | undefined;
70
89
  text?: string | undefined;
71
90
  label?: string | undefined;
72
91
  placeholder?: string | undefined;
73
- testid?: string | undefined;
74
92
  alt?: string | undefined;
75
- component?: string | undefined;
76
93
  value?: string | undefined;
94
+ name?: string | undefined;
95
+ by?: "testid" | "role" | "component" | "text" | "label" | "placeholder" | "alt" | undefined;
96
+ attrs?: string[] | undefined;
77
97
  source?: {
78
98
  file: string;
79
99
  line: number;
80
100
  column?: number | undefined;
81
101
  } | undefined;
82
- name?: string | undefined;
83
102
  scope?: string | undefined;
84
- by?: "role" | "text" | "label" | "placeholder" | "testid" | "alt" | "component" | undefined;
85
- attrs?: string[] | undefined;
86
103
  self?: boolean | undefined;
87
104
  }, {
105
+ testid?: string | undefined;
88
106
  role?: string | undefined;
107
+ component?: string | undefined;
89
108
  text?: string | undefined;
90
109
  label?: string | undefined;
91
110
  placeholder?: string | undefined;
92
- testid?: string | undefined;
93
111
  alt?: string | undefined;
94
- component?: string | undefined;
95
112
  value?: string | undefined;
113
+ name?: string | undefined;
114
+ by?: "testid" | "role" | "component" | "text" | "label" | "placeholder" | "alt" | undefined;
115
+ attrs?: string[] | undefined;
96
116
  source?: {
97
117
  file: string;
98
118
  line: number;
99
119
  column?: number | undefined;
100
120
  } | undefined;
101
- name?: string | undefined;
102
121
  scope?: string | undefined;
103
- by?: "role" | "text" | "label" | "placeholder" | "testid" | "alt" | "component" | undefined;
104
- attrs?: string[] | undefined;
105
122
  self?: boolean | undefined;
106
123
  }>;
107
124
  export type ElementQuery = z.infer<typeof ElementQuerySchema>;
@@ -188,6 +205,14 @@ export interface QueryEmptyHint {
188
205
  presentRegions: PresentRegion[];
189
206
  /** @deprecated Use presentRegions. Kept for one major cycle; removed next major. */
190
207
  presentTestids: string[];
208
+ /**
209
+ * Present only when `presentTestids` was cut at its cap: how many distinct testids there were
210
+ * before the cut. The list is collected in DOCUMENT ORDER, so what the cap drops is whatever sits
211
+ * lowest on the page — a detail panel after the header, nav and list — and a list handed back
212
+ * with no marker reads as "here is what is present", with the panel absent from it. That was read
213
+ * in the field as proof the panel never rendered. A trim is never silent.
214
+ */
215
+ presentTestidsTotal?: number;
191
216
  /** True if a capability-registered testid is present in the scope. */
192
217
  knownEmptyState: boolean;
193
218
  /**
@@ -297,23 +322,23 @@ export declare const ManifestGovernanceSchema: z.ZodObject<{
297
322
  paths?: string[] | undefined;
298
323
  }>, "many">>;
299
324
  }, "strip", z.ZodTypeAny, {
300
- scope?: string[] | undefined;
301
- owner?: string | undefined;
302
325
  risk?: {
303
326
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
304
327
  note?: string | undefined;
305
328
  paths?: string[] | undefined;
306
329
  }[] | undefined;
330
+ scope?: string[] | undefined;
331
+ owner?: string | undefined;
307
332
  safety?: string[] | undefined;
308
333
  redact?: string[] | undefined;
309
334
  }, {
310
- scope?: string[] | undefined;
311
- owner?: string | undefined;
312
335
  risk?: {
313
336
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
314
337
  note?: string | undefined;
315
338
  paths?: string[] | undefined;
316
339
  }[] | undefined;
340
+ scope?: string[] | undefined;
341
+ owner?: string | undefined;
317
342
  safety?: string[] | undefined;
318
343
  redact?: string[] | undefined;
319
344
  }>;
@@ -362,23 +387,23 @@ export declare const CapabilitiesSchema: z.ZodObject<{
362
387
  paths?: string[] | undefined;
363
388
  }>, "many">>;
364
389
  }, "strip", z.ZodTypeAny, {
365
- scope?: string[] | undefined;
366
- owner?: string | undefined;
367
390
  risk?: {
368
391
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
369
392
  note?: string | undefined;
370
393
  paths?: string[] | undefined;
371
394
  }[] | undefined;
395
+ scope?: string[] | undefined;
396
+ owner?: string | undefined;
372
397
  safety?: string[] | undefined;
373
398
  redact?: string[] | undefined;
374
399
  }, {
375
- scope?: string[] | undefined;
376
- owner?: string | undefined;
377
400
  risk?: {
378
401
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
379
402
  note?: string | undefined;
380
403
  paths?: string[] | undefined;
381
404
  }[] | undefined;
405
+ scope?: string[] | undefined;
406
+ owner?: string | undefined;
382
407
  safety?: string[] | undefined;
383
408
  redact?: string[] | undefined;
384
409
  }>>;
@@ -387,17 +412,17 @@ export declare const CapabilitiesSchema: z.ZodObject<{
387
412
  name: string;
388
413
  steps: string[];
389
414
  }[];
390
- signals: string[];
391
415
  testids: string[];
416
+ signals: string[];
392
417
  stores: string[];
393
418
  governance?: {
394
- scope?: string[] | undefined;
395
- owner?: string | undefined;
396
419
  risk?: {
397
420
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
398
421
  note?: string | undefined;
399
422
  paths?: string[] | undefined;
400
423
  }[] | undefined;
424
+ scope?: string[] | undefined;
425
+ owner?: string | undefined;
401
426
  safety?: string[] | undefined;
402
427
  redact?: string[] | undefined;
403
428
  } | undefined;
@@ -406,17 +431,17 @@ export declare const CapabilitiesSchema: z.ZodObject<{
406
431
  name: string;
407
432
  steps: string[];
408
433
  }[];
409
- signals: string[];
410
434
  testids: string[];
435
+ signals: string[];
411
436
  stores: string[];
412
437
  governance?: {
413
- scope?: string[] | undefined;
414
- owner?: string | undefined;
415
438
  risk?: {
416
439
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
417
440
  note?: string | undefined;
418
441
  paths?: string[] | undefined;
419
442
  }[] | undefined;
443
+ scope?: string[] | undefined;
444
+ owner?: string | undefined;
420
445
  safety?: string[] | undefined;
421
446
  redact?: string[] | undefined;
422
447
  } | undefined;
@@ -469,23 +494,23 @@ export declare const ContractFileSchema: z.ZodObject<{
469
494
  paths?: string[] | undefined;
470
495
  }>, "many">>;
471
496
  }, "strip", z.ZodTypeAny, {
472
- scope?: string[] | undefined;
473
- owner?: string | undefined;
474
497
  risk?: {
475
498
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
476
499
  note?: string | undefined;
477
500
  paths?: string[] | undefined;
478
501
  }[] | undefined;
502
+ scope?: string[] | undefined;
503
+ owner?: string | undefined;
479
504
  safety?: string[] | undefined;
480
505
  redact?: string[] | undefined;
481
506
  }, {
482
- scope?: string[] | undefined;
483
- owner?: string | undefined;
484
507
  risk?: {
485
508
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
486
509
  note?: string | undefined;
487
510
  paths?: string[] | undefined;
488
511
  }[] | undefined;
512
+ scope?: string[] | undefined;
513
+ owner?: string | undefined;
489
514
  safety?: string[] | undefined;
490
515
  redact?: string[] | undefined;
491
516
  }>>;
@@ -494,17 +519,17 @@ export declare const ContractFileSchema: z.ZodObject<{
494
519
  name: string;
495
520
  steps: string[];
496
521
  }[];
497
- signals: string[];
498
522
  testids: string[];
523
+ signals: string[];
499
524
  stores: string[];
500
525
  governance?: {
501
- scope?: string[] | undefined;
502
- owner?: string | undefined;
503
526
  risk?: {
504
527
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
505
528
  note?: string | undefined;
506
529
  paths?: string[] | undefined;
507
530
  }[] | undefined;
531
+ scope?: string[] | undefined;
532
+ owner?: string | undefined;
508
533
  safety?: string[] | undefined;
509
534
  redact?: string[] | undefined;
510
535
  } | undefined;
@@ -513,17 +538,17 @@ export declare const ContractFileSchema: z.ZodObject<{
513
538
  name: string;
514
539
  steps: string[];
515
540
  }[];
516
- signals: string[];
517
541
  testids: string[];
542
+ signals: string[];
518
543
  stores: string[];
519
544
  governance?: {
520
- scope?: string[] | undefined;
521
- owner?: string | undefined;
522
545
  risk?: {
523
546
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
524
547
  note?: string | undefined;
525
548
  paths?: string[] | undefined;
526
549
  }[] | undefined;
550
+ scope?: string[] | undefined;
551
+ owner?: string | undefined;
527
552
  safety?: string[] | undefined;
528
553
  redact?: string[] | undefined;
529
554
  } | undefined;
@@ -534,17 +559,17 @@ export declare const ContractFileSchema: z.ZodObject<{
534
559
  name: string;
535
560
  steps: string[];
536
561
  }[];
537
- signals: string[];
538
562
  testids: string[];
563
+ signals: string[];
539
564
  stores: string[];
540
565
  governance?: {
541
- scope?: string[] | undefined;
542
- owner?: string | undefined;
543
566
  risk?: {
544
567
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
545
568
  note?: string | undefined;
546
569
  paths?: string[] | undefined;
547
570
  }[] | undefined;
571
+ scope?: string[] | undefined;
572
+ owner?: string | undefined;
548
573
  safety?: string[] | undefined;
549
574
  redact?: string[] | undefined;
550
575
  } | undefined;
@@ -557,17 +582,17 @@ export declare const ContractFileSchema: z.ZodObject<{
557
582
  name: string;
558
583
  steps: string[];
559
584
  }[];
560
- signals: string[];
561
585
  testids: string[];
586
+ signals: string[];
562
587
  stores: string[];
563
588
  governance?: {
564
- scope?: string[] | undefined;
565
- owner?: string | undefined;
566
589
  risk?: {
567
590
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
568
591
  note?: string | undefined;
569
592
  paths?: string[] | undefined;
570
593
  }[] | undefined;
594
+ scope?: string[] | undefined;
595
+ owner?: string | undefined;
571
596
  safety?: string[] | undefined;
572
597
  redact?: string[] | undefined;
573
598
  } | undefined;
@@ -623,28 +648,28 @@ export declare const RunRecordSchema: z.ZodObject<{
623
648
  durationMs: z.ZodOptional<z.ZodNumber>;
624
649
  }, "strip", z.ZodTypeAny, {
625
650
  status: "pass" | "drift" | "error" | "fail";
626
- kind: "flow_replay" | "manual";
627
651
  at: number;
628
652
  name: string;
629
- summary?: string | undefined;
653
+ kind: "flow_replay" | "manual";
630
654
  durationMs?: number | undefined;
631
655
  evidence?: {
632
656
  consoleErrors?: number | undefined;
633
657
  networkErrors?: number | undefined;
634
658
  driftSteps?: number | undefined;
635
659
  } | undefined;
660
+ summary?: string | undefined;
636
661
  }, {
637
662
  status: "pass" | "drift" | "error" | "fail";
638
- kind: "flow_replay" | "manual";
639
663
  at: number;
640
664
  name: string;
641
- summary?: string | undefined;
665
+ kind: "flow_replay" | "manual";
642
666
  durationMs?: number | undefined;
643
667
  evidence?: {
644
668
  consoleErrors?: number | undefined;
645
669
  networkErrors?: number | undefined;
646
670
  driftSteps?: number | undefined;
647
671
  } | undefined;
672
+ summary?: string | undefined;
648
673
  }>;
649
674
  export type RunRecord = z.infer<typeof RunRecordSchema>;
650
675
  /** The optional learned map of the app (known flow/route names). */
@@ -764,42 +789,42 @@ export declare const ProjectFileSchema: z.ZodObject<{
764
789
  durationMs: z.ZodOptional<z.ZodNumber>;
765
790
  }, "strip", z.ZodTypeAny, {
766
791
  status: "pass" | "drift" | "error" | "fail";
767
- kind: "flow_replay" | "manual";
768
792
  at: number;
769
793
  name: string;
770
- summary?: string | undefined;
794
+ kind: "flow_replay" | "manual";
771
795
  durationMs?: number | undefined;
772
796
  evidence?: {
773
797
  consoleErrors?: number | undefined;
774
798
  networkErrors?: number | undefined;
775
799
  driftSteps?: number | undefined;
776
800
  } | undefined;
801
+ summary?: string | undefined;
777
802
  }, {
778
803
  status: "pass" | "drift" | "error" | "fail";
779
- kind: "flow_replay" | "manual";
780
804
  at: number;
781
805
  name: string;
782
- summary?: string | undefined;
806
+ kind: "flow_replay" | "manual";
783
807
  durationMs?: number | undefined;
784
808
  evidence?: {
785
809
  consoleErrors?: number | undefined;
786
810
  networkErrors?: number | undefined;
787
811
  driftSteps?: number | undefined;
788
812
  } | undefined;
813
+ summary?: string | undefined;
789
814
  }>, "many">;
790
815
  }, "strip", z.ZodTypeAny, {
791
816
  runs: {
792
817
  status: "pass" | "drift" | "error" | "fail";
793
- kind: "flow_replay" | "manual";
794
818
  at: number;
795
819
  name: string;
796
- summary?: string | undefined;
820
+ kind: "flow_replay" | "manual";
797
821
  durationMs?: number | undefined;
798
822
  evidence?: {
799
823
  consoleErrors?: number | undefined;
800
824
  networkErrors?: number | undefined;
801
825
  driftSteps?: number | undefined;
802
826
  } | undefined;
827
+ summary?: string | undefined;
803
828
  }[];
804
829
  version: 1;
805
830
  learned?: {
@@ -813,16 +838,16 @@ export declare const ProjectFileSchema: z.ZodObject<{
813
838
  }, {
814
839
  runs: {
815
840
  status: "pass" | "drift" | "error" | "fail";
816
- kind: "flow_replay" | "manual";
817
841
  at: number;
818
842
  name: string;
819
- summary?: string | undefined;
843
+ kind: "flow_replay" | "manual";
820
844
  durationMs?: number | undefined;
821
845
  evidence?: {
822
846
  consoleErrors?: number | undefined;
823
847
  networkErrors?: number | undefined;
824
848
  driftSteps?: number | undefined;
825
849
  } | undefined;
850
+ summary?: string | undefined;
826
851
  }[];
827
852
  version: 1;
828
853
  learned?: {
@@ -851,12 +876,12 @@ export declare const AnnotationSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
851
876
  name: z.ZodString;
852
877
  dataMatches: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
853
878
  }, "strip", z.ZodTypeAny, {
854
- kind: "assert-signal";
855
879
  name: string;
880
+ kind: "assert-signal";
856
881
  dataMatches?: Record<string, unknown> | undefined;
857
882
  }, {
858
- kind: "assert-signal";
859
883
  name: string;
884
+ kind: "assert-signal";
860
885
  dataMatches?: Record<string, unknown> | undefined;
861
886
  }>, z.ZodObject<{
862
887
  kind: z.ZodLiteral<"assert-visible">;
@@ -967,24 +992,24 @@ export declare const AnnotationSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
967
992
  }, "strip", z.ZodTypeAny, {
968
993
  contains: string;
969
994
  visible?: boolean | undefined;
970
- absent?: boolean | undefined;
971
995
  scope?: string | undefined;
996
+ absent?: boolean | undefined;
972
997
  }, {
973
998
  contains: string;
974
999
  visible?: boolean | undefined;
975
- absent?: boolean | undefined;
976
1000
  scope?: string | undefined;
1001
+ absent?: boolean | undefined;
977
1002
  }>>;
978
1003
  }, "strip", z.ZodTypeAny, {
979
1004
  kind: "success-state";
1005
+ testid?: string | undefined;
980
1006
  signal?: string | undefined;
981
1007
  text?: {
982
1008
  contains: string;
983
1009
  visible?: boolean | undefined;
984
- absent?: boolean | undefined;
985
1010
  scope?: string | undefined;
1011
+ absent?: boolean | undefined;
986
1012
  } | undefined;
987
- testid?: string | undefined;
988
1013
  net?: {
989
1014
  status?: number | undefined;
990
1015
  method?: string | undefined;
@@ -996,19 +1021,19 @@ export declare const AnnotationSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
996
1021
  absent?: boolean | undefined;
997
1022
  } | undefined;
998
1023
  store?: string | undefined;
1024
+ statePath?: string | undefined;
999
1025
  equals?: unknown;
1000
1026
  hold?: boolean | undefined;
1001
- statePath?: string | undefined;
1002
1027
  }, {
1003
1028
  kind: "success-state";
1029
+ testid?: string | undefined;
1004
1030
  signal?: string | undefined;
1005
1031
  text?: {
1006
1032
  contains: string;
1007
1033
  visible?: boolean | undefined;
1008
- absent?: boolean | undefined;
1009
1034
  scope?: string | undefined;
1035
+ absent?: boolean | undefined;
1010
1036
  } | undefined;
1011
- testid?: string | undefined;
1012
1037
  net?: {
1013
1038
  status?: number | undefined;
1014
1039
  method?: string | undefined;
@@ -1020,9 +1045,9 @@ export declare const AnnotationSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
1020
1045
  absent?: boolean | undefined;
1021
1046
  } | undefined;
1022
1047
  store?: string | undefined;
1048
+ statePath?: string | undefined;
1023
1049
  equals?: unknown;
1024
1050
  hold?: boolean | undefined;
1025
- statePath?: string | undefined;
1026
1051
  }>, z.ZodObject<{
1027
1052
  kind: z.ZodLiteral<"intent">;
1028
1053
  text: z.ZodString;
@@ -1071,11 +1096,11 @@ export type AnnotateResult = {
1071
1096
  export interface AnnotatePatch {
1072
1097
  /** index of the step whose.expect is set (assert-signal / assert-visible). */
1073
1098
  stepIndex?: number;
1074
- stepExpect?: FlowExpect;
1099
+ stepExpect?: Predicate;
1075
1100
  /** the testid pushed into flow.dynamic[] (mark-dynamic). */
1076
1101
  dynamicAdd?: string;
1077
1102
  /** flow.success (success-state). */
1078
- success?: FlowExpect;
1103
+ success?: Predicate;
1079
1104
  /** flow.intent (intent) — the business goal this flow exists to verify. */
1080
1105
  intent?: string;
1081
1106
  }
@@ -3,6 +3,28 @@ import { CONTRACT_FILE_VERSION, ElementState, QueryBy } from './constants/consta
3
3
  // Imported from where they actually live: these are artifact constants, not wire constants.
4
4
  import { AnnotationKind, PROJECT_FILE_VERSION, RunKind, RunStatus, } from '../artifacts/flow-constants.js';
5
5
  import { RiskSurface } from '../verdict/verification-run.js';
6
+ /**
7
+ * Attribute NAMES to project. `name=value` is refused, never quietly half-honoured.
8
+ *
9
+ * `attrs` has only ever been a projection: the browser reads each string with `getAttribute` and
10
+ * omits what is absent (adapters/realm/browser/src/dom/query.ts). So `["data-status=complete"]`
11
+ * looked up an attribute literally called `data-status=complete`, found none anywhere, and left the
12
+ * verdict resting on the locator alone — reported from the field (#1057) as three contradictory
13
+ * values all answering `verified:"yes"` on one element, one of them used to call a pipeline stage
14
+ * finished while it was still running.
15
+ *
16
+ * REFUSED rather than taught to match, because `attrs` is a projection list and a filter list is a
17
+ * different thing: `["href", "data-status=done"]` would have to mean both at once, and an `=` is
18
+ * legal inside an attribute value, so any split is a guess. The value comparison already exists as
19
+ * the query's own `value` residual, and the projected map answers everything else. A predicate that
20
+ * cannot express a value is honest; one that pretends to is a false green.
21
+ */
22
+ export const AttrNamesSchema = z.array(z.string().refine((name) => !name.includes('='), (name) => ({
23
+ message: `\`attrs\` takes attribute NAMES only, not \`name=value\` — got ${JSON.stringify(name)}. ` +
24
+ 'It PROJECTS each attribute onto the match, it does not filter on it. Drop the `=value` ' +
25
+ 'half and read the returned `attrs` map, or assert the value with an `element` predicate ' +
26
+ 'carrying `value`.',
27
+ })));
6
28
  /**
7
29
  * A query describing which element(s) to find, Testing-Library style.
8
30
  *
@@ -30,7 +52,7 @@ export const ElementQuerySchema = z
30
52
  * Attribute names to project onto each match (e.g. `['href']` to inventory links, `['src']` for
31
53
  * images). Without this the descriptor carries only semantics, so URLs are unreachable.
32
54
  */
33
- attrs: z.array(z.string()).optional(),
55
+ attrs: AttrNamesSchema.optional(),
34
56
  /** Source location of the target element (auto-anchor resolution) — the precise, granular match. */
35
57
  source: z
36
58
  .object({ file: z.string(), line: z.number(), column: z.number().optional() })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/core",
3
- "version": "3.1.0",
3
+ "version": "3.3.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",
@@ -35,6 +35,10 @@
35
35
  "./tour": {
36
36
  "types": "./dist/tour-entry.d.ts",
37
37
  "default": "./dist/tour-entry.js"
38
+ },
39
+ "./hud": {
40
+ "types": "./dist/hud-entry.d.ts",
41
+ "default": "./dist/hud-entry.js"
38
42
  }
39
43
  },
40
44
  "dependencies": {