@reticlehq/engine 3.10.1 → 3.10.2

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.
@@ -26,6 +26,13 @@ export declare function evalNet(events: ReticleEvent[], p: Extract<Predicate, {
26
26
  export declare function evalSignal(events: ReticleEvent[], p: Extract<Predicate, {
27
27
  kind: typeof PredicateKind.SIGNAL;
28
28
  }>): EvalResult;
29
+ /**
30
+ * An attribute written with the value it already had. Nothing on the page changed, so it is not
31
+ * activity. A page with a hidden input whose inline style was written again, unchanged, every 1-3 s
32
+ * never read as settled, on a page that had stopped. Both values must be present: an SDK that does
33
+ * not send `old` keeps every write as activity, so a real change is never hidden.
34
+ */
35
+ export declare function isUnchangedAttrWrite(e: ReticleEvent): boolean;
29
36
  /**
30
37
  * What the caller knows about whose traffic this is.
31
38
  *
@@ -602,6 +602,20 @@ const SETTLE_ACTIVITY = new Set([
602
602
  ]);
603
603
  /** An app-scoped settle: the default's activity, and every framework render commit. */
604
604
  const APP_ACTIVITY = new Set([...SETTLE_ACTIVITY, EventType.RENDER_COMMIT]);
605
+ /**
606
+ * An attribute written with the value it already had. Nothing on the page changed, so it is not
607
+ * activity. A page with a hidden input whose inline style was written again, unchanged, every 1-3 s
608
+ * never read as settled, on a page that had stopped. Both values must be present: an SDK that does
609
+ * not send `old` keeps every write as activity, so a real change is never hidden.
610
+ */
611
+ export function isUnchangedAttrWrite(e) {
612
+ if (EventType.DOM_ATTR !== e.type) {
613
+ return false;
614
+ }
615
+ const value = e.data['value'];
616
+ const old = e.data['old'];
617
+ return 'string' === typeof value && 'string' === typeof old && value === old;
618
+ }
605
619
  /** The quiet window of a network-scoped settle: a completed request is the only activity. */
606
620
  const NETWORK_ACTIVITY = new Set([EventType.NET_REQUEST]);
607
621
  /** The three net-shaped event types a URL can be read off — the only ones dev tooling can produce. */
@@ -812,7 +826,7 @@ export function evalSettled(allEvents, p, now, scope) {
812
826
  let lastT = -1;
813
827
  let lastType;
814
828
  for (const e of events) {
815
- if (activity.has(e.type) && e.t > lastT) {
829
+ if (activity.has(e.type) && !isUnchangedAttrWrite(e) && e.t > lastT) {
816
830
  lastT = e.t;
817
831
  lastType = e.type;
818
832
  }
@@ -5,7 +5,7 @@
5
5
  * app is right now — and keeping that reconciliation in one place is what makes it readable.
6
6
  */
7
7
  import { EventType, PredicateKind, RETICLE_URL_PARAM } from '@reticlehq/core';
8
- import { str } from './predicate-eval.js';
8
+ import { isUnchangedAttrWrite, str } from './predicate-eval.js';
9
9
  /**
10
10
  * Which fact answered a `route` predicate: a navigation inside the window, or where the app is now.
11
11
  *
@@ -329,7 +329,7 @@ since = 0) {
329
329
  * moment to be too close to, and a caveat there would describe a reading it is not about.
330
330
  */
331
331
  function sawActivityAfter(events, routeAt) {
332
- return events.some((e) => e.t > routeAt && ROUTE_SETTLE_ACTIVITY.has(e.type));
332
+ return events.some((e) => e.t > routeAt && ROUTE_SETTLE_ACTIVITY.has(e.type) && !isUnchangedAttrWrite(e));
333
333
  }
334
334
  /**
335
335
  * What counts as the view still moving. Same set the `settled` oracle uses, and deliberately the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/engine",
3
- "version": "3.10.1",
3
+ "version": "3.10.2",
4
4
  "description": "The rules that decide a verdict: read what happened in a running app and say whether the declared consequence held. No browser, no daemon, no command line - an implementation of the OpenVerification specification you can use on its own.",
5
5
  "keywords": [
6
6
  "verification",
@@ -57,7 +57,7 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "zod": "^4.6.6",
60
- "@reticlehq/core": "3.10.1",
60
+ "@reticlehq/core": "3.10.2",
61
61
  "open-verification": "1.1.0"
62
62
  },
63
63
  "scripts": {