Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## [Unreleased]

Packages: `runtime-browser` 1.11.0, `otlp-ingester` 1.21.0.

### Silent failures: clicks and forms that do nothing

- `runtime-browser`: reports three failures that throw no error, on by default. A dead click is a click on a button, link or `[role=button]` after which nothing happens within 1.5 s. A rage click is three dead clicks on one control within 2 s. A rejected form is one refused twice, by the browser's own validation or by a 400, 409 or 422 answer to its submit. Each is an `outcome` event with severity `warning`, at most once per control per page load and at most 20 per page load.
- `runtime-browser`: turn it off with `initAutterBrowser({ ..., captureInteractions: false })`. `captureActions: false` turns it off too. Dead clicks also need the request hooks (`captureNetworkFailures`).
- `runtime-browser`: name a control with `data-autter-action`, and leave out a control whose clicks are meant to do nothing with `data-autter-ignore`. Clicks inside an element with `data-autter-ignore` are not watched.
- `runtime-browser`: `trackGoal(name, props?)` sends a `track_event` named `goal:<name>`. The name is 1 to 80 letters, digits, `_`, `.` or `-`; any other name is ignored with one `console.warn`.
- `otlp-ingester`: groups the signals by a `control-v1` fingerprint of the group (`click` for dead and rage clicks, `submit` for rejected forms), the route template and the control key. Dead and rage clicks on one control form one issue. An event with a missing or malformed context is stored as a plain outcome.
- No new event type is added. The signals travel as existing `outcome` events, so older relays and ingesters store them as ordinary outcomes.

## [1.23.1] - 2026-11-27

Packages: `runtime-browser` 1.10.1, `runtime-node` 1.19.1, `runtime-edge` 1.6.1, `runtime-next` 1.12.1, `runtime-cli` 1.6.1, `otlp-ingester` 1.20.1. No code changes from 1.23.0.
Expand Down
9 changes: 9 additions & 0 deletions adapters/python/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,15 @@
"sdks": {
"@autter/runtime-node": "1.14.0"
}
},
{
"id": "browser-interactions",
"title": "Silent browser failures (dead clicks, rage clicks, rejected forms) grouped by control (control-v1)",
"ingester": "1.21.0",
"migrations": [],
"sdks": {
"@autter/runtime-browser": "1.11.0"
}
}
]
}
Expand Down
1 change: 1 addition & 0 deletions docs/COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ SDKs you have installed and the ingester you point it at.
| Server bundles symbolicated, with source context lines (`server_source_maps`) | 1.11.0+ | 1.9.0+ | 1.9.0+ | – | 1.4.0+ | `/v1/sourcemaps` | |
| Wrapped errors grouped with their root cause (cause-v1) (`cause_fingerprint`) | 1.11.0+ | 1.9.0+ | 1.9.0+ | – | 1.4.0+ | | |
| Cache-aware LLM cost (prompt-cache reads and writes) (`llm_cache_tokens`) | 1.16.0+ | 1.14.0+ | – | – | – | | `0024-llm-cache-tokens` |
| Silent browser failures (dead clicks, rage clicks, rejected forms) grouped by control (control-v1) (`browser-interactions`) | 1.21.0+ | – | – | 1.11.0+ | – | | |
<!-- compat-table:end -->

Notes:
Expand Down
32 changes: 32 additions & 0 deletions docs/CONTINUOUS-DETECTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,38 @@ enough evidence to prepare a PR. Never put a server key in the browser bundle.
All automatically prepared fixes are draft PRs. Repository owners can turn
expanded detection or automatic drafts off in Runtime Overview.

## Silent browser failures

A page can fail without throwing: a button that does nothing, a control
clicked over and over, a form rejected again and again. The browser SDK reports
these as three warning-level error types, so they never count as crashes or
errors:

| Error type | Meaning |
| --- | --- |
| `DeadClick` | a click on a control produced no visible effect |
| `RageClick` | rapid repeated clicks on one control |
| `FormRejected` | a form submission refused repeatedly |

They travel as the existing `outcome` event (`severity: "warning"`, name
`autter.interaction.<dead_click|rage_click|form_rejected>`), so an older relay
or ingester still stores them as ordinary outcomes. The context carries
`autter.interaction`, `autter.control` (a stable key such as
`click:main>form>button.2`, only `[a-z0-9:>_.-]`, at most 160 characters),
`autter.control.route` (the route with ids collapsed, e.g. `/orders/:id`) and
the click counts. An event whose context is missing or malformed is stored as a
plain outcome.

Occurrences group by the `control-v1` fingerprint: sha256 of `control-v1`,
the group, the route and the control key, joined with a NUL byte, cut to 32 hex
characters. The group is `click` for `DeadClick` and `RageClick` (one issue for
both) and `submit` for `FormRejected`. An explicit fingerprint set in the SDK
still wins. `autter.interaction.blocked: true` marks a signal the SDK suspects
is noise (offline, a blocked script).

A goal is a `track_event` named `goal:<name>`; it is counted on the route
`event:goal:<name>` like any other event.

## Rollout order

Deploy the ingester first so it creates the profile and source map ClickHouse
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/otlp-ingester/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@autter/otlp-ingester",
"version": "1.20.1",
"version": "1.21.0",
"description": "Self-hostable OTLP + browser-error ingest service for Autter Runtime: normalises telemetry into a per-repo ClickHouse data model",
"license": "MIT",
"type": "module",
Expand Down
7 changes: 7 additions & 0 deletions packages/otlp-ingester/src/compat-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@
"ingester": "1.16.0",
"migrations": ["0024-llm-cache-tokens"],
"sdks": { "@autter/runtime-node": "1.14.0" }
},
{
"id": "browser-interactions",
"title": "Silent browser failures (dead clicks, rage clicks, rejected forms) grouped by control (control-v1)",
"ingester": "1.21.0",
"migrations": [],
"sdks": { "@autter/runtime-browser": "1.11.0" }
}
]
}
12 changes: 12 additions & 0 deletions packages/otlp-ingester/src/compat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,15 @@ test("docs/COMPATIBILITY.md's table is the manifest (node scripts/compat-table.m
const table = compatTableMarkdown();
for (const feature of COMPAT_MANIFEST.features) assert.ok(table.includes(`(\`${feature.id}\`) | ${feature.ingester}+ |`), feature.id);
});

test("browser-interactions rides the existing outcome event type: no new type, no migration", () => {
const feature = COMPAT_MANIFEST.features.find((f) => f.id === "browser-interactions");
assert.ok(feature);
assert.deepEqual(feature.migrations, []);
assert.ok(feature.sdks["@autter/runtime-browser"]);
assert.equal(feature.browserEvents, undefined);
assert.ok(browserPayloadSchema.safeParse({
version: 1, service: "s", environment: "e",
events: [{ type: "outcome", timestamp: new Date().toISOString(), name: "autter.interaction.dead_click", severity: "warning" }],
}).success);
});
46 changes: 46 additions & 0 deletions packages/otlp-ingester/src/fingerprint-control.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import assert from "node:assert/strict";
import { test } from "node:test";
import { CONTROL_V1, controlFingerprint, controlV1Of, interactionSignalOf } from "./fingerprint-control.js";
import { occurrenceIdentity } from "./fingerprint-v3.js";
import type { RuntimeOccurrenceInput } from "./types.js";

// Fixed vectors: control-v1 = sha256("control-v1" \0 group \0 route \0 control).hex()[:32].
// The platform mirrors them; changing one regroups every interaction issue.
const VECTORS: Array<{ group: "click" | "submit"; route: string; control: string; fingerprint: string }> = [
{ group: "click", route: "/orders/:id", control: "click:main>form>button.2", fingerprint: "c2909d332b3df78ff9402a6a3ba1b5da" },
{ group: "submit", route: "/orders/:id", control: "click:main>form>button.2", fingerprint: "bec869ea714cc7374cb7c37b289071be" },
{ group: "click", route: "/settings", control: "click:save-settings", fingerprint: "36adbd2da1ee5dbfa74d79b82ad9092a" },
{ group: "submit", route: "/signup", control: "submit:main>form.0", fingerprint: "c8fd298e38b4185e8f40deb7c9266486" },
];

test("control-v1 fixed vectors", () => {
for (const v of VECTORS) assert.equal(controlFingerprint(v), v.fingerprint, `${v.group} ${v.route} ${v.control}`);
});

function occurrence(context: Record<string, unknown>, errorType = "DeadClick"): RuntimeOccurrenceInput {
return {
source: "browser", severity: "warning", service: "web", environment: "prod", release: null,
errorType, message: "Clicking click:save-settings did nothing", stack: null, route: "/settings",
method: null, statusCode: null, traceId: null, sessionId: "s1", attributes: { context }, occurredAt: new Date(0),
};
}

test("control-v1 candidate comes right after manual-v1 and before frames-v3, legacy kept", () => {
const o = occurrence({ "autter.interaction": "dead_click", "autter.control": "click:save-settings", "autter.control.route": "/settings" });
const id = occurrenceIdentity(o, []);
assert.deepEqual(id.candidates.map((c) => c.scheme), [CONTROL_V1, "frames-v3", "message-v1"]);
assert.equal(id.candidates[0]!.fingerprint, "36adbd2da1ee5dbfa74d79b82ad9092a");
assert.equal(id.legacy.scheme, "message-v1");
const manual = occurrenceIdentity({ ...o, fingerprintOverride: ["mine"] }, []);
assert.deepEqual(manual.candidates.slice(0, 2).map((c) => c.scheme), ["manual-v1", CONTROL_V1]);
});

test("no control-v1 for a server error, a generic type or a malformed context", () => {
const ok = { "autter.interaction": "dead_click", "autter.control": "click:save-settings", "autter.control.route": "/settings" };
assert.equal(controlV1Of({ ...occurrence(ok), source: "server" }), null);
assert.equal(controlV1Of(occurrence(ok, "OutcomeFailure")), null);
assert.equal(controlV1Of(occurrence({ ...ok, "autter.control": "Click:Save" })), null);
assert.equal(interactionSignalOf({ ...ok, "autter.control.route": "settings" }), null);
assert.equal(interactionSignalOf({ ...ok, "autter.control.route": "/" + "a".repeat(300) }), null);
assert.equal(interactionSignalOf({ ...ok, "autter.interaction": "toString" }), null);
});
86 changes: 86 additions & 0 deletions packages/otlp-ingester/src/fingerprint-control.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { createHash } from "node:crypto";
import type { RuntimeOccurrenceInput } from "./types.js";

/**
* Silent-failure signals from the browser SDK (runtime-browser ≥ the version
* in the `browser-interactions` compat entry) arrive as the existing
* `outcome` event type, with the interaction named in the event context:
*
* context["autter.interaction"] dead_click | rage_click | form_rejected
* context["autter.control"] control key, ^[a-z0-9:>_.-]{1,160}$
* context["autter.control.route"] route template, starts with "/", ≤ 300 chars
*
* A valid triple makes the occurrence an *interaction signal*: its errorType
* is DeadClick / RageClick / FormRejected and it carries a `control-v1`
* fingerprint, so every occurrence on one control of one route groups into
* one issue:
*
* sha256("control-v1" \0 group \0 routeTemplate \0 controlKey).hex()[:32]
*
* `group` is "click" for dead_click and rage_click (one issue for both) and
* "submit" for form_rejected. No service in the input: the platform keys
* issues per service already, and the contract fixes these four parts.
* Anything malformed is not an interaction signal and stays a plain outcome.
*/
export const CONTROL_V1 = "control-v1";

export const INTERACTION_ERROR_TYPES = {
dead_click: "DeadClick",
rage_click: "RageClick",
form_rejected: "FormRejected",
} as const;

export type InteractionKind = keyof typeof INTERACTION_ERROR_TYPES;

const INTERACTION_GROUP: Record<InteractionKind, "click" | "submit"> = {
dead_click: "click",
rage_click: "click",
form_rejected: "submit",
};

const CONTROL_KEY = /^[a-z0-9:>_.-]{1,160}$/;
const MAX_ROUTE_LENGTH = 300;

export interface InteractionSignal {
kind: InteractionKind;
errorType: (typeof INTERACTION_ERROR_TYPES)[InteractionKind];
group: "click" | "submit";
control: string;
route: string;
}

/** The interaction signal a browser event's context describes, or null. */
export function interactionSignalOf(context: unknown): InteractionSignal | null {
if (typeof context !== "object" || context === null || Array.isArray(context)) return null;
const bag = context as Record<string, unknown>;
const kind = bag["autter.interaction"];
if (typeof kind !== "string" || !Object.hasOwn(INTERACTION_ERROR_TYPES, kind)) return null;
const control = bag["autter.control"];
if (typeof control !== "string" || !CONTROL_KEY.test(control)) return null;
const route = bag["autter.control.route"];
if (typeof route !== "string" || !route.startsWith("/") || route.length > MAX_ROUTE_LENGTH) return null;
const k = kind as InteractionKind;
return { kind: k, errorType: INTERACTION_ERROR_TYPES[k], group: INTERACTION_GROUP[k], control, route };
}

/** The `control-v1` fingerprint (32 lowercase hex) of an interaction signal. */
export function controlFingerprint(signal: Pick<InteractionSignal, "group" | "route" | "control">): string {
return createHash("sha256")
.update([CONTROL_V1, signal.group, signal.route, signal.control].join("\u0000"))
.digest("hex")
.slice(0, 32);
}

/**
* The control-v1 fingerprint and its parts for an occurrence, or null when it
* is not an interaction signal. Only browser outcomes of the three interaction
* error types qualify, so a server error with the same attributes never does.
*/
export function controlV1Of(
input: Pick<RuntimeOccurrenceInput, "source" | "errorType" | "attributes">,
): { fingerprint: string; parts: string[] } | null {
if (input.source !== "browser") return null;
const signal = interactionSignalOf(input.attributes?.context);
if (!signal || input.errorType !== signal.errorType) return null;
return { fingerprint: controlFingerprint(signal), parts: [signal.group, signal.route, signal.control] };
}
10 changes: 8 additions & 2 deletions packages/otlp-ingester/src/fingerprint-v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createHash } from "node:crypto";
import { causeTexts } from "./cause-chain.js";
import { normalizeMessage, occurrenceFingerprint } from "./fingerprint.js";
import { manualFingerprint } from "./fingerprint-override.js";
import { CONTROL_V1, controlV1Of } from "./fingerprint-control.js";
import { parseStackFrames } from "./stack-frames.js";
import type {
FingerprintCandidate,
Expand Down Expand Up @@ -179,8 +180,8 @@ export interface OccurrenceIdentity {

/**
* The candidate list the sink carries (contract §1/§4), in precedence order:
* manual-v1 (SDK override) → code-v1 (valid error code) → frames-v3 →
* message-v1 (legacy) → cause-v1 (RF-06).
* manual-v1 (SDK override) → control-v1 (browser interaction signal) →
* code-v1 (valid error code) → frames-v3 → message-v1 (legacy) → cause-v1 (RF-06).
* A coded error's legacy identity IS code-v1, which outranks every auto
* scheme, so its list is [manual-v1?, code-v1]; an uncoded one is
* [manual-v1?, frames-v3, message-v1, cause-v1?].
Expand Down Expand Up @@ -210,6 +211,11 @@ export function occurrenceIdentity(
const candidates: FingerprintCandidate[] = [];
const manual = manualFingerprint(input);
if (manual) candidates.push({ scheme: "manual-v1", fingerprint: manual });
// Browser interaction signals (dead/rage click, rejected form) group by
// control; the candidate outranks the automatic schemes, which stay after
// it so a platform that does not know control-v1 falls back to them.
const control = controlV1Of(input);
if (control) candidates.push({ scheme: CONTROL_V1, fingerprint: control.fingerprint });
let record: FingerprintRecord | null = null;
let causeRecord: FingerprintRecord | null = null;
if (legacy.scheme === "code-v1") {
Expand Down
Loading
Loading