@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,18 +1,8 @@
1
1
  /**
2
2
  * What a verification can FIND — the vocabulary of faults and contradictions shared by the crawl,
3
- * the contradiction hunter and the tools that report them. Split out of constants.ts to keep that
4
- * file under the size cap.
5
- */
6
- /**
7
- * Cross-channel contradictions: two observation channels making INCOMPATIBLE claims about the same
8
- * action. This is the bug class a human structurally cannot see, because a human has one channel
9
- * open — the screen. The agent holds DOM, store, signals, console and network in one causally
10
- * ordered window and can notice they disagree.
11
- *
12
- * Every kind here describes a shipped-today false green: the run is green, the screen looks right,
13
- * and the app is wrong. Contrast `CrawlAnomalyKind`, whose members are all SINGLE-channel facts (an
14
- * error was logged; a request failed) — those are findable by reading one stream.
3
+ * the contradiction hunter and the tools that report them.
15
4
  */
5
+ import { ChannelId, disagreementCanConvict } from '../wire/channel.js';
16
6
  export const ContradictionKind = {
17
7
  /** The screen moved forward while a request in the same window failed — the swallowed rejection. */
18
8
  UI_ADVANCED_REQUEST_FAILED: 'ui-advanced-request-failed',
@@ -29,7 +19,7 @@ export const ContradictionKind = {
29
19
  * "dispatched but the app did NOTHING (no DOM/net/route/signal)", so firing a signal was enough to
30
20
  * rescue a control that did nothing at all. That is the hole. An app whose signal is emitted from
31
21
  * the value it was ASKED for rather than the one it COMMITTED gets a verdict at signal grade —
32
- * the strongest we award — for a click that changed nothing. Measured on the bench fixture: a
22
+ * the strongest grade there is — for a click that changed nothing. On the bench fixture: a
33
23
  * modal that never opened came back `verified: "yes" / proved`.
34
24
  *
35
25
  * Absence-derived on purpose (see below). "Nothing corroborated it" is not "it did not happen":
@@ -37,6 +27,20 @@ export const ContradictionKind = {
37
27
  * so the false green cannot stand, without asserting a fault nobody proved.
38
28
  */
39
29
  SIGNAL_WITHOUT_CONSEQUENCE: 'signal-without-consequence',
30
+ /**
31
+ * The store committed and the screen never moved.
32
+ *
33
+ * `response-ignored` covers *a write succeeded and nothing moved*; `action-had-no-effect` covers
34
+ * *the click did nothing at all*. Neither covers the commonest render defect there is: state
35
+ * commits and the component that should have re-rendered does not — a memo with a stale
36
+ * comparator, a key that never changes, a selector reading the wrong slice. The app is internally
37
+ * consistent and the user is looking at the old value.
38
+ *
39
+ * Absence-derived, for the same reason as the entry above: a store holds plenty that was never
40
+ * meant to paint — an analytics flag, a timer, a cached token — so "nothing rendered" is not proof
41
+ * of a fault. It removes the false green and never invents a NO.
42
+ */
43
+ STATE_VS_RENDER: 'state-vs-render',
40
44
  /**
41
45
  * A write succeeded on the server and nothing moved in THIS document — because the page opened
42
46
  * another browsing context (an OAuth popup is the archetype) and the consequence lives there,
@@ -96,7 +100,7 @@ export const ContradictionKind = {
96
100
  * PATCH honouring a subset, an enum falling back to a default. The status is 2xx, the body reports
97
101
  * no failure, the UI advanced, the page settled — so every channel except the payload agrees the
98
102
  * save worked, and the screen goes on showing the value the user typed rather than the value that
99
- * was stored. Measured on a preferences write that asked for `locale: fr` and echoed `locale: en`.
103
+ * was stored — a write asking for `locale: fr` and echoing `locale: en`.
100
104
  */
101
105
  WRITE_FIELD_IGNORED: 'write-field-ignored',
102
106
  /** The UI advanced while a request was still in flight, so `settled` was reported over a live call. */
@@ -115,9 +119,8 @@ export const ContradictionKind = {
115
119
  * `dispatched: true, settled: true`, and every observation channel reports an empty window. The
116
120
  * settle half is the trap — a page that does nothing is quiet, and quiet is exactly what `settled`
117
121
  * tests for, so `until: { kind: 'settled' }` PASSES on a dead click and the verdict read
118
- * `verified: "yes", because: "no channel disagreeing"`. Measured on a real merchant dashboard by
119
- * clicking a `styled.div` that `reticle_query { by: 'text' }` had resolved instead of the button
120
- * beside it: zero events, store unchanged, green verdict.
122
+ * `verified: "yes", because: "no channel disagreeing"`. The shape that produces it: a `by: 'text'`
123
+ * query resolves a `styled.div` instead of the button beside it, and the click lands on nothing.
121
124
  */
122
125
  ACTION_HAD_NO_EFFECT: 'action-had-no-effect',
123
126
  /**
@@ -125,22 +128,18 @@ export const ContradictionKind = {
125
128
  * The URL says you arrived somewhere; the page is blank.
126
129
  *
127
130
  * This is the class every "did the control work" heuristic misses, because the control DID work:
128
- * it navigated. Measured on a real merchant dashboard with nine such links (Invoices, Route,
129
- * Subscriptions, QR Codes, Customers…), `reticle_crawl` drove all nine and reported
130
- * `deadControls: 0` — correctly, by its own definition, since a route change is activity.
131
+ * it navigated. A crawler counting dead controls reports none, correctly by its own definition,
132
+ * since a route change IS activity.
131
133
  *
132
- * The discriminator came from executing both cases and comparing, not from reasoning: a working
133
- * nav emitted `domAdded: 1, network: 2`; a blank one emitted `domAdded: 0, domRemoved: 0,
134
- * network: 0` and left the page at an eighth the size. A real transition either fetches something
135
- * or renders something.
134
+ * The discriminator: a working nav emits `domAdded: 1, network: 2`; a blank one emits
135
+ * `domAdded: 0, domRemoved: 0, network: 0`. A real transition either fetches something or renders
136
+ * something.
136
137
  *
137
- * MEASURED PRECISION, and the limit is real: 11 findings on that dashboard, 10 of them genuinely
138
- * blank destinations (verified by reading the DOM directly, not by asking Reticle), 1 false
139
- * positive. The false positive is instructive rather than fixable by tuning — a route whose view
140
- * is REVEALED from DOM that already existed emits `route.change` + `dom.attr` and nothing else,
141
- * which is byte-for-byte the window a blank destination emits. No event-only rule separates them.
142
- * Over-warning is the safe direction here (a false alarm costs a glance; a blank page shipped as
143
- * working does not), so it is reported with that ceiling stated rather than tuned into silence.
138
+ * THE LIMIT IS REAL, and is not fixable by tuning: a route whose view is REVEALED from DOM that
139
+ * already existed emits `route.change` + `dom.attr` and nothing else, which is byte-for-byte the
140
+ * window a blank destination emits. No event-only rule separates them. Over-warning is the safe
141
+ * direction (a false alarm costs a glance; a blank page shipped as working does not), so this is
142
+ * reported with the ceiling stated rather than tuned into silence.
144
143
  */
145
144
  ROUTE_RENDERED_NOTHING: 'route-rendered-nothing',
146
145
  /**
@@ -206,26 +205,22 @@ export const ContradictionKind = {
206
205
  /**
207
206
  * Contradictions inferred from the ABSENCE of evidence in a window whose end Reticle itself chose.
208
207
  *
209
- * The distinction is not cosmetic — it decides whether Reticle is entitled to say an action FAILED.
210
- * The other kinds are things we positively observed: a request came back 500 while the UI advanced,
211
- * a signal fired carrying data that disagrees with the DOM, a written field echoed a different
212
- * value. Those are evidence AGAINST the action, and they must keep outranking a passing assertion,
213
- * because a green assertion sitting on top of a failed write is the entire bug class this product
214
- * exists to catch.
208
+ * The distinction decides whether Reticle is entitled to say an action FAILED. The other kinds are
209
+ * POSITIVELY observed — a request came back 500 while the UI advanced, a signal fired carrying data
210
+ * that disagrees with the DOM, a written field echoed a different value — and they must keep
211
+ * outranking a passing assertion, because a green assertion on top of a failed write is the bug
212
+ * class this product exists to catch.
215
213
  *
216
- * These five are different. Each says "the thing I expected to see had not happened YET when I
217
- * stopped looking" — and the window closes the moment the predicate first passes, which on an app
218
- * that navigates optimistically is routinely before the network drains. Reproduced on the bench app:
219
- * `auth:granted` fired WITH matching data, application state changed, the token was stored, capture
220
- * integrity was clean and the honesty grade was `signal` — our strongest evidence class — and the
221
- * verdict was still `no`, because one POST had not settled. A timing observation overruled a
222
- * consequence observation, which inverts the grade hierarchy the verifier is built on.
214
+ * These five say only "the thing I expected had not happened YET when I stopped looking", and the
215
+ * window closes the moment the predicate first passes — on an app that navigates optimistically,
216
+ * routinely before the network drains. Letting one assert NO makes a timing observation overrule a
217
+ * consequence observation, which inverts the grade hierarchy the verifier is built on: the bench app
218
+ * produces a `no` over a fired signal with matching data, changed state, a stored token and a clean
219
+ * capture, because one POST had not settled.
223
220
  *
224
221
  * A false negative is not the mirror of a false positive here. A false positive stops an agent
225
222
  * early; a false NEGATIVE makes it redo work that already succeeded, or stop trusting the verdict
226
- * channel — and the verdict channel is the product. `bug.attribution` was deleted for exactly this
227
- * reason: every `attribution: 'app'` on `request-never-settled` turned out to be a misattribution.
228
- * We removed the field and left the verdict.
223
+ * channel — and the verdict channel is the product.
229
224
  *
230
225
  * So these downgrade a verdict to UNKNOWN rather than asserting NO. The finding is still reported in
231
226
  * `contradictions` either way — nothing is hidden, and an agent that wants to wait and re-check has
@@ -238,6 +233,9 @@ export const ABSENCE_DERIVED_CONTRADICTIONS = new Set([
238
233
  // never proof the app is wrong — a signal about non-visual state has nothing to corroborate it by
239
234
  // construction. UNKNOWN removes the false green; NO would invent a fault.
240
235
  ContradictionKind.SIGNAL_WITHOUT_CONSEQUENCE,
236
+ // The store moved and nothing painted. Non-visual state is a legitimate reason for that, so the
237
+ // absence of a render is never by itself proof the app is wrong.
238
+ ContradictionKind.STATE_VS_RENDER,
241
239
  // The consequence is not missing, it is somewhere this document's SDK cannot look — a claim about
242
240
  // the reach of the observation, never a positive fault in the app.
243
241
  ContradictionKind.CONSEQUENCE_ELSEWHERE,
@@ -297,13 +295,14 @@ export const FindingTier = {
297
295
  OBSERVED: 'observed',
298
296
  /**
299
297
  * Inferred from something NOT having happened yet, in a window whose end Reticle chose. It may
300
- * become true a moment later. It is a statement about our timing at least as much as about the app.
298
+ * become true a moment later. It is a statement about the window's timing at least as much as
299
+ * about the app.
301
300
  */
302
301
  ABSENCE_DERIVED: 'absence-derived',
303
302
  /**
304
303
  * True, reported, and not about the question asked. Traffic the assertion never named.
305
304
  *
306
- * Distinct from ABSENCE_DERIVED, which IS about the declared consequence and says our timing was
305
+ * Distinct from ABSENCE_DERIVED, which IS about the declared consequence and says the timing was
307
306
  * inconclusive about it. This one is about something else entirely, so downgrading on it answers a
308
307
  * question nobody put.
309
308
  */
@@ -333,6 +332,61 @@ export function tierOfFinding(kind) {
333
332
  * write. Narrowing to writes is what keeps the rules from crying wolf on ordinary reads.
334
333
  */
335
334
  export const MUTATING_METHODS = ['POST', 'PUT', 'PATCH', 'DELETE', 'IPC'];
335
+ /**
336
+ * Which two channels each contradiction sets against each other.
337
+ *
338
+ * `Record<ContradictionKind, ...>` on purpose: a new kind does not compile until somebody says what
339
+ * it compares. That is the point -- the independence rule is only checkable if the pairing is
340
+ * written down, and until now it was carried in the head of whoever added the rule.
341
+ *
342
+ * The pairing is causal, not observational: it names where each side of the disagreement was
343
+ * PRODUCED. A screenshot is `ui` even though it is taken out of process, because the pixels came
344
+ * from the render the action caused.
345
+ */
346
+ export const CONTRADICTION_CHANNELS = {
347
+ [ContradictionKind.UI_ADVANCED_REQUEST_FAILED]: [ChannelId.UI, ChannelId.NET],
348
+ [ContradictionKind.SIGNAL_CONTRADICTED]: [ChannelId.SIGNAL, ChannelId.NET],
349
+ [ContradictionKind.RESPONSE_IGNORED]: [ChannelId.NET, ChannelId.UI],
350
+ [ContradictionKind.SIGNAL_WITHOUT_CONSEQUENCE]: [ChannelId.SIGNAL, ChannelId.NET],
351
+ // The two channels that disagree are the store and the screen it should have driven.
352
+ [ContradictionKind.STATE_VS_RENDER]: [ChannelId.STATE, ChannelId.UI],
353
+ [ContradictionKind.CONSEQUENCE_ELSEWHERE]: [ChannelId.NET, ChannelId.UI],
354
+ [ContradictionKind.DUPLICATE_REQUEST]: [ChannelId.NET, ChannelId.NET],
355
+ [ContradictionKind.DUPLICATE_REQUEST_UNRELATED]: [ChannelId.NET, ChannelId.NET],
356
+ // The evidence is the interleaving of two responses, read against what the screen ended up showing.
357
+ [ContradictionKind.STALE_RESPONSE_APPLIED]: [ChannelId.NET, ChannelId.UI],
358
+ // Both sides are the server's own answer: the status line and the payload under it.
359
+ [ContradictionKind.PARTIAL_FAILURE_IN_OK_RESPONSE]: [ChannelId.NET, ChannelId.NET],
360
+ [ContradictionKind.UNIT_MISMATCH]: [ChannelId.UI, ChannelId.NET],
361
+ // What was sent against what came back -- the request and its echo, neither derived from the click.
362
+ [ContradictionKind.WRITE_FIELD_IGNORED]: [ChannelId.NET, ChannelId.NET],
363
+ [ContradictionKind.REQUEST_NEVER_SETTLED]: [ChannelId.TIME, ChannelId.NET],
364
+ // The app's message to the user, against the status the server actually returned.
365
+ [ContradictionKind.FAILURE_MISATTRIBUTED]: [ChannelId.UI, ChannelId.NET],
366
+ // "Nothing anywhere moved" is a claim about every channel; `net` is the independent one in it.
367
+ [ContradictionKind.ACTION_HAD_NO_EFFECT]: [ChannelId.NET, ChannelId.UI],
368
+ [ContradictionKind.ROUTE_RENDERED_NOTHING]: [ChannelId.ROUTE, ChannelId.NET],
369
+ // The crashed variant pairs against LOG rather than NET, because that is what makes it a
370
+ // different finding from the one above: its positive evidence is a console error in the same
371
+ // window, not a request. Pairing it with `net` would claim the network disagreed when nothing
372
+ // about the network was read.
373
+ [ContradictionKind.ROUTE_RENDERED_NOTHING_CRASHED]: [ChannelId.ROUTE, ChannelId.LOG],
374
+ // Not two channels disagreeing but evidence disagreeing with the clock, which is the independent
375
+ // side. Recorded rather than exempted: an exemption is a hole somebody later widens.
376
+ [ContradictionKind.EVIDENCE_SUPERSEDED]: [ChannelId.TIME, ChannelId.UI],
377
+ [ContradictionKind.EVIDENCE_PREDATES_EDIT]: [ChannelId.TIME, ChannelId.UI],
378
+ };
379
+ /**
380
+ * May this kind of disagreement be reported as a fault in the app?
381
+ *
382
+ * False when both sides come from the app's own actuation path. Such a disagreement is real and
383
+ * worth reporting -- the app contradicted itself -- but it is not evidence that the action failed,
384
+ * and treating it as such is how a verdict channel earns a reputation for crying wolf.
385
+ */
386
+ export function contradictionCanConvict(kind) {
387
+ const pair = CONTRADICTION_CHANNELS[kind];
388
+ return disagreementCanConvict(pair[0], pair[1]);
389
+ }
336
390
  export const CrawlAnomalyKind = {
337
391
  CONSOLE_ERROR: 'console-error', // the click logged a console.error / uncaught error
338
392
  FAILED_REQUEST: 'failed-request', // it fired a request that returned >= 400
@@ -5,20 +5,14 @@
5
5
  * verdict rather than passing it. That is a safety property and it is why a green verdict here means
6
6
  * something. What it has never answered is the other half: **what would I need in order to see it?**
7
7
  *
8
- * The difference matters because of who is driving. The decision-maker is an agent, and an agent
9
- * cannot be relied on to remember to instrument an app — nobody can. But an agent WILL act on a cost
10
- * it is paying right now, if it is handed the file, the line, and the change. So an absence in the
11
- * app stops being a silent weakness in the verdict and becomes a piece of work, at the moment the
12
- * agent is trying to finish.
8
+ * An agent will act on a cost it is paying right now if it is handed the file, the line and the
9
+ * change — so an absence in the app becomes a piece of work rather than a silent weakness in the
10
+ * verdict.
13
11
  *
14
- * ## The rule that keeps this from becoming noise
15
- *
16
- * A gap is reported ONLY when a verdict came back weaker than it would otherwise have been, BECAUSE
17
- * of an absence in the app. Never as a survey of everything uninstrumented on the page.
18
- *
19
- * A gap nobody hit is a backlog, not a finding, and this product does not need another surface
20
- * producing findings nobody reads. The test for whether a gap belongs here is: *did this absence
21
- * change the answer the agent just got?* If not, it does not fire.
12
+ * THE RULE THAT KEEPS IT FROM BECOMING NOISE: a gap is reported ONLY when a verdict came back weaker
13
+ * than it would otherwise have been, BECAUSE of an absence in the app. Never as a survey of
14
+ * everything uninstrumented on the page. The test is *did this absence change the answer the agent
15
+ * just got?* — if not, it does not fire.
22
16
  */
23
17
  /**
24
18
  * The kinds of absence that can weaken a verdict. Most name a capability the app did not provide;
@@ -43,7 +37,6 @@ export declare const InstrumentationGapKind: {
43
37
  */
44
38
  readonly NO_SIGNAL_ON_MUTATION: "no-signal-on-mutation";
45
39
  /** The route changed and no route signal fired, so route consequences cannot be asserted. */
46
- readonly NO_ROUTE_SIGNAL: "no-route-signal";
47
40
  /** A control was driven that the declared capability contract does not mention. */
48
41
  readonly UNDECLARED_CONTROL: "undeclared-control";
49
42
  /**
@@ -5,20 +5,14 @@
5
5
  * verdict rather than passing it. That is a safety property and it is why a green verdict here means
6
6
  * something. What it has never answered is the other half: **what would I need in order to see it?**
7
7
  *
8
- * The difference matters because of who is driving. The decision-maker is an agent, and an agent
9
- * cannot be relied on to remember to instrument an app — nobody can. But an agent WILL act on a cost
10
- * it is paying right now, if it is handed the file, the line, and the change. So an absence in the
11
- * app stops being a silent weakness in the verdict and becomes a piece of work, at the moment the
12
- * agent is trying to finish.
8
+ * An agent will act on a cost it is paying right now if it is handed the file, the line and the
9
+ * change — so an absence in the app becomes a piece of work rather than a silent weakness in the
10
+ * verdict.
13
11
  *
14
- * ## The rule that keeps this from becoming noise
15
- *
16
- * A gap is reported ONLY when a verdict came back weaker than it would otherwise have been, BECAUSE
17
- * of an absence in the app. Never as a survey of everything uninstrumented on the page.
18
- *
19
- * A gap nobody hit is a backlog, not a finding, and this product does not need another surface
20
- * producing findings nobody reads. The test for whether a gap belongs here is: *did this absence
21
- * change the answer the agent just got?* If not, it does not fire.
12
+ * THE RULE THAT KEEPS IT FROM BECOMING NOISE: a gap is reported ONLY when a verdict came back weaker
13
+ * than it would otherwise have been, BECAUSE of an absence in the app. Never as a survey of
14
+ * everything uninstrumented on the page. The test is *did this absence change the answer the agent
15
+ * just got?* — if not, it does not fire.
22
16
  */
23
17
  /**
24
18
  * The kinds of absence that can weaken a verdict. Most name a capability the app did not provide;
@@ -43,7 +37,6 @@ export const InstrumentationGapKind = {
43
37
  */
44
38
  NO_SIGNAL_ON_MUTATION: 'no-signal-on-mutation',
45
39
  /** The route changed and no route signal fired, so route consequences cannot be asserted. */
46
- NO_ROUTE_SIGNAL: 'no-route-signal',
47
40
  /** A control was driven that the declared capability contract does not mention. */
48
41
  UNDECLARED_CONTROL: 'undeclared-control',
49
42
  /**
@@ -128,7 +121,6 @@ const GAP_FIX = {
128
121
  [InstrumentationGapKind.NO_SOURCE_MAPPING]: 'add the Reticle build plugin (@reticlehq/vite-plugin, @reticlehq/next, or the babel plugin) so elements carry data-reticle-source',
129
122
  [InstrumentationGapKind.NO_STORE_REGISTERED]: 'register the store with reticle.registerStore(name, getState) so state can be read directly instead of inferred from the DOM',
130
123
  [InstrumentationGapKind.NO_SIGNAL_ON_MUTATION]: 'fire reticle.signal(name, data) where this state is committed — commitAndSignal binds the two so they cannot drift',
131
- [InstrumentationGapKind.NO_ROUTE_SIGNAL]: 'let the Reticle router adapter observe navigation, or fire reticle.signal on route commit',
132
124
  [InstrumentationGapKind.UNDECLARED_CONTROL]: 'add this control to reticle.describe() so the capability contract matches what the app actually exposes',
133
125
  [InstrumentationGapKind.MISSING_TESTID]: 'add data-testid="..." on this control so the flow can name it after a refactor',
134
126
  [InstrumentationGapKind.UNDECLARED_CHANGE]: 'declare it with reticle_intent { action: "declare", intents: [{ id, statement }] } — the statement is prose, in your own words: which user does what, and what should become true',
@@ -8,31 +8,20 @@ import { z } from 'zod';
8
8
  * holding the DOM, the diff, and no intent. So it asserts what it can SEE rather than what was
9
9
  * MEANT, and what it can see is almost always weaker. That gap is where a false green comes from.
10
10
  *
11
- * ## Why the prose is captured early and the predicate late
11
+ * ## Prose early, predicate late
12
12
  *
13
- * Intent has two properties that move in opposite directions over the life of a task.
14
- *
15
- * **Fidelity** is highest the moment the human asks and decays from there; every later restatement
16
- * is a lossy re-derivation. **Bindability** — whether it can be written as something checkable — is
17
- * near zero then, because there is no route, no ref and often no code, and rises as the code
18
- * appears.
19
- *
20
- * Capture at either end alone loses one of them. Demanding a predicate at declare time collects
21
- * MECHANISMS, which is what assertions already are. Waiting until drive time collects a
22
- * RE-DERIVATION, which is the weak artifact this exists to replace — by then the agent has already
23
- * forgotten, and that is the entire premise.
24
- *
25
- * So: `statement` is prose and mandatory. `binding` is a predicate, optional, and may arrive later
26
- * or never. An intent that stays `declared` and never becomes `bound` is not a failure — it is the
27
- * most interesting row in the ledger, because it names something the team meant that nothing can
28
- * currently prove.
13
+ * Fidelity is highest the moment the human asks and decays from there. Bindability — whether it can
14
+ * be written as something checkable — is near zero then and rises as the code appears. So
15
+ * `statement` is prose and mandatory, and `binding` is a predicate, optional, arriving later or
16
+ * never. An intent that stays `declared` is not a failure: it names something the team meant that
17
+ * nothing can currently prove.
29
18
  *
30
19
  * ## Amendments are append-only
31
20
  *
32
- * A long build changes its mind, so an intent must be amendable. But an amendable intent is also how
33
- * an agent could quietly rewrite what it meant to match what it can already prove. Keeping the
34
- * previous statement makes a NARROWING visible in the git diff, which is the only real defence —
35
- * and it is a partial one, stated here rather than papered over.
21
+ * A long build changes its mind, so an intent must be amendable — and an amendable intent is also
22
+ * how an agent could quietly rewrite what it meant to match what it can already prove. Keeping the
23
+ * previous statement makes a NARROWING visible in the git diff. That is a PARTIAL defence and the
24
+ * only one there is.
36
25
  */
37
26
  export declare const INTENT_FILE_VERSION = 1;
38
27
  export declare const IntentState: {
@@ -66,12 +55,12 @@ export declare const IntentProofSchema: z.ZodObject<{
66
55
  at: z.ZodNumber;
67
56
  }, "strip", z.ZodTypeAny, {
68
57
  at: number;
69
- verdictId: string;
70
58
  grade: string;
59
+ verdictId: string;
71
60
  }, {
72
61
  at: number;
73
- verdictId: string;
74
62
  grade: string;
63
+ verdictId: string;
75
64
  }>;
76
65
  export declare const IntentSchema: z.ZodObject<{
77
66
  id: z.ZodString;
@@ -100,12 +89,12 @@ export declare const IntentSchema: z.ZodObject<{
100
89
  at: z.ZodNumber;
101
90
  }, "strip", z.ZodTypeAny, {
102
91
  at: number;
103
- verdictId: string;
104
92
  grade: string;
93
+ verdictId: string;
105
94
  }, {
106
95
  at: number;
107
- verdictId: string;
108
96
  grade: string;
97
+ verdictId: string;
109
98
  }>>;
110
99
  /** Every statement this intent previously carried, oldest first. Append-only, never rewritten. */
111
100
  amended: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -119,40 +108,40 @@ export declare const IntentSchema: z.ZodObject<{
119
108
  statement: string;
120
109
  }>, "many">>;
121
110
  }, "strip", z.ZodTypeAny, {
111
+ state: "proved" | "declared" | "bound";
122
112
  id: string;
123
113
  statement: string;
124
- state: "declared" | "bound" | "proved";
125
114
  declaredAt: number;
126
- binding?: unknown;
127
115
  surface?: {
128
116
  route?: string | undefined;
129
117
  flow?: string | undefined;
130
118
  files?: string[] | undefined;
131
119
  } | undefined;
120
+ binding?: unknown;
132
121
  provenBy?: {
133
122
  at: number;
134
- verdictId: string;
135
123
  grade: string;
124
+ verdictId: string;
136
125
  } | undefined;
137
126
  amended?: {
138
127
  at: number;
139
128
  statement: string;
140
129
  }[] | undefined;
141
130
  }, {
131
+ state: "proved" | "declared" | "bound";
142
132
  id: string;
143
133
  statement: string;
144
- state: "declared" | "bound" | "proved";
145
134
  declaredAt: number;
146
- binding?: unknown;
147
135
  surface?: {
148
136
  route?: string | undefined;
149
137
  flow?: string | undefined;
150
138
  files?: string[] | undefined;
151
139
  } | undefined;
140
+ binding?: unknown;
152
141
  provenBy?: {
153
142
  at: number;
154
- verdictId: string;
155
143
  grade: string;
144
+ verdictId: string;
156
145
  } | undefined;
157
146
  amended?: {
158
147
  at: number;
@@ -189,12 +178,12 @@ export declare const IntentFileSchema: z.ZodObject<{
189
178
  at: z.ZodNumber;
190
179
  }, "strip", z.ZodTypeAny, {
191
180
  at: number;
192
- verdictId: string;
193
181
  grade: string;
182
+ verdictId: string;
194
183
  }, {
195
184
  at: number;
196
- verdictId: string;
197
185
  grade: string;
186
+ verdictId: string;
198
187
  }>>;
199
188
  /** Every statement this intent previously carried, oldest first. Append-only, never rewritten. */
200
189
  amended: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -208,40 +197,40 @@ export declare const IntentFileSchema: z.ZodObject<{
208
197
  statement: string;
209
198
  }>, "many">>;
210
199
  }, "strip", z.ZodTypeAny, {
200
+ state: "proved" | "declared" | "bound";
211
201
  id: string;
212
202
  statement: string;
213
- state: "declared" | "bound" | "proved";
214
203
  declaredAt: number;
215
- binding?: unknown;
216
204
  surface?: {
217
205
  route?: string | undefined;
218
206
  flow?: string | undefined;
219
207
  files?: string[] | undefined;
220
208
  } | undefined;
209
+ binding?: unknown;
221
210
  provenBy?: {
222
211
  at: number;
223
- verdictId: string;
224
212
  grade: string;
213
+ verdictId: string;
225
214
  } | undefined;
226
215
  amended?: {
227
216
  at: number;
228
217
  statement: string;
229
218
  }[] | undefined;
230
219
  }, {
220
+ state: "proved" | "declared" | "bound";
231
221
  id: string;
232
222
  statement: string;
233
- state: "declared" | "bound" | "proved";
234
223
  declaredAt: number;
235
- binding?: unknown;
236
224
  surface?: {
237
225
  route?: string | undefined;
238
226
  flow?: string | undefined;
239
227
  files?: string[] | undefined;
240
228
  } | undefined;
229
+ binding?: unknown;
241
230
  provenBy?: {
242
231
  at: number;
243
- verdictId: string;
244
232
  grade: string;
233
+ verdictId: string;
245
234
  } | undefined;
246
235
  amended?: {
247
236
  at: number;
@@ -251,20 +240,20 @@ export declare const IntentFileSchema: z.ZodObject<{
251
240
  }, "strip", z.ZodTypeAny, {
252
241
  version: 1;
253
242
  intents: Record<string, {
243
+ state: "proved" | "declared" | "bound";
254
244
  id: string;
255
245
  statement: string;
256
- state: "declared" | "bound" | "proved";
257
246
  declaredAt: number;
258
- binding?: unknown;
259
247
  surface?: {
260
248
  route?: string | undefined;
261
249
  flow?: string | undefined;
262
250
  files?: string[] | undefined;
263
251
  } | undefined;
252
+ binding?: unknown;
264
253
  provenBy?: {
265
254
  at: number;
266
- verdictId: string;
267
255
  grade: string;
256
+ verdictId: string;
268
257
  } | undefined;
269
258
  amended?: {
270
259
  at: number;
@@ -274,20 +263,20 @@ export declare const IntentFileSchema: z.ZodObject<{
274
263
  }, {
275
264
  version: 1;
276
265
  intents: Record<string, {
266
+ state: "proved" | "declared" | "bound";
277
267
  id: string;
278
268
  statement: string;
279
- state: "declared" | "bound" | "proved";
280
269
  declaredAt: number;
281
- binding?: unknown;
282
270
  surface?: {
283
271
  route?: string | undefined;
284
272
  flow?: string | undefined;
285
273
  files?: string[] | undefined;
286
274
  } | undefined;
275
+ binding?: unknown;
287
276
  provenBy?: {
288
277
  at: number;
289
- verdictId: string;
290
278
  grade: string;
279
+ verdictId: string;
291
280
  } | undefined;
292
281
  amended?: {
293
282
  at: number;
@@ -319,7 +308,7 @@ export declare function dischargeIntent(intent: Intent, proof: {
319
308
  at: number;
320
309
  }): Intent;
321
310
  /**
322
- * Add or amend an intent, keeping what it used to say.
311
+ * Add or amend an intent, keeping the previous statement in its history.
323
312
  *
324
313
  * An amendment is recorded only when the statement actually changed — re-declaring the same intent
325
314
  * unchanged is what a re-run does, and filling the history with identical rows would bury the one
@@ -8,31 +8,20 @@ import { z } from 'zod';
8
8
  * holding the DOM, the diff, and no intent. So it asserts what it can SEE rather than what was
9
9
  * MEANT, and what it can see is almost always weaker. That gap is where a false green comes from.
10
10
  *
11
- * ## Why the prose is captured early and the predicate late
11
+ * ## Prose early, predicate late
12
12
  *
13
- * Intent has two properties that move in opposite directions over the life of a task.
14
- *
15
- * **Fidelity** is highest the moment the human asks and decays from there; every later restatement
16
- * is a lossy re-derivation. **Bindability** — whether it can be written as something checkable — is
17
- * near zero then, because there is no route, no ref and often no code, and rises as the code
18
- * appears.
19
- *
20
- * Capture at either end alone loses one of them. Demanding a predicate at declare time collects
21
- * MECHANISMS, which is what assertions already are. Waiting until drive time collects a
22
- * RE-DERIVATION, which is the weak artifact this exists to replace — by then the agent has already
23
- * forgotten, and that is the entire premise.
24
- *
25
- * So: `statement` is prose and mandatory. `binding` is a predicate, optional, and may arrive later
26
- * or never. An intent that stays `declared` and never becomes `bound` is not a failure — it is the
27
- * most interesting row in the ledger, because it names something the team meant that nothing can
28
- * currently prove.
13
+ * Fidelity is highest the moment the human asks and decays from there. Bindability — whether it can
14
+ * be written as something checkable — is near zero then and rises as the code appears. So
15
+ * `statement` is prose and mandatory, and `binding` is a predicate, optional, arriving later or
16
+ * never. An intent that stays `declared` is not a failure: it names something the team meant that
17
+ * nothing can currently prove.
29
18
  *
30
19
  * ## Amendments are append-only
31
20
  *
32
- * A long build changes its mind, so an intent must be amendable. But an amendable intent is also how
33
- * an agent could quietly rewrite what it meant to match what it can already prove. Keeping the
34
- * previous statement makes a NARROWING visible in the git diff, which is the only real defence —
35
- * and it is a partial one, stated here rather than papered over.
21
+ * A long build changes its mind, so an intent must be amendable — and an amendable intent is also
22
+ * how an agent could quietly rewrite what it meant to match what it can already prove. Keeping the
23
+ * previous statement makes a NARROWING visible in the git diff. That is a PARTIAL defence and the
24
+ * only one there is.
36
25
  */
37
26
  export const INTENT_FILE_VERSION = 1;
38
27
  export const IntentState = {
@@ -102,7 +91,7 @@ export function dischargeIntent(intent, proof) {
102
91
  return { ...intent, state: IntentState.PROVED, provenBy: proof };
103
92
  }
104
93
  /**
105
- * Add or amend an intent, keeping what it used to say.
94
+ * Add or amend an intent, keeping the previous statement in its history.
106
95
  *
107
96
  * An amendment is recorded only when the statement actually changed — re-declaring the same intent
108
97
  * unchanged is what a re-run does, and filling the history with identical rows would bury the one