@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.
Files changed (147) hide show
  1. package/dist/artifacts/artifacts-entry.d.ts +20 -0
  2. package/dist/artifacts/artifacts-entry.js +20 -0
  3. package/dist/artifacts/flow-composition.d.ts +30 -0
  4. package/dist/artifacts/flow-composition.js +19 -0
  5. package/dist/{flow-constants.d.ts → artifacts/flow-constants.d.ts} +97 -3
  6. package/dist/{flow-constants.js → artifacts/flow-constants.js} +103 -4
  7. package/dist/artifacts/flow-mutation-target.d.ts +39 -0
  8. package/dist/artifacts/flow-mutation-target.js +89 -0
  9. package/dist/artifacts/flow-order.d.ts +30 -0
  10. package/dist/artifacts/flow-order.js +49 -0
  11. package/dist/artifacts/flow-select.d.ts +56 -0
  12. package/dist/artifacts/flow-select.js +56 -0
  13. package/dist/artifacts/flow-step-tool.d.ts +31 -0
  14. package/dist/artifacts/flow-step-tool.js +31 -0
  15. package/dist/artifacts/flow-types.d.ts +3736 -0
  16. package/dist/artifacts/flow-types.js +463 -0
  17. package/dist/artifacts/flow-unreached.d.ts +12 -0
  18. package/dist/artifacts/flow-unreached.js +24 -0
  19. package/dist/{impact-savings.d.ts → artifacts/impact-savings.d.ts} +7 -3
  20. package/dist/{impact-savings.js → artifacts/impact-savings.js} +27 -4
  21. package/dist/{impact.d.ts → artifacts/impact.d.ts} +122 -54
  22. package/dist/{impact.js → artifacts/impact.js} +30 -0
  23. package/dist/{journal.d.ts → artifacts/journal.d.ts} +50 -6
  24. package/dist/{journal.js → artifacts/journal.js} +38 -2
  25. package/dist/artifacts/step-effect.d.ts +29 -0
  26. package/dist/artifacts/step-effect.js +28 -0
  27. package/dist/hooks/hook-events.d.ts +311 -0
  28. package/dist/hooks/hook-events.js +127 -0
  29. package/dist/hooks/hooks-entry.d.ts +9 -0
  30. package/dist/hooks/hooks-entry.js +9 -0
  31. package/dist/{brand.d.ts → identity/brand.d.ts} +7 -0
  32. package/dist/{contract-fingerprint.d.ts → identity/contract-fingerprint.d.ts} +21 -3
  33. package/dist/{contract-fingerprint.js → identity/contract-fingerprint.js} +22 -4
  34. package/dist/{document-identity.d.ts → identity/document-identity.d.ts} +4 -5
  35. package/dist/{document-identity.js → identity/document-identity.js} +4 -5
  36. package/dist/{source-constants.d.ts → identity/source-constants.d.ts} +4 -4
  37. package/dist/{source-constants.js → identity/source-constants.js} +4 -4
  38. package/dist/index.d.ts +69 -42
  39. package/dist/index.js +78 -44
  40. package/dist/onboarding.d.ts +114 -0
  41. package/dist/onboarding.js +141 -0
  42. package/dist/realm/registry.d.ts +212 -0
  43. package/dist/realm/registry.js +302 -0
  44. package/dist/{dev-server-registry.d.ts → registry/dev-server-registry.d.ts} +4 -5
  45. package/dist/{dev-server-registry.js → registry/dev-server-registry.js} +28 -19
  46. package/dist/{project-registry.d.ts → registry/project-registry.d.ts} +5 -5
  47. package/dist/{project-registry.js → registry/project-registry.js} +5 -5
  48. package/dist/schema/command-name.json +31 -0
  49. package/dist/schema/event-message.json +1 -0
  50. package/dist/schema/event-payloads.json +791 -0
  51. package/dist/schema/event-type.json +1 -0
  52. package/dist/schema/hello-message.json +76 -2
  53. package/dist/schema/reticle-event.json +1 -0
  54. package/dist/schema/reticle-message.json +77 -2
  55. package/dist/telemetry-entry.d.ts +15 -0
  56. package/dist/telemetry-entry.js +15 -0
  57. package/dist/telemetry-feedback.d.ts +13 -14
  58. package/dist/telemetry-feedback.js +11 -12
  59. package/dist/telemetry-license.d.ts +1 -1
  60. package/dist/telemetry-license.js +1 -1
  61. package/dist/telemetry-refusal.d.ts +11 -11
  62. package/dist/telemetry-refusal.js +7 -8
  63. package/dist/telemetry-session.d.ts +49 -57
  64. package/dist/telemetry-session.js +47 -55
  65. package/dist/telemetry.d.ts +229 -198
  66. package/dist/telemetry.js +83 -98
  67. package/dist/tour-entry.d.ts +10 -0
  68. package/dist/tour-entry.js +10 -0
  69. package/dist/tour.d.ts +125 -0
  70. package/dist/tour.js +165 -0
  71. package/dist/{consequence.d.ts → verdict/consequence.d.ts} +35 -11
  72. package/dist/{consequence.js → verdict/consequence.js} +9 -22
  73. package/dist/{finding-fingerprint.js → verdict/finding-fingerprint.js} +1 -1
  74. package/dist/{findings.d.ts → verdict/findings.d.ts} +149 -41
  75. package/dist/{findings.js → verdict/findings.js} +169 -48
  76. package/dist/{instrumentation-gap.d.ts → verdict/instrumentation-gap.d.ts} +22 -14
  77. package/dist/{instrumentation-gap.js → verdict/instrumentation-gap.js} +23 -15
  78. package/dist/{intent.d.ts → verdict/intent.d.ts} +41 -52
  79. package/dist/{intent.js → verdict/intent.js} +11 -22
  80. package/dist/verdict/revision.d.ts +44 -0
  81. package/dist/verdict/revision.js +53 -0
  82. package/dist/{run-context.d.ts → verdict/run-context.d.ts} +13 -34
  83. package/dist/{run-context.js → verdict/run-context.js} +15 -36
  84. package/dist/{security.js → verdict/security.js} +12 -21
  85. package/dist/{verification-run.d.ts → verdict/verification-run.d.ts} +369 -93
  86. package/dist/{verification-run.js → verdict/verification-run.js} +157 -21
  87. package/dist/{verified-constants.d.ts → verdict/verified-constants.d.ts} +36 -13
  88. package/dist/{verified-constants.js → verdict/verified-constants.js} +36 -13
  89. package/dist/verdict/verify-progress.d.ts +129 -0
  90. package/dist/verdict/verify-progress.js +74 -0
  91. package/dist/wire/channel.d.ts +46 -0
  92. package/dist/wire/channel.js +95 -0
  93. package/dist/{constants.d.ts → wire/constants/constants.d.ts} +124 -28
  94. package/dist/{constants.js → wire/constants/constants.js} +137 -28
  95. package/dist/{session-constants.d.ts → wire/constants/session-constants.d.ts} +9 -2
  96. package/dist/{session-constants.js → wire/constants/session-constants.js} +9 -2
  97. package/dist/{desktop-contract.js → wire/desktop-contract.js} +1 -1
  98. package/dist/{event-classification.js → wire/event-classification.js} +1 -1
  99. package/dist/{event-payloads.d.ts → wire/event-payloads.d.ts} +229 -17
  100. package/dist/{event-payloads.js → wire/event-payloads.js} +61 -3
  101. package/dist/{event-priority.d.ts → wire/event-priority.d.ts} +1 -4
  102. package/dist/{event-priority.js → wire/event-priority.js} +2 -5
  103. package/dist/wire/global-press.d.ts +30 -0
  104. package/dist/wire/global-press.js +54 -0
  105. package/dist/{messages.d.ts → wire/messages.d.ts} +290 -38
  106. package/dist/{messages.js → wire/messages.js} +93 -5
  107. package/dist/wire/narrow.d.ts +39 -0
  108. package/dist/wire/narrow.js +45 -0
  109. package/dist/{net.d.ts → wire/net.d.ts} +49 -10
  110. package/dist/{net.js → wire/net.js} +49 -10
  111. package/dist/wire/platform.d.ts +37 -0
  112. package/dist/wire/platform.js +36 -0
  113. package/dist/{redaction.d.ts → wire/redaction.d.ts} +30 -0
  114. package/dist/wire/redaction.js +274 -0
  115. package/dist/wire/tool-names.d.ts +133 -0
  116. package/dist/wire/tool-names.js +142 -0
  117. package/dist/{toon.js → wire/toon.js} +1 -1
  118. package/dist/{types.d.ts → wire/types.d.ts} +106 -66
  119. package/dist/{types.js → wire/types.js} +24 -4
  120. package/dist/{no-session-reason.d.ts → words/no-session-reason.d.ts} +7 -3
  121. package/dist/{no-session-reason.js → words/no-session-reason.js} +7 -3
  122. package/dist/{notices.d.ts → words/notices.d.ts} +24 -12
  123. package/dist/{notices.js → words/notices.js} +27 -12
  124. package/package.json +22 -5
  125. package/dist/flow-types.d.ts +0 -1473
  126. package/dist/flow-types.js +0 -195
  127. package/dist/redaction.js +0 -149
  128. /package/dist/{brand.js → identity/brand.js} +0 -0
  129. /package/dist/{edit-epoch.d.ts → identity/edit-epoch.d.ts} +0 -0
  130. /package/dist/{edit-epoch.js → identity/edit-epoch.js} +0 -0
  131. /package/dist/{project-id.d.ts → identity/project-id.d.ts} +0 -0
  132. /package/dist/{project-id.js → identity/project-id.js} +0 -0
  133. /package/dist/{daemon-registry.d.ts → registry/daemon-registry.d.ts} +0 -0
  134. /package/dist/{daemon-registry.js → registry/daemon-registry.js} +0 -0
  135. /package/dist/{finding-fingerprint.d.ts → verdict/finding-fingerprint.d.ts} +0 -0
  136. /package/dist/{security.d.ts → verdict/security.d.ts} +0 -0
  137. /package/dist/{desktop-contract.d.ts → wire/desktop-contract.d.ts} +0 -0
  138. /package/dist/{event-classification.d.ts → wire/event-classification.d.ts} +0 -0
  139. /package/dist/{state-select.d.ts → wire/state-select.d.ts} +0 -0
  140. /package/dist/{state-select.js → wire/state-select.js} +0 -0
  141. /package/dist/{toon.d.ts → wire/toon.d.ts} +0 -0
  142. /package/dist/{browser-misdirect.d.ts → words/browser-misdirect.d.ts} +0 -0
  143. /package/dist/{browser-misdirect.js → words/browser-misdirect.js} +0 -0
  144. /package/dist/{unreachable-notice.d.ts → words/unreachable-notice.d.ts} +0 -0
  145. /package/dist/{unreachable-notice.js → words/unreachable-notice.js} +0 -0
  146. /package/dist/{upgrade.d.ts → words/upgrade.d.ts} +0 -0
  147. /package/dist/{upgrade.js → words/upgrade.js} +0 -0
@@ -1,7 +1,8 @@
1
- import type { Ref } from './brand.js';
1
+ import type { Ref } from '../identity/brand.js';
2
2
  import { z } from 'zod';
3
- import { type AnnotationErrorCode, type AnnotationTarget, ElementState } from './constants.js';
4
- import type { FlowExpect } from './flow-types.js';
3
+ import { ElementState } from './constants/constants.js';
4
+ import { type AnnotationErrorCode, type AnnotationTarget } from '../artifacts/flow-constants.js';
5
+ import type { FlowExpect } from '../artifacts/flow-types.js';
5
6
  /**
6
7
  * A query describing which element(s) to find, Testing-Library style.
7
8
  *
@@ -54,7 +55,8 @@ export declare const ElementQuerySchema: z.ZodObject<{
54
55
  /** CSS selector or ref to scope the search. */
55
56
  scope: z.ZodOptional<z.ZodString>;
56
57
  /**
57
- * Return the `scope` element ITSELF rather than searching inside it.
58
+ * Return the `scope` element ITSELF rather than searching inside it. When `text` is also given,
59
+ * the scope root must contain that text across its full subtree.
58
60
  *
59
61
  * Every other path excludes the scope root by construction, so a layout container with no role,
60
62
  * name, testid or text of its own was unreachable — and that is routinely the element carrying the
@@ -64,13 +66,13 @@ export declare const ElementQuerySchema: z.ZodObject<{
64
66
  */
65
67
  self: z.ZodOptional<z.ZodBoolean>;
66
68
  }, "strict", z.ZodTypeAny, {
67
- testid?: string | undefined;
68
69
  role?: string | undefined;
69
- component?: string | undefined;
70
70
  text?: string | undefined;
71
71
  label?: string | undefined;
72
72
  placeholder?: string | undefined;
73
+ testid?: string | undefined;
73
74
  alt?: string | undefined;
75
+ component?: string | undefined;
74
76
  value?: string | undefined;
75
77
  source?: {
76
78
  file: string;
@@ -78,18 +80,18 @@ export declare const ElementQuerySchema: z.ZodObject<{
78
80
  column?: number | undefined;
79
81
  } | undefined;
80
82
  name?: string | undefined;
81
- by?: "testid" | "role" | "component" | "text" | "label" | "placeholder" | "alt" | undefined;
82
- attrs?: string[] | undefined;
83
83
  scope?: string | undefined;
84
+ by?: "role" | "text" | "label" | "placeholder" | "testid" | "alt" | "component" | undefined;
85
+ attrs?: string[] | undefined;
84
86
  self?: boolean | undefined;
85
87
  }, {
86
- testid?: string | undefined;
87
88
  role?: string | undefined;
88
- component?: string | undefined;
89
89
  text?: string | undefined;
90
90
  label?: string | undefined;
91
91
  placeholder?: string | undefined;
92
+ testid?: string | undefined;
92
93
  alt?: string | undefined;
94
+ component?: string | undefined;
93
95
  value?: string | undefined;
94
96
  source?: {
95
97
  file: string;
@@ -97,9 +99,9 @@ export declare const ElementQuerySchema: z.ZodObject<{
97
99
  column?: number | undefined;
98
100
  } | undefined;
99
101
  name?: string | undefined;
100
- by?: "testid" | "role" | "component" | "text" | "label" | "placeholder" | "alt" | undefined;
101
- attrs?: string[] | undefined;
102
102
  scope?: string | undefined;
103
+ by?: "role" | "text" | "label" | "placeholder" | "testid" | "alt" | "component" | undefined;
104
+ attrs?: string[] | undefined;
103
105
  self?: boolean | undefined;
104
106
  }>;
105
107
  export type ElementQuery = z.infer<typeof ElementQuerySchema>;
@@ -197,6 +199,16 @@ export interface QueryEmptyHint {
197
199
  * the recovery is `{ scope: <ref>, self: true }` rather than another guess at the text.
198
200
  */
199
201
  splitText?: ElementDescriptor;
202
+ /**
203
+ * Present only when a ROLE+NAME search missed and that role DOES carry a nearly-matching name.
204
+ *
205
+ * Role+name matching is exact, deliberately: substring matching on `name` would let a query for
206
+ * "Save" select "Save and close", and acting on the wrong control is a worse failure than not
207
+ * finding the right one. An exact miss that says nothing costs a whole snapshot to discover the
208
+ * caller was one word away — a query for "Mesh" against a button reading "2 Mesh". The match
209
+ * stays exact; the miss answers.
210
+ */
211
+ nameNearMiss?: string[];
200
212
  }
201
213
  /** Result of the QUERY command / reticle_query tool. `hint` present ONLY on zero matches. */
202
214
  export interface QueryResult {
@@ -285,23 +297,23 @@ export declare const ManifestGovernanceSchema: z.ZodObject<{
285
297
  paths?: string[] | undefined;
286
298
  }>, "many">>;
287
299
  }, "strip", z.ZodTypeAny, {
300
+ scope?: string[] | undefined;
301
+ owner?: string | undefined;
288
302
  risk?: {
289
303
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
290
304
  note?: string | undefined;
291
305
  paths?: string[] | undefined;
292
306
  }[] | undefined;
293
- scope?: string[] | undefined;
294
- owner?: string | undefined;
295
307
  safety?: string[] | undefined;
296
308
  redact?: string[] | undefined;
297
309
  }, {
310
+ scope?: string[] | undefined;
311
+ owner?: string | undefined;
298
312
  risk?: {
299
313
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
300
314
  note?: string | undefined;
301
315
  paths?: string[] | undefined;
302
316
  }[] | undefined;
303
- scope?: string[] | undefined;
304
- owner?: string | undefined;
305
317
  safety?: string[] | undefined;
306
318
  redact?: string[] | undefined;
307
319
  }>;
@@ -350,23 +362,23 @@ export declare const CapabilitiesSchema: z.ZodObject<{
350
362
  paths?: string[] | undefined;
351
363
  }>, "many">>;
352
364
  }, "strip", z.ZodTypeAny, {
365
+ scope?: string[] | undefined;
366
+ owner?: string | undefined;
353
367
  risk?: {
354
368
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
355
369
  note?: string | undefined;
356
370
  paths?: string[] | undefined;
357
371
  }[] | undefined;
358
- scope?: string[] | undefined;
359
- owner?: string | undefined;
360
372
  safety?: string[] | undefined;
361
373
  redact?: string[] | undefined;
362
374
  }, {
375
+ scope?: string[] | undefined;
376
+ owner?: string | undefined;
363
377
  risk?: {
364
378
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
365
379
  note?: string | undefined;
366
380
  paths?: string[] | undefined;
367
381
  }[] | undefined;
368
- scope?: string[] | undefined;
369
- owner?: string | undefined;
370
382
  safety?: string[] | undefined;
371
383
  redact?: string[] | undefined;
372
384
  }>>;
@@ -375,17 +387,17 @@ export declare const CapabilitiesSchema: z.ZodObject<{
375
387
  name: string;
376
388
  steps: string[];
377
389
  }[];
378
- testids: string[];
379
390
  signals: string[];
391
+ testids: string[];
380
392
  stores: string[];
381
393
  governance?: {
394
+ scope?: string[] | undefined;
395
+ owner?: string | undefined;
382
396
  risk?: {
383
397
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
384
398
  note?: string | undefined;
385
399
  paths?: string[] | undefined;
386
400
  }[] | undefined;
387
- scope?: string[] | undefined;
388
- owner?: string | undefined;
389
401
  safety?: string[] | undefined;
390
402
  redact?: string[] | undefined;
391
403
  } | undefined;
@@ -394,17 +406,17 @@ export declare const CapabilitiesSchema: z.ZodObject<{
394
406
  name: string;
395
407
  steps: string[];
396
408
  }[];
397
- testids: string[];
398
409
  signals: string[];
410
+ testids: string[];
399
411
  stores: string[];
400
412
  governance?: {
413
+ scope?: string[] | undefined;
414
+ owner?: string | undefined;
401
415
  risk?: {
402
416
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
403
417
  note?: string | undefined;
404
418
  paths?: string[] | undefined;
405
419
  }[] | undefined;
406
- scope?: string[] | undefined;
407
- owner?: string | undefined;
408
420
  safety?: string[] | undefined;
409
421
  redact?: string[] | undefined;
410
422
  } | undefined;
@@ -457,23 +469,23 @@ export declare const ContractFileSchema: z.ZodObject<{
457
469
  paths?: string[] | undefined;
458
470
  }>, "many">>;
459
471
  }, "strip", z.ZodTypeAny, {
472
+ scope?: string[] | undefined;
473
+ owner?: string | undefined;
460
474
  risk?: {
461
475
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
462
476
  note?: string | undefined;
463
477
  paths?: string[] | undefined;
464
478
  }[] | undefined;
465
- scope?: string[] | undefined;
466
- owner?: string | undefined;
467
479
  safety?: string[] | undefined;
468
480
  redact?: string[] | undefined;
469
481
  }, {
482
+ scope?: string[] | undefined;
483
+ owner?: string | undefined;
470
484
  risk?: {
471
485
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
472
486
  note?: string | undefined;
473
487
  paths?: string[] | undefined;
474
488
  }[] | undefined;
475
- scope?: string[] | undefined;
476
- owner?: string | undefined;
477
489
  safety?: string[] | undefined;
478
490
  redact?: string[] | undefined;
479
491
  }>>;
@@ -482,17 +494,17 @@ export declare const ContractFileSchema: z.ZodObject<{
482
494
  name: string;
483
495
  steps: string[];
484
496
  }[];
485
- testids: string[];
486
497
  signals: string[];
498
+ testids: string[];
487
499
  stores: string[];
488
500
  governance?: {
501
+ scope?: string[] | undefined;
502
+ owner?: string | undefined;
489
503
  risk?: {
490
504
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
491
505
  note?: string | undefined;
492
506
  paths?: string[] | undefined;
493
507
  }[] | undefined;
494
- scope?: string[] | undefined;
495
- owner?: string | undefined;
496
508
  safety?: string[] | undefined;
497
509
  redact?: string[] | undefined;
498
510
  } | undefined;
@@ -501,17 +513,17 @@ export declare const ContractFileSchema: z.ZodObject<{
501
513
  name: string;
502
514
  steps: string[];
503
515
  }[];
504
- testids: string[];
505
516
  signals: string[];
517
+ testids: string[];
506
518
  stores: string[];
507
519
  governance?: {
520
+ scope?: string[] | undefined;
521
+ owner?: string | undefined;
508
522
  risk?: {
509
523
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
510
524
  note?: string | undefined;
511
525
  paths?: string[] | undefined;
512
526
  }[] | undefined;
513
- scope?: string[] | undefined;
514
- owner?: string | undefined;
515
527
  safety?: string[] | undefined;
516
528
  redact?: string[] | undefined;
517
529
  } | undefined;
@@ -522,17 +534,17 @@ export declare const ContractFileSchema: z.ZodObject<{
522
534
  name: string;
523
535
  steps: string[];
524
536
  }[];
525
- testids: string[];
526
537
  signals: string[];
538
+ testids: string[];
527
539
  stores: string[];
528
540
  governance?: {
541
+ scope?: string[] | undefined;
542
+ owner?: string | undefined;
529
543
  risk?: {
530
544
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
531
545
  note?: string | undefined;
532
546
  paths?: string[] | undefined;
533
547
  }[] | undefined;
534
- scope?: string[] | undefined;
535
- owner?: string | undefined;
536
548
  safety?: string[] | undefined;
537
549
  redact?: string[] | undefined;
538
550
  } | undefined;
@@ -545,17 +557,17 @@ export declare const ContractFileSchema: z.ZodObject<{
545
557
  name: string;
546
558
  steps: string[];
547
559
  }[];
548
- testids: string[];
549
560
  signals: string[];
561
+ testids: string[];
550
562
  stores: string[];
551
563
  governance?: {
564
+ scope?: string[] | undefined;
565
+ owner?: string | undefined;
552
566
  risk?: {
553
567
  surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external";
554
568
  note?: string | undefined;
555
569
  paths?: string[] | undefined;
556
570
  }[] | undefined;
557
- scope?: string[] | undefined;
558
- owner?: string | undefined;
559
571
  safety?: string[] | undefined;
560
572
  redact?: string[] | undefined;
561
573
  } | undefined;
@@ -611,28 +623,28 @@ export declare const RunRecordSchema: z.ZodObject<{
611
623
  durationMs: z.ZodOptional<z.ZodNumber>;
612
624
  }, "strip", z.ZodTypeAny, {
613
625
  status: "pass" | "drift" | "error" | "fail";
614
- at: number;
615
626
  kind: "flow_replay" | "manual";
627
+ at: number;
616
628
  name: string;
629
+ summary?: string | undefined;
617
630
  durationMs?: number | undefined;
618
631
  evidence?: {
619
632
  consoleErrors?: number | undefined;
620
633
  networkErrors?: number | undefined;
621
634
  driftSteps?: number | undefined;
622
635
  } | undefined;
623
- summary?: string | undefined;
624
636
  }, {
625
637
  status: "pass" | "drift" | "error" | "fail";
626
- at: number;
627
638
  kind: "flow_replay" | "manual";
639
+ at: number;
628
640
  name: string;
641
+ summary?: string | undefined;
629
642
  durationMs?: number | undefined;
630
643
  evidence?: {
631
644
  consoleErrors?: number | undefined;
632
645
  networkErrors?: number | undefined;
633
646
  driftSteps?: number | undefined;
634
647
  } | undefined;
635
- summary?: string | undefined;
636
648
  }>;
637
649
  export type RunRecord = z.infer<typeof RunRecordSchema>;
638
650
  /** The optional learned map of the app (known flow/route names). */
@@ -752,42 +764,42 @@ export declare const ProjectFileSchema: z.ZodObject<{
752
764
  durationMs: z.ZodOptional<z.ZodNumber>;
753
765
  }, "strip", z.ZodTypeAny, {
754
766
  status: "pass" | "drift" | "error" | "fail";
755
- at: number;
756
767
  kind: "flow_replay" | "manual";
768
+ at: number;
757
769
  name: string;
770
+ summary?: string | undefined;
758
771
  durationMs?: number | undefined;
759
772
  evidence?: {
760
773
  consoleErrors?: number | undefined;
761
774
  networkErrors?: number | undefined;
762
775
  driftSteps?: number | undefined;
763
776
  } | undefined;
764
- summary?: string | undefined;
765
777
  }, {
766
778
  status: "pass" | "drift" | "error" | "fail";
767
- at: number;
768
779
  kind: "flow_replay" | "manual";
780
+ at: number;
769
781
  name: string;
782
+ summary?: string | undefined;
770
783
  durationMs?: number | undefined;
771
784
  evidence?: {
772
785
  consoleErrors?: number | undefined;
773
786
  networkErrors?: number | undefined;
774
787
  driftSteps?: number | undefined;
775
788
  } | undefined;
776
- summary?: string | undefined;
777
789
  }>, "many">;
778
790
  }, "strip", z.ZodTypeAny, {
779
791
  runs: {
780
792
  status: "pass" | "drift" | "error" | "fail";
781
- at: number;
782
793
  kind: "flow_replay" | "manual";
794
+ at: number;
783
795
  name: string;
796
+ summary?: string | undefined;
784
797
  durationMs?: number | undefined;
785
798
  evidence?: {
786
799
  consoleErrors?: number | undefined;
787
800
  networkErrors?: number | undefined;
788
801
  driftSteps?: number | undefined;
789
802
  } | undefined;
790
- summary?: string | undefined;
791
803
  }[];
792
804
  version: 1;
793
805
  learned?: {
@@ -801,16 +813,16 @@ export declare const ProjectFileSchema: z.ZodObject<{
801
813
  }, {
802
814
  runs: {
803
815
  status: "pass" | "drift" | "error" | "fail";
804
- at: number;
805
816
  kind: "flow_replay" | "manual";
817
+ at: number;
806
818
  name: string;
819
+ summary?: string | undefined;
807
820
  durationMs?: number | undefined;
808
821
  evidence?: {
809
822
  consoleErrors?: number | undefined;
810
823
  networkErrors?: number | undefined;
811
824
  driftSteps?: number | undefined;
812
825
  } | undefined;
813
- summary?: string | undefined;
814
826
  }[];
815
827
  version: 1;
816
828
  learned?: {
@@ -880,30 +892,30 @@ export declare const AnnotationSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
880
892
  }, "strip", z.ZodTypeAny, {
881
893
  status?: number | undefined;
882
894
  method?: string | undefined;
883
- count?: number | undefined;
884
895
  urlContains?: string | undefined;
896
+ count?: number | undefined;
885
897
  }, {
886
898
  status?: number | undefined;
887
899
  method?: string | undefined;
888
- count?: number | undefined;
889
900
  urlContains?: string | undefined;
901
+ count?: number | undefined;
890
902
  }>;
891
903
  }, "strip", z.ZodTypeAny, {
892
- kind: "assert-net";
893
904
  net: {
894
905
  status?: number | undefined;
895
906
  method?: string | undefined;
896
- count?: number | undefined;
897
907
  urlContains?: string | undefined;
908
+ count?: number | undefined;
898
909
  };
899
- }, {
900
910
  kind: "assert-net";
911
+ }, {
901
912
  net: {
902
913
  status?: number | undefined;
903
914
  method?: string | undefined;
904
- count?: number | undefined;
905
915
  urlContains?: string | undefined;
916
+ count?: number | undefined;
906
917
  };
918
+ kind: "assert-net";
907
919
  }>, z.ZodObject<{
908
920
  kind: z.ZodLiteral<"mark-dynamic">;
909
921
  testid: z.ZodString;
@@ -929,13 +941,13 @@ export declare const AnnotationSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
929
941
  }, "strip", z.ZodTypeAny, {
930
942
  status?: number | undefined;
931
943
  method?: string | undefined;
932
- count?: number | undefined;
933
944
  urlContains?: string | undefined;
945
+ count?: number | undefined;
934
946
  }, {
935
947
  status?: number | undefined;
936
948
  method?: string | undefined;
937
- count?: number | undefined;
938
949
  urlContains?: string | undefined;
950
+ count?: number | undefined;
939
951
  }>>;
940
952
  console: z.ZodOptional<z.ZodObject<{
941
953
  level: z.ZodOptional<z.ZodString>;
@@ -947,15 +959,37 @@ export declare const AnnotationSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
947
959
  level?: string | undefined;
948
960
  absent?: boolean | undefined;
949
961
  }>>;
962
+ text: z.ZodOptional<z.ZodObject<{
963
+ contains: z.ZodString;
964
+ scope: z.ZodOptional<z.ZodString>;
965
+ absent: z.ZodOptional<z.ZodBoolean>;
966
+ visible: z.ZodOptional<z.ZodBoolean>;
967
+ }, "strip", z.ZodTypeAny, {
968
+ contains: string;
969
+ visible?: boolean | undefined;
970
+ absent?: boolean | undefined;
971
+ scope?: string | undefined;
972
+ }, {
973
+ contains: string;
974
+ visible?: boolean | undefined;
975
+ absent?: boolean | undefined;
976
+ scope?: string | undefined;
977
+ }>>;
950
978
  }, "strip", z.ZodTypeAny, {
951
979
  kind: "success-state";
952
- testid?: string | undefined;
953
980
  signal?: string | undefined;
981
+ text?: {
982
+ contains: string;
983
+ visible?: boolean | undefined;
984
+ absent?: boolean | undefined;
985
+ scope?: string | undefined;
986
+ } | undefined;
987
+ testid?: string | undefined;
954
988
  net?: {
955
989
  status?: number | undefined;
956
990
  method?: string | undefined;
957
- count?: number | undefined;
958
991
  urlContains?: string | undefined;
992
+ count?: number | undefined;
959
993
  } | undefined;
960
994
  console?: {
961
995
  level?: string | undefined;
@@ -967,13 +1001,19 @@ export declare const AnnotationSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObj
967
1001
  statePath?: string | undefined;
968
1002
  }, {
969
1003
  kind: "success-state";
970
- testid?: string | undefined;
971
1004
  signal?: string | undefined;
1005
+ text?: {
1006
+ contains: string;
1007
+ visible?: boolean | undefined;
1008
+ absent?: boolean | undefined;
1009
+ scope?: string | undefined;
1010
+ } | undefined;
1011
+ testid?: string | undefined;
972
1012
  net?: {
973
1013
  status?: number | undefined;
974
1014
  method?: string | undefined;
975
- count?: number | undefined;
976
1015
  urlContains?: string | undefined;
1016
+ count?: number | undefined;
977
1017
  } | undefined;
978
1018
  console?: {
979
1019
  level?: string | undefined;
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { AnnotationKind, CONTRACT_FILE_VERSION, ElementState, QueryBy, RunKind, RunStatus, } from './constants.js';
3
- import { PROJECT_FILE_VERSION } from './flow-constants.js';
4
- import { RiskSurface } from './verification-run.js';
2
+ import { CONTRACT_FILE_VERSION, ElementState, QueryBy } from './constants/constants.js';
3
+ // Imported from where they actually live: these are artifact constants, not wire constants.
4
+ import { AnnotationKind, PROJECT_FILE_VERSION, RunKind, RunStatus, } from '../artifacts/flow-constants.js';
5
+ import { RiskSurface } from '../verdict/verification-run.js';
5
6
  /**
6
7
  * A query describing which element(s) to find, Testing-Library style.
7
8
  *
@@ -38,7 +39,8 @@ export const ElementQuerySchema = z
38
39
  /** CSS selector or ref to scope the search. */
39
40
  scope: z.string().optional(),
40
41
  /**
41
- * Return the `scope` element ITSELF rather than searching inside it.
42
+ * Return the `scope` element ITSELF rather than searching inside it. When `text` is also given,
43
+ * the scope root must contain that text across its full subtree.
42
44
  *
43
45
  * Every other path excludes the scope root by construction, so a layout container with no role,
44
46
  * name, testid or text of its own was unreachable — and that is routinely the element carrying the
@@ -210,6 +212,24 @@ export const AnnotationSchema = z.discriminatedUnion('kind', [
210
212
  absent: z.boolean().optional(),
211
213
  })
212
214
  .optional(),
215
+ // A rendered-text golden end-condition, in the shapes the assert surface already accepts.
216
+ //
217
+ // The app this exists for has no testids, no `reticle.signal`, no registrable store and no
218
+ // network call on the interaction under test: a discount price computed and rendered, a
219
+ // formatted total, a derived label. Every other kind here needs a channel that app does not
220
+ // have, so it could not produce an asserted flow AT ALL -- and a flow with no assertion is a
221
+ // permanent green (#811).
222
+ //
223
+ // Ranked below `testid` in the precedence order: an element is a locator, text is content, and
224
+ // where a caller offered both the locator is the more stable anchor.
225
+ text: z
226
+ .object({
227
+ contains: z.string().min(1),
228
+ scope: z.string().min(1).optional(),
229
+ absent: z.boolean().optional(),
230
+ visible: z.boolean().optional(),
231
+ })
232
+ .optional(),
213
233
  }),
214
234
  z.object({
215
235
  kind: z.literal(AnnotationKind.INTENT),
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * WHY an install has produced no session — the closed vocabulary, on its own.
3
3
  *
4
- * Split out of telemetry.ts when that file crossed the 1000-line cap. It belongs apart regardless:
5
- * telemetry.ts is the wire contract, and this is the taxonomy the no-session DIAGNOSIS owns, read
6
- * by `explainNoSession`, the session manager and the refusal reporter alike.
4
+ * `telemetry.ts` is the wire contract; this is the taxonomy the no-session DIAGNOSIS owns, read by
5
+ * `explainNoSession`, the session manager and the refusal reporter alike.
7
6
  *
8
7
  * `no_session` is the largest refusal cohort, and on its own it is a set difference: the daemon
9
8
  * started, no app connected, and nothing says which of several opposite situations that was.
@@ -15,6 +14,11 @@
15
14
  * received would be worse than none.
16
15
  */
17
16
  export declare const NoSessionReason: {
17
+ /**
18
+ * A page dialled and was REFUSED on its pairing token. The only positive evidence in the set:
19
+ * only an SDK dials the bridge, so the app is running and instrumented and this daemon said no.
20
+ */
21
+ readonly AUTH_REFUSED: "auth_refused";
18
22
  /** Connected before; the session that went was a pooled lease that aged out. */
19
23
  readonly LEASE_EXPIRED: "lease_expired";
20
24
  /** Connected before; the tab was closed, navigated away, or hard-reloaded. */
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * WHY an install has produced no session — the closed vocabulary, on its own.
3
3
  *
4
- * Split out of telemetry.ts when that file crossed the 1000-line cap. It belongs apart regardless:
5
- * telemetry.ts is the wire contract, and this is the taxonomy the no-session DIAGNOSIS owns, read
6
- * by `explainNoSession`, the session manager and the refusal reporter alike.
4
+ * `telemetry.ts` is the wire contract; this is the taxonomy the no-session DIAGNOSIS owns, read by
5
+ * `explainNoSession`, the session manager and the refusal reporter alike.
7
6
  *
8
7
  * `no_session` is the largest refusal cohort, and on its own it is a set difference: the daemon
9
8
  * started, no app connected, and nothing says which of several opposite situations that was.
@@ -15,6 +14,11 @@
15
14
  * received would be worse than none.
16
15
  */
17
16
  export const NoSessionReason = {
17
+ /**
18
+ * A page dialled and was REFUSED on its pairing token. The only positive evidence in the set:
19
+ * only an SDK dials the bridge, so the app is running and instrumented and this daemon said no.
20
+ */
21
+ AUTH_REFUSED: 'auth_refused',
18
22
  /** Connected before; the session that went was a pooled lease that aged out. */
19
23
  LEASE_EXPIRED: 'lease_expired',
20
24
  /** Connected before; the tab was closed, navigated away, or hard-reloaded. */
@@ -51,6 +51,22 @@ export declare const THROTTLED_WARNING = "tab throttled; timer/rAF/pointer gestu
51
51
  * failure. The CLI escape hatch is named second; an MCP-only agent has no shell.
52
52
  */
53
53
  export declare const THROTTLED_STARVED_NOTE: string;
54
+ /**
55
+ * Carried by a `console absent` pass whose window starts where the SDK attached.
56
+ *
57
+ * The console channel does not exist until `installConsole` patches `console`, and the documented
58
+ * Next.js install connects through a dynamic import inside a `useEffect` — so a `console.error`
59
+ * fired during first render is never captured. Not evicted, permanently invisible: a reporter
60
+ * proved it with a control, and the same error fired from a click seconds later IS captured.
61
+ * Meanwhile the response said the observation "ran and found none, which is a result, not a missing
62
+ * reading", which is the opposite of true for that stretch of the page's life.
63
+ *
64
+ * Same shape and same argument as PRE_ATTACH_CAVEAT one channel over, and the same deliberate
65
+ * restraint: the grade is NOT downgraded. A clean console is the finding this oracle exists to
66
+ * make, and turning every startup window into `unknown` would retire the check rather than fix it.
67
+ * What changes is only what the pass CLAIMS.
68
+ */
69
+ export declare const CONSOLE_ATTACH_NOTE: string;
54
70
  /**
55
71
  * Pushed to the panel when the last agent's MCP connection drops — the agent (any of
56
72
  * Codex/OpenCode/Claude/Hermes) has stopped or is waiting on you. Tells the human, who is
@@ -106,13 +122,11 @@ export declare const LEASE_IS_INVISIBLE_NOTE = "note that a lease is a SEPARATE
106
122
  /**
107
123
  * A DESKTOP window that has gone to the background, which is a different problem with a different fix.
108
124
  *
109
- * The web answer — acquire a lease, or run `reticle drive <url>` — is unavailable here and saying it
110
- * is worse than saying nothing. A lease opens a headless BROWSER context; an Electron or Tauri app's
111
- * window IS the client, and a browser pointed at the same dev-server URL is a different program with
112
- * no main process, no preload and no Rust commands. Driven on MarkText, a shipped Electron editor:
113
- * its window went behind, the session reported hidden+throttled, and the only advice offered was the
114
- * one thing that could not be done — while the thing that works, bringing the window forward, went
115
- * unsaid.
125
+ * The web answer — acquire a lease, or run `reticle drive <url>` — is unavailable here, and saying
126
+ * it is worse than saying nothing: a lease opens a headless BROWSER context, while an Electron or
127
+ * Tauri app's window IS the client, so a browser pointed at the same dev-server URL is a different
128
+ * program with no main process, no preload and no Rust commands. The thing that works is bringing
129
+ * the window forward.
116
130
  *
117
131
  * No `reticle_lease` and no `reticle drive` in this sentence, deliberately. Both are checked by test.
118
132
  */
@@ -125,11 +139,9 @@ export declare const HIDDEN_TAB_RECOMMENDATION: string;
125
139
  * stale only means no health heartbeat arrived inside the window. For a tab that is not hidden that
126
140
  * usually means nothing worse than a quiet page, and such a tab is very often driveable.
127
141
  *
128
- * Split out because the old single message treated this as equivalent to hidden and it is not.
129
- * Measured in the field: a session flagged throttled took a sign-in and two clean net-grade verdicts
130
- * with no retries, while the recommendation had already sent the agent into a lease the watching
131
- * human could not see. One flag produced advice that cost the product's main trust surface and
132
- * bought nothing.
142
+ * Treating it as equivalent to hidden costs the drive for nothing: a throttled tab routinely takes
143
+ * a sign-in and grades clean net verdicts with no retries, while advice to lease sends the agent
144
+ * into a context the watching human cannot see.
133
145
  *
134
146
  * So this reports the uncertainty honestly — it MAY be slow, timing-sensitive work is what suffers —
135
147
  * and offers the precise instrument for that (`refuseWhenThrottled`) rather than a different