@reticlehq/core 2.14.0 → 3.1.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/{artifacts-entry.d.ts → artifacts/artifacts-entry.d.ts} +7 -7
- package/dist/{artifacts-entry.js → artifacts/artifacts-entry.js} +7 -7
- package/dist/artifacts/flow-composition.d.ts +30 -0
- package/dist/artifacts/flow-composition.js +19 -0
- package/dist/{flow-constants.d.ts → artifacts/flow-constants.d.ts} +89 -3
- package/dist/{flow-constants.js → artifacts/flow-constants.js} +95 -4
- package/dist/artifacts/flow-mutation-target.d.ts +39 -0
- package/dist/artifacts/flow-mutation-target.js +89 -0
- package/dist/artifacts/flow-order.d.ts +30 -0
- package/dist/artifacts/flow-order.js +49 -0
- package/dist/artifacts/flow-select.d.ts +56 -0
- package/dist/artifacts/flow-select.js +56 -0
- package/dist/artifacts/flow-step-tool.d.ts +31 -0
- package/dist/artifacts/flow-step-tool.js +31 -0
- package/dist/artifacts/flow-types.d.ts +3736 -0
- package/dist/artifacts/flow-types.js +463 -0
- package/dist/artifacts/flow-unreached.d.ts +12 -0
- package/dist/artifacts/flow-unreached.js +24 -0
- package/dist/{impact.d.ts → artifacts/impact.d.ts} +119 -103
- package/dist/{impact.js → artifacts/impact.js} +14 -5
- package/dist/{journal.d.ts → artifacts/journal.d.ts} +51 -7
- package/dist/{journal.js → artifacts/journal.js} +38 -2
- package/dist/artifacts/step-effect.d.ts +29 -0
- package/dist/artifacts/step-effect.js +28 -0
- package/dist/hooks/hook-events.d.ts +311 -0
- package/dist/hooks/hook-events.js +127 -0
- package/dist/hooks/hooks-entry.d.ts +9 -0
- package/dist/hooks/hooks-entry.js +9 -0
- package/dist/{brand.d.ts → identity/brand.d.ts} +7 -0
- package/dist/{contract-fingerprint.d.ts → identity/contract-fingerprint.d.ts} +21 -3
- package/dist/{contract-fingerprint.js → identity/contract-fingerprint.js} +22 -4
- package/dist/{document-identity.d.ts → identity/document-identity.d.ts} +4 -5
- package/dist/{document-identity.js → identity/document-identity.js} +4 -5
- package/dist/{source-constants.d.ts → identity/source-constants.d.ts} +4 -4
- package/dist/{source-constants.js → identity/source-constants.js} +4 -4
- package/dist/index.d.ts +56 -43
- package/dist/index.js +65 -45
- package/dist/onboarding.d.ts +114 -0
- package/dist/onboarding.js +141 -0
- package/dist/realm/registry.d.ts +212 -0
- package/dist/realm/registry.js +302 -0
- package/dist/{dev-server-registry.d.ts → registry/dev-server-registry.d.ts} +6 -7
- package/dist/{dev-server-registry.js → registry/dev-server-registry.js} +28 -19
- package/dist/{project-registry.d.ts → registry/project-registry.d.ts} +5 -5
- package/dist/{project-registry.js → registry/project-registry.js} +5 -5
- package/dist/schema/command-name.json +31 -0
- package/dist/schema/event-payloads.json +791 -0
- package/dist/schema/hello-message.json +70 -2
- package/dist/schema/reticle-message.json +70 -2
- package/dist/telemetry-entry.d.ts +1 -1
- package/dist/telemetry-entry.js +1 -1
- package/dist/telemetry-feedback.d.ts +15 -16
- package/dist/telemetry-feedback.js +11 -12
- package/dist/telemetry-license.d.ts +1 -1
- package/dist/telemetry-license.js +1 -1
- package/dist/telemetry-refusal.d.ts +11 -11
- package/dist/telemetry-refusal.js +7 -8
- package/dist/telemetry-session.d.ts +51 -59
- package/dist/telemetry-session.js +47 -55
- package/dist/telemetry.d.ts +243 -214
- package/dist/telemetry.js +83 -98
- package/dist/tour-entry.d.ts +10 -0
- package/dist/tour-entry.js +10 -0
- package/dist/tour.d.ts +125 -0
- package/dist/tour.js +165 -0
- package/dist/{consequence.d.ts → verdict/consequence.d.ts} +32 -15
- package/dist/{consequence.js → verdict/consequence.js} +9 -31
- package/dist/{finding-fingerprint.js → verdict/finding-fingerprint.js} +1 -1
- package/dist/{findings.d.ts → verdict/findings.d.ts} +86 -39
- package/dist/{findings.js → verdict/findings.js} +103 -49
- package/dist/{instrumentation-gap.d.ts → verdict/instrumentation-gap.d.ts} +7 -14
- package/dist/{instrumentation-gap.js → verdict/instrumentation-gap.js} +7 -15
- package/dist/{intent.d.ts → verdict/intent.d.ts} +35 -46
- package/dist/{intent.js → verdict/intent.js} +11 -22
- package/dist/verdict/revision.d.ts +44 -0
- package/dist/verdict/revision.js +53 -0
- package/dist/{run-context.d.ts → verdict/run-context.d.ts} +13 -34
- package/dist/{run-context.js → verdict/run-context.js} +15 -36
- package/dist/{security.js → verdict/security.js} +12 -21
- package/dist/{verification-run.d.ts → verdict/verification-run.d.ts} +381 -105
- package/dist/{verification-run.js → verdict/verification-run.js} +157 -21
- package/dist/{verified-constants.d.ts → verdict/verified-constants.d.ts} +25 -13
- package/dist/{verified-constants.js → verdict/verified-constants.js} +25 -13
- package/dist/{verify-progress.d.ts → verdict/verify-progress.d.ts} +18 -22
- package/dist/{verify-progress.js → verdict/verify-progress.js} +6 -10
- package/dist/wire/channel.d.ts +46 -0
- package/dist/wire/channel.js +95 -0
- package/dist/{constants.d.ts → wire/constants/constants.d.ts} +91 -28
- package/dist/{constants.js → wire/constants/constants.js} +105 -28
- package/dist/{session-constants.d.ts → wire/constants/session-constants.d.ts} +9 -2
- package/dist/{session-constants.js → wire/constants/session-constants.js} +9 -2
- package/dist/{desktop-contract.js → wire/desktop-contract.js} +1 -1
- package/dist/{event-classification.js → wire/event-classification.js} +1 -1
- package/dist/{event-payloads.d.ts → wire/event-payloads.d.ts} +68 -13
- package/dist/{event-payloads.js → wire/event-payloads.js} +21 -3
- package/dist/{event-priority.d.ts → wire/event-priority.d.ts} +1 -4
- package/dist/{event-priority.js → wire/event-priority.js} +2 -5
- package/dist/{global-press.js → wire/global-press.js} +1 -1
- package/dist/{messages.d.ts → wire/messages.d.ts} +239 -48
- package/dist/{messages.js → wire/messages.js} +68 -5
- package/dist/wire/narrow.d.ts +39 -0
- package/dist/wire/narrow.js +45 -0
- package/dist/{net.d.ts → wire/net.d.ts} +12 -13
- package/dist/{net.js → wire/net.js} +12 -13
- package/dist/wire/platform.d.ts +37 -0
- package/dist/wire/platform.js +36 -0
- package/dist/{redaction.js → wire/redaction.js} +12 -12
- package/dist/wire/tool-names.d.ts +133 -0
- package/dist/wire/tool-names.js +142 -0
- package/dist/{toon.js → wire/toon.js} +1 -1
- package/dist/{types.d.ts → wire/types.d.ts} +77 -76
- package/dist/{types.js → wire/types.js} +4 -3
- package/dist/{no-session-reason.d.ts → words/no-session-reason.d.ts} +7 -3
- package/dist/{no-session-reason.js → words/no-session-reason.js} +7 -3
- package/dist/{notices.d.ts → words/notices.d.ts} +8 -12
- package/dist/{notices.js → words/notices.js} +8 -12
- package/package.json +16 -7
- package/dist/flow-types.d.ts +0 -1711
- package/dist/flow-types.js +0 -247
- package/dist/{impact-savings.d.ts → artifacts/impact-savings.d.ts} +0 -0
- package/dist/{impact-savings.js → artifacts/impact-savings.js} +0 -0
- package/dist/{brand.js → identity/brand.js} +0 -0
- package/dist/{edit-epoch.d.ts → identity/edit-epoch.d.ts} +0 -0
- package/dist/{edit-epoch.js → identity/edit-epoch.js} +0 -0
- package/dist/{project-id.d.ts → identity/project-id.d.ts} +0 -0
- package/dist/{project-id.js → identity/project-id.js} +0 -0
- package/dist/{daemon-registry.d.ts → registry/daemon-registry.d.ts} +0 -0
- package/dist/{daemon-registry.js → registry/daemon-registry.js} +0 -0
- package/dist/{finding-fingerprint.d.ts → verdict/finding-fingerprint.d.ts} +0 -0
- package/dist/{security.d.ts → verdict/security.d.ts} +0 -0
- package/dist/{desktop-contract.d.ts → wire/desktop-contract.d.ts} +0 -0
- package/dist/{event-classification.d.ts → wire/event-classification.d.ts} +0 -0
- package/dist/{global-press.d.ts → wire/global-press.d.ts} +0 -0
- package/dist/{redaction.d.ts → wire/redaction.d.ts} +0 -0
- package/dist/{state-select.d.ts → wire/state-select.d.ts} +0 -0
- package/dist/{state-select.js → wire/state-select.js} +0 -0
- package/dist/{toon.d.ts → wire/toon.d.ts} +0 -0
- package/dist/{browser-misdirect.d.ts → words/browser-misdirect.d.ts} +0 -0
- package/dist/{browser-misdirect.js → words/browser-misdirect.js} +0 -0
- package/dist/{unreachable-notice.d.ts → words/unreachable-notice.d.ts} +0 -0
- package/dist/{unreachable-notice.js → words/unreachable-notice.js} +0 -0
- package/dist/{upgrade.d.ts → words/upgrade.d.ts} +2 -2
- /package/dist/{upgrade.js → words/upgrade.js} +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which flows a run replays, which it refused to — and which it runs AGAIN.
|
|
3
|
+
*
|
|
4
|
+
* Two jobs that must stay distinguishable in the answer. SELECTION is what the caller asked for.
|
|
5
|
+
* EXCLUSION is what the suite declined to run despite being asked. A run that silently returns fewer
|
|
6
|
+
* flows than were selected is a run whose coverage nobody can account for — so anything held back
|
|
7
|
+
* comes back NAMED, never subtracted.
|
|
8
|
+
*
|
|
9
|
+
* The same reasoning applies to a selection that matched nothing. Quietly passing over a typo is how
|
|
10
|
+
* "all green" comes to mean "nothing ran", which is the failure this product exists to prevent
|
|
11
|
+
* wearing a different hat.
|
|
12
|
+
*
|
|
13
|
+
* Pure: flows and a selection in, three lists out. No store, no clock, no IO.
|
|
14
|
+
*/
|
|
15
|
+
import { isQuarantined } from './flow-types.js';
|
|
16
|
+
export function selectFlows(flows, selection) {
|
|
17
|
+
const wantedLabels = selection.labels ?? [];
|
|
18
|
+
const wantedNames = selection.names ?? [];
|
|
19
|
+
const asked = 0 === wantedLabels.length && 0 === wantedNames.length
|
|
20
|
+
? [...flows]
|
|
21
|
+
: flows.filter((flow) => wantedNames.includes(flow.name) ||
|
|
22
|
+
(flow.labels ?? []).some((label) => wantedLabels.includes(label)));
|
|
23
|
+
// Quarantine is applied AFTER selection, so asking for a label a held flow carries cannot drag it
|
|
24
|
+
// back in — and so the held one is reportable as "you asked for this and we did not run it".
|
|
25
|
+
const run = asked.filter((flow) => !isQuarantined(flow));
|
|
26
|
+
const quarantined = asked.filter((flow) => isQuarantined(flow)).map((flow) => flow.name);
|
|
27
|
+
const unmatched = [
|
|
28
|
+
...wantedNames.filter((name) => !flows.some((flow) => flow.name === name)),
|
|
29
|
+
...wantedLabels.filter((label) => !flows.some((flow) => (flow.labels ?? []).includes(label))),
|
|
30
|
+
];
|
|
31
|
+
return { run, quarantined, unmatched };
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Should this flow be re-attempted?
|
|
35
|
+
*
|
|
36
|
+
* Held back until there was a ledger to ask, because without one "retry on failure" is
|
|
37
|
+
* retry-everything with extra steps: a genuinely broken flow is run three times to fail three times,
|
|
38
|
+
* and the suite pays triple to learn what it already knew after the first attempt.
|
|
39
|
+
*
|
|
40
|
+
* The ledger answers the one question that makes retry honest — has this flow been seen to BOTH pass
|
|
41
|
+
* and fail on unchanged code? A flow that has only ever failed is not flaky, it is broken, and
|
|
42
|
+
* re-running it is how a suite turns a real regression into a slow one. A flow with no history has
|
|
43
|
+
* not been classified at all, and guessing is the same mistake with less evidence.
|
|
44
|
+
*
|
|
45
|
+
* Silence is never an opt-in: no policy means no retry.
|
|
46
|
+
*/
|
|
47
|
+
export function shouldRetry(policy, history, attemptsSoFar) {
|
|
48
|
+
if (policy === undefined || attemptsSoFar + 1 >= policy.attempts)
|
|
49
|
+
return false;
|
|
50
|
+
if ('any' === policy.on)
|
|
51
|
+
return true;
|
|
52
|
+
if (history === undefined || 0 === history.runs)
|
|
53
|
+
return false;
|
|
54
|
+
// Both outcomes seen on unchanged code. Neither "never failed" nor "never passed" is flaky.
|
|
55
|
+
return history.fails > 0 && history.fails < history.runs;
|
|
56
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The names a flow step can carry, and the address of a whole-journey finding.
|
|
3
|
+
*
|
|
4
|
+
* A LEAF module on purpose, and the reason is measurable. These are plain constants, but they used
|
|
5
|
+
* to live in `flow-types.ts` beside eleven zod schemas built at module scope — so the browser SDK,
|
|
6
|
+
* which imports `FlowStepTool` and nothing else from that file, loaded every one of them into every
|
|
7
|
+
* page it instruments. A browser never validates a flow FILE; flows are read and written by the
|
|
8
|
+
* daemon. The schemas were pure weight on every page load, and they grew whenever the daemon's file
|
|
9
|
+
* format did: three separate schema additions moved the SDK's first-load ceiling in one week.
|
|
10
|
+
*
|
|
11
|
+
* This is the same defect this repository has already recorded once, in the first-load guard's own
|
|
12
|
+
* words: "a single z-index dragged the panel's whole stylesheet into the first load, a hundred
|
|
13
|
+
* kilobytes reached through one integer." A constant that a light consumer needs belongs in a file
|
|
14
|
+
* of its own, not beside the heavy thing it happens to describe.
|
|
15
|
+
*/
|
|
16
|
+
/** The `step` address of a finding that belongs to the whole journey, not to one step in it. */
|
|
17
|
+
export declare const CROSS_STEP_ADDRESS = -1;
|
|
18
|
+
export declare const FlowStepTool: {
|
|
19
|
+
readonly ACT: "reticle_act";
|
|
20
|
+
readonly ACT_SEQUENCE: "reticle_act_sequence";
|
|
21
|
+
readonly ACT_AND_WAIT: "reticle_act_and_wait";
|
|
22
|
+
/**
|
|
23
|
+
* Run another flow. The step drives nothing itself; `invoke` names the document to replay.
|
|
24
|
+
*
|
|
25
|
+
* Here rather than in the recorder, for the reason stated above this object: it crosses the
|
|
26
|
+
* recorder, the saved file and the replayer, and a string spelled in three places is a rename
|
|
27
|
+
* away from a recorder that writes what no replayer reads. That is the exact drift this enum was
|
|
28
|
+
* created to end, and a new one would have re-opened it.
|
|
29
|
+
*/
|
|
30
|
+
readonly INVOKE: "reticle_invoke";
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The names a flow step can carry, and the address of a whole-journey finding.
|
|
3
|
+
*
|
|
4
|
+
* A LEAF module on purpose, and the reason is measurable. These are plain constants, but they used
|
|
5
|
+
* to live in `flow-types.ts` beside eleven zod schemas built at module scope — so the browser SDK,
|
|
6
|
+
* which imports `FlowStepTool` and nothing else from that file, loaded every one of them into every
|
|
7
|
+
* page it instruments. A browser never validates a flow FILE; flows are read and written by the
|
|
8
|
+
* daemon. The schemas were pure weight on every page load, and they grew whenever the daemon's file
|
|
9
|
+
* format did: three separate schema additions moved the SDK's first-load ceiling in one week.
|
|
10
|
+
*
|
|
11
|
+
* This is the same defect this repository has already recorded once, in the first-load guard's own
|
|
12
|
+
* words: "a single z-index dragged the panel's whole stylesheet into the first load, a hundred
|
|
13
|
+
* kilobytes reached through one integer." A constant that a light consumer needs belongs in a file
|
|
14
|
+
* of its own, not beside the heavy thing it happens to describe.
|
|
15
|
+
*/
|
|
16
|
+
/** The `step` address of a finding that belongs to the whole journey, not to one step in it. */
|
|
17
|
+
export const CROSS_STEP_ADDRESS = -1;
|
|
18
|
+
export const FlowStepTool = {
|
|
19
|
+
ACT: 'reticle_act',
|
|
20
|
+
ACT_SEQUENCE: 'reticle_act_sequence',
|
|
21
|
+
ACT_AND_WAIT: 'reticle_act_and_wait',
|
|
22
|
+
/**
|
|
23
|
+
* Run another flow. The step drives nothing itself; `invoke` names the document to replay.
|
|
24
|
+
*
|
|
25
|
+
* Here rather than in the recorder, for the reason stated above this object: it crosses the
|
|
26
|
+
* recorder, the saved file and the replayer, and a string spelled in three places is a rename
|
|
27
|
+
* away from a recorder that writes what no replayer reads. That is the exact drift this enum was
|
|
28
|
+
* created to end, and a new one would have re-opened it.
|
|
29
|
+
*/
|
|
30
|
+
INVOKE: 'reticle_invoke',
|
|
31
|
+
};
|