@reticlehq/core 2.8.0 → 2.10.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.
- package/dist/browser-misdirect.d.ts +23 -0
- package/dist/browser-misdirect.js +28 -0
- package/dist/constants.d.ts +48 -0
- package/dist/constants.js +48 -0
- package/dist/contract-fingerprint.d.ts +7 -0
- package/dist/contract-fingerprint.js +1 -1
- package/dist/event-payloads.d.ts +3 -2
- package/dist/finding-fingerprint.d.ts +23 -0
- package/dist/finding-fingerprint.js +19 -0
- package/dist/findings.d.ts +36 -0
- package/dist/findings.js +37 -0
- package/dist/flow-types.d.ts +10 -0
- package/dist/impact-savings.d.ts +17 -0
- package/dist/impact-savings.js +47 -0
- package/dist/impact.d.ts +1284 -0
- package/dist/impact.js +127 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +8 -1
- package/dist/notices.d.ts +12 -0
- package/dist/notices.js +13 -0
- package/dist/project-id.js +25 -4
- package/dist/security.js +18 -1
- package/dist/session-constants.d.ts +18 -0
- package/dist/session-constants.js +17 -0
- package/dist/telemetry-feedback.d.ts +28 -4
- package/dist/telemetry-feedback.js +13 -1
- package/dist/telemetry-license.d.ts +35 -0
- package/dist/telemetry-license.js +34 -0
- package/dist/telemetry.d.ts +260 -39
- package/dist/telemetry.js +95 -1
- package/dist/types.d.ts +12 -3
- package/dist/types.js +15 -3
- package/dist/verified-constants.d.ts +47 -1
- package/dist/verified-constants.js +47 -1
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Names that exist ONLY to say where the browser API actually lives.
|
|
3
|
+
*
|
|
4
|
+
* `@reticlehq/core` is the wire contract — zod schemas and constants, no DOM anywhere in it — but it
|
|
5
|
+
* is the package whose name reads like "the thing you install", so agents and hand-written snippets
|
|
6
|
+
* keep reaching for `import { install, reticle } from '@reticlehq/core'`. Reported from the field:
|
|
7
|
+
* that import took a Vite app down with a blank page and `SyntaxError: The requested module does not
|
|
8
|
+
* provide an export named 'install'`, which names neither the mistake nor the fix.
|
|
9
|
+
*
|
|
10
|
+
* Renaming the package would be worse than the problem. Exporting the names, so the module still
|
|
11
|
+
* loads and the first call says where to go, costs three lines and turns a dead end into a sentence.
|
|
12
|
+
*/
|
|
13
|
+
declare function browserApiIsElsewhere(): never;
|
|
14
|
+
/** Not the SDK. Throws with the package that has it — see the note above. */
|
|
15
|
+
export declare const install: typeof browserApiIsElsewhere;
|
|
16
|
+
/** Not the SDK. Throws with the package that has it — see the note above. */
|
|
17
|
+
export declare const connect: typeof browserApiIsElsewhere;
|
|
18
|
+
/** Not the SDK instance (that is `@reticlehq/browser`'s). Every call says so. */
|
|
19
|
+
export declare const reticle: {
|
|
20
|
+
readonly connect: typeof browserApiIsElsewhere;
|
|
21
|
+
readonly install: typeof browserApiIsElsewhere;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Names that exist ONLY to say where the browser API actually lives.
|
|
3
|
+
*
|
|
4
|
+
* `@reticlehq/core` is the wire contract — zod schemas and constants, no DOM anywhere in it — but it
|
|
5
|
+
* is the package whose name reads like "the thing you install", so agents and hand-written snippets
|
|
6
|
+
* keep reaching for `import { install, reticle } from '@reticlehq/core'`. Reported from the field:
|
|
7
|
+
* that import took a Vite app down with a blank page and `SyntaxError: The requested module does not
|
|
8
|
+
* provide an export named 'install'`, which names neither the mistake nor the fix.
|
|
9
|
+
*
|
|
10
|
+
* Renaming the package would be worse than the problem. Exporting the names, so the module still
|
|
11
|
+
* loads and the first call says where to go, costs three lines and turns a dead end into a sentence.
|
|
12
|
+
*/
|
|
13
|
+
const WRONG_PACKAGE = '@reticlehq/core is the wire contract (schemas + constants) and has no browser API. The SDK that ' +
|
|
14
|
+
'connects a page lives in @reticlehq/browser (or @reticlehq/react, which re-exports it), and it ' +
|
|
15
|
+
'is normally wired for you by @reticlehq/vite-plugin or @reticlehq/next — run `npx ' +
|
|
16
|
+
'@reticlehq/server init` and let it do the wiring.';
|
|
17
|
+
function browserApiIsElsewhere() {
|
|
18
|
+
throw new Error(WRONG_PACKAGE);
|
|
19
|
+
}
|
|
20
|
+
/** Not the SDK. Throws with the package that has it — see the note above. */
|
|
21
|
+
export const install = browserApiIsElsewhere;
|
|
22
|
+
/** Not the SDK. Throws with the package that has it — see the note above. */
|
|
23
|
+
export const connect = browserApiIsElsewhere;
|
|
24
|
+
/** Not the SDK instance (that is `@reticlehq/browser`'s). Every call says so. */
|
|
25
|
+
export const reticle = {
|
|
26
|
+
connect: browserApiIsElsewhere,
|
|
27
|
+
install: browserApiIsElsewhere,
|
|
28
|
+
};
|
package/dist/constants.d.ts
CHANGED
|
@@ -7,8 +7,35 @@ export declare const RETICLE_WS_PATH = "/reticle";
|
|
|
7
7
|
/** Agent↔server MCP wire paths — served by the daemon HTTP plane, forwarded by the stdio proxy. */
|
|
8
8
|
export declare const MCP_SSE_PATH = "/mcp/sse";
|
|
9
9
|
export declare const MCP_MESSAGE_PATH = "/mcp/message";
|
|
10
|
+
/**
|
|
11
|
+
* The name this MCP server answers to — in its own `serverInfo` handshake, and in the registration
|
|
12
|
+
* an installer writes into an agent's config. Those must be the same string or the agent registers
|
|
13
|
+
* one server and talks to another.
|
|
14
|
+
*
|
|
15
|
+
* It lives here because it is an identity that crosses the wire, not an installer detail. It used to
|
|
16
|
+
* live in `init/`, which made the MCP handshake — squarely on the library path — reach into the
|
|
17
|
+
* install-time surface for a single string, and dragged that whole subtree along behind it for any
|
|
18
|
+
* consumer embedding the engine as a library.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MCP_SERVER_NAME = "reticle";
|
|
21
|
+
/**
|
|
22
|
+
* SSE event name the daemon writes to every open MCP stream immediately before it shuts itself down.
|
|
23
|
+
*
|
|
24
|
+
* A stream that simply ends looks identical from the proxy whether the daemon retired on schedule or
|
|
25
|
+
* died under it, so every planned shutdown was counted as an outage the agent suffered. The proxy
|
|
26
|
+
* cannot infer the difference — the daemon is the only thing that knows, and this is it saying so.
|
|
27
|
+
* A custom event name rather than a `message`: the proxy forwards `message` frames to the client
|
|
28
|
+
* verbatim, and this is addressed to the proxy, not to the agent.
|
|
29
|
+
*/
|
|
30
|
+
export declare const MCP_SHUTDOWN_EVENT = "reticle-shutdown";
|
|
10
31
|
/** Local-only daemon introspection — `reticle status` GETs this for sessions + health at a glance. */
|
|
11
32
|
export declare const STATUS_PATH = "/status";
|
|
33
|
+
/**
|
|
34
|
+
* Local-only drive request — `reticle drive <url>` POSTs `{url}` here when a daemon already owns the
|
|
35
|
+
* bridge port, and gets back the pooled session that daemon opened. The CLI asks instead of binding,
|
|
36
|
+
* so the two never fight over the port. Same trust tier as STATUS_PATH.
|
|
37
|
+
*/
|
|
38
|
+
export declare const DRIVE_PATH = "/drive";
|
|
12
39
|
export declare const RETICLE_PROTOCOL_VERSION = 1;
|
|
13
40
|
/**
|
|
14
41
|
* The one place the bridge WebSocket URL is built. The SDK connect default, the vite/next snippet
|
|
@@ -176,6 +203,13 @@ export declare const ReticleDir: {
|
|
|
176
203
|
readonly BASELINES_SUBDIR: "baselines";
|
|
177
204
|
/** cross-run memory — outcomes of past runs (the "did it behave like last time?" file). */
|
|
178
205
|
readonly PROJECT_FILE: "project.json";
|
|
206
|
+
/**
|
|
207
|
+
* the user's own record of what Reticle has done for them — .reticle/impact.json.
|
|
208
|
+
*
|
|
209
|
+
* Local only, never uploaded, and deliberately NOT part of telemetry: telemetry answers our
|
|
210
|
+
* questions about the product; this answers the user's question about their own work.
|
|
211
|
+
*/
|
|
212
|
+
readonly IMPACT_FILE: "impact.json";
|
|
179
213
|
/** opt-in pixel baselines —.reticle/visual/<name>.png + <name>.diff.png. */
|
|
180
214
|
readonly VISUAL_SUBDIR: "visual";
|
|
181
215
|
/** verification-run artifacts —.reticle/runs/<runId>.json (the OEM/CI-consumable verdict). */
|
|
@@ -539,6 +573,14 @@ export declare const ElementState: {
|
|
|
539
573
|
readonly EXPANDED: "expanded";
|
|
540
574
|
readonly FOCUSED: "focused";
|
|
541
575
|
readonly PRESENT: "present";
|
|
576
|
+
/**
|
|
577
|
+
* Inside the viewport right now (getBoundingClientRect intersects the window). Distinct from
|
|
578
|
+
* `visible`, which folds only aria-hidden/[hidden]/display/visibility/opacity and so is already
|
|
579
|
+
* true for content below the fold of a scrolling container. Without this, `scrollIntoView` is
|
|
580
|
+
* ungradeable: the target satisfied `visible`/`present` before the scroll, so act_and_wait
|
|
581
|
+
* returns already_true. (#398)
|
|
582
|
+
*/
|
|
583
|
+
readonly IN_VIEWPORT: "inViewport";
|
|
542
584
|
};
|
|
543
585
|
export type ElementState = (typeof ElementState)[keyof typeof ElementState];
|
|
544
586
|
/** Query strategies, aligned with Testing Library semantics (plan/04). */
|
|
@@ -578,6 +620,12 @@ export declare const ReticleCommand: {
|
|
|
578
620
|
* AGENT-driven pause/end keeps the presenter in sync. `args: { state, text? }`.
|
|
579
621
|
*/
|
|
580
622
|
readonly PRESENTER: "presenter";
|
|
623
|
+
/**
|
|
624
|
+
* Bridge -> browser: the user's own impact record, so the HUD can show what Reticle has done for
|
|
625
|
+
* them without the page asking for it. `args: { snapshot: ImpactSnapshot }`. Local data on a
|
|
626
|
+
* local socket - it is the same file the report is stored in, not a fetch to us.
|
|
627
|
+
*/
|
|
628
|
+
readonly IMPACT: "impact";
|
|
581
629
|
/**
|
|
582
630
|
* Ask the DESKTOP shell to photograph its own window and return `{ png: <base64> }`.
|
|
583
631
|
*
|
package/dist/constants.js
CHANGED
|
@@ -7,8 +7,35 @@ export const RETICLE_WS_PATH = '/reticle';
|
|
|
7
7
|
/** Agent↔server MCP wire paths — served by the daemon HTTP plane, forwarded by the stdio proxy. */
|
|
8
8
|
export const MCP_SSE_PATH = '/mcp/sse';
|
|
9
9
|
export const MCP_MESSAGE_PATH = '/mcp/message';
|
|
10
|
+
/**
|
|
11
|
+
* The name this MCP server answers to — in its own `serverInfo` handshake, and in the registration
|
|
12
|
+
* an installer writes into an agent's config. Those must be the same string or the agent registers
|
|
13
|
+
* one server and talks to another.
|
|
14
|
+
*
|
|
15
|
+
* It lives here because it is an identity that crosses the wire, not an installer detail. It used to
|
|
16
|
+
* live in `init/`, which made the MCP handshake — squarely on the library path — reach into the
|
|
17
|
+
* install-time surface for a single string, and dragged that whole subtree along behind it for any
|
|
18
|
+
* consumer embedding the engine as a library.
|
|
19
|
+
*/
|
|
20
|
+
export const MCP_SERVER_NAME = 'reticle';
|
|
21
|
+
/**
|
|
22
|
+
* SSE event name the daemon writes to every open MCP stream immediately before it shuts itself down.
|
|
23
|
+
*
|
|
24
|
+
* A stream that simply ends looks identical from the proxy whether the daemon retired on schedule or
|
|
25
|
+
* died under it, so every planned shutdown was counted as an outage the agent suffered. The proxy
|
|
26
|
+
* cannot infer the difference — the daemon is the only thing that knows, and this is it saying so.
|
|
27
|
+
* A custom event name rather than a `message`: the proxy forwards `message` frames to the client
|
|
28
|
+
* verbatim, and this is addressed to the proxy, not to the agent.
|
|
29
|
+
*/
|
|
30
|
+
export const MCP_SHUTDOWN_EVENT = 'reticle-shutdown';
|
|
10
31
|
/** Local-only daemon introspection — `reticle status` GETs this for sessions + health at a glance. */
|
|
11
32
|
export const STATUS_PATH = '/status';
|
|
33
|
+
/**
|
|
34
|
+
* Local-only drive request — `reticle drive <url>` POSTs `{url}` here when a daemon already owns the
|
|
35
|
+
* bridge port, and gets back the pooled session that daemon opened. The CLI asks instead of binding,
|
|
36
|
+
* so the two never fight over the port. Same trust tier as STATUS_PATH.
|
|
37
|
+
*/
|
|
38
|
+
export const DRIVE_PATH = '/drive';
|
|
12
39
|
export const RETICLE_PROTOCOL_VERSION = 1;
|
|
13
40
|
/**
|
|
14
41
|
* The one place the bridge WebSocket URL is built. The SDK connect default, the vite/next snippet
|
|
@@ -178,6 +205,13 @@ export const ReticleDir = {
|
|
|
178
205
|
BASELINES_SUBDIR: 'baselines',
|
|
179
206
|
/** cross-run memory — outcomes of past runs (the "did it behave like last time?" file). */
|
|
180
207
|
PROJECT_FILE: 'project.json',
|
|
208
|
+
/**
|
|
209
|
+
* the user's own record of what Reticle has done for them — .reticle/impact.json.
|
|
210
|
+
*
|
|
211
|
+
* Local only, never uploaded, and deliberately NOT part of telemetry: telemetry answers our
|
|
212
|
+
* questions about the product; this answers the user's question about their own work.
|
|
213
|
+
*/
|
|
214
|
+
IMPACT_FILE: 'impact.json',
|
|
181
215
|
/** opt-in pixel baselines —.reticle/visual/<name>.png + <name>.diff.png. */
|
|
182
216
|
VISUAL_SUBDIR: 'visual',
|
|
183
217
|
/** verification-run artifacts —.reticle/runs/<runId>.json (the OEM/CI-consumable verdict). */
|
|
@@ -521,6 +555,14 @@ export const ElementState = {
|
|
|
521
555
|
EXPANDED: 'expanded',
|
|
522
556
|
FOCUSED: 'focused',
|
|
523
557
|
PRESENT: 'present',
|
|
558
|
+
/**
|
|
559
|
+
* Inside the viewport right now (getBoundingClientRect intersects the window). Distinct from
|
|
560
|
+
* `visible`, which folds only aria-hidden/[hidden]/display/visibility/opacity and so is already
|
|
561
|
+
* true for content below the fold of a scrolling container. Without this, `scrollIntoView` is
|
|
562
|
+
* ungradeable: the target satisfied `visible`/`present` before the scroll, so act_and_wait
|
|
563
|
+
* returns already_true. (#398)
|
|
564
|
+
*/
|
|
565
|
+
IN_VIEWPORT: 'inViewport',
|
|
524
566
|
};
|
|
525
567
|
/** Query strategies, aligned with Testing Library semantics (plan/04). */
|
|
526
568
|
export const QueryBy = {
|
|
@@ -558,6 +600,12 @@ export const ReticleCommand = {
|
|
|
558
600
|
* AGENT-driven pause/end keeps the presenter in sync. `args: { state, text? }`.
|
|
559
601
|
*/
|
|
560
602
|
PRESENTER: 'presenter',
|
|
603
|
+
/**
|
|
604
|
+
* Bridge -> browser: the user's own impact record, so the HUD can show what Reticle has done for
|
|
605
|
+
* them without the page asking for it. `args: { snapshot: ImpactSnapshot }`. Local data on a
|
|
606
|
+
* local socket - it is the same file the report is stored in, not a fetch to us.
|
|
607
|
+
*/
|
|
608
|
+
IMPACT: 'impact',
|
|
561
609
|
/**
|
|
562
610
|
* Ask the DESKTOP shell to photograph its own window and return `{ png: <base64> }`.
|
|
563
611
|
*
|
|
@@ -15,6 +15,13 @@
|
|
|
15
15
|
* Derived on purpose. A hand-maintained contract number is one somebody eventually forgets to bump,
|
|
16
16
|
* and a forgotten bump is silent skew — the failure this exists to end.
|
|
17
17
|
*/
|
|
18
|
+
/**
|
|
19
|
+
* FNV-1a, 32-bit. Chosen over a crypto hash because this runs in the PAGE: `crypto.subtle` is async
|
|
20
|
+
* and unavailable on insecure origins, and a dependency is not worth 40 lines. Collisions do not
|
|
21
|
+
* matter here — the comparison is equality between two builds of the same project, not a security
|
|
22
|
+
* boundary.
|
|
23
|
+
*/
|
|
24
|
+
export declare function fnv1a(input: string): string;
|
|
18
25
|
/**
|
|
19
26
|
* Hash a named vocabulary. Keys and values are sorted, so declaration order — which changes for
|
|
20
27
|
* cosmetic reasons — never moves the fingerprint, while a renamed, added or removed name always does.
|
|
@@ -22,7 +22,7 @@ import { ActionType, EventType, MessageKind, ReticleCommand } from './constants.
|
|
|
22
22
|
* matter here — the comparison is equality between two builds of the same project, not a security
|
|
23
23
|
* boundary.
|
|
24
24
|
*/
|
|
25
|
-
function fnv1a(input) {
|
|
25
|
+
export function fnv1a(input) {
|
|
26
26
|
let hash = 0x811c9dc5;
|
|
27
27
|
for (let i = 0; i < input.length; i++) {
|
|
28
28
|
hash ^= input.charCodeAt(i);
|
package/dist/event-payloads.d.ts
CHANGED
|
@@ -501,13 +501,14 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
|
|
|
501
501
|
readonly WRAPPED_NETWORK: "wrapped-network";
|
|
502
502
|
readonly UNOBSERVED_IPC: "unobserved-ipc";
|
|
503
503
|
readonly VERDICTLESS_SEND: "verdictless-send";
|
|
504
|
+
readonly UNWATCHED_STATE: "unwatched-state";
|
|
504
505
|
}>;
|
|
505
506
|
count: z.ZodNumber;
|
|
506
507
|
}, "strip", z.ZodTypeAny, {
|
|
507
|
-
kind: "closed-shadow-root" | "rate-limited" | "cross-origin-iframe" | "uninstrumented-frame" | "virtualized-unmounted" | "wrapped-network" | "unobserved-ipc" | "verdictless-send";
|
|
508
|
+
kind: "closed-shadow-root" | "rate-limited" | "cross-origin-iframe" | "uninstrumented-frame" | "virtualized-unmounted" | "wrapped-network" | "unobserved-ipc" | "verdictless-send" | "unwatched-state";
|
|
508
509
|
count: number;
|
|
509
510
|
}, {
|
|
510
|
-
kind: "closed-shadow-root" | "rate-limited" | "cross-origin-iframe" | "uninstrumented-frame" | "virtualized-unmounted" | "wrapped-network" | "unobserved-ipc" | "verdictless-send";
|
|
511
|
+
kind: "closed-shadow-root" | "rate-limited" | "cross-origin-iframe" | "uninstrumented-frame" | "virtualized-unmounted" | "wrapped-network" | "unobserved-ipc" | "verdictless-send" | "unwatched-state";
|
|
511
512
|
count: number;
|
|
512
513
|
}>;
|
|
513
514
|
"sdk.failed": z.ZodObject<{
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A stable, privacy-safe fingerprint for a finding — so the same defect can be recognised across
|
|
3
|
+
* sessions without sending any app-specific data over the wire.
|
|
4
|
+
*
|
|
5
|
+
* The hash travels in `bug_found`; the inputs (route, selector) never do. Same pattern as
|
|
6
|
+
* `projectId`: hash the identifying bits, send only the hash, let the analytics side group by it.
|
|
7
|
+
*/
|
|
8
|
+
export interface FindingIdentity {
|
|
9
|
+
/** The classified kind from Reticle's findings vocabulary (`signal-contradicted`, `console-error`, …). */
|
|
10
|
+
kind: string;
|
|
11
|
+
/** How Reticle found it (`contradiction`, `crawl`, `assertion`, `replay`). */
|
|
12
|
+
source: string;
|
|
13
|
+
/** The route the app was on when this was found. Hashed, never sent raw. */
|
|
14
|
+
route?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Produce a short hex fingerprint that identifies a finding stably across sessions.
|
|
18
|
+
*
|
|
19
|
+
* Same inputs = same output, regardless of when or where it runs. A changed route or a changed
|
|
20
|
+
* kind = a different fingerprint = a different defect. The analytics side can then answer "was this
|
|
21
|
+
* fixed?" by checking whether a fingerprint stops appearing.
|
|
22
|
+
*/
|
|
23
|
+
export declare function fingerprintFinding(identity: FindingIdentity): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A stable, privacy-safe fingerprint for a finding — so the same defect can be recognised across
|
|
3
|
+
* sessions without sending any app-specific data over the wire.
|
|
4
|
+
*
|
|
5
|
+
* The hash travels in `bug_found`; the inputs (route, selector) never do. Same pattern as
|
|
6
|
+
* `projectId`: hash the identifying bits, send only the hash, let the analytics side group by it.
|
|
7
|
+
*/
|
|
8
|
+
import { fnv1a } from './contract-fingerprint.js';
|
|
9
|
+
/**
|
|
10
|
+
* Produce a short hex fingerprint that identifies a finding stably across sessions.
|
|
11
|
+
*
|
|
12
|
+
* Same inputs = same output, regardless of when or where it runs. A changed route or a changed
|
|
13
|
+
* kind = a different fingerprint = a different defect. The analytics side can then answer "was this
|
|
14
|
+
* fixed?" by checking whether a fingerprint stops appearing.
|
|
15
|
+
*/
|
|
16
|
+
export function fingerprintFinding(identity) {
|
|
17
|
+
const canonical = [identity.kind, identity.source, identity.route ?? ''].join('\x00');
|
|
18
|
+
return fnv1a(canonical);
|
|
19
|
+
}
|
package/dist/findings.d.ts
CHANGED
|
@@ -141,6 +141,42 @@ export type ContradictionKind = (typeof ContradictionKind)[keyof typeof Contradi
|
|
|
141
141
|
export declare const ABSENCE_DERIVED_CONTRADICTIONS: ReadonlySet<ContradictionKind>;
|
|
142
142
|
/** True when this kind was inferred from absence rather than positively observed. */
|
|
143
143
|
export declare function isAbsenceDerived(kind: string): boolean;
|
|
144
|
+
/**
|
|
145
|
+
* How much authority a finding carries — the distinction above, said out loud on the finding itself.
|
|
146
|
+
*
|
|
147
|
+
* The rule already turns on this: an OBSERVED contradiction outranks a passing assertion and answers
|
|
148
|
+
* `no`, an ABSENCE_DERIVED one downgrades to `unknown`. But the findings all arrive looking alike, so
|
|
149
|
+
* an agent handed three of them cannot tell which one decided the verdict and which is a note about
|
|
150
|
+
* when Reticle stopped looking. Two facts of very different strength, reported in one voice.
|
|
151
|
+
*/
|
|
152
|
+
export declare const FindingTier: {
|
|
153
|
+
/**
|
|
154
|
+
* Positively observed evidence AGAINST the action: a request came back 500 while the UI advanced, a
|
|
155
|
+
* signal fired carrying data the DOM disagrees with, a written field echoed a different value.
|
|
156
|
+
* Something happened, and it is incompatible with the action having worked.
|
|
157
|
+
*/
|
|
158
|
+
readonly OBSERVED: "observed";
|
|
159
|
+
/**
|
|
160
|
+
* Inferred from something NOT having happened yet, in a window whose end Reticle chose. It may
|
|
161
|
+
* become true a moment later. It is a statement about our timing at least as much as about the app.
|
|
162
|
+
*/
|
|
163
|
+
readonly ABSENCE_DERIVED: "absence-derived";
|
|
164
|
+
};
|
|
165
|
+
export type FindingTier = (typeof FindingTier)[keyof typeof FindingTier];
|
|
166
|
+
/**
|
|
167
|
+
* The tier of a finding, DERIVED from its kind.
|
|
168
|
+
*
|
|
169
|
+
* Deliberately a lookup rather than a field an oracle sets. An oracle that stated its own tier would
|
|
170
|
+
* be grading its own homework, and the one thing every author of a new rule is sure of is that their
|
|
171
|
+
* finding is important. The kind decides, in one place, where the verdict rule already reads it.
|
|
172
|
+
*
|
|
173
|
+
* An unrecognised kind is OBSERVED, and that default is doing real work rather than being a fallback.
|
|
174
|
+
* A rule registered by a consumer emits kinds deliberately absent from this vocabulary — that is what
|
|
175
|
+
* keeps somebody's private finding names out of the free product — and those findings still have to
|
|
176
|
+
* be tierable. OBSERVED is the honest answer: an unknown kind has made no claim about a window whose
|
|
177
|
+
* end Reticle chose, so downgrading it would invent a caveat on its author's behalf.
|
|
178
|
+
*/
|
|
179
|
+
export declare function tierOfFinding(kind: string): FindingTier;
|
|
144
180
|
/**
|
|
145
181
|
* HTTP methods that CHANGE server state. Several contradiction rules are restricted to these on
|
|
146
182
|
* purpose: a GET that fires without moving the UI is a prefetch, but a POST that does is a lost
|
package/dist/findings.js
CHANGED
|
@@ -148,6 +148,43 @@ export const ABSENCE_DERIVED_CONTRADICTIONS = new Set([
|
|
|
148
148
|
export function isAbsenceDerived(kind) {
|
|
149
149
|
return ABSENCE_DERIVED_CONTRADICTIONS.has(kind);
|
|
150
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* How much authority a finding carries — the distinction above, said out loud on the finding itself.
|
|
153
|
+
*
|
|
154
|
+
* The rule already turns on this: an OBSERVED contradiction outranks a passing assertion and answers
|
|
155
|
+
* `no`, an ABSENCE_DERIVED one downgrades to `unknown`. But the findings all arrive looking alike, so
|
|
156
|
+
* an agent handed three of them cannot tell which one decided the verdict and which is a note about
|
|
157
|
+
* when Reticle stopped looking. Two facts of very different strength, reported in one voice.
|
|
158
|
+
*/
|
|
159
|
+
export const FindingTier = {
|
|
160
|
+
/**
|
|
161
|
+
* Positively observed evidence AGAINST the action: a request came back 500 while the UI advanced, a
|
|
162
|
+
* signal fired carrying data the DOM disagrees with, a written field echoed a different value.
|
|
163
|
+
* Something happened, and it is incompatible with the action having worked.
|
|
164
|
+
*/
|
|
165
|
+
OBSERVED: 'observed',
|
|
166
|
+
/**
|
|
167
|
+
* Inferred from something NOT having happened yet, in a window whose end Reticle chose. It may
|
|
168
|
+
* become true a moment later. It is a statement about our timing at least as much as about the app.
|
|
169
|
+
*/
|
|
170
|
+
ABSENCE_DERIVED: 'absence-derived',
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* The tier of a finding, DERIVED from its kind.
|
|
174
|
+
*
|
|
175
|
+
* Deliberately a lookup rather than a field an oracle sets. An oracle that stated its own tier would
|
|
176
|
+
* be grading its own homework, and the one thing every author of a new rule is sure of is that their
|
|
177
|
+
* finding is important. The kind decides, in one place, where the verdict rule already reads it.
|
|
178
|
+
*
|
|
179
|
+
* An unrecognised kind is OBSERVED, and that default is doing real work rather than being a fallback.
|
|
180
|
+
* A rule registered by a consumer emits kinds deliberately absent from this vocabulary — that is what
|
|
181
|
+
* keeps somebody's private finding names out of the free product — and those findings still have to
|
|
182
|
+
* be tierable. OBSERVED is the honest answer: an unknown kind has made no claim about a window whose
|
|
183
|
+
* end Reticle chose, so downgrading it would invent a caveat on its author's behalf.
|
|
184
|
+
*/
|
|
185
|
+
export function tierOfFinding(kind) {
|
|
186
|
+
return isAbsenceDerived(kind) ? FindingTier.ABSENCE_DERIVED : FindingTier.OBSERVED;
|
|
187
|
+
}
|
|
151
188
|
/**
|
|
152
189
|
* HTTP methods that CHANGE server state. Several contradiction rules are restricted to these on
|
|
153
190
|
* purpose: a GET that fires without moving the UI is a prefetch, but a POST that does is a lost
|
package/dist/flow-types.d.ts
CHANGED
|
@@ -409,6 +409,16 @@ export interface FlowReplayResult {
|
|
|
409
409
|
code: string;
|
|
410
410
|
message: string;
|
|
411
411
|
};
|
|
412
|
+
/**
|
|
413
|
+
* Set on an `ok` replay whose flow cannot fail: it asserts no observable consequence, or has no
|
|
414
|
+
* steps at all. The replay genuinely completed, so the status stays `ok` — but a bare `ok` read
|
|
415
|
+
* as proof the feature works is exactly the false confidence `flow-risk.ts` argues against, and
|
|
416
|
+
* `reticle_flow_verify` already refuses to count these as passes. This carries the same reason,
|
|
417
|
+
* from the same function, to the single-flow caller who would otherwise never see it.
|
|
418
|
+
*/
|
|
419
|
+
unverifiable?: {
|
|
420
|
+
reason: string;
|
|
421
|
+
};
|
|
412
422
|
/**
|
|
413
423
|
* The confident rebind proposals aggregated across drifted steps (additive,
|
|
414
424
|
* optional — present only when at least one drifted step has a confident nearest match).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ImpactCounts, ImpactSavings } from './impact.js';
|
|
2
|
+
/** What the two numbers are measured against, shown beside them in the report. */
|
|
3
|
+
export declare const IMPACT_BASIS: {
|
|
4
|
+
readonly TOKENS: "vs an agent reading the app through screenshots";
|
|
5
|
+
readonly MINUTES: "vs one re-prompt cycle per defect caught";
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Estimate what the recorded work saved.
|
|
9
|
+
*
|
|
10
|
+
* Tokens: every verdict-bearing call replaced a look the agent would otherwise have taken as a
|
|
11
|
+
* screenshot. The tokens Reticle actually returned are subtracted, so the figure is a NET saving
|
|
12
|
+
* and can never exceed the modelled cost of the runs it replaced.
|
|
13
|
+
*
|
|
14
|
+
* Minutes: only DEFECTS count. A pass saves nothing by itself - the run was going to pass either
|
|
15
|
+
* way; what a false green costs is the round trip, and that is what catching it returns.
|
|
16
|
+
*/
|
|
17
|
+
export declare function estimateImpactSavings(counts: ImpactCounts): ImpactSavings;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The savings model: one file, so every claim Reticle makes about its own worth is derivable here
|
|
3
|
+
* and nowhere else.
|
|
4
|
+
*
|
|
5
|
+
* A saving is a counterfactual - a comparison against a run that did not happen - so each constant
|
|
6
|
+
* below carries the run it stands for. Change a number here and the claim changes everywhere; there
|
|
7
|
+
* is deliberately no second place to tune one.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Tokens an agent spends to LOOK at an app it cannot see from the inside: a screenshot into
|
|
11
|
+
* context, plus the prose it writes reasoning about the pixels. Screenshots dominate - an image
|
|
12
|
+
* costs on the order of a thousand tokens before anything is understood from it.
|
|
13
|
+
*
|
|
14
|
+
* Reticle's answer to the same question is a semantic snapshot, and what that cost is not modelled:
|
|
15
|
+
* it is COUNTED, per call, and subtracted below.
|
|
16
|
+
*/
|
|
17
|
+
const TOKENS_PER_SCREENSHOT_LOOK = 1600;
|
|
18
|
+
/**
|
|
19
|
+
* Minutes a false green costs when it escapes: the agent reports done, a person tries it, finds it
|
|
20
|
+
* broken, writes the correction, and the agent goes round again. Deliberately conservative - one
|
|
21
|
+
* short cycle, not the afternoon a shipped regression can take.
|
|
22
|
+
*/
|
|
23
|
+
const MINUTES_PER_REPROMPT_CYCLE = 4;
|
|
24
|
+
/** What the two numbers are measured against, shown beside them in the report. */
|
|
25
|
+
export const IMPACT_BASIS = {
|
|
26
|
+
TOKENS: 'vs an agent reading the app through screenshots',
|
|
27
|
+
MINUTES: 'vs one re-prompt cycle per defect caught',
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Estimate what the recorded work saved.
|
|
31
|
+
*
|
|
32
|
+
* Tokens: every verdict-bearing call replaced a look the agent would otherwise have taken as a
|
|
33
|
+
* screenshot. The tokens Reticle actually returned are subtracted, so the figure is a NET saving
|
|
34
|
+
* and can never exceed the modelled cost of the runs it replaced.
|
|
35
|
+
*
|
|
36
|
+
* Minutes: only DEFECTS count. A pass saves nothing by itself - the run was going to pass either
|
|
37
|
+
* way; what a false green costs is the round trip, and that is what catching it returns.
|
|
38
|
+
*/
|
|
39
|
+
export function estimateImpactSavings(counts) {
|
|
40
|
+
const looksReplaced = counts.verdicts;
|
|
41
|
+
const grossTokens = looksReplaced * TOKENS_PER_SCREENSHOT_LOOK;
|
|
42
|
+
const netTokens = Math.max(0, grossTokens - counts.tokensReturned);
|
|
43
|
+
return {
|
|
44
|
+
tokens: { value: netTokens, basis: IMPACT_BASIS.TOKENS },
|
|
45
|
+
minutes: { value: counts.failed * MINUTES_PER_REPROMPT_CYCLE, basis: IMPACT_BASIS.MINUTES },
|
|
46
|
+
};
|
|
47
|
+
}
|