@reticlehq/core 3.9.0 → 3.10.1

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 (55) hide show
  1. package/dist/artifacts/flow-constants.d.ts +17 -0
  2. package/dist/artifacts/flow-constants.js +15 -0
  3. package/dist/artifacts/flow-results.d.ts +27 -2
  4. package/dist/artifacts/flow-step-tool.d.ts +17 -0
  5. package/dist/artifacts/flow-step-tool.js +18 -1
  6. package/dist/artifacts/flow-types.d.ts +59 -0
  7. package/dist/artifacts/flow-types.js +51 -6
  8. package/dist/identity/github-action.d.ts +2 -2
  9. package/dist/identity/github-action.js +1 -1
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.js +3 -0
  12. package/dist/schema/event-message.json +1 -0
  13. package/dist/schema/event-payloads.json +47 -1
  14. package/dist/schema/event-type.json +1 -0
  15. package/dist/schema/reticle-event.json +1 -0
  16. package/dist/schema/reticle-message.json +1 -0
  17. package/dist/telemetry-refusal.d.ts +82 -0
  18. package/dist/telemetry-refusal.js +49 -0
  19. package/dist/telemetry-signals.d.ts +44 -0
  20. package/dist/telemetry-signals.js +17 -0
  21. package/dist/telemetry.d.ts +66 -2
  22. package/dist/telemetry.js +8 -1
  23. package/dist/verdict/findings.d.ts +34 -0
  24. package/dist/verdict/findings.js +37 -0
  25. package/dist/verdict/predicate.d.ts +1 -0
  26. package/dist/verdict/predicate.js +26 -1
  27. package/dist/verdict/verdict-attribution.js +1 -0
  28. package/dist/verdict/verified-constants.d.ts +17 -0
  29. package/dist/verdict/verified-constants.js +17 -0
  30. package/dist/wire/click-input.d.ts +26 -0
  31. package/dist/wire/click-input.js +65 -0
  32. package/dist/wire/constants/animation-command.d.ts +2 -0
  33. package/dist/wire/constants/animation-command.js +2 -0
  34. package/dist/wire/constants/console-event.d.ts +44 -0
  35. package/dist/wire/constants/console-event.js +44 -0
  36. package/dist/wire/constants/constants.d.ts +38 -13
  37. package/dist/wire/constants/constants.js +38 -13
  38. package/dist/wire/constants/determinism.d.ts +17 -0
  39. package/dist/wire/constants/determinism.js +17 -0
  40. package/dist/wire/constants/event-types.d.ts +113 -0
  41. package/dist/wire/constants/event-types.js +87 -0
  42. package/dist/wire/event-payloads.d.ts +16 -93
  43. package/dist/wire/event-payloads.js +26 -72
  44. package/dist/wire/event-priority.js +1 -0
  45. package/dist/wire/global-press.d.ts +9 -2
  46. package/dist/wire/global-press.js +39 -12
  47. package/dist/wire/messages.d.ts +3 -0
  48. package/dist/wire/net.d.ts +39 -0
  49. package/dist/wire/net.js +56 -8
  50. package/dist/wire/redaction.d.ts +18 -0
  51. package/dist/wire/redaction.js +72 -0
  52. package/dist/wire/tool-names.d.ts +4 -0
  53. package/dist/wire/tool-names.js +4 -0
  54. package/dist/wire/types.d.ts +8 -0
  55. package/package.json +1 -1
@@ -34,6 +34,51 @@ export declare const RefusalReason: {
34
34
  readonly OTHER: "other";
35
35
  };
36
36
  export type RefusalReason = (typeof RefusalReason)[keyof typeof RefusalReason];
37
+ /**
38
+ * WHICH cause inside a `RefusalReason` bucket, when the server can tell.
39
+ *
40
+ * One member for each entry of `error-recovery.ts`'s recovery table. A missing browser pool has
41
+ * three: no pool, a pool that is shut down, and no Chromium for Playwright. They need different
42
+ * fixes, and `not_ready` alone could not say which one stopped a user. Never the message.
43
+ */
44
+ export declare const RefusalDetail: {
45
+ readonly NO_SESSION: "no_session";
46
+ readonly MULTIPLE_SESSIONS: "multiple_sessions";
47
+ readonly UNKNOWN_SESSION: "unknown_session";
48
+ readonly SCOPE_MISMATCH: "scope_mismatch";
49
+ readonly SESSION_GONE: "session_gone";
50
+ readonly THROTTLED: "throttled";
51
+ readonly COMMAND_TIMEOUT: "command_timeout";
52
+ /** The daemon has no browser pool: Reticle did not start through `reticle mcp`. */
53
+ readonly POOL_UNAVAILABLE: "pool_unavailable";
54
+ /** The browser pool stopped, because the daemon is shutting down. */
55
+ readonly POOL_SHUT_DOWN: "pool_shut_down";
56
+ /** Playwright has no Chromium installed. */
57
+ readonly CHROMIUM_MISSING: "chromium_missing";
58
+ /** RETICLE_CHROMIUM_PATH names a browser the daemon cannot launch. */
59
+ readonly CHROMIUM_PATH: "chromium_path";
60
+ readonly TOKEN_REQUIRED: "token_required";
61
+ readonly MISSING_BASELINE: "missing_baseline";
62
+ readonly MISSING_RECORDING: "missing_recording";
63
+ readonly STALE_REF: "stale_ref";
64
+ readonly STALE_REF_AFTER_EDIT: "stale_ref_after_edit";
65
+ readonly UNISSUED_REF: "unissued_ref";
66
+ readonly NO_SUCH_OPTION: "no_such_option";
67
+ readonly TARGET_MISSED: "target_missed";
68
+ readonly AMBIGUOUS_TARGET: "ambiguous_target";
69
+ readonly FLOW_STEP_MISSING: "flow_step_missing";
70
+ readonly UNSUPPORTED_SURFACE: "unsupported_surface";
71
+ readonly HOVER_NEEDS_POINTER: "hover_needs_pointer";
72
+ readonly NOT_EDITABLE: "not_editable";
73
+ readonly CONFIRM_DANGEROUS: "confirm_dangerous";
74
+ readonly WRONG_TARGET: "wrong_target";
75
+ readonly PRODUCTION_POLICY: "production_policy";
76
+ readonly BAD_ARGUMENTS: "bad_arguments";
77
+ readonly INVALID_NAME: "invalid_name";
78
+ readonly HARNESS_OFF: "harness_off";
79
+ readonly HARNESS_LOCKED: "harness_locked";
80
+ };
81
+ export type RefusalDetail = (typeof RefusalDetail)[keyof typeof RefusalDetail];
37
82
  /** One tool call that could not be served. */
38
83
  export declare const ToolRefusalSchema: z.ZodObject<{
39
84
  tool: z.ZodString;
@@ -64,6 +109,43 @@ export declare const ToolRefusalSchema: z.ZodObject<{
64
109
  readonly NO_CONFIG: "no_config";
65
110
  readonly SDK_NOT_REACHING_DAEMON: "sdk_not_reaching_daemon";
66
111
  }>>;
112
+ detail: z.ZodOptional<z.ZodEnum<{
113
+ readonly NO_SESSION: "no_session";
114
+ readonly MULTIPLE_SESSIONS: "multiple_sessions";
115
+ readonly UNKNOWN_SESSION: "unknown_session";
116
+ readonly SCOPE_MISMATCH: "scope_mismatch";
117
+ readonly SESSION_GONE: "session_gone";
118
+ readonly THROTTLED: "throttled";
119
+ readonly COMMAND_TIMEOUT: "command_timeout";
120
+ /** The daemon has no browser pool: Reticle did not start through `reticle mcp`. */
121
+ readonly POOL_UNAVAILABLE: "pool_unavailable";
122
+ /** The browser pool stopped, because the daemon is shutting down. */
123
+ readonly POOL_SHUT_DOWN: "pool_shut_down";
124
+ /** Playwright has no Chromium installed. */
125
+ readonly CHROMIUM_MISSING: "chromium_missing";
126
+ /** RETICLE_CHROMIUM_PATH names a browser the daemon cannot launch. */
127
+ readonly CHROMIUM_PATH: "chromium_path";
128
+ readonly TOKEN_REQUIRED: "token_required";
129
+ readonly MISSING_BASELINE: "missing_baseline";
130
+ readonly MISSING_RECORDING: "missing_recording";
131
+ readonly STALE_REF: "stale_ref";
132
+ readonly STALE_REF_AFTER_EDIT: "stale_ref_after_edit";
133
+ readonly UNISSUED_REF: "unissued_ref";
134
+ readonly NO_SUCH_OPTION: "no_such_option";
135
+ readonly TARGET_MISSED: "target_missed";
136
+ readonly AMBIGUOUS_TARGET: "ambiguous_target";
137
+ readonly FLOW_STEP_MISSING: "flow_step_missing";
138
+ readonly UNSUPPORTED_SURFACE: "unsupported_surface";
139
+ readonly HOVER_NEEDS_POINTER: "hover_needs_pointer";
140
+ readonly NOT_EDITABLE: "not_editable";
141
+ readonly CONFIRM_DANGEROUS: "confirm_dangerous";
142
+ readonly WRONG_TARGET: "wrong_target";
143
+ readonly PRODUCTION_POLICY: "production_policy";
144
+ readonly BAD_ARGUMENTS: "bad_arguments";
145
+ readonly INVALID_NAME: "invalid_name";
146
+ readonly HARNESS_OFF: "harness_off";
147
+ readonly HARNESS_LOCKED: "harness_locked";
148
+ }>>;
67
149
  retried: z.ZodBoolean;
68
150
  params: z.ZodOptional<z.ZodArray<z.ZodString>>;
69
151
  }, z.core.$strip>;
@@ -34,6 +34,50 @@ export const RefusalReason = {
34
34
  /** A refusal this list does not name. A classifier that cannot say "I don't know" lies instead. */
35
35
  OTHER: 'other',
36
36
  };
37
+ /**
38
+ * WHICH cause inside a `RefusalReason` bucket, when the server can tell.
39
+ *
40
+ * One member for each entry of `error-recovery.ts`'s recovery table. A missing browser pool has
41
+ * three: no pool, a pool that is shut down, and no Chromium for Playwright. They need different
42
+ * fixes, and `not_ready` alone could not say which one stopped a user. Never the message.
43
+ */
44
+ export const RefusalDetail = {
45
+ NO_SESSION: 'no_session',
46
+ MULTIPLE_SESSIONS: 'multiple_sessions',
47
+ UNKNOWN_SESSION: 'unknown_session',
48
+ SCOPE_MISMATCH: 'scope_mismatch',
49
+ SESSION_GONE: 'session_gone',
50
+ THROTTLED: 'throttled',
51
+ COMMAND_TIMEOUT: 'command_timeout',
52
+ /** The daemon has no browser pool: Reticle did not start through `reticle mcp`. */
53
+ POOL_UNAVAILABLE: 'pool_unavailable',
54
+ /** The browser pool stopped, because the daemon is shutting down. */
55
+ POOL_SHUT_DOWN: 'pool_shut_down',
56
+ /** Playwright has no Chromium installed. */
57
+ CHROMIUM_MISSING: 'chromium_missing',
58
+ /** RETICLE_CHROMIUM_PATH names a browser the daemon cannot launch. */
59
+ CHROMIUM_PATH: 'chromium_path',
60
+ TOKEN_REQUIRED: 'token_required',
61
+ MISSING_BASELINE: 'missing_baseline',
62
+ MISSING_RECORDING: 'missing_recording',
63
+ STALE_REF: 'stale_ref',
64
+ STALE_REF_AFTER_EDIT: 'stale_ref_after_edit',
65
+ UNISSUED_REF: 'unissued_ref',
66
+ NO_SUCH_OPTION: 'no_such_option',
67
+ TARGET_MISSED: 'target_missed',
68
+ AMBIGUOUS_TARGET: 'ambiguous_target',
69
+ FLOW_STEP_MISSING: 'flow_step_missing',
70
+ UNSUPPORTED_SURFACE: 'unsupported_surface',
71
+ HOVER_NEEDS_POINTER: 'hover_needs_pointer',
72
+ NOT_EDITABLE: 'not_editable',
73
+ CONFIRM_DANGEROUS: 'confirm_dangerous',
74
+ WRONG_TARGET: 'wrong_target',
75
+ PRODUCTION_POLICY: 'production_policy',
76
+ BAD_ARGUMENTS: 'bad_arguments',
77
+ INVALID_NAME: 'invalid_name',
78
+ HARNESS_OFF: 'harness_off',
79
+ HARNESS_LOCKED: 'harness_locked',
80
+ };
37
81
  /** One tool call that could not be served. */
38
82
  export const ToolRefusalSchema = z.object({
39
83
  /** Which tool. A name from our own fixed namespace, never app data. */
@@ -47,6 +91,11 @@ export const ToolRefusalSchema = z.object({
47
91
  * it cannot carry a reason that does not exist yet. Absent on every other refusal reason.
48
92
  */
49
93
  noSessionReason: z.nativeEnum(NoSessionReason).optional(),
94
+ /**
95
+ * WHICH cause inside `reason`, from core's closed `RefusalDetail`. Absent when the recovery table
96
+ * did not recognise the message, and on a refusal that diagnosed itself.
97
+ */
98
+ detail: z.nativeEnum(RefusalDetail).optional(),
50
99
  /**
51
100
  * TRUE when the call immediately before this one was the SAME tool, also refused.
52
101
  *
@@ -433,10 +433,26 @@ export declare const DaemonEnd: {
433
433
  readonly SIGNALLED: "signalled";
434
434
  /** The beat simply stopped. No exit, no signal: killed, crashed, or swept. */
435
435
  readonly DIED_SILENTLY: "died_silently";
436
+ /** It failed to start, before its first beat. `startupError` says where. */
437
+ readonly START_FAILED: "start_failed";
436
438
  /** No beat was ever emitted, so the log cannot answer the question. */
437
439
  readonly UNKNOWN: "unknown";
438
440
  };
439
441
  export type DaemonEnd = (typeof DaemonEnd)[keyof typeof DaemonEnd];
442
+ /** Where a daemon start failed. A closed list: the message of the error never leaves the machine. */
443
+ export declare const DaemonStartupError: {
444
+ /** The bind of the port failed, for example with `EADDRINUSE` or `EACCES`. */
445
+ readonly LISTEN: "listen";
446
+ /** The start failed for a different reason. */
447
+ readonly START: "start";
448
+ /** A throw that nothing caught stopped the start. */
449
+ readonly UNCAUGHT_EXCEPTION: "uncaught_exception";
450
+ /** A rejected promise that nothing handled stopped the start. */
451
+ readonly UNHANDLED_REJECTION: "unhandled_rejection";
452
+ /** Node stopped the process before it wrote its first log line, for example on a failed import. */
453
+ readonly BEFORE_LOG: "before_log";
454
+ };
455
+ export type DaemonStartupError = (typeof DaemonStartupError)[keyof typeof DaemonStartupError];
440
456
  /** A Node error code, such as `EADDRINUSE` or `ERR_MODULE_NOT_FOUND`. Never a message or a path. */
441
457
  export declare const NODE_ERROR_CODE: RegExp;
442
458
  /** `daemon_died_unclean`: a daemon start found the pidfile of a daemon that never stopped cleanly. */
@@ -451,6 +467,8 @@ export declare const DaemonDeathSchema: z.ZodObject<{
451
467
  readonly SIGNALLED: "signalled";
452
468
  /** The beat simply stopped. No exit, no signal: killed, crashed, or swept. */
453
469
  readonly DIED_SILENTLY: "died_silently";
470
+ /** It failed to start, before its first beat. `startupError` says where. */
471
+ readonly START_FAILED: "start_failed";
454
472
  /** No beat was ever emitted, so the log cannot answer the question. */
455
473
  readonly UNKNOWN: "unknown";
456
474
  }>>;
@@ -460,6 +478,18 @@ export declare const DaemonDeathSchema: z.ZodObject<{
460
478
  served: z.ZodOptional<z.ZodBoolean>;
461
479
  rssMb: z.ZodOptional<z.ZodNumber>;
462
480
  error: z.ZodOptional<z.ZodString>;
481
+ startupError: z.ZodOptional<z.ZodEnum<{
482
+ /** The bind of the port failed, for example with `EADDRINUSE` or `EACCES`. */
483
+ readonly LISTEN: "listen";
484
+ /** The start failed for a different reason. */
485
+ readonly START: "start";
486
+ /** A throw that nothing caught stopped the start. */
487
+ readonly UNCAUGHT_EXCEPTION: "uncaught_exception";
488
+ /** A rejected promise that nothing handled stopped the start. */
489
+ readonly UNHANDLED_REJECTION: "unhandled_rejection";
490
+ /** Node stopped the process before it wrote its first log line, for example on a failed import. */
491
+ readonly BEFORE_LOG: "before_log";
492
+ }>>;
463
493
  }, z.core.$strip>;
464
494
  export type DaemonDeath = z.infer<typeof DaemonDeathSchema>;
465
495
  /** How the parent started the daemon. On Windows a start through WMI leaves the Job Object. */
@@ -521,6 +551,8 @@ export declare const TRANSPORT_FIELDS: {
521
551
  readonly SIGNALLED: "signalled";
522
552
  /** The beat simply stopped. No exit, no signal: killed, crashed, or swept. */
523
553
  readonly DIED_SILENTLY: "died_silently";
554
+ /** It failed to start, before its first beat. `startupError` says where. */
555
+ readonly START_FAILED: "start_failed";
524
556
  /** No beat was ever emitted, so the log cannot answer the question. */
525
557
  readonly UNKNOWN: "unknown";
526
558
  }>>;
@@ -530,6 +562,18 @@ export declare const TRANSPORT_FIELDS: {
530
562
  served: z.ZodOptional<z.ZodBoolean>;
531
563
  rssMb: z.ZodOptional<z.ZodNumber>;
532
564
  error: z.ZodOptional<z.ZodString>;
565
+ startupError: z.ZodOptional<z.ZodEnum<{
566
+ /** The bind of the port failed, for example with `EADDRINUSE` or `EACCES`. */
567
+ readonly LISTEN: "listen";
568
+ /** The start failed for a different reason. */
569
+ readonly START: "start";
570
+ /** A throw that nothing caught stopped the start. */
571
+ readonly UNCAUGHT_EXCEPTION: "uncaught_exception";
572
+ /** A rejected promise that nothing handled stopped the start. */
573
+ readonly UNHANDLED_REJECTION: "unhandled_rejection";
574
+ /** Node stopped the process before it wrote its first log line, for example on a failed import. */
575
+ readonly BEFORE_LOG: "before_log";
576
+ }>>;
533
577
  }, z.core.$strip>>;
534
578
  /** Only on `wake_refused`. */
535
579
  wakeRefusal: z.ZodOptional<z.ZodObject<{
@@ -228,9 +228,24 @@ export const DaemonEnd = {
228
228
  SIGNALLED: 'signalled',
229
229
  /** The beat simply stopped. No exit, no signal: killed, crashed, or swept. */
230
230
  DIED_SILENTLY: 'died_silently',
231
+ /** It failed to start, before its first beat. `startupError` says where. */
232
+ START_FAILED: 'start_failed',
231
233
  /** No beat was ever emitted, so the log cannot answer the question. */
232
234
  UNKNOWN: 'unknown',
233
235
  };
236
+ /** Where a daemon start failed. A closed list: the message of the error never leaves the machine. */
237
+ export const DaemonStartupError = {
238
+ /** The bind of the port failed, for example with `EADDRINUSE` or `EACCES`. */
239
+ LISTEN: 'listen',
240
+ /** The start failed for a different reason. */
241
+ START: 'start',
242
+ /** A throw that nothing caught stopped the start. */
243
+ UNCAUGHT_EXCEPTION: 'uncaught_exception',
244
+ /** A rejected promise that nothing handled stopped the start. */
245
+ UNHANDLED_REJECTION: 'unhandled_rejection',
246
+ /** Node stopped the process before it wrote its first log line, for example on a failed import. */
247
+ BEFORE_LOG: 'before_log',
248
+ };
234
249
  /** A signal name, never anything else. */
235
250
  const SIGNAL_NAME = /^SIG[A-Z0-9]{1,12}$/;
236
251
  /** A Node error code, such as `EADDRINUSE` or `ERR_MODULE_NOT_FOUND`. Never a message or a path. */
@@ -253,6 +268,8 @@ export const DaemonDeathSchema = z.object({
253
268
  rssMb: z.number().int().nonnegative().optional(),
254
269
  /** The Node error code of a failed start or a crash. */
255
270
  error: z.string().regex(NODE_ERROR_CODE).optional(),
271
+ /** Where the start failed, when `end` is `start_failed`. */
272
+ startupError: z.nativeEnum(DaemonStartupError).optional(),
256
273
  });
257
274
  /** How the parent started the daemon. On Windows a start through WMI leaves the Job Object. */
258
275
  export const DaemonSpawnMethod = {
@@ -80,7 +80,7 @@ export declare const TelemetryEventKind: {
80
80
  readonly PROJECT_PROFILED: "project_profiled";
81
81
  /**
82
82
  * A start found a version that differs from the last start on this machine, or `reticle update` /
83
- * `reticle rollback` moved it. Carries from → to.
83
+ * `reticle update --rollback` moved it. Carries from → to.
84
84
  */
85
85
  readonly VERSION_CHANGED: "version_changed";
86
86
  /** An uncaught exception or unhandled rejection reached the top of the daemon. Crash analytics. */
@@ -293,6 +293,7 @@ export declare const VerificationSchema: z.ZodObject<{
293
293
  readonly INCONCLUSIVE: "inconclusive";
294
294
  readonly OBSERVATION_LOST: "observation_lost";
295
295
  readonly WINDOW_CLOSED_EARLY: "window_closed_early";
296
+ readonly DIALOG_DECLINED: "dialog_declined";
296
297
  readonly ASSERTION_FAILED: "assertion_failed";
297
298
  readonly CONTRADICTED: "contradicted";
298
299
  readonly ALREADY_TRUE: "already_true";
@@ -610,6 +611,13 @@ export declare const InitConfirmation: {
610
611
  * already followed. They need to open the app.
611
612
  */
612
613
  readonly NO_PAGE: "no_page";
614
+ /**
615
+ * `init` wrote its files, and the machine kept the dev server from starting (its port was taken,
616
+ * or it answered on one loopback address and not the other), so no page could connect. Not a failed
617
+ * install: the project is wired and the app is fine. `stop` says which. A dev server that exits,
618
+ * hangs or does not exist is still a failure (`reason` `dev_server`).
619
+ */
620
+ readonly DEV_SERVER_NOT_STARTED: "dev_server_not_started";
613
621
  };
614
622
  export type InitConfirmation = (typeof InitConfirmation)[keyof typeof InitConfirmation];
615
623
  /**
@@ -672,6 +680,13 @@ export declare const InitOutcomeSchema: z.ZodObject<{
672
680
  * already followed. They need to open the app.
673
681
  */
674
682
  readonly NO_PAGE: "no_page";
683
+ /**
684
+ * `init` wrote its files, and the machine kept the dev server from starting (its port was taken,
685
+ * or it answered on one loopback address and not the other), so no page could connect. Not a failed
686
+ * install: the project is wired and the app is fine. `stop` says which. A dev server that exits,
687
+ * hangs or does not exist is still a failure (`reason` `dev_server`).
688
+ */
689
+ readonly DEV_SERVER_NOT_STARTED: "dev_server_not_started";
675
690
  }>>;
676
691
  stop: z.ZodOptional<z.ZodEnum<{
677
692
  /** The project names no dev, start or serve script, and no `--url` was given. */
@@ -723,6 +738,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
723
738
  readonly CLEAN: "clean";
724
739
  readonly SIGNALLED: "signalled";
725
740
  readonly DIED_SILENTLY: "died_silently";
741
+ readonly START_FAILED: "start_failed";
726
742
  readonly UNKNOWN: "unknown";
727
743
  }>>;
728
744
  silentMs: z.ZodOptional<z.ZodNumber>;
@@ -731,6 +747,13 @@ export declare const TelemetryEventSchema: z.ZodObject<{
731
747
  served: z.ZodOptional<z.ZodBoolean>;
732
748
  rssMb: z.ZodOptional<z.ZodNumber>;
733
749
  error: z.ZodOptional<z.ZodString>;
750
+ startupError: z.ZodOptional<z.ZodEnum<{
751
+ readonly LISTEN: "listen";
752
+ readonly START: "start";
753
+ readonly UNCAUGHT_EXCEPTION: "uncaught_exception";
754
+ readonly UNHANDLED_REJECTION: "unhandled_rejection";
755
+ readonly BEFORE_LOG: "before_log";
756
+ }>>;
734
757
  }, z.core.$strip>>;
735
758
  wakeRefusal: z.ZodOptional<z.ZodObject<{
736
759
  presence: z.ZodEnum<{
@@ -905,7 +928,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
905
928
  readonly PROJECT_PROFILED: "project_profiled";
906
929
  /**
907
930
  * A start found a version that differs from the last start on this machine, or `reticle update` /
908
- * `reticle rollback` moved it. Carries from → to.
931
+ * `reticle update --rollback` moved it. Carries from → to.
909
932
  */
910
933
  readonly VERSION_CHANGED: "version_changed";
911
934
  /** An uncaught exception or unhandled rejection reached the top of the daemon. Crash analytics. */
@@ -1273,6 +1296,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1273
1296
  readonly INCONCLUSIVE: "inconclusive";
1274
1297
  readonly OBSERVATION_LOST: "observation_lost";
1275
1298
  readonly WINDOW_CLOSED_EARLY: "window_closed_early";
1299
+ readonly DIALOG_DECLINED: "dialog_declined";
1276
1300
  readonly ASSERTION_FAILED: "assertion_failed";
1277
1301
  readonly CONTRADICTED: "contradicted";
1278
1302
  readonly ALREADY_TRUE: "already_true";
@@ -1377,6 +1401,13 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1377
1401
  * already followed. They need to open the app.
1378
1402
  */
1379
1403
  readonly NO_PAGE: "no_page";
1404
+ /**
1405
+ * `init` wrote its files, and the machine kept the dev server from starting (its port was taken,
1406
+ * or it answered on one loopback address and not the other), so no page could connect. Not a failed
1407
+ * install: the project is wired and the app is fine. `stop` says which. A dev server that exits,
1408
+ * hangs or does not exist is still a failure (`reason` `dev_server`).
1409
+ */
1410
+ readonly DEV_SERVER_NOT_STARTED: "dev_server_not_started";
1380
1411
  }>>;
1381
1412
  stop: z.ZodOptional<z.ZodEnum<{
1382
1413
  /** The project names no dev, start or serve script, and no `--url` was given. */
@@ -1487,6 +1518,39 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1487
1518
  readonly NO_CONFIG: "no_config";
1488
1519
  readonly SDK_NOT_REACHING_DAEMON: "sdk_not_reaching_daemon";
1489
1520
  }>>;
1521
+ detail: z.ZodOptional<z.ZodEnum<{
1522
+ readonly NO_SESSION: "no_session";
1523
+ readonly MULTIPLE_SESSIONS: "multiple_sessions";
1524
+ readonly UNKNOWN_SESSION: "unknown_session";
1525
+ readonly SCOPE_MISMATCH: "scope_mismatch";
1526
+ readonly SESSION_GONE: "session_gone";
1527
+ readonly THROTTLED: "throttled";
1528
+ readonly COMMAND_TIMEOUT: "command_timeout";
1529
+ readonly POOL_UNAVAILABLE: "pool_unavailable";
1530
+ readonly POOL_SHUT_DOWN: "pool_shut_down";
1531
+ readonly CHROMIUM_MISSING: "chromium_missing";
1532
+ readonly CHROMIUM_PATH: "chromium_path";
1533
+ readonly TOKEN_REQUIRED: "token_required";
1534
+ readonly MISSING_BASELINE: "missing_baseline";
1535
+ readonly MISSING_RECORDING: "missing_recording";
1536
+ readonly STALE_REF: "stale_ref";
1537
+ readonly STALE_REF_AFTER_EDIT: "stale_ref_after_edit";
1538
+ readonly UNISSUED_REF: "unissued_ref";
1539
+ readonly NO_SUCH_OPTION: "no_such_option";
1540
+ readonly TARGET_MISSED: "target_missed";
1541
+ readonly AMBIGUOUS_TARGET: "ambiguous_target";
1542
+ readonly FLOW_STEP_MISSING: "flow_step_missing";
1543
+ readonly UNSUPPORTED_SURFACE: "unsupported_surface";
1544
+ readonly HOVER_NEEDS_POINTER: "hover_needs_pointer";
1545
+ readonly NOT_EDITABLE: "not_editable";
1546
+ readonly CONFIRM_DANGEROUS: "confirm_dangerous";
1547
+ readonly WRONG_TARGET: "wrong_target";
1548
+ readonly PRODUCTION_POLICY: "production_policy";
1549
+ readonly BAD_ARGUMENTS: "bad_arguments";
1550
+ readonly INVALID_NAME: "invalid_name";
1551
+ readonly HARNESS_OFF: "harness_off";
1552
+ readonly HARNESS_LOCKED: "harness_locked";
1553
+ }>>;
1490
1554
  retried: z.ZodBoolean;
1491
1555
  params: z.ZodOptional<z.ZodArray<z.ZodString>>;
1492
1556
  }, z.core.$strip>>;
package/dist/telemetry.js CHANGED
@@ -88,7 +88,7 @@ export const TelemetryEventKind = {
88
88
  PROJECT_PROFILED: 'project_profiled',
89
89
  /**
90
90
  * A start found a version that differs from the last start on this machine, or `reticle update` /
91
- * `reticle rollback` moved it. Carries from → to.
91
+ * `reticle update --rollback` moved it. Carries from → to.
92
92
  */
93
93
  VERSION_CHANGED: 'version_changed',
94
94
  /** An uncaught exception or unhandled rejection reached the top of the daemon. Crash analytics. */
@@ -703,6 +703,13 @@ export const InitConfirmation = {
703
703
  * already followed. They need to open the app.
704
704
  */
705
705
  NO_PAGE: 'no_page',
706
+ /**
707
+ * `init` wrote its files, and the machine kept the dev server from starting (its port was taken,
708
+ * or it answered on one loopback address and not the other), so no page could connect. Not a failed
709
+ * install: the project is wired and the app is fine. `stop` says which. A dev server that exits,
710
+ * hangs or does not exist is still a failure (`reason` `dev_server`).
711
+ */
712
+ DEV_SERVER_NOT_STARTED: 'dev_server_not_started',
706
713
  };
707
714
  /**
708
715
  * The step a failed runtime `init` stopped at. It refines `reason` and never replaces it.
@@ -253,6 +253,19 @@ export declare const ContradictionKind: {
253
253
  * "you changed the code and then looked only at what happened before you did".
254
254
  */
255
255
  readonly EVIDENCE_PREDATES_EDIT: "evidence-predates-edit";
256
+ /**
257
+ * A read of the app's own failed with a server error (5xx) inside the action window, and no later
258
+ * call to the same url recovered it.
259
+ *
260
+ * A GET is skipped by the write rules because the DOM shows its payload. A FAILED GET breaks that
261
+ * premise: the page can keep stale or placeholder content, and a route, a label or a visible
262
+ * control still holds over it. Found in the field: a replayed flow passed over a 500 and a 502 from
263
+ * the app's own API, and the app had a real serialization bug.
264
+ *
265
+ * Absence-derived, so it makes a verdict unknown, never no. The screen may show data that an
266
+ * earlier load put there, which is correct. What is absent is proof that it is this action's data.
267
+ */
268
+ readonly READ_SERVER_FAULT: "read-server-fault";
256
269
  };
257
270
  export type ContradictionKind = (typeof ContradictionKind)[keyof typeof ContradictionKind];
258
271
  /**
@@ -380,3 +393,24 @@ export declare const CrawlAnomalyKind: {
380
393
  readonly DEAD_CONTROL: "dead-control";
381
394
  };
382
395
  export type CrawlAnomalyKind = (typeof CrawlAnomalyKind)[keyof typeof CrawlAnomalyKind];
396
+ /**
397
+ * Behaviour faults that the systematic explorer finds by driving the app against itself. Each one
398
+ * needs no reference answer: the app's own earlier state, request or run is the reference.
399
+ *
400
+ * Like `CrawlAnomalyKind`, these are not cross-channel contradictions and do not decide a verdict.
401
+ */
402
+ export declare const BehaviourFindingKind: {
403
+ /** An undo or cancel did not return the page to the state before the action. */
404
+ readonly UNDO_NOT_RESTORED: "undo-not-restored";
405
+ /** A repeated identical action changed state that the first action did not change. */
406
+ readonly REPEAT_CHANGED_STATE: "repeat-changed-state";
407
+ /** A value the app saved is not shown after a reload, and the app did not say it was not saved. */
408
+ readonly LOST_AFTER_RELOAD: "lost-after-reload";
409
+ /** The value the page shows after a write is not the value the write request sent. */
410
+ readonly SHOWN_DIFFERS_FROM_SENT: "shown-differs-from-sent";
411
+ /** Two identical drives from a fresh page showed different results. */
412
+ readonly INTERMITTENT_RESULT: "intermittent-result";
413
+ /** With a write failing, the app arrived where it goes when the write succeeds. */
414
+ readonly FAILURE_UNHANDLED: "failure-unhandled";
415
+ };
416
+ export type BehaviourFindingKind = (typeof BehaviourFindingKind)[keyof typeof BehaviourFindingKind];
@@ -222,6 +222,19 @@ export const ContradictionKind = {
222
222
  * "you changed the code and then looked only at what happened before you did".
223
223
  */
224
224
  EVIDENCE_PREDATES_EDIT: 'evidence-predates-edit',
225
+ /**
226
+ * A read of the app's own failed with a server error (5xx) inside the action window, and no later
227
+ * call to the same url recovered it.
228
+ *
229
+ * A GET is skipped by the write rules because the DOM shows its payload. A FAILED GET breaks that
230
+ * premise: the page can keep stale or placeholder content, and a route, a label or a visible
231
+ * control still holds over it. Found in the field: a replayed flow passed over a 500 and a 502 from
232
+ * the app's own API, and the app had a real serialization bug.
233
+ *
234
+ * Absence-derived, so it makes a verdict unknown, never no. The screen may show data that an
235
+ * earlier load put there, which is correct. What is absent is proof that it is this action's data.
236
+ */
237
+ READ_SERVER_FAULT: 'read-server-fault',
225
238
  };
226
239
  /**
227
240
  * Contradictions inferred from the ABSENCE of evidence in a window whose end Reticle itself chose.
@@ -271,6 +284,8 @@ export const ABSENCE_DERIVED_CONTRADICTIONS = new Set([
271
284
  ContradictionKind.EVIDENCE_SUPERSEDED,
272
285
  // Nothing here says the app is wrong either — only that the window predates the edit under test.
273
286
  ContradictionKind.EVIDENCE_PREDATES_EDIT,
287
+ // The 5xx is observed. What is absent is proof that the screen shows this action's data.
288
+ ContradictionKind.READ_SERVER_FAULT,
274
289
  ]);
275
290
  /** True when this kind was inferred from absence rather than positively observed. */
276
291
  export function isAbsenceDerived(kind) {
@@ -404,6 +419,8 @@ export const CONTRADICTION_CHANNELS = {
404
419
  // side. Recorded rather than exempted: an exemption is a hole somebody later widens.
405
420
  [ContradictionKind.EVIDENCE_SUPERSEDED]: [ChannelId.TIME, ChannelId.UI],
406
421
  [ContradictionKind.EVIDENCE_PREDATES_EDIT]: [ChannelId.TIME, ChannelId.UI],
422
+ // What the screen shows against the status of the read that should have filled it.
423
+ [ContradictionKind.READ_SERVER_FAULT]: [ChannelId.UI, ChannelId.NET],
407
424
  };
408
425
  /**
409
426
  * May this kind of disagreement be reported as a fault in the app?
@@ -421,3 +438,23 @@ export const CrawlAnomalyKind = {
421
438
  FAILED_REQUEST: 'failed-request', // it fired a request that returned >= 400
422
439
  DEAD_CONTROL: 'dead-control', // it dispatched but the app did NOTHING (no DOM/net/route/signal)
423
440
  };
441
+ /**
442
+ * Behaviour faults that the systematic explorer finds by driving the app against itself. Each one
443
+ * needs no reference answer: the app's own earlier state, request or run is the reference.
444
+ *
445
+ * Like `CrawlAnomalyKind`, these are not cross-channel contradictions and do not decide a verdict.
446
+ */
447
+ export const BehaviourFindingKind = {
448
+ /** An undo or cancel did not return the page to the state before the action. */
449
+ UNDO_NOT_RESTORED: 'undo-not-restored',
450
+ /** A repeated identical action changed state that the first action did not change. */
451
+ REPEAT_CHANGED_STATE: 'repeat-changed-state',
452
+ /** A value the app saved is not shown after a reload, and the app did not say it was not saved. */
453
+ LOST_AFTER_RELOAD: 'lost-after-reload',
454
+ /** The value the page shows after a write is not the value the write request sent. */
455
+ SHOWN_DIFFERS_FROM_SENT: 'shown-differs-from-sent',
456
+ /** Two identical drives from a fresh page showed different results. */
457
+ INTERMITTENT_RESULT: 'intermittent-result',
458
+ /** With a write failing, the app arrived where it goes when the write succeeds. */
459
+ FAILURE_UNHANDLED: 'failure-unhandled',
460
+ };
@@ -91,6 +91,7 @@ export type Predicate = {
91
91
  } | {
92
92
  kind: typeof PredicateKind.ANIMATION;
93
93
  name?: string;
94
+ /** Target element as a Reticle ref (`e12`) or a CSS selector resolved against the live page. */
94
95
  target?: string;
95
96
  completed?: boolean;
96
97
  since?: number;
@@ -273,10 +273,34 @@ function readAbsentKind(obj) {
273
273
  note: `kind: "${ABSENT_FIELD}" → kind: "${kind}", ${ABSENT_FIELD}: true`,
274
274
  };
275
275
  }
276
+ /**
277
+ * `"{\"kind\":\"text\",...}"`: the predicate object sent as a JSON string (#1117). Read as page
278
+ * text, it is on no page, so a check that held answered `no`. A JSON object is read as that object.
279
+ * Any other string that starts with `{` is refused: it has no reading as text on a page.
280
+ */
281
+ function readJsonString(written) {
282
+ let parsed;
283
+ try {
284
+ parsed = JSON.parse(written);
285
+ }
286
+ catch {
287
+ parsed = undefined;
288
+ }
289
+ if (!isPlainRecord(parsed)) {
290
+ return {
291
+ value: written,
292
+ refusal: 'this string starts with { but is not a JSON object, so it was not read as text. Send the ' +
293
+ 'predicate as an object: { kind: "text", contains: "Saved" }',
294
+ };
295
+ }
296
+ const inner = readShorthand(parsed);
297
+ const note = 'a JSON string → the object it holds';
298
+ return { ...inner, note: inner.note === undefined ? note : `${note}; ${inner.note}` };
299
+ }
276
300
  /** The one place a lenient form is read. The parse and the report both call it. */
277
301
  function readShorthand(input) {
278
302
  if ('string' === typeof input) {
279
- return readBareString(input);
303
+ return input.trimStart().startsWith('{') ? readJsonString(input) : readBareString(input);
280
304
  }
281
305
  if (!isPlainRecord(input)) {
282
306
  return { value: input };
@@ -533,6 +557,7 @@ function predicateUnion() {
533
557
  .object({
534
558
  kind: z.literal(PredicateKind.ANIMATION),
535
559
  name: z.string().optional(),
560
+ /** Target element as a Reticle ref (`e12`) or a CSS selector resolved against the live page. */
536
561
  target: z.string().optional(),
537
562
  completed: z.boolean().optional(),
538
563
  since: z.number().optional(),
@@ -68,6 +68,7 @@ const OWNER = {
68
68
  // Ours, or the caller's — either way not the app's.
69
69
  [VerifiedReason.VERSION_SKEW]: VerdictAttribution.HARNESS,
70
70
  [VerifiedReason.WINDOW_CLOSED_EARLY]: VerdictAttribution.HARNESS,
71
+ [VerifiedReason.DIALOG_DECLINED]: VerdictAttribution.HARNESS,
71
72
  [VerifiedReason.NOTHING_DECLARED]: VerdictAttribution.HARNESS,
72
73
  [VerifiedReason.VACUOUS_GRADE]: VerdictAttribution.HARNESS,
73
74
  [VerifiedReason.ALREADY_TRUE]: VerdictAttribution.HARNESS,
@@ -100,6 +100,12 @@ export declare const VerifiedReason: {
100
100
  * forbid. See #669.
101
101
  */
102
102
  readonly WINDOW_CLOSED_EARLY: "window_closed_early";
103
+ /**
104
+ * The app opened a `confirm` or `prompt` during the action, and Reticle declined it so that the
105
+ * tab cannot wedge. The app then took the path for "no", so a consequence that needed "yes" was
106
+ * not judged. NEVER `"no"`: the answer that decided the path was Reticle's, not the app's.
107
+ */
108
+ readonly DIALOG_DECLINED: "dialog_declined";
103
109
  /** The declared consequence did not hold. */
104
110
  readonly ASSERTION_FAILED: "assertion_failed";
105
111
  /** Channels disagreed about the action — the false green this product exists to catch. */
@@ -282,6 +288,17 @@ export declare const BlindSpotKind: {
282
288
  * subscribable store registers, which is when the SDK emits this kind with count 0.
283
289
  */
284
290
  readonly UNWATCHED_STATE: "unwatched-state";
291
+ /**
292
+ * The store committed, no DOM node moved, and a `<canvas>` on screen showed no change that the
293
+ * canvas digest could see.
294
+ *
295
+ * A canvas renders as pixels, so a repaint makes no DOM mutation. The digest is a 16x16 sample, so
296
+ * a small repaint can leave it the same, and a WebGL canvas without `preserveDrawingBuffer` reads
297
+ * back blank. `state-vs-render` does not fire then, and this says why: the render may be in pixels
298
+ * this window could not compare (#1525). Computed by the daemon for one act window; no SDK sends
299
+ * it. BOUNDING, never impeaching: what WAS observed is observed completely.
300
+ */
301
+ readonly CANVAS_PAINT_UNOBSERVED: "canvas-paint-unobserved";
285
302
  };
286
303
  export type BlindSpotKind = (typeof BlindSpotKind)[keyof typeof BlindSpotKind];
287
304
  /**