@reticlehq/core 3.7.0 → 3.8.1
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/activation-entry.d.ts +9 -0
- package/dist/activation-entry.js +9 -0
- package/dist/artifacts/drive-script.d.ts +84 -1217
- package/dist/artifacts/drive-script.js +1 -1
- package/dist/artifacts/flow-constants.d.ts +15 -0
- package/dist/artifacts/flow-constants.js +15 -0
- package/dist/artifacts/flow-expect-flat.d.ts +8 -192
- package/dist/artifacts/flow-expect-flat.js +2 -2
- package/dist/artifacts/flow-results.d.ts +26 -0
- package/dist/artifacts/flow-types.d.ts +212 -2295
- package/dist/artifacts/flow-types.js +14 -2
- package/dist/artifacts/harness-credits.d.ts +6 -3
- package/dist/artifacts/harness-credits.js +9 -6
- package/dist/artifacts/harness-map.d.ts +8 -69
- package/dist/artifacts/harness-map.js +1 -1
- package/dist/artifacts/hud-notices.d.ts +8 -82
- package/dist/artifacts/hud-notices.js +1 -1
- package/dist/artifacts/impact.d.ts +104 -1665
- package/dist/artifacts/impact.js +38 -21
- package/dist/artifacts/journal.d.ts +15 -231
- package/dist/artifacts/journal.js +15 -2
- package/dist/artifacts/prompt-context.d.ts +7 -33
- package/dist/artifacts/prompt-context.js +15 -4
- package/dist/artifacts/screenshot-upload.d.ts +3 -26
- package/dist/artifacts/screenshot-upload.js +1 -1
- package/dist/graph/app-graph.d.ts +137 -0
- package/dist/graph/app-graph.js +498 -0
- package/dist/hooks/hook-events.d.ts +15 -171
- package/dist/hooks/hook-events.js +1 -1
- package/dist/hud-entry.js +1 -1
- package/dist/identity/checkout.d.ts +41 -0
- package/dist/identity/checkout.js +118 -0
- package/dist/identity/state-dir.d.ts +23 -0
- package/dist/identity/state-dir.js +43 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/onboarding.d.ts +23 -52
- package/dist/onboarding.js +20 -1
- package/dist/registry/daemon-registry.d.ts +2 -14
- package/dist/registry/daemon-registry.js +1 -1
- package/dist/registry/dev-server-registry.d.ts +2 -31
- package/dist/registry/dev-server-registry.js +1 -1
- package/dist/registry/project-registry.d.ts +4 -32
- package/dist/registry/project-registry.js +1 -1
- package/dist/schema/command-message.json +65 -68
- package/dist/schema/command-name.json +29 -33
- package/dist/schema/command-result.json +25 -30
- package/dist/schema/event-message.json +104 -101
- package/dist/schema/event-payloads.json +246 -108
- package/dist/schema/event-type.json +47 -48
- package/dist/schema/hello-message.json +150 -133
- package/dist/schema/reticle-event.json +98 -94
- package/dist/schema/reticle-message.json +338 -310
- package/dist/telemetry-bug.d.ts +4 -75
- package/dist/telemetry-bug.js +1 -1
- package/dist/telemetry-entry.d.ts +1 -1
- package/dist/telemetry-entry.js +1 -1
- package/dist/telemetry-feedback.d.ts +17 -91
- package/dist/telemetry-feedback.js +20 -1
- package/dist/telemetry-refusal.d.ts +4 -31
- package/dist/telemetry-refusal.js +1 -1
- package/dist/telemetry-session.d.ts +45 -624
- package/dist/telemetry-session.js +25 -12
- package/dist/telemetry-signals.d.ts +211 -86
- package/dist/telemetry-signals.js +100 -2
- package/dist/telemetry.d.ts +321 -1691
- package/dist/telemetry.js +72 -6
- package/dist/verdict/check-sentence.d.ts +34 -0
- package/dist/verdict/check-sentence.js +228 -0
- package/dist/verdict/compare-source.d.ts +1 -1
- package/dist/verdict/compare-source.js +1 -1
- package/dist/verdict/consequence.d.ts +15 -0
- package/dist/verdict/consequence.js +11 -0
- package/dist/verdict/disparity.d.ts +8 -56
- package/dist/verdict/disparity.js +1 -1
- package/dist/verdict/findings.d.ts +10 -0
- package/dist/verdict/findings.js +13 -0
- package/dist/verdict/instrumentation-coverage.d.ts +6 -37
- package/dist/verdict/instrumentation-coverage.js +15 -59
- package/dist/verdict/instrumentation-gap.d.ts +72 -0
- package/dist/verdict/instrumentation-gap.js +64 -0
- package/dist/verdict/intent.d.ts +25 -224
- package/dist/verdict/intent.js +1 -1
- package/dist/verdict/predicate-tree.d.ts +2 -0
- package/dist/verdict/predicate-tree.js +16 -0
- package/dist/verdict/predicate.d.ts +3 -2
- package/dist/verdict/predicate.js +107 -16
- package/dist/verdict/property-assertion.d.ts +23 -101
- package/dist/verdict/property-assertion.js +1 -1
- package/dist/verdict/run-report.d.ts +71 -0
- package/dist/verdict/run-report.js +53 -0
- package/dist/verdict/security.d.ts +48 -2
- package/dist/verdict/security.js +185 -18
- package/dist/verdict/verification-run.d.ts +124 -1623
- package/dist/verdict/verification-run.js +37 -6
- package/dist/verdict/verify-progress.d.ts +22 -64
- package/dist/verdict/verify-progress.js +1 -1
- package/dist/wire/constants/constants.d.ts +56 -141
- package/dist/wire/constants/constants.js +64 -144
- package/dist/wire/constants/discovery.d.ts +4 -4
- package/dist/wire/constants/discovery.js +4 -4
- package/dist/wire/constants/event-types.d.ts +37 -1
- package/dist/wire/constants/event-types.js +35 -1
- package/dist/wire/constants/hud-controls.js +0 -2
- package/dist/wire/constants/hud-use.d.ts +4 -0
- package/dist/wire/constants/hud-use.js +4 -0
- package/dist/wire/constants/mcp-wire.d.ts +16 -0
- package/dist/wire/constants/mcp-wire.js +16 -0
- package/dist/wire/constants/response-body-reason.d.ts +19 -0
- package/dist/wire/constants/response-body-reason.js +18 -0
- package/dist/wire/constants/reticle-env.d.ts +140 -0
- package/dist/wire/constants/reticle-env.js +140 -0
- package/dist/wire/constants/session-constants.d.ts +11 -0
- package/dist/wire/constants/session-constants.js +11 -0
- package/dist/wire/event-payloads.d.ts +173 -629
- package/dist/wire/event-payloads.js +107 -23
- package/dist/wire/event-priority.js +1 -0
- package/dist/wire/messages.d.ts +90 -713
- package/dist/wire/messages.js +19 -3
- package/dist/wire/narrow.d.ts +6 -0
- package/dist/wire/narrow.js +26 -0
- package/dist/wire/next-step.d.ts +50 -0
- package/dist/wire/next-step.js +37 -0
- package/dist/wire/platform-link.d.ts +7 -0
- package/dist/wire/platform-link.js +14 -8
- package/dist/wire/production/activation-ticket.d.ts +64 -0
- package/dist/wire/production/activation-ticket.js +148 -0
- package/dist/wire/production/hello-mode.d.ts +35 -0
- package/dist/wire/production/hello-mode.js +32 -0
- package/dist/wire/production/production-policy.d.ts +92 -0
- package/dist/wire/production/production-policy.js +133 -0
- package/dist/wire/tool-names.d.ts +2 -0
- package/dist/wire/tool-names.js +2 -0
- package/dist/wire/types.d.ts +102 -700
- package/dist/wire/types.js +5 -5
- package/dist/words/upgrade.d.ts +3 -13
- package/dist/words/upgrade.js +1 -1
- package/package.json +7 -4
package/dist/telemetry.js
CHANGED
|
@@ -14,20 +14,20 @@
|
|
|
14
14
|
* the tool's behaviour). Same conventions as the rest of core: enums are `as const` narrowed with
|
|
15
15
|
* `z.nativeEnum`, timestamps are epoch-ms NUMBERS, no `any`.
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
18
|
-
import { OnboardingPhase, OnboardingStepSchema, OnboardingStepStatus, OnboardingSteps, } from './onboarding.js';
|
|
17
|
+
import * as z from 'zod';
|
|
18
|
+
import { NextStepOffered, OnboardingPhase, OnboardingStepSchema, OnboardingStepStatus, OnboardingSteps, } from './onboarding.js';
|
|
19
19
|
/**
|
|
20
20
|
* The setup funnel's vocabulary. It is defined in `onboarding.ts`, which is its own subject, and
|
|
21
21
|
* re-exported here so every `@reticlehq/core/telemetry` import reaches it.
|
|
22
22
|
*/
|
|
23
|
-
export { OnboardingPhase, OnboardingStepSchema, OnboardingStepStatus, OnboardingSteps, };
|
|
23
|
+
export { NextStepOffered, OnboardingPhase, OnboardingStepSchema, OnboardingStepStatus, OnboardingSteps, };
|
|
24
24
|
import { ToolRefusalSchema } from './telemetry-refusal.js';
|
|
25
25
|
import { MachineSnapshotSchema, ProjectProfileSchema, SessionSummarySchema, } from './telemetry-session.js';
|
|
26
26
|
import { BrowserBrand, FeedbackSchema } from './telemetry-feedback.js';
|
|
27
27
|
import { CaptureLoss, VerifiedReason } from './verdict/verified-constants.js';
|
|
28
28
|
import { IdentitySchema } from './telemetry-feedback.js';
|
|
29
29
|
import { LicenseActivation } from './telemetry-license.js';
|
|
30
|
-
import { SIGNAL_FIELDS } from './telemetry-signals.js';
|
|
30
|
+
import { OutageErrCode, SIGNAL_FIELDS, TRANSPORT_FIELDS } from './telemetry-signals.js';
|
|
31
31
|
import { BugFoundSchema } from './telemetry-bug.js';
|
|
32
32
|
export * from './telemetry-bug.js';
|
|
33
33
|
/** Bump when the event shape changes so the analytics side can segment old senders. */
|
|
@@ -72,7 +72,7 @@ export const TelemetryEventKind = {
|
|
|
72
72
|
* tool never idle-exits, so only idle ones reach a clean shutdown. Emitting a periodic flush under
|
|
73
73
|
* an exit's name therefore describes active sessions at one end and abandoned ones at the other.
|
|
74
74
|
*
|
|
75
|
-
* Count
|
|
75
|
+
* Count daemon runs with DAEMON_STARTED, clean exits with DAEMON_STOPPED. Sum work with both.
|
|
76
76
|
*/
|
|
77
77
|
SESSION_PROGRESS: 'session_progress',
|
|
78
78
|
/**
|
|
@@ -86,7 +86,10 @@ export const TelemetryEventKind = {
|
|
|
86
86
|
* between a retention problem and an activation problem. Once per daemon start, so it is cheap.
|
|
87
87
|
*/
|
|
88
88
|
PROJECT_PROFILED: 'project_profiled',
|
|
89
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* A start found a version that differs from the last start on this machine, or `reticle update` /
|
|
91
|
+
* `reticle rollback` moved it. Carries from → to.
|
|
92
|
+
*/
|
|
90
93
|
VERSION_CHANGED: 'version_changed',
|
|
91
94
|
/** An uncaught exception or unhandled rejection reached the top of the daemon. Crash analytics. */
|
|
92
95
|
RUNTIME_CRASHED: 'runtime_crashed',
|
|
@@ -149,6 +152,17 @@ export const TelemetryEventKind = {
|
|
|
149
152
|
* that decides whether this is fixed.
|
|
150
153
|
*/
|
|
151
154
|
MCP_CONNECTION_LOST: 'mcp_connection_lost',
|
|
155
|
+
/**
|
|
156
|
+
* The MCP proxy process ended. The agent lost its tools until the client starts a new one.
|
|
157
|
+
*
|
|
158
|
+
* `mcp_connection_lost` cannot see this: the stream to the daemon can be healthy when the proxy
|
|
159
|
+
* leaves. Sent even when the proxy has no other counts to report. See `ProxyExitSchema`.
|
|
160
|
+
*/
|
|
161
|
+
MCP_PROXY_EXITED: 'mcp_proxy_exited',
|
|
162
|
+
/** A daemon start found the pidfile of a daemon that died without a clean stop. */
|
|
163
|
+
DAEMON_DIED_UNCLEAN: 'daemon_died_unclean',
|
|
164
|
+
/** The proxy found the daemon port held by a stranger or by another project, and did not use it. */
|
|
165
|
+
WAKE_REFUSED: 'wake_refused',
|
|
152
166
|
/**
|
|
153
167
|
* `reticle init` finished. The onboarding funnel had no instrumentation at all, so a setup that
|
|
154
168
|
* failed on a missing dependency was indistinguishable from a user who never tried.
|
|
@@ -355,6 +369,8 @@ export const VerificationSchema = z.object({
|
|
|
355
369
|
* `VerificationDriver`. Absent is the ordinary case and means the agent called the tool itself.
|
|
356
370
|
*/
|
|
357
371
|
driven: z.nativeEnum(VerificationDriver).optional(),
|
|
372
|
+
/** The page SDK version from its HELLO: our own release number, or `other`. Absent if unsaid. */
|
|
373
|
+
sdkVersion: z.string().min(1).max(32).optional(),
|
|
358
374
|
});
|
|
359
375
|
/** Which way the installed version moved, and between which versions. */
|
|
360
376
|
export const VersionChangeSchema = z.object({
|
|
@@ -490,6 +506,8 @@ export const McpConnectionSchema = z.object({
|
|
|
490
506
|
* OPTIONAL because an older sender has none. Absent means not measured, never `false`.
|
|
491
507
|
*/
|
|
492
508
|
appConnected: z.boolean().optional(),
|
|
509
|
+
/** The id of the proxy process that attached. Its outages carry the same id. */
|
|
510
|
+
proxyId: z.string().min(1).max(64).optional(),
|
|
493
511
|
});
|
|
494
512
|
/**
|
|
495
513
|
* `app_instrumented`: an app carrying the SDK reached this daemon for the first time.
|
|
@@ -553,6 +571,11 @@ export const OutageReason = {
|
|
|
553
571
|
SSE_CLOSED: 'sse_closed',
|
|
554
572
|
/** A reconnect attempt could not reach the daemon at all. */
|
|
555
573
|
CONNECT_ERROR: 'connect_error',
|
|
574
|
+
/**
|
|
575
|
+
* A stream that was already serving was reset. The request saw the error before the response
|
|
576
|
+
* closed, so this used to read as `connect_error`, which says the daemon was never reached.
|
|
577
|
+
*/
|
|
578
|
+
SSE_RESET: 'sse_reset',
|
|
556
579
|
/** Anything the proxy reported that this list does not name. A classifier must be able to say so. */
|
|
557
580
|
OTHER: 'other',
|
|
558
581
|
};
|
|
@@ -582,6 +605,12 @@ export const McpOutageSchema = z.object({
|
|
|
582
605
|
* worth driving down.
|
|
583
606
|
*/
|
|
584
607
|
pendingLost: z.number().int().nonnegative().optional(),
|
|
608
|
+
/** The socket error code behind the drop, when the drop came with one. */
|
|
609
|
+
errCode: z.nativeEnum(OutageErrCode).optional(),
|
|
610
|
+
/** The stream got a response before it failed: a live stream dropped, not a refused connect. */
|
|
611
|
+
responded: z.boolean().optional(),
|
|
612
|
+
/** The proxy process. It joins `mcp_client_connected`, which carries the daemon's `sessionId`. */
|
|
613
|
+
proxyId: z.string().min(1).max(64).optional(),
|
|
585
614
|
});
|
|
586
615
|
/**
|
|
587
616
|
* WHICH published route brought this install in.
|
|
@@ -616,6 +645,8 @@ export const InstallSource = {
|
|
|
616
645
|
DOCS_SITE: 'docs_site',
|
|
617
646
|
/** The repository README's install snippet. */
|
|
618
647
|
README: 'readme',
|
|
648
|
+
/** reticle.sh/blog, whose posts' install snippets carry the marker. */
|
|
649
|
+
BLOG: 'blog',
|
|
619
650
|
/** Somebody typed the command with no channel in front of it. Only ever self-declared. */
|
|
620
651
|
CLI_DIRECT: 'cli_direct',
|
|
621
652
|
/** No marker, or one this list does not name. The honest answer, and expected to dominate. */
|
|
@@ -671,6 +702,37 @@ export const InitConfirmation = {
|
|
|
671
702
|
*/
|
|
672
703
|
NO_PAGE: 'no_page',
|
|
673
704
|
};
|
|
705
|
+
/**
|
|
706
|
+
* The step a failed runtime `init` stopped at. It refines `reason` and never replaces it.
|
|
707
|
+
*
|
|
708
|
+
* `dev_server` and `app_connection` each covered several stops with different fixes: no dev script,
|
|
709
|
+
* a busy port, a launcher that exited, a build that never served, a page without the SDK, a page
|
|
710
|
+
* that never dialled. The event could not tell them apart, so no fix could be aimed at the common one.
|
|
711
|
+
*/
|
|
712
|
+
export const InitStop = {
|
|
713
|
+
/** The project names no dev, start or serve script, and no `--url` was given. */
|
|
714
|
+
NO_DEV_COMMAND: 'no_dev_command',
|
|
715
|
+
/** Something answers on one loopback address and not the other, on the dev port. */
|
|
716
|
+
SPLIT_LOOPBACK: 'split_loopback',
|
|
717
|
+
/** The dev server said that its port is in use. */
|
|
718
|
+
PORT_BUSY: 'port_busy',
|
|
719
|
+
/** The dev server exited and nothing serves. */
|
|
720
|
+
DEV_SERVER_EXITED: 'dev_server_exited',
|
|
721
|
+
/** The dev server printed no URL and bound no port in the budget. */
|
|
722
|
+
NO_URL: 'no_url',
|
|
723
|
+
/** The dev server announced a URL that did not become ready in the budget. */
|
|
724
|
+
NOT_READY: 'not_ready',
|
|
725
|
+
/** Nothing answered the app URL when the connect wait ended. */
|
|
726
|
+
PAGE_NOT_SERVED: 'page_not_served',
|
|
727
|
+
/** The app URL refused the TLS handshake. */
|
|
728
|
+
PAGE_TLS_REFUSED: 'page_tls_refused',
|
|
729
|
+
/** The page answered, and its HTML does not load the SDK. */
|
|
730
|
+
SDK_MISSING: 'sdk_missing',
|
|
731
|
+
/** The page answered and no session dialled the daemon. */
|
|
732
|
+
NO_SESSION: 'no_session',
|
|
733
|
+
/** A desktop app never dialled the daemon. */
|
|
734
|
+
DESKTOP_NO_SESSION: 'desktop_no_session',
|
|
735
|
+
};
|
|
674
736
|
/** How `reticle init` went. The onboarding funnel, which had no instrumentation whatsoever. */
|
|
675
737
|
export const InitOutcomeSchema = z.object({
|
|
676
738
|
ok: z.boolean(),
|
|
@@ -688,6 +750,8 @@ export const InitOutcomeSchema = z.object({
|
|
|
688
750
|
* only in an interactive terminal. Absence alone is not evidence of a failed connection.
|
|
689
751
|
*/
|
|
690
752
|
confirmation: z.nativeEnum(InitConfirmation).optional(),
|
|
753
|
+
/** Only with `reason` `dev_server` or `app_connection`: the step it stopped at. */
|
|
754
|
+
stop: z.nativeEnum(InitStop).optional(),
|
|
691
755
|
});
|
|
692
756
|
/**
|
|
693
757
|
* One anonymous telemetry event. `anonymousId` and the optional hashed `projectId` are the only
|
|
@@ -834,4 +898,6 @@ export const TelemetryEventSchema = z.object({
|
|
|
834
898
|
licenseKeyPresent: z.boolean().optional(),
|
|
835
899
|
// Account, workspace, client, launch, and the HUD / link / Harness-run blocks: see that file.
|
|
836
900
|
...SIGNAL_FIELDS,
|
|
901
|
+
// The proxy-exit, unclean-death and wake-refusal blocks: see telemetry-signals.ts.
|
|
902
|
+
...TRANSPORT_FIELDS,
|
|
837
903
|
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Predicate } from './predicate.js';
|
|
2
|
+
/**
|
|
3
|
+
* The check in the failure voice. With `failedPart`, an `allOf` is named by the one part that failed.
|
|
4
|
+
* `assertion` is the verdict's (of that part, for an `allOf`): a body clause that missed on a call
|
|
5
|
+
* that was made reads as that, not as "no request was made".
|
|
6
|
+
*/
|
|
7
|
+
export declare function failureSentence(predicate: Predicate, failedPart?: number, assertion?: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* The index of the `allOf` part that failed, read from the per-part results a failed conjunction
|
|
10
|
+
* keeps as its evidence. A part nobody could read is skipped: a real failure outranks it, as in the
|
|
11
|
+
* evaluation. Undefined for a pass, a leaf, an `anyOf` (every part failed) or evidence it cannot read.
|
|
12
|
+
*/
|
|
13
|
+
export declare function failedPartOf(predicate: Predicate, evidence: unknown): number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* The intent fields a recorded check carries: the agent's words, else the sentence built here. Read
|
|
16
|
+
* from the verdict: its evidence names an `allOf`'s failed part, and its assertion says whether a
|
|
17
|
+
* net claim's call was made at all.
|
|
18
|
+
*/
|
|
19
|
+
export declare function checkIntent(predicate: Predicate, verdict: {
|
|
20
|
+
readonly evidence?: unknown;
|
|
21
|
+
readonly assertion?: string | undefined;
|
|
22
|
+
}, given?: string): {
|
|
23
|
+
intent: string;
|
|
24
|
+
intentDerived?: true;
|
|
25
|
+
failedPart?: number;
|
|
26
|
+
};
|
|
27
|
+
/** What a claim makes true, as a sentence: "A POST request to /api/login is made". */
|
|
28
|
+
export declare function expectSentence(predicate: Predicate): string;
|
|
29
|
+
/**
|
|
30
|
+
* A journey in one sentence, from what its steps expect, in order: "A POST request to /api/login is
|
|
31
|
+
* made, then the page moves to /home". An expect that only waits for the page to go idle says
|
|
32
|
+
* nothing about the journey and is skipped. Undefined when no step claims anything else.
|
|
33
|
+
*/
|
|
34
|
+
export declare function journeySentence(expects: readonly Predicate[]): string | undefined;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { PredicateKind } from './consequence.js';
|
|
2
|
+
/** Joins the parts of a conjunction in one sentence. */
|
|
3
|
+
const PART_GAP = '; ';
|
|
4
|
+
const ALL_OF_LEAD = 'Not all of these happened: ';
|
|
5
|
+
const ANY_OF_LEAD = 'None of these happened: ';
|
|
6
|
+
const SHOULD_NOT = ', and it should not have';
|
|
7
|
+
/**
|
|
8
|
+
* Verdict assertions that mean a call matching the method and url WAS made, and only a body clause
|
|
9
|
+
* missed: the request side (what the UI sent) and the response side (what the server answered).
|
|
10
|
+
*/
|
|
11
|
+
const REQUEST_BODY_MISS = new Set([
|
|
12
|
+
'net.requestBody',
|
|
13
|
+
'net.requestBodyMatches',
|
|
14
|
+
]);
|
|
15
|
+
const RESPONSE_BODY_MISS = new Set(['net.bodyContains', 'net.bodyMatches']);
|
|
16
|
+
const capital = (text) => text.charAt(0).toUpperCase() + text.slice(1);
|
|
17
|
+
/** The element a query names, as a noun: 'the button "Pay"', 'the element marked "x"', 'a dialog'. */
|
|
18
|
+
function elementNoun(query) {
|
|
19
|
+
if (query.testid !== undefined)
|
|
20
|
+
return `the element marked "${query.testid}"`;
|
|
21
|
+
const named = query.name ?? query.text ?? query.label ?? query.placeholder ?? query.alt;
|
|
22
|
+
if (query.role !== undefined)
|
|
23
|
+
return named === undefined ? `a ${query.role}` : `the ${query.role} "${named}"`;
|
|
24
|
+
if (named !== undefined)
|
|
25
|
+
return `the element "${named}"`;
|
|
26
|
+
return `an element matching ${JSON.stringify(query)}`;
|
|
27
|
+
}
|
|
28
|
+
/** What a claim is about, as a noun: "a PATCH request to /assignee", 'the text "Saved"'. */
|
|
29
|
+
function noun(predicate) {
|
|
30
|
+
switch (predicate.kind) {
|
|
31
|
+
case PredicateKind.NET:
|
|
32
|
+
return `a ${predicate.method === undefined ? '' : `${predicate.method} `}request${predicate.urlContains === undefined ? '' : ` to ${predicate.urlContains}`}`;
|
|
33
|
+
case PredicateKind.TEXT:
|
|
34
|
+
return `the text "${predicate.contains ?? ''}"`;
|
|
35
|
+
case PredicateKind.SIGNAL:
|
|
36
|
+
return predicate.name === undefined ? 'a signal' : `the app reporting "${predicate.name}"`;
|
|
37
|
+
case PredicateKind.ROUTE:
|
|
38
|
+
return predicate.pathname !== undefined
|
|
39
|
+
? `a move to ${predicate.pathname}`
|
|
40
|
+
: predicate.contains !== undefined
|
|
41
|
+
? `a move to an address holding "${predicate.contains}"`
|
|
42
|
+
: 'a route change';
|
|
43
|
+
case PredicateKind.ELEMENT:
|
|
44
|
+
return elementNoun(predicate.query);
|
|
45
|
+
default:
|
|
46
|
+
return `a ${predicate.kind} check`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** A net claim whose call was made: what it did not carry, else undefined. */
|
|
50
|
+
function madeWithout(predicate, assertion) {
|
|
51
|
+
if (PredicateKind.NET !== predicate.kind || assertion === undefined)
|
|
52
|
+
return undefined;
|
|
53
|
+
const made = `${capital(noun(predicate))} was made, but`;
|
|
54
|
+
if (REQUEST_BODY_MISS.has(assertion)) {
|
|
55
|
+
const wanted = predicate.requestBodyMatches ?? predicate.requestBodyContains;
|
|
56
|
+
if (wanted !== undefined)
|
|
57
|
+
return `${made} it did not carry ${JSON.stringify(wanted)}`;
|
|
58
|
+
}
|
|
59
|
+
if (RESPONSE_BODY_MISS.has(assertion)) {
|
|
60
|
+
const wanted = predicate.bodyMatches ?? predicate.bodyContains;
|
|
61
|
+
if (wanted !== undefined)
|
|
62
|
+
return `${made} its answer did not carry ${JSON.stringify(wanted)}`;
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
/** The sentence for a leaf claim that did not come true. */
|
|
67
|
+
function missed(predicate, assertion) {
|
|
68
|
+
switch (predicate.kind) {
|
|
69
|
+
case PredicateKind.NET:
|
|
70
|
+
return (madeWithout(predicate, assertion) ?? `No ${noun(predicate).slice('a '.length)} was made`);
|
|
71
|
+
case PredicateKind.TEXT:
|
|
72
|
+
return true === predicate.absent
|
|
73
|
+
? `${capital(noun(predicate))} appeared${SHOULD_NOT}`
|
|
74
|
+
: `${capital(noun(predicate))} never appeared`;
|
|
75
|
+
case PredicateKind.SIGNAL:
|
|
76
|
+
return predicate.name === undefined
|
|
77
|
+
? 'The app reported no signal'
|
|
78
|
+
: `The app never reported "${predicate.name}"`;
|
|
79
|
+
case PredicateKind.ROUTE:
|
|
80
|
+
return predicate.pathname !== undefined
|
|
81
|
+
? `The page never moved to ${predicate.pathname}`
|
|
82
|
+
: predicate.contains !== undefined
|
|
83
|
+
? `The address never came to hold "${predicate.contains}"`
|
|
84
|
+
: 'The route never changed';
|
|
85
|
+
case PredicateKind.ELEMENT: {
|
|
86
|
+
const subject = elementNoun(predicate.query);
|
|
87
|
+
if (true === predicate.absent)
|
|
88
|
+
return `${capital(subject)} appeared${SHOULD_NOT}`;
|
|
89
|
+
if (predicate.state !== undefined)
|
|
90
|
+
return `${capital(subject)} was not ${predicate.state}`;
|
|
91
|
+
return subject.startsWith('a ')
|
|
92
|
+
? `No ${subject.slice('a '.length)} appeared`
|
|
93
|
+
: `${capital(subject)} never appeared`;
|
|
94
|
+
}
|
|
95
|
+
case PredicateKind.STATE:
|
|
96
|
+
return `The app's state at ${predicate.path} was not as the check expected`;
|
|
97
|
+
case PredicateKind.SETTLED:
|
|
98
|
+
return 'The page never went idle';
|
|
99
|
+
case PredicateKind.CONSOLE:
|
|
100
|
+
return true === predicate.absent
|
|
101
|
+
? `A console message appeared${SHOULD_NOT}`
|
|
102
|
+
: 'No console message appeared';
|
|
103
|
+
case PredicateKind.ANIMATION:
|
|
104
|
+
return predicate.name === undefined
|
|
105
|
+
? 'No animation ran'
|
|
106
|
+
: `The animation "${predicate.name}" never ran`;
|
|
107
|
+
case PredicateKind.COMPARE:
|
|
108
|
+
return `The ${predicate.left.from} and ${predicate.right.from} readings did not agree`;
|
|
109
|
+
case PredicateKind.NOT:
|
|
110
|
+
return `${capital(noun(predicate.predicate))} happened${SHOULD_NOT}`;
|
|
111
|
+
case PredicateKind.ALL_OF:
|
|
112
|
+
return `${ALL_OF_LEAD}${predicate.predicates.map(noun).join(PART_GAP)}`;
|
|
113
|
+
case PredicateKind.ANY_OF:
|
|
114
|
+
return `${ANY_OF_LEAD}${predicate.predicates.map(noun).join(PART_GAP)}`;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The check in the failure voice. With `failedPart`, an `allOf` is named by the one part that failed.
|
|
119
|
+
* `assertion` is the verdict's (of that part, for an `allOf`): a body clause that missed on a call
|
|
120
|
+
* that was made reads as that, not as "no request was made".
|
|
121
|
+
*/
|
|
122
|
+
export function failureSentence(predicate, failedPart, assertion) {
|
|
123
|
+
if (PredicateKind.ALL_OF === predicate.kind && failedPart !== undefined) {
|
|
124
|
+
const part = predicate.predicates[failedPart];
|
|
125
|
+
if (part !== undefined)
|
|
126
|
+
return failureSentence(part, undefined, assertion);
|
|
127
|
+
}
|
|
128
|
+
return missed(predicate, assertion);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The index of the `allOf` part that failed, read from the per-part results a failed conjunction
|
|
132
|
+
* keeps as its evidence. A part nobody could read is skipped: a real failure outranks it, as in the
|
|
133
|
+
* evaluation. Undefined for a pass, a leaf, an `anyOf` (every part failed) or evidence it cannot read.
|
|
134
|
+
*/
|
|
135
|
+
export function failedPartOf(predicate, evidence) {
|
|
136
|
+
if (PredicateKind.ALL_OF !== predicate.kind || !Array.isArray(evidence))
|
|
137
|
+
return undefined;
|
|
138
|
+
const index = evidence.findIndex((part) => {
|
|
139
|
+
if ('object' !== typeof part || null === part)
|
|
140
|
+
return false;
|
|
141
|
+
return false === Reflect.get(part, 'pass') && undefined === Reflect.get(part, 'inconclusive');
|
|
142
|
+
});
|
|
143
|
+
return index < 0 ? undefined : index;
|
|
144
|
+
}
|
|
145
|
+
/** The `assertion` a failed `allOf` part kept in the per-part results, if it kept one. */
|
|
146
|
+
function partAssertion(evidence, failedPart) {
|
|
147
|
+
const part = Array.isArray(evidence) ? evidence[failedPart] : undefined;
|
|
148
|
+
if ('object' !== typeof part || null === part)
|
|
149
|
+
return undefined;
|
|
150
|
+
const assertion = Reflect.get(part, 'assertion');
|
|
151
|
+
return 'string' === typeof assertion ? assertion : undefined;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* The intent fields a recorded check carries: the agent's words, else the sentence built here. Read
|
|
155
|
+
* from the verdict: its evidence names an `allOf`'s failed part, and its assertion says whether a
|
|
156
|
+
* net claim's call was made at all.
|
|
157
|
+
*/
|
|
158
|
+
export function checkIntent(predicate, verdict, given) {
|
|
159
|
+
const { evidence, assertion } = verdict;
|
|
160
|
+
const failedPart = failedPartOf(predicate, evidence);
|
|
161
|
+
const part = failedPart === undefined ? {} : { failedPart };
|
|
162
|
+
if (given !== undefined && 0 < given.trim().length)
|
|
163
|
+
return { intent: given, ...part };
|
|
164
|
+
const asserted = failedPart === undefined ? assertion : partAssertion(evidence, failedPart);
|
|
165
|
+
return {
|
|
166
|
+
intent: failureSentence(predicate, failedPart, asserted),
|
|
167
|
+
intentDerived: true,
|
|
168
|
+
...part,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
const lower = (text) => text.charAt(0).toLowerCase() + text.slice(1);
|
|
172
|
+
/** What a claim makes true, as a sentence: "A POST request to /api/login is made". */
|
|
173
|
+
export function expectSentence(predicate) {
|
|
174
|
+
switch (predicate.kind) {
|
|
175
|
+
case PredicateKind.NET:
|
|
176
|
+
return `${capital(noun(predicate))} is made`;
|
|
177
|
+
case PredicateKind.TEXT:
|
|
178
|
+
return `${capital(noun(predicate))} ${true === predicate.absent ? 'does not appear' : 'appears'}`;
|
|
179
|
+
case PredicateKind.SIGNAL:
|
|
180
|
+
return predicate.name === undefined
|
|
181
|
+
? 'The app reports a signal'
|
|
182
|
+
: `The app reports "${predicate.name}"`;
|
|
183
|
+
case PredicateKind.ROUTE:
|
|
184
|
+
return predicate.pathname !== undefined
|
|
185
|
+
? `The page moves to ${predicate.pathname}`
|
|
186
|
+
: predicate.contains !== undefined
|
|
187
|
+
? `The address holds "${predicate.contains}"`
|
|
188
|
+
: 'The route changes';
|
|
189
|
+
case PredicateKind.ELEMENT: {
|
|
190
|
+
const subject = capital(elementNoun(predicate.query));
|
|
191
|
+
if (true === predicate.absent)
|
|
192
|
+
return `${subject} does not appear`;
|
|
193
|
+
return predicate.state === undefined
|
|
194
|
+
? `${subject} appears`
|
|
195
|
+
: `${subject} is ${predicate.state}`;
|
|
196
|
+
}
|
|
197
|
+
case PredicateKind.STATE:
|
|
198
|
+
return `The app's state at ${predicate.path} holds the expected value`;
|
|
199
|
+
case PredicateKind.SETTLED:
|
|
200
|
+
return 'The page goes idle';
|
|
201
|
+
case PredicateKind.NOT:
|
|
202
|
+
return `${capital(noun(predicate.predicate))} does not happen`;
|
|
203
|
+
case PredicateKind.ALL_OF:
|
|
204
|
+
return joined(predicate.predicates, ' and ');
|
|
205
|
+
case PredicateKind.ANY_OF:
|
|
206
|
+
return joined(predicate.predicates, ' or ');
|
|
207
|
+
default:
|
|
208
|
+
return `${capital(noun(predicate))} holds`;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function joined(predicates, gap) {
|
|
212
|
+
return predicates
|
|
213
|
+
.map((p, i) => (0 === i ? expectSentence(p) : lower(expectSentence(p))))
|
|
214
|
+
.join(gap);
|
|
215
|
+
}
|
|
216
|
+
/** How many claims a journey's sentence names before it stops: a name, not a transcript. */
|
|
217
|
+
const JOURNEY_CLAIMS = 2;
|
|
218
|
+
/**
|
|
219
|
+
* A journey in one sentence, from what its steps expect, in order: "A POST request to /api/login is
|
|
220
|
+
* made, then the page moves to /home". An expect that only waits for the page to go idle says
|
|
221
|
+
* nothing about the journey and is skipped. Undefined when no step claims anything else.
|
|
222
|
+
*/
|
|
223
|
+
export function journeySentence(expects) {
|
|
224
|
+
const claims = expects.filter((p) => PredicateKind.SETTLED !== p.kind).slice(0, JOURNEY_CLAIMS);
|
|
225
|
+
if (0 === claims.length)
|
|
226
|
+
return undefined;
|
|
227
|
+
return joined(claims, ', then ');
|
|
228
|
+
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* payload field, a store path, an element's text). Route, console and animation carry events, not
|
|
14
14
|
* values, so they are not sources.
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
16
|
+
import * as z from 'zod';
|
|
17
17
|
import { PredicateKind } from './consequence.js';
|
|
18
18
|
/** Which half of an exchange a `net` source reads. */
|
|
19
19
|
export declare const NetBodySide: {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* payload field, a store path, an element's text). Route, console and animation carry events, not
|
|
14
14
|
* values, so they are not sources.
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
16
|
+
import * as z from 'zod';
|
|
17
17
|
import { PredicateKind } from './consequence.js';
|
|
18
18
|
/** Which half of an exchange a `net` source reads. */
|
|
19
19
|
export const NetBodySide = {
|
|
@@ -33,6 +33,21 @@ export type PresenceKind = (typeof PresenceKind)[keyof typeof PresenceKind];
|
|
|
33
33
|
* The remaining kinds are neither consequence nor presence: they observe context (route, console),
|
|
34
34
|
* timing (animation, settled), or combine other predicates (allOf/anyOf/not).
|
|
35
35
|
*/
|
|
36
|
+
/**
|
|
37
|
+
* What a `settled` check waits on. Absent: the whole page (requests and DOM). `network`: requests
|
|
38
|
+
* only, for a check about requests — a counted `net` claim waits for a late duplicate, and DOM churn
|
|
39
|
+
* from an animation must not hold it open.
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* What a `settled` waits out. NETWORK: completed requests only. APP: the default's activity plus every
|
|
43
|
+
* framework render commit, for an app whose commits are its work (the default leaves them out: on many
|
|
44
|
+
* pages they are ambient, a clock re-rendering every second, and would never go quiet).
|
|
45
|
+
*/
|
|
46
|
+
export declare const SettledChannel: {
|
|
47
|
+
readonly NETWORK: "network";
|
|
48
|
+
readonly APP: "app";
|
|
49
|
+
};
|
|
50
|
+
export type SettledChannel = (typeof SettledChannel)[keyof typeof SettledChannel];
|
|
36
51
|
export declare const PredicateKind: {
|
|
37
52
|
readonly ELEMENT: "element";
|
|
38
53
|
readonly TEXT: "text";
|
|
@@ -31,6 +31,17 @@ export const PresenceKind = {
|
|
|
31
31
|
* The remaining kinds are neither consequence nor presence: they observe context (route, console),
|
|
32
32
|
* timing (animation, settled), or combine other predicates (allOf/anyOf/not).
|
|
33
33
|
*/
|
|
34
|
+
/**
|
|
35
|
+
* What a `settled` check waits on. Absent: the whole page (requests and DOM). `network`: requests
|
|
36
|
+
* only, for a check about requests — a counted `net` claim waits for a late duplicate, and DOM churn
|
|
37
|
+
* from an animation must not hold it open.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* What a `settled` waits out. NETWORK: completed requests only. APP: the default's activity plus every
|
|
41
|
+
* framework render commit, for an app whose commits are its work (the default leaves them out: on many
|
|
42
|
+
* pages they are ambient, a clock re-rendering every second, and would never go quiet).
|
|
43
|
+
*/
|
|
44
|
+
export const SettledChannel = { NETWORK: 'network', APP: 'app' };
|
|
34
45
|
export const PredicateKind = {
|
|
35
46
|
ELEMENT: PresenceKind.ELEMENT,
|
|
36
47
|
TEXT: PresenceKind.TEXT,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* that proved a goal the Harness could not find is a discoverability finding, not noise and not a
|
|
7
7
|
* defect. Carried on a Harness run's artifact and on the explore tool's answer.
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
9
|
+
import * as z from 'zod';
|
|
10
10
|
/** How the two verdicts on one goal compare. */
|
|
11
11
|
export declare const DisparityKind: {
|
|
12
12
|
/** Both proved it: it works, and someone new can find it. */
|
|
@@ -22,9 +22,8 @@ export type DisparityKind = (typeof DisparityKind)[keyof typeof DisparityKind];
|
|
|
22
22
|
/** Where the Harness looked, at most this many places. */
|
|
23
23
|
export declare const MAX_DISPARITY_SEARCHED = 20;
|
|
24
24
|
export declare const RunDisparitySchema: z.ZodObject<{
|
|
25
|
-
/** The goal's text, as the journey quoted it. */
|
|
26
25
|
goal: z.ZodString;
|
|
27
|
-
kind: z.
|
|
26
|
+
kind: z.ZodEnum<{
|
|
28
27
|
/** Both proved it: it works, and someone new can find it. */
|
|
29
28
|
readonly FINDABLE: "findable";
|
|
30
29
|
/** The agent proved it; the Harness searched and could not find it. */
|
|
@@ -34,72 +33,25 @@ export declare const RunDisparitySchema: z.ZodObject<{
|
|
|
34
33
|
/** The agent saw it fail and the Harness did not prove it: a defect. */
|
|
35
34
|
readonly DEFECT: "defect";
|
|
36
35
|
}>;
|
|
37
|
-
/** The coding agent's verdict on a claim naming the goal, in the same app. */
|
|
38
36
|
agent: z.ZodObject<{
|
|
39
|
-
verified: z.
|
|
37
|
+
verified: z.ZodEnum<{
|
|
40
38
|
readonly YES: "yes";
|
|
41
39
|
readonly NO: "no";
|
|
42
40
|
readonly UNKNOWN: "unknown";
|
|
43
41
|
readonly NO_FAULT: "no-fault";
|
|
44
42
|
}>;
|
|
45
43
|
claim: z.ZodString;
|
|
46
|
-
},
|
|
47
|
-
verified: "yes" | "no" | "unknown" | "no-fault";
|
|
48
|
-
claim: string;
|
|
49
|
-
}, {
|
|
50
|
-
verified: "yes" | "no" | "unknown" | "no-fault";
|
|
51
|
-
claim: string;
|
|
52
|
-
}>;
|
|
53
|
-
/** The Harness's verdict, and the hunt behind it. */
|
|
44
|
+
}, z.core.$strip>;
|
|
54
45
|
harness: z.ZodObject<{
|
|
55
|
-
verified: z.
|
|
46
|
+
verified: z.ZodEnum<{
|
|
56
47
|
readonly YES: "yes";
|
|
57
48
|
readonly NO: "no";
|
|
58
49
|
readonly UNKNOWN: "unknown";
|
|
59
50
|
readonly NO_FAULT: "no-fault";
|
|
60
51
|
}>;
|
|
61
|
-
/** Whether its search found the goal on a page at all. */
|
|
62
52
|
found: z.ZodBoolean;
|
|
63
|
-
|
|
64
|
-
searched: z.ZodArray<z.ZodString, "many">;
|
|
65
|
-
/** The last place it looked before giving up, when it did. */
|
|
53
|
+
searched: z.ZodArray<z.ZodString>;
|
|
66
54
|
gaveUpAt: z.ZodOptional<z.ZodString>;
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
found: boolean;
|
|
70
|
-
searched: string[];
|
|
71
|
-
gaveUpAt?: string | undefined;
|
|
72
|
-
}, {
|
|
73
|
-
verified: "yes" | "no" | "unknown" | "no-fault";
|
|
74
|
-
found: boolean;
|
|
75
|
-
searched: string[];
|
|
76
|
-
gaveUpAt?: string | undefined;
|
|
77
|
-
}>;
|
|
78
|
-
}, "strip", z.ZodTypeAny, {
|
|
79
|
-
kind: "findable" | "discoverability" | "agent_assumption" | "defect";
|
|
80
|
-
goal: string;
|
|
81
|
-
agent: {
|
|
82
|
-
verified: "yes" | "no" | "unknown" | "no-fault";
|
|
83
|
-
claim: string;
|
|
84
|
-
};
|
|
85
|
-
harness: {
|
|
86
|
-
verified: "yes" | "no" | "unknown" | "no-fault";
|
|
87
|
-
found: boolean;
|
|
88
|
-
searched: string[];
|
|
89
|
-
gaveUpAt?: string | undefined;
|
|
90
|
-
};
|
|
91
|
-
}, {
|
|
92
|
-
kind: "findable" | "discoverability" | "agent_assumption" | "defect";
|
|
93
|
-
goal: string;
|
|
94
|
-
agent: {
|
|
95
|
-
verified: "yes" | "no" | "unknown" | "no-fault";
|
|
96
|
-
claim: string;
|
|
97
|
-
};
|
|
98
|
-
harness: {
|
|
99
|
-
verified: "yes" | "no" | "unknown" | "no-fault";
|
|
100
|
-
found: boolean;
|
|
101
|
-
searched: string[];
|
|
102
|
-
gaveUpAt?: string | undefined;
|
|
103
|
-
};
|
|
104
|
-
}>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
}, z.core.$strip>;
|
|
105
57
|
export type RunDisparity = z.infer<typeof RunDisparitySchema>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* that proved a goal the Harness could not find is a discoverability finding, not noise and not a
|
|
7
7
|
* defect. Carried on a Harness run's artifact and on the explore tool's answer.
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
9
|
+
import * as z from 'zod';
|
|
10
10
|
import { Verified } from './verified-constants.js';
|
|
11
11
|
/** How the two verdicts on one goal compare. */
|
|
12
12
|
export const DisparityKind = {
|
|
@@ -37,6 +37,16 @@ export interface Contradiction {
|
|
|
37
37
|
export declare const ContradictionKind: {
|
|
38
38
|
/** The screen moved forward while a request in the same window failed — the swallowed rejection. */
|
|
39
39
|
readonly UI_ADVANCED_REQUEST_FAILED: "ui-advanced-request-failed";
|
|
40
|
+
/**
|
|
41
|
+
* The UI moved while a write failed, and the app publishes no signal and no store change.
|
|
42
|
+
*
|
|
43
|
+
* The same window as `ui-advanced-request-failed`, but nothing could decide whether the app
|
|
44
|
+
* handled the failure: no acted control to follow, and no voice of the app's own. Measured on a
|
|
45
|
+
* zero-install live feed: the correct build and the broken one both produced the strong finding,
|
|
46
|
+
* because a feed that appends rows on its own is a UI that moves. Absence-derived, so it makes a
|
|
47
|
+
* verdict unknown, never no.
|
|
48
|
+
*/
|
|
49
|
+
readonly UI_ADVANCED_UNSIGNALLED: "ui-advanced-unsignalled";
|
|
40
50
|
/** The app fired its own success signal while a request in the same window failed. Strongest form:
|
|
41
51
|
* the app did not merely look right, it explicitly ASSERTED success against its own evidence. */
|
|
42
52
|
readonly SIGNAL_CONTRADICTED: "signal-contradicted";
|
package/dist/verdict/findings.js
CHANGED
|
@@ -6,6 +6,16 @@ import { ChannelId, disagreementCanConvict } from '../wire/channel.js';
|
|
|
6
6
|
export const ContradictionKind = {
|
|
7
7
|
/** The screen moved forward while a request in the same window failed — the swallowed rejection. */
|
|
8
8
|
UI_ADVANCED_REQUEST_FAILED: 'ui-advanced-request-failed',
|
|
9
|
+
/**
|
|
10
|
+
* The UI moved while a write failed, and the app publishes no signal and no store change.
|
|
11
|
+
*
|
|
12
|
+
* The same window as `ui-advanced-request-failed`, but nothing could decide whether the app
|
|
13
|
+
* handled the failure: no acted control to follow, and no voice of the app's own. Measured on a
|
|
14
|
+
* zero-install live feed: the correct build and the broken one both produced the strong finding,
|
|
15
|
+
* because a feed that appends rows on its own is a UI that moves. Absence-derived, so it makes a
|
|
16
|
+
* verdict unknown, never no.
|
|
17
|
+
*/
|
|
18
|
+
UI_ADVANCED_UNSIGNALLED: 'ui-advanced-unsignalled',
|
|
9
19
|
/** The app fired its own success signal while a request in the same window failed. Strongest form:
|
|
10
20
|
* the app did not merely look right, it explicitly ASSERTED success against its own evidence. */
|
|
11
21
|
SIGNAL_CONTRADICTED: 'signal-contradicted',
|
|
@@ -239,6 +249,8 @@ export const ContradictionKind = {
|
|
|
239
249
|
*/
|
|
240
250
|
export const ABSENCE_DERIVED_CONTRADICTIONS = new Set([
|
|
241
251
|
ContradictionKind.REQUEST_NEVER_SETTLED,
|
|
252
|
+
// The app has no voice to say it handled the failure, and no acted control showed it either way.
|
|
253
|
+
ContradictionKind.UI_ADVANCED_UNSIGNALLED,
|
|
242
254
|
ContradictionKind.RESPONSE_IGNORED,
|
|
243
255
|
// The app said something happened and nothing corroborated it. That is an absence of agreement,
|
|
244
256
|
// never proof the app is wrong — a signal about non-visual state has nothing to corroborate it by
|
|
@@ -357,6 +369,7 @@ export const MUTATING_METHODS = ['POST', 'PUT', 'PATCH', 'DELETE', 'IPC'];
|
|
|
357
369
|
*/
|
|
358
370
|
export const CONTRADICTION_CHANNELS = {
|
|
359
371
|
[ContradictionKind.UI_ADVANCED_REQUEST_FAILED]: [ChannelId.UI, ChannelId.NET],
|
|
372
|
+
[ContradictionKind.UI_ADVANCED_UNSIGNALLED]: [ChannelId.UI, ChannelId.NET],
|
|
360
373
|
[ContradictionKind.SIGNAL_CONTRADICTED]: [ChannelId.SIGNAL, ChannelId.NET],
|
|
361
374
|
[ContradictionKind.RESPONSE_IGNORED]: [ChannelId.NET, ChannelId.UI],
|
|
362
375
|
[ContradictionKind.SIGNAL_WITHOUT_CONSEQUENCE]: [ChannelId.SIGNAL, ChannelId.NET],
|