@reticlehq/core 2.14.0 → 3.2.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 (148) hide show
  1. package/dist/{artifacts-entry.d.ts → artifacts/artifacts-entry.d.ts} +7 -7
  2. package/dist/{artifacts-entry.js → artifacts/artifacts-entry.js} +7 -7
  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} +99 -3
  6. package/dist/{flow-constants.js → artifacts/flow-constants.js} +108 -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.d.ts → artifacts/impact.d.ts} +271 -103
  20. package/dist/{impact.js → artifacts/impact.js} +75 -5
  21. package/dist/artifacts/journal.d.ts +218 -0
  22. package/dist/artifacts/journal.js +130 -0
  23. package/dist/artifacts/step-effect.d.ts +29 -0
  24. package/dist/artifacts/step-effect.js +28 -0
  25. package/dist/hooks/hook-events.d.ts +311 -0
  26. package/dist/hooks/hook-events.js +127 -0
  27. package/dist/hooks/hooks-entry.d.ts +9 -0
  28. package/dist/hooks/hooks-entry.js +9 -0
  29. package/dist/identity/brand.d.ts +102 -0
  30. package/dist/{brand.js → identity/brand.js} +7 -0
  31. package/dist/{contract-fingerprint.d.ts → identity/contract-fingerprint.d.ts} +21 -3
  32. package/dist/{contract-fingerprint.js → identity/contract-fingerprint.js} +22 -4
  33. package/dist/{document-identity.d.ts → identity/document-identity.d.ts} +4 -5
  34. package/dist/{document-identity.js → identity/document-identity.js} +4 -5
  35. package/dist/{source-constants.d.ts → identity/source-constants.d.ts} +4 -4
  36. package/dist/{source-constants.js → identity/source-constants.js} +4 -4
  37. package/dist/index.d.ts +57 -43
  38. package/dist/index.js +66 -45
  39. package/dist/onboarding.d.ts +114 -0
  40. package/dist/onboarding.js +141 -0
  41. package/dist/realm/registry.d.ts +212 -0
  42. package/dist/realm/registry.js +302 -0
  43. package/dist/{dev-server-registry.d.ts → registry/dev-server-registry.d.ts} +6 -7
  44. package/dist/{dev-server-registry.js → registry/dev-server-registry.js} +28 -19
  45. package/dist/{project-registry.d.ts → registry/project-registry.d.ts} +5 -5
  46. package/dist/{project-registry.js → registry/project-registry.js} +5 -5
  47. package/dist/schema/command-name.json +31 -0
  48. package/dist/schema/event-payloads.json +795 -0
  49. package/dist/schema/hello-message.json +70 -2
  50. package/dist/schema/reticle-message.json +70 -2
  51. package/dist/telemetry-entry.d.ts +1 -1
  52. package/dist/telemetry-entry.js +1 -1
  53. package/dist/telemetry-feedback.d.ts +15 -16
  54. package/dist/telemetry-feedback.js +11 -12
  55. package/dist/telemetry-license.d.ts +1 -1
  56. package/dist/telemetry-license.js +1 -1
  57. package/dist/telemetry-refusal.d.ts +11 -11
  58. package/dist/telemetry-refusal.js +7 -8
  59. package/dist/telemetry-session.d.ts +51 -59
  60. package/dist/telemetry-session.js +47 -55
  61. package/dist/telemetry.d.ts +306 -222
  62. package/dist/telemetry.js +112 -99
  63. package/dist/tour-entry.d.ts +10 -0
  64. package/dist/tour-entry.js +10 -0
  65. package/dist/tour.d.ts +125 -0
  66. package/dist/tour.js +165 -0
  67. package/dist/{consequence.d.ts → verdict/consequence.d.ts} +32 -15
  68. package/dist/{consequence.js → verdict/consequence.js} +9 -31
  69. package/dist/{finding-fingerprint.js → verdict/finding-fingerprint.js} +1 -1
  70. package/dist/{findings.d.ts → verdict/findings.d.ts} +86 -39
  71. package/dist/{findings.js → verdict/findings.js} +103 -49
  72. package/dist/{instrumentation-gap.d.ts → verdict/instrumentation-gap.d.ts} +7 -14
  73. package/dist/{instrumentation-gap.js → verdict/instrumentation-gap.js} +7 -15
  74. package/dist/{intent.d.ts → verdict/intent.d.ts} +35 -46
  75. package/dist/{intent.js → verdict/intent.js} +11 -22
  76. package/dist/verdict/revision.d.ts +44 -0
  77. package/dist/verdict/revision.js +53 -0
  78. package/dist/{run-context.d.ts → verdict/run-context.d.ts} +13 -34
  79. package/dist/{run-context.js → verdict/run-context.js} +15 -36
  80. package/dist/{security.js → verdict/security.js} +12 -21
  81. package/dist/{verification-run.d.ts → verdict/verification-run.d.ts} +381 -105
  82. package/dist/{verification-run.js → verdict/verification-run.js} +157 -21
  83. package/dist/{verified-constants.d.ts → verdict/verified-constants.d.ts} +34 -13
  84. package/dist/{verified-constants.js → verdict/verified-constants.js} +34 -13
  85. package/dist/{verify-progress.d.ts → verdict/verify-progress.d.ts} +18 -22
  86. package/dist/{verify-progress.js → verdict/verify-progress.js} +6 -10
  87. package/dist/wire/channel.d.ts +46 -0
  88. package/dist/wire/channel.js +95 -0
  89. package/dist/{constants.d.ts → wire/constants/constants.d.ts} +179 -28
  90. package/dist/{constants.js → wire/constants/constants.js} +199 -28
  91. package/dist/{session-constants.d.ts → wire/constants/session-constants.d.ts} +23 -2
  92. package/dist/{session-constants.js → wire/constants/session-constants.js} +23 -2
  93. package/dist/{desktop-contract.js → wire/desktop-contract.js} +1 -1
  94. package/dist/{event-classification.js → wire/event-classification.js} +1 -1
  95. package/dist/{event-payloads.d.ts → wire/event-payloads.d.ts} +72 -13
  96. package/dist/{event-payloads.js → wire/event-payloads.js} +23 -3
  97. package/dist/{event-priority.d.ts → wire/event-priority.d.ts} +1 -4
  98. package/dist/{event-priority.js → wire/event-priority.js} +2 -5
  99. package/dist/{global-press.js → wire/global-press.js} +1 -1
  100. package/dist/{messages.d.ts → wire/messages.d.ts} +240 -48
  101. package/dist/{messages.js → wire/messages.js} +68 -5
  102. package/dist/wire/narrow.d.ts +39 -0
  103. package/dist/wire/narrow.js +45 -0
  104. package/dist/{net.d.ts → wire/net.d.ts} +36 -13
  105. package/dist/{net.js → wire/net.js} +36 -13
  106. package/dist/wire/platform.d.ts +37 -0
  107. package/dist/wire/platform.js +36 -0
  108. package/dist/{redaction.js → wire/redaction.js} +12 -12
  109. package/dist/wire/snapshot-tree.d.ts +33 -0
  110. package/dist/wire/snapshot-tree.js +43 -0
  111. package/dist/wire/tool-names.d.ts +133 -0
  112. package/dist/wire/tool-names.js +142 -0
  113. package/dist/{toon.js → wire/toon.js} +1 -1
  114. package/dist/{types.d.ts → wire/types.d.ts} +77 -76
  115. package/dist/{types.js → wire/types.js} +4 -3
  116. package/dist/{no-session-reason.d.ts → words/no-session-reason.d.ts} +7 -3
  117. package/dist/{no-session-reason.js → words/no-session-reason.js} +7 -3
  118. package/dist/{notices.d.ts → words/notices.d.ts} +8 -12
  119. package/dist/{notices.js → words/notices.js} +8 -12
  120. package/package.json +16 -7
  121. package/dist/brand.d.ts +0 -49
  122. package/dist/flow-types.d.ts +0 -1711
  123. package/dist/flow-types.js +0 -247
  124. package/dist/journal.d.ts +0 -122
  125. package/dist/journal.js +0 -57
  126. package/dist/{impact-savings.d.ts → artifacts/impact-savings.d.ts} +0 -0
  127. package/dist/{impact-savings.js → artifacts/impact-savings.js} +0 -0
  128. package/dist/{edit-epoch.d.ts → identity/edit-epoch.d.ts} +0 -0
  129. package/dist/{edit-epoch.js → identity/edit-epoch.js} +0 -0
  130. package/dist/{project-id.d.ts → identity/project-id.d.ts} +0 -0
  131. package/dist/{project-id.js → identity/project-id.js} +0 -0
  132. package/dist/{daemon-registry.d.ts → registry/daemon-registry.d.ts} +0 -0
  133. package/dist/{daemon-registry.js → registry/daemon-registry.js} +0 -0
  134. package/dist/{finding-fingerprint.d.ts → verdict/finding-fingerprint.d.ts} +0 -0
  135. package/dist/{security.d.ts → verdict/security.d.ts} +0 -0
  136. package/dist/{desktop-contract.d.ts → wire/desktop-contract.d.ts} +0 -0
  137. package/dist/{event-classification.d.ts → wire/event-classification.d.ts} +0 -0
  138. package/dist/{global-press.d.ts → wire/global-press.d.ts} +0 -0
  139. package/dist/{redaction.d.ts → wire/redaction.d.ts} +0 -0
  140. package/dist/{state-select.d.ts → wire/state-select.d.ts} +0 -0
  141. package/dist/{state-select.js → wire/state-select.js} +0 -0
  142. package/dist/{toon.d.ts → wire/toon.d.ts} +0 -0
  143. package/dist/{browser-misdirect.d.ts → words/browser-misdirect.d.ts} +0 -0
  144. package/dist/{browser-misdirect.js → words/browser-misdirect.js} +0 -0
  145. package/dist/{unreachable-notice.d.ts → words/unreachable-notice.d.ts} +0 -0
  146. package/dist/{unreachable-notice.js → words/unreachable-notice.js} +0 -0
  147. package/dist/{upgrade.d.ts → words/upgrade.d.ts} +2 -2
  148. /package/dist/{upgrade.js → words/upgrade.js} +0 -0
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * Which document an observation belongs to.
3
3
  *
4
- * Evidence used to be scoped by time and by ring-buffer capacity and by nothing else. A request
5
- * observed under a PREVIOUS document — or under a previous run of the application entirely — could
6
- * therefore be counted against an action taken now. Field reports describe exactly that, including
7
- * one where the failing request Reticle cited named a database row that no longer exists: true about
8
- * the bytes, false about the world, which is the worst kind of wrong a verification tool can be.
4
+ * Evidence scoped by time and ring-buffer capacity alone lets a request observed under a PREVIOUS
5
+ * document — or under a previous run of the application entirely — be counted against an action
6
+ * taken now. That is a citation that is true about the bytes and false about the world, which is
7
+ * the worst kind of wrong a verification tool can be.
9
8
  *
10
9
  * A document id is minted once per real document and dies with it. A full navigation replaces the
11
10
  * document and so replaces the id. An SPA route change does NOT, which is correct rather than a
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * Source mapping: how a DOM node is traced back to the line of code that rendered it.
3
3
  *
4
- * Split out of `constants.ts` — these two are read by the build plugins, the browser SDK and the
5
- * React adapter together, and they change for one reason (the source-pointer feature) rather than
6
- * for the dozen reasons the wire contract does.
4
+ * These two are read by the build plugins, the browser SDK and the React adapter together, and they
5
+ * change for one reason (the source-pointer feature) rather than for the dozen reasons the wire
6
+ * contract does.
7
7
  */
8
8
  /**
9
9
  * The attribute the build plugin stamps on JSX host elements as `file:line:column`, so the browser SDK
10
10
  * and the React adapter can map a DOM node back to its source file (the source-pointer feature, needed
11
11
  * on React 19 which dropped _debugSource). Read here by both packages — it was duplicated as a local
12
- * const in dom/source.ts AND dom/query.ts and inlined as a literal in the React adapter. The stamper
12
+ * const in dom/addressing/source.ts AND dom/query.ts and inlined as a literal in the React adapter. The stamper
13
13
  * (@reticlehq/babel-plugin, separate build tooling) stamps this same literal and MUST match it.
14
14
  */
15
15
  export declare const DATA_RETICLE_SOURCE_ATTR = "data-reticle-source";
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * Source mapping: how a DOM node is traced back to the line of code that rendered it.
3
3
  *
4
- * Split out of `constants.ts` — these two are read by the build plugins, the browser SDK and the
5
- * React adapter together, and they change for one reason (the source-pointer feature) rather than
6
- * for the dozen reasons the wire contract does.
4
+ * These two are read by the build plugins, the browser SDK and the React adapter together, and they
5
+ * change for one reason (the source-pointer feature) rather than for the dozen reasons the wire
6
+ * contract does.
7
7
  */
8
8
  /**
9
9
  * The attribute the build plugin stamps on JSX host elements as `file:line:column`, so the browser SDK
10
10
  * and the React adapter can map a DOM node back to its source file (the source-pointer feature, needed
11
11
  * on React 19 which dropped _debugSource). Read here by both packages — it was duplicated as a local
12
- * const in dom/source.ts AND dom/query.ts and inlined as a literal in the React adapter. The stamper
12
+ * const in dom/addressing/source.ts AND dom/query.ts and inlined as a literal in the React adapter. The stamper
13
13
  * (@reticlehq/babel-plugin, separate build tooling) stamps this same literal and MUST match it.
14
14
  */
15
15
  export const DATA_RETICLE_SOURCE_ATTR = 'data-reticle-source';
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * @reticlehq/core — the wire contract at the bottom of the Reticle graph (zod its only dependency).
3
3
  *
4
4
  * API-stability note: the exports below the divider are INTERNAL cross-package plumbing — they are
5
- * re-exported so the other @reticlehq/* packages can share one implementation, NOT as a stable surface
5
+ * cross-package plumbing so the other @reticlehq/* packages share one implementation, NOT a stable surface
6
6
  * for outside consumers. They can change in a minor release. Depend on the STABLE section for anything
7
7
  * outside this monorepo.
8
8
  *
@@ -15,53 +15,67 @@
15
15
  * This root entry point still exports everything it did before — the subpaths are additive, and
16
16
  * removing a name from here would be a breaking change to a published package. The boundary that is
17
17
  * actually ENFORCED is the one the browser SDK must not cross: `core-boundary.test.ts` in
18
- * @reticlehq/browser fails if packages/browser/src imports any artifacts-group name from
18
+ * @reticlehq/browser fails if adapters/realm/browser/src imports any artifacts-group name from
19
19
  * '@reticlehq/core'. That test, not this comment, is what keeps the DOM side off the Node-side
20
20
  * plumbing.
21
21
  */
22
- export * from './constants.js';
23
- export * from './global-press.js';
24
- export * from './source-constants.js';
25
- export * from './event-classification.js';
26
- export * from './verified-constants.js';
27
- export * from './verify-progress.js';
28
- export * from './session-constants.js';
29
- export * from './document-identity.js';
30
- export * from './edit-epoch.js';
31
- export * from './messages.js';
32
- export * from './event-payloads.js';
33
- export * from './event-priority.js';
34
- export * from './flow-types.js';
35
- export * from './verification-run.js';
36
- export * from './types.js';
37
- export * from './brand.js';
38
- export * from './net.js';
39
- export * from './findings.js';
40
- export * from './desktop-contract.js';
41
- export * from './consequence.js';
42
- export * from './project-id.js';
43
- export * from './notices.js';
44
- export * from './journal.js';
45
- export * from './browser-misdirect.js';
46
- export * from './daemon-registry.js';
47
- export * from './dev-server-registry.js';
48
- export * from './project-registry.js';
49
- export * from './intent.js';
50
- export * from './run-context.js';
51
- export * from './instrumentation-gap.js';
52
- export * from './security.js';
53
- export * from './redaction.js';
54
- export * from './state-select.js';
55
- export * from './toon.js';
56
- export * from './upgrade.js';
22
+ export * from './artifacts/flow-order.js';
23
+ export * from './artifacts/flow-select.js';
24
+ export * from './artifacts/flow-unreached.js';
25
+ export * from './artifacts/flow-mutation-target.js';
26
+ export * from './wire/constants/constants.js';
27
+ export * from './identity/source-constants.js';
28
+ export * from './wire/event-classification.js';
29
+ export * from './wire/global-press.js';
30
+ export * from './verdict/verified-constants.js';
31
+ export * from './verdict/verify-progress.js';
32
+ export * from './wire/constants/session-constants.js';
33
+ export * from './identity/document-identity.js';
34
+ export * from './identity/edit-epoch.js';
35
+ export * from './wire/messages.js';
36
+ export * from './wire/event-payloads.js';
37
+ export * from './wire/event-priority.js';
38
+ export * from './artifacts/flow-constants.js';
39
+ export * from './artifacts/flow-types.js';
40
+ export * from './artifacts/step-effect.js';
41
+ export * from './artifacts/flow-composition.js';
42
+ export * from './verdict/verification-run.js';
43
+ export * from './wire/types.js';
44
+ export * from './identity/brand.js';
45
+ export * from './wire/net.js';
46
+ export * from './verdict/findings.js';
47
+ export * from './wire/desktop-contract.js';
48
+ export * from './verdict/consequence.js';
49
+ export * from './identity/project-id.js';
50
+ export * from './words/notices.js';
51
+ export * from './artifacts/journal.js';
52
+ export * from './words/browser-misdirect.js';
53
+ export * from './registry/daemon-registry.js';
54
+ export * from './registry/dev-server-registry.js';
55
+ export * from './registry/project-registry.js';
56
+ export * from './verdict/intent.js';
57
+ export * from './verdict/run-context.js';
58
+ export * from './verdict/instrumentation-gap.js';
59
+ export * from './verdict/security.js';
60
+ export * from './wire/redaction.js';
61
+ export * from './wire/state-select.js';
62
+ export * from './wire/toon.js';
63
+ export * from './words/upgrade.js';
57
64
  export * from './telemetry.js';
58
- export * from './no-session-reason.js';
65
+ export * from './words/no-session-reason.js';
59
66
  export * from './telemetry-refusal.js';
67
+ export * from './wire/narrow.js';
68
+ export * from './wire/tool-names.js';
69
+ export * from './wire/snapshot-tree.js';
70
+ export * from './wire/platform.js';
71
+ export * from './wire/channel.js';
72
+ export * from './verdict/revision.js';
73
+ export * from './realm/registry.js';
60
74
  export * from './telemetry-session.js';
61
75
  export * from './telemetry-license.js';
62
76
  export * from './telemetry-feedback.js';
63
- export * from './impact.js';
64
- export * from './impact-savings.js';
65
- export { CONTRACT_FINGERPRINT, fnv1a, fingerprintOf } from './contract-fingerprint.js';
66
- export { fingerprintFinding, type FindingIdentity } from './finding-fingerprint.js';
67
- export * from './unreachable-notice.js';
77
+ export * from './artifacts/impact.js';
78
+ export * from './artifacts/impact-savings.js';
79
+ export { CONTRACT_FINGERPRINT, CONTRACT_PARTS, fnv1a, fingerprintOf, } from './identity/contract-fingerprint.js';
80
+ export { fingerprintFinding, type FindingIdentity } from './verdict/finding-fingerprint.js';
81
+ export * from './words/unreachable-notice.js';
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * @reticlehq/core — the wire contract at the bottom of the Reticle graph (zod its only dependency).
3
3
  *
4
4
  * API-stability note: the exports below the divider are INTERNAL cross-package plumbing — they are
5
- * re-exported so the other @reticlehq/* packages can share one implementation, NOT as a stable surface
5
+ * cross-package plumbing so the other @reticlehq/* packages share one implementation, NOT a stable surface
6
6
  * for outside consumers. They can change in a minor release. Depend on the STABLE section for anything
7
7
  * outside this monorepo.
8
8
  *
@@ -15,58 +15,79 @@
15
15
  * This root entry point still exports everything it did before — the subpaths are additive, and
16
16
  * removing a name from here would be a breaking change to a published package. The boundary that is
17
17
  * actually ENFORCED is the one the browser SDK must not cross: `core-boundary.test.ts` in
18
- * @reticlehq/browser fails if packages/browser/src imports any artifacts-group name from
18
+ * @reticlehq/browser fails if adapters/realm/browser/src imports any artifacts-group name from
19
19
  * '@reticlehq/core'. That test, not this comment, is what keeps the DOM side off the Node-side
20
20
  * plumbing.
21
21
  */
22
22
  // ── STABLE public surface: the wire/domain contract ──────────────────────────────────────────────
23
- export * from './constants.js'; // EventType, ActionType, wire constants, TRANSPORT_LIMITS, …
24
- export * from './global-press.js'; // which press is a document key (Escape / Tab / a shortcut)
25
- export * from './source-constants.js'; // DATA_RETICLE_SOURCE_ATTR, RETICLE_ROOT_GLOBAL
26
- export * from './event-classification.js'; // CHURN_TYPES — shared eviction priority for buffer/queue
27
- export * from './verified-constants.js'; // Verified — the one field an agent gates on
28
- export * from './verify-progress.js'; // VerifyPhase — what a run is doing while it is still doing it
29
- export * from './session-constants.js';
30
- export * from './document-identity.js'; // which document an observation belongs to
31
- export * from './edit-epoch.js'; // which round of source edits an observation belongs to
32
- export * from './messages.js'; // ReticleEvent + the message schemas
33
- export * from './event-payloads.js'; // per-event payload schemas + wire vocab
34
- export * from './event-priority.js'; // which events survive the bridge rate cap
35
- export * from './flow-types.js'; // FlowStep, FlowExpect, FlowStepTool, replay result shapes
36
- export * from './verification-run.js'; // run/verdict shapes for the CI surface
37
- export * from './types.js';
38
- export * from './brand.js'; // RunId / SessionId / Ref brands + validators
39
- export * from './net.js'; // NetInitiator / ipc:// scheme — network + desktop-IPC call vocabulary
40
- export * from './findings.js'; // crawl anomalies + cross-channel contradictions
41
- export * from './desktop-contract.js'; // the Electron preload/main/renderer/daemon string contract
42
- export * from './consequence.js';
43
- export * from './project-id.js';
44
- export * from './notices.js';
45
- export * from './journal.js';
23
+ export * from './artifacts/flow-order.js'; // orderFlows — prerequisites first, cycles reported
24
+ export * from './artifacts/flow-select.js'; // selectFlows — which flows a run replays, and what it held back
25
+ export * from './artifacts/flow-unreached.js'; // unreachedRoutes — known routes this run never visited
26
+ export * from './artifacts/flow-mutation-target.js'; // what a flow says it depends on: mutationTargetsFor + perturbationFor
27
+ export * from './wire/constants/constants.js'; // EventType, ActionType, wire constants, TRANSPORT_LIMITS, …
28
+ export * from './identity/source-constants.js'; // DATA_RETICLE_SOURCE_ATTR, RETICLE_ROOT_GLOBAL
29
+ export * from './wire/event-classification.js'; // CHURN_TYPES — shared eviction priority for buffer/queue
30
+ export * from './wire/global-press.js'; // which press is a document key (Escape / Tab / a shortcut)
31
+ export * from './verdict/verified-constants.js'; // Verified — the one field an agent gates on
32
+ export * from './verdict/verify-progress.js'; // VerifyPhase — what a run is doing while it is still doing it
33
+ export * from './wire/constants/session-constants.js';
34
+ export * from './identity/document-identity.js'; // which document an observation belongs to
35
+ export * from './identity/edit-epoch.js'; // which round of source edits an observation belongs to
36
+ export * from './wire/messages.js'; // ReticleEvent + the message schemas
37
+ export * from './wire/event-payloads.js'; // per-event payload schemas + wire vocab
38
+ export * from './wire/event-priority.js'; // which events survive the bridge rate cap
39
+ export * from './artifacts/flow-constants.js'; // moved off wire/constants/constants, which had no use for them
40
+ export * from './artifacts/flow-types.js'; // FlowStep, FlowExpect, FlowStepTool, replay result shapes
41
+ export * from './artifacts/step-effect.js'; // StepEffect: a leaf, so the page never downloads it
42
+ export * from './artifacts/flow-composition.js'; // canFollow: may B replay straight after A
43
+ export * from './verdict/verification-run.js'; // run/verdict shapes for the CI surface
44
+ export * from './wire/types.js';
45
+ export * from './identity/brand.js'; // RunId / SessionId / ProjectId / Ref brands + validators
46
+ export * from './wire/net.js'; // NetInitiator / ipc:// scheme — network + desktop-IPC call vocabulary
47
+ export * from './verdict/findings.js'; // crawl anomalies + cross-channel contradictions
48
+ export * from './wire/desktop-contract.js'; // the Electron preload/main/renderer/daemon string contract
49
+ export * from './verdict/consequence.js';
50
+ export * from './identity/project-id.js';
51
+ export * from './words/notices.js';
52
+ export * from './artifacts/journal.js';
46
53
  // Not an API — three names that exist so importing the BROWSER SDK from here fails with a sentence
47
54
  // naming @reticlehq/browser, instead of a bare SyntaxError that blanks the app. See the module.
48
- export * from './browser-misdirect.js';
55
+ export * from './words/browser-misdirect.js';
49
56
  // ── INTERNAL cross-package plumbing (shared impl; not a stable outside API — may change in a minor) ─
50
- export * from './daemon-registry.js'; // daemon discovery, used by the vite plugin + server
51
- export * from './dev-server-registry.js'; // the return leg: dev servers announcing themselves
52
- export * from './project-registry.js'; // projectId -> directory, so a cross-repo daemon can still resolve
53
- export * from './intent.js'; // what a change was supposed to make true, captured while somebody knows
54
- export * from './run-context.js'; // what a run established, folded and capped, for the agent to pull back
55
- export * from './instrumentation-gap.js'; // what Reticle could not see, and the change that would let it
56
- export * from './security.js'; // sanitize/serialize helpers shared by browser + server
57
- export * from './redaction.js'; // isSensitiveKey / scrubKnownSecrets — the shared redaction rules
58
- export * from './state-select.js'; // selectPath / capDepth — shared by browser SDK + server fallback
59
- export * from './toon.js'; // TOON encoding used by the server's result encoder
60
- export * from './upgrade.js'; // self-update policy shared by the CLI
57
+ export * from './registry/daemon-registry.js'; // daemon discovery, used by the vite plugin + server
58
+ export * from './registry/dev-server-registry.js'; // the return leg: dev servers announcing themselves
59
+ export * from './registry/project-registry.js'; // projectId -> directory, so a cross-repo daemon can still resolve
60
+ export * from './verdict/intent.js'; // what a change was supposed to make true, captured while somebody knows
61
+ export * from './verdict/run-context.js'; // what a run established, folded and capped, for the agent to pull back
62
+ export * from './verdict/instrumentation-gap.js'; // what Reticle could not see, and the change that would let it
63
+ export * from './verdict/security.js'; // sanitize/serialize helpers shared by browser + server
64
+ export * from './wire/redaction.js'; // isSensitiveKey / scrubKnownSecrets — the shared redaction rules
65
+ export * from './wire/state-select.js'; // selectPath / capDepth — shared by browser SDK + server fallback
66
+ export * from './wire/toon.js'; // TOON encoding used by the server's result encoder
67
+ export * from './words/upgrade.js'; // self-update policy shared by the CLI
61
68
  export * from './telemetry.js';
62
- // Split out of telemetry.js at the 1000-line cap; the barrel keeps the import path callers use.
63
- export * from './no-session-reason.js';
69
+ export * from './words/no-session-reason.js';
64
70
  export * from './telemetry-refusal.js';
71
+ export * from './wire/narrow.js';
72
+ export * from './wire/tool-names.js';
73
+ export * from './wire/snapshot-tree.js'; // parseInteractive — the browser writes this format, Node reads it
74
+ export * from './wire/platform.js';
75
+ export * from './wire/channel.js';
76
+ export * from './verdict/revision.js';
77
+ export * from './realm/registry.js';
78
+ // The protocol is NOT re-exported here, deliberately.
79
+ //
80
+ // `open-verification` is the specification this codebase implements, and it is a separate
81
+ // package precisely so that somebody implementing it does not have to install the product. Blanket
82
+ // re-exporting it from core erases that line: a consumer reaches a protocol name through Reticle
83
+ // and now depends on Reticle for a contract that was written not to need it. Import the protocol
84
+ // from the protocol. What core re-exports are the few names this repository has always spelled its
85
+ // own way -- see wire/channel.ts, which imports the rule rather than restating it.
65
86
  export * from './telemetry-session.js'; // the session/project rollup payloads
66
87
  export * from './telemetry-license.js'; // LicenseActivation — shared by the licence gate and telemetry
67
- export * from './telemetry-feedback.js'; // the two things a PERSON writes: feedback + a self-declared identity // anonymous adoption telemetry wire contract (DAU/WAU/MAU/installs)
68
- export * from './impact.js'; // the user's own record of what Reticle has done for them (local only)
69
- export * from './impact-savings.js'; // the savings model - one file, so every claim is derivable there
70
- export { CONTRACT_FINGERPRINT, fnv1a, fingerprintOf } from './contract-fingerprint.js';
71
- export { fingerprintFinding } from './finding-fingerprint.js';
72
- export * from './unreachable-notice.js'; // the page's unreachable warning, as a contract the daemon parses
88
+ export * from './telemetry-feedback.js'; // the two things a PERSON writes: feedback + a self-declared identity
89
+ export * from './artifacts/impact.js'; // the user's own record of what Reticle has done for them (local only)
90
+ export * from './artifacts/impact-savings.js'; // the savings model - one file, so every claim is derivable there
91
+ export { CONTRACT_FINGERPRINT, CONTRACT_PARTS, fnv1a, fingerprintOf, } from './identity/contract-fingerprint.js';
92
+ export { fingerprintFinding } from './verdict/finding-fingerprint.js';
93
+ export * from './words/unreachable-notice.js'; // the page's unreachable warning, as a contract the daemon parses
@@ -0,0 +1,114 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The three phases between "never heard of Reticle" and "it produced a verdict on my app".
4
+ *
5
+ * Named as one vocabulary because the question they exist to answer is one question: WHERE do people
6
+ * stop. Prior measurement put the break at instrumentation — user retention strong, verification
7
+ * retention far weaker — and `init_completed` cannot see that, because it fires when the files are
8
+ * written and the story continues for minutes afterwards.
9
+ */
10
+ export declare const OnboardingPhase: {
11
+ /** Getting the CLI onto the machine and the MCP registered with the agents that are there. */
12
+ readonly INSTALL: "install";
13
+ /** Being shown what Reticle is and how it is driven, before being asked to drive anything. */
14
+ readonly ONBOARD: "onboard";
15
+ /** Instrumenting a real project and driving it until something is actually proved. */
16
+ readonly FIRST_RUN: "first_run";
17
+ };
18
+ export type OnboardingPhase = (typeof OnboardingPhase)[keyof typeof OnboardingPhase];
19
+ /**
20
+ * What became of one step.
21
+ *
22
+ * `ABANDONED` is the one that earns its place: a step that is STARTED and never resolved is
23
+ * indistinguishable from one that was never reached, and both read as "we never got there" in a
24
+ * funnel. Saying a person walked away from a step we know they began is a different fact from
25
+ * saying the step failed, and only one of them is our bug.
26
+ */
27
+ export declare const OnboardingStepStatus: {
28
+ readonly STARTED: "started";
29
+ readonly COMPLETED: "completed";
30
+ readonly FAILED: "failed";
31
+ readonly ABANDONED: "abandoned";
32
+ /** Nothing to do — already installed, already instrumented. Not a loss, and not a win either. */
33
+ readonly SKIPPED: "skipped";
34
+ };
35
+ export type OnboardingStepStatus = (typeof OnboardingStepStatus)[keyof typeof OnboardingStepStatus];
36
+ /**
37
+ * The steps, per phase, as ONE table.
38
+ *
39
+ * Written down here rather than as string literals at each emit site, for the reason rule 4 exists:
40
+ * a vocabulary copied into the place that uses it drifts from the place that reads it, and the
41
+ * reader is a dashboard nobody re-checks. A step that is renamed here is renamed everywhere or it
42
+ * does not compile.
43
+ *
44
+ * The ORDER matters and is the funnel: each phase's steps are listed in the sequence they occur, so
45
+ * a drop-off curve is this array with counts against it.
46
+ */
47
+ export declare const OnboardingSteps: {
48
+ readonly install: readonly ["script_started", "runtime_ready", "cli_installed", "agents_detected", "mcp_registered"];
49
+ readonly onboard: readonly ["tour_started", "concept_shown", "first_look", "first_act", "first_verdict"];
50
+ readonly first_run: readonly ["project_detected", "instrumented", "app_connected", "driven", "flow_recorded", "verdict_produced"];
51
+ };
52
+ export declare const OnboardingStepSchema: z.ZodObject<{
53
+ phase: z.ZodNativeEnum<{
54
+ /** Getting the CLI onto the machine and the MCP registered with the agents that are there. */
55
+ readonly INSTALL: "install";
56
+ /** Being shown what Reticle is and how it is driven, before being asked to drive anything. */
57
+ readonly ONBOARD: "onboard";
58
+ /** Instrumenting a real project and driving it until something is actually proved. */
59
+ readonly FIRST_RUN: "first_run";
60
+ }>;
61
+ /**
62
+ * Our name for the step, and ONLY one of ours.
63
+ *
64
+ * This was `z.string().max(48)`, with a comment promising it was never user text — and a cap is
65
+ * not a promise. `/Users/someone/secret/project` is 28 characters and validated cleanly, which is
66
+ * a rule-3 leak (names, never values) reaching the wire from the one payload a person can edit:
67
+ * the installer's breadcrumb file, on disk, in their own home directory.
68
+ *
69
+ * A closed set makes the promise enforceable instead of aspirational. Found by the test written
70
+ * for that file, not by reading this line.
71
+ */
72
+ step: z.ZodEnum<[string, ...string[]]>;
73
+ status: z.ZodNativeEnum<{
74
+ readonly STARTED: "started";
75
+ readonly COMPLETED: "completed";
76
+ readonly FAILED: "failed";
77
+ readonly ABANDONED: "abandoned";
78
+ /** Nothing to do — already installed, already instrumented. Not a loss, and not a win either. */
79
+ readonly SKIPPED: "skipped";
80
+ }>;
81
+ /**
82
+ * Milliseconds this step took. Absent when the step is instantaneous or not timed — absent means
83
+ * NOT MEASURED, never zero, because a zero would pull every average toward a duration nobody had.
84
+ */
85
+ elapsedMs: z.ZodOptional<z.ZodNumber>;
86
+ /** Classified cause when it failed — our vocabulary, never a raw error or a path. */
87
+ reason: z.ZodOptional<z.ZodString>;
88
+ /** The stack it was detected on, so a phase that only fails on one framework is visible. */
89
+ stack: z.ZodOptional<z.ZodString>;
90
+ /**
91
+ * True when nobody was asked anything — the zero-human-input path an agent takes from a link.
92
+ *
93
+ * Recorded because the two audiences fail differently and a funnel that mixes them explains
94
+ * neither: a human abandons a step, an agent's run exits.
95
+ */
96
+ unattended: z.ZodOptional<z.ZodBoolean>;
97
+ }, "strip", z.ZodTypeAny, {
98
+ status: "skipped" | "started" | "completed" | "failed" | "abandoned";
99
+ step: string;
100
+ phase: "install" | "onboard" | "first_run";
101
+ reason?: string | undefined;
102
+ stack?: string | undefined;
103
+ elapsedMs?: number | undefined;
104
+ unattended?: boolean | undefined;
105
+ }, {
106
+ status: "skipped" | "started" | "completed" | "failed" | "abandoned";
107
+ step: string;
108
+ phase: "install" | "onboard" | "first_run";
109
+ reason?: string | undefined;
110
+ stack?: string | undefined;
111
+ elapsedMs?: number | undefined;
112
+ unattended?: boolean | undefined;
113
+ }>;
114
+ export type OnboardingStep = z.infer<typeof OnboardingStepSchema>;
@@ -0,0 +1,141 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The three phases between "never heard of Reticle" and "it produced a verdict on my app".
4
+ *
5
+ * Named as one vocabulary because the question they exist to answer is one question: WHERE do people
6
+ * stop. Prior measurement put the break at instrumentation — user retention strong, verification
7
+ * retention far weaker — and `init_completed` cannot see that, because it fires when the files are
8
+ * written and the story continues for minutes afterwards.
9
+ */
10
+ export const OnboardingPhase = {
11
+ /** Getting the CLI onto the machine and the MCP registered with the agents that are there. */
12
+ INSTALL: 'install',
13
+ /** Being shown what Reticle is and how it is driven, before being asked to drive anything. */
14
+ ONBOARD: 'onboard',
15
+ /** Instrumenting a real project and driving it until something is actually proved. */
16
+ FIRST_RUN: 'first_run',
17
+ };
18
+ /**
19
+ * What became of one step.
20
+ *
21
+ * `ABANDONED` is the one that earns its place: a step that is STARTED and never resolved is
22
+ * indistinguishable from one that was never reached, and both read as "we never got there" in a
23
+ * funnel. Saying a person walked away from a step we know they began is a different fact from
24
+ * saying the step failed, and only one of them is our bug.
25
+ */
26
+ export const OnboardingStepStatus = {
27
+ STARTED: 'started',
28
+ COMPLETED: 'completed',
29
+ FAILED: 'failed',
30
+ ABANDONED: 'abandoned',
31
+ /** Nothing to do — already installed, already instrumented. Not a loss, and not a win either. */
32
+ SKIPPED: 'skipped',
33
+ };
34
+ /**
35
+ * The steps, per phase, as ONE table.
36
+ *
37
+ * Written down here rather than as string literals at each emit site, for the reason rule 4 exists:
38
+ * a vocabulary copied into the place that uses it drifts from the place that reads it, and the
39
+ * reader is a dashboard nobody re-checks. A step that is renamed here is renamed everywhere or it
40
+ * does not compile.
41
+ *
42
+ * The ORDER matters and is the funnel: each phase's steps are listed in the sequence they occur, so
43
+ * a drop-off curve is this array with counts against it.
44
+ */
45
+ export const OnboardingSteps = {
46
+ [OnboardingPhase.INSTALL]: [
47
+ /** The one-line installer ran at all — the first thing we can possibly know about someone. */
48
+ 'script_started',
49
+ /** A usable runtime was found or provisioned. The commonest reason an install dies on a clean box. */
50
+ 'runtime_ready',
51
+ 'cli_installed',
52
+ /** Which coding agents are on this machine. Zero is a real answer and not a failure. */
53
+ 'agents_detected',
54
+ /** The MCP server registered with them. The step most likely to fail silently — see InitOutcome. */
55
+ 'mcp_registered',
56
+ ],
57
+ [OnboardingPhase.ONBOARD]: [
58
+ 'tour_started',
59
+ /** Shown what Reticle is FOR, before being asked to run anything. */
60
+ 'concept_shown',
61
+ /** The first look at a real page. */
62
+ 'first_look',
63
+ /** The first action driven through Reticle. */
64
+ 'first_act',
65
+ /**
66
+ * The first VERDICT. The tour ends here on purpose: a tour that ends at "you can see the page"
67
+ * has taught the least valuable half, and an agent that learns only to look reports that it
68
+ * looked. Same reasoning as `tutorial.ts`, which already ends here.
69
+ */
70
+ 'first_verdict',
71
+ ],
72
+ [OnboardingPhase.FIRST_RUN]: [
73
+ 'project_detected',
74
+ /** The SDK is in the bundle. Files written is NOT this — see `app_instrumented`. */
75
+ 'instrumented',
76
+ /** A page loaded and the SDK dialled the bridge. The half of the install nothing else can see. */
77
+ 'app_connected',
78
+ /** Something was driven. */
79
+ 'driven',
80
+ /** A flow was recorded from that drive, which is what makes the SECOND run cheap. */
81
+ 'flow_recorded',
82
+ /**
83
+ * A verdict was produced on the user's own app. THE conversion event.
84
+ *
85
+ * Everything before this is setup that proved nothing. Prior measurement put the break here —
86
+ * strong user retention, far weaker verification retention — and no existing event marks it,
87
+ * because `init_completed` fires when files are written and this is minutes later.
88
+ */
89
+ 'verdict_produced',
90
+ ],
91
+ };
92
+ /**
93
+ * ONE event for every step of every phase, rather than an event name per step.
94
+ *
95
+ * The kinds list is already at the size where a reader has to scan it, and a name per step would
96
+ * mean every funnel query naming the steps it spans — so moving, renaming or inserting a step
97
+ * silently breaks the queries that were watching it. A phase + step pair keeps the funnel a GROUP BY
98
+ * instead of a union, and a new step arrives in the existing chart rather than beside it.
99
+ *
100
+ * `step` is one of our own names and never a path, a URL or anything the user typed — rule 3. The
101
+ * schema caps it for the same reason every other free-ish field here is capped.
102
+ */
103
+ /**
104
+ * Every step name, flattened — the closed set `step` is allowed to be.
105
+ *
106
+ * Derived from `OnboardingSteps` rather than retyped, so a step added there is accepted here on the
107
+ * same edit and a step renamed cannot be accepted under both spellings.
108
+ */
109
+ const ALL_ONBOARDING_STEPS = Object.values(OnboardingSteps).flatMap((steps) => [...steps]);
110
+ export const OnboardingStepSchema = z.object({
111
+ phase: z.nativeEnum(OnboardingPhase),
112
+ /**
113
+ * Our name for the step, and ONLY one of ours.
114
+ *
115
+ * This was `z.string().max(48)`, with a comment promising it was never user text — and a cap is
116
+ * not a promise. `/Users/someone/secret/project` is 28 characters and validated cleanly, which is
117
+ * a rule-3 leak (names, never values) reaching the wire from the one payload a person can edit:
118
+ * the installer's breadcrumb file, on disk, in their own home directory.
119
+ *
120
+ * A closed set makes the promise enforceable instead of aspirational. Found by the test written
121
+ * for that file, not by reading this line.
122
+ */
123
+ step: z.enum(ALL_ONBOARDING_STEPS),
124
+ status: z.nativeEnum(OnboardingStepStatus),
125
+ /**
126
+ * Milliseconds this step took. Absent when the step is instantaneous or not timed — absent means
127
+ * NOT MEASURED, never zero, because a zero would pull every average toward a duration nobody had.
128
+ */
129
+ elapsedMs: z.number().int().nonnegative().optional(),
130
+ /** Classified cause when it failed — our vocabulary, never a raw error or a path. */
131
+ reason: z.string().max(64).optional(),
132
+ /** The stack it was detected on, so a phase that only fails on one framework is visible. */
133
+ stack: z.string().max(64).optional(),
134
+ /**
135
+ * True when nobody was asked anything — the zero-human-input path an agent takes from a link.
136
+ *
137
+ * Recorded because the two audiences fail differently and a funnel that mixes them explains
138
+ * neither: a human abandons a step, an agent's run exits.
139
+ */
140
+ unattended: z.boolean().optional(),
141
+ });