@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,44 @@
|
|
|
1
|
+
import type { RunId, RunVerdict } from './verification-run.js';
|
|
2
|
+
/**
|
|
3
|
+
* Correcting a verdict when the truth arrives after the window closed.
|
|
4
|
+
*
|
|
5
|
+
* Two of the reasons a verdict can carry mean, in plain words, "the truth has not arrived yet": a
|
|
6
|
+
* write the server accepted for later processing, and a window that closed while something was
|
|
7
|
+
* still in flight. Both were final the moment they were made. A write that is accepted and then
|
|
8
|
+
* succeeds was recorded as `unknown` forever, and nothing anywhere could say otherwise.
|
|
9
|
+
*
|
|
10
|
+
* That is an unsoundness rather than a missing convenience. A judgement made over a bounded stretch
|
|
11
|
+
* of time, presented as final, is a claim the evidence does not support -- the evidence supports
|
|
12
|
+
* "this is what it looked like by the time we stopped watching".
|
|
13
|
+
*
|
|
14
|
+
* **A revision never edits the verdict it replaces.** It is a new verdict that cites the old one.
|
|
15
|
+
* Both are kept. Anybody reading them can see that the first answer was given, when it changed, and
|
|
16
|
+
* why -- and "we always knew" stops being expressible.
|
|
17
|
+
*
|
|
18
|
+
* Nothing calls this yet. The mechanism exists so that a later adjudication over late evidence has
|
|
19
|
+
* somewhere to put its answer; wiring it into a live adjudication changes what verdicts a run
|
|
20
|
+
* produces, which is a measurable change and belongs with its measurement.
|
|
21
|
+
*/
|
|
22
|
+
/** How a verdict is named, so another can point at it. */
|
|
23
|
+
export declare function citeVerdict(runId: RunId, checkId: string): string;
|
|
24
|
+
/** Is this verdict a correction of that one? */
|
|
25
|
+
export declare function isRevisionOf(verdict: RunVerdict, runId: RunId, checkId: string): boolean;
|
|
26
|
+
interface Revision {
|
|
27
|
+
/** The verdict being corrected. Left untouched. */
|
|
28
|
+
readonly earlier: RunVerdict;
|
|
29
|
+
/** The run the earlier verdict belongs to. */
|
|
30
|
+
readonly earlierRunId: RunId;
|
|
31
|
+
/** What the answer is now that the rest of the evidence has arrived. */
|
|
32
|
+
readonly status: RunVerdict['status'];
|
|
33
|
+
/** Why it changed, in the words of whoever made the new judgement. */
|
|
34
|
+
readonly reasons: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A new verdict that corrects an earlier one.
|
|
38
|
+
*
|
|
39
|
+
* Returns a fresh object; the earlier verdict is not modified. It carries the new reasons rather
|
|
40
|
+
* than appending to the old ones -- the old ones described what was known at the time, and they are
|
|
41
|
+
* still there, on the verdict this one cites.
|
|
42
|
+
*/
|
|
43
|
+
export declare function reviseVerdict(revision: Revision): RunVerdict;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Correcting a verdict when the truth arrives after the window closed.
|
|
3
|
+
*
|
|
4
|
+
* Two of the reasons a verdict can carry mean, in plain words, "the truth has not arrived yet": a
|
|
5
|
+
* write the server accepted for later processing, and a window that closed while something was
|
|
6
|
+
* still in flight. Both were final the moment they were made. A write that is accepted and then
|
|
7
|
+
* succeeds was recorded as `unknown` forever, and nothing anywhere could say otherwise.
|
|
8
|
+
*
|
|
9
|
+
* That is an unsoundness rather than a missing convenience. A judgement made over a bounded stretch
|
|
10
|
+
* of time, presented as final, is a claim the evidence does not support -- the evidence supports
|
|
11
|
+
* "this is what it looked like by the time we stopped watching".
|
|
12
|
+
*
|
|
13
|
+
* **A revision never edits the verdict it replaces.** It is a new verdict that cites the old one.
|
|
14
|
+
* Both are kept. Anybody reading them can see that the first answer was given, when it changed, and
|
|
15
|
+
* why -- and "we always knew" stops being expressible.
|
|
16
|
+
*
|
|
17
|
+
* Nothing calls this yet. The mechanism exists so that a later adjudication over late evidence has
|
|
18
|
+
* somewhere to put its answer; wiring it into a live adjudication changes what verdicts a run
|
|
19
|
+
* produces, which is a measurable change and belongs with its measurement.
|
|
20
|
+
*/
|
|
21
|
+
/** How a verdict is named, so another can point at it. */
|
|
22
|
+
export function citeVerdict(runId, checkId) {
|
|
23
|
+
return `${runId}#${checkId}`;
|
|
24
|
+
}
|
|
25
|
+
/** Is this verdict a correction of that one? */
|
|
26
|
+
export function isRevisionOf(verdict, runId, checkId) {
|
|
27
|
+
return verdict.supersedes === citeVerdict(runId, checkId);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A new verdict that corrects an earlier one.
|
|
31
|
+
*
|
|
32
|
+
* Returns a fresh object; the earlier verdict is not modified. It carries the new reasons rather
|
|
33
|
+
* than appending to the old ones -- the old ones described what was known at the time, and they are
|
|
34
|
+
* still there, on the verdict this one cites.
|
|
35
|
+
*/
|
|
36
|
+
export function reviseVerdict(revision) {
|
|
37
|
+
const { earlier, earlierRunId, status, reasons } = revision;
|
|
38
|
+
const checkId = earlier.checkId;
|
|
39
|
+
if (checkId === undefined) {
|
|
40
|
+
// A citation nobody can resolve is not a citation. Refusing here is better than emitting a
|
|
41
|
+
// correction that points at something unidentifiable.
|
|
42
|
+
throw new Error('cannot revise a verdict that never said which check it was about: nothing could resolve ' +
|
|
43
|
+
'the citation, so the correction would claim to replace something nobody can find');
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
status,
|
|
47
|
+
reasons: [...reasons],
|
|
48
|
+
confidence: earlier.confidence,
|
|
49
|
+
blockingRisks: earlier.blockingRisks,
|
|
50
|
+
checkId,
|
|
51
|
+
supersedes: citeVerdict(earlierRunId, checkId),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -1,43 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What a run has established, held so the agent can ASK for it back.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* PULLED, NEVER PUSHED. Riding along on every tool response duplicates context the agent still has,
|
|
5
|
+
* on every call. The value is not that Reticle remembers MORE, it is that Reticle's copy does not
|
|
6
|
+
* degrade when the agent's does — so the agent asks once, at the moment its own memory is gone.
|
|
7
|
+
* That is why nothing here returns `undefined` for an empty run: a pull was asked a question, and
|
|
8
|
+
* "nothing established yet" is the answer the asker needs.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* It must SHRINK, not grow: superseding facts REPLACE rather than append, and both blocks are
|
|
11
|
+
* capped.
|
|
11
12
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* remembers MORE, it is that Reticle's copy does not degrade at the moment the agent's does. So the
|
|
16
|
-
* agent asks, at the moment it knows its own memory is gone, and pays once.
|
|
13
|
+
* A fact that can be wrong is worse than no fact, so every one carries the document AND the edit
|
|
14
|
+
* epoch it was observed under and is dropped the moment either moves — `isSameDocument` /
|
|
15
|
+
* `isSameEditEpoch`, no grace period.
|
|
17
16
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ## Two rules stop it becoming the thing it prevents
|
|
23
|
-
*
|
|
24
|
-
* **It must shrink, not grow.** Superseding facts REPLACE rather than append, and both blocks are
|
|
25
|
-
* capped. A context object that accumulates is a token bomb, and read-only payloads are already the
|
|
26
|
-
* largest thing this product emits.
|
|
27
|
-
*
|
|
28
|
-
* **Memory that can be wrong is worse than no memory.** A stale established fact is precisely the
|
|
29
|
-
* false-green mechanism this product exists to prevent, and stale refs are already the most common
|
|
30
|
-
* error an agent sees from us. So every fact carries the document AND the edit epoch it was observed
|
|
31
|
-
* under, and is dropped the moment either moves: no grace period, no probably-fine. The comparison
|
|
32
|
-
* is `isSameDocument`/`isSameEditEpoch` rather than a third rule written beside them.
|
|
33
|
-
*
|
|
34
|
-
* ## What may never go in
|
|
35
|
-
*
|
|
36
|
-
* Only what Reticle OBSERVED. Never what the agent intends, plans, or believes: that is not ours to
|
|
37
|
-
* hold, it is unbounded, and a verification tool that remembers what an agent was thinking is
|
|
38
|
-
* inventing evidence. `remaining` is the one forward-looking field and it is derived mechanically
|
|
39
|
-
* from declared bindings, so it remains a report of a fact — which bindings are undischarged — and
|
|
40
|
-
* not a prediction.
|
|
17
|
+
* Only what Reticle OBSERVED goes in, never what the agent intends or believes: that is unbounded,
|
|
18
|
+
* and remembering it would be inventing evidence. `remaining` is the one forward-looking field and
|
|
19
|
+
* is derived mechanically from declared bindings, so it reports a fact rather than a prediction.
|
|
41
20
|
*/
|
|
42
21
|
import { type Intent } from './intent.js';
|
|
43
22
|
import type { Verified } from './verified-constants.js';
|
|
@@ -1,46 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What a run has established, held so the agent can ASK for it back.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* PULLED, NEVER PUSHED. Riding along on every tool response duplicates context the agent still has,
|
|
5
|
+
* on every call. The value is not that Reticle remembers MORE, it is that Reticle's copy does not
|
|
6
|
+
* degrade when the agent's does — so the agent asks once, at the moment its own memory is gone.
|
|
7
|
+
* That is why nothing here returns `undefined` for an empty run: a pull was asked a question, and
|
|
8
|
+
* "nothing established yet" is the answer the asker needs.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* It must SHRINK, not grow: superseding facts REPLACE rather than append, and both blocks are
|
|
11
|
+
* capped.
|
|
11
12
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* remembers MORE, it is that Reticle's copy does not degrade at the moment the agent's does. So the
|
|
16
|
-
* agent asks, at the moment it knows its own memory is gone, and pays once.
|
|
13
|
+
* A fact that can be wrong is worse than no fact, so every one carries the document AND the edit
|
|
14
|
+
* epoch it was observed under and is dropped the moment either moves — `isSameDocument` /
|
|
15
|
+
* `isSameEditEpoch`, no grace period.
|
|
17
16
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ## Two rules stop it becoming the thing it prevents
|
|
23
|
-
*
|
|
24
|
-
* **It must shrink, not grow.** Superseding facts REPLACE rather than append, and both blocks are
|
|
25
|
-
* capped. A context object that accumulates is a token bomb, and read-only payloads are already the
|
|
26
|
-
* largest thing this product emits.
|
|
27
|
-
*
|
|
28
|
-
* **Memory that can be wrong is worse than no memory.** A stale established fact is precisely the
|
|
29
|
-
* false-green mechanism this product exists to prevent, and stale refs are already the most common
|
|
30
|
-
* error an agent sees from us. So every fact carries the document AND the edit epoch it was observed
|
|
31
|
-
* under, and is dropped the moment either moves: no grace period, no probably-fine. The comparison
|
|
32
|
-
* is `isSameDocument`/`isSameEditEpoch` rather than a third rule written beside them.
|
|
33
|
-
*
|
|
34
|
-
* ## What may never go in
|
|
35
|
-
*
|
|
36
|
-
* Only what Reticle OBSERVED. Never what the agent intends, plans, or believes: that is not ours to
|
|
37
|
-
* hold, it is unbounded, and a verification tool that remembers what an agent was thinking is
|
|
38
|
-
* inventing evidence. `remaining` is the one forward-looking field and it is derived mechanically
|
|
39
|
-
* from declared bindings, so it remains a report of a fact — which bindings are undischarged — and
|
|
40
|
-
* not a prediction.
|
|
17
|
+
* Only what Reticle OBSERVED goes in, never what the agent intends or believes: that is unbounded,
|
|
18
|
+
* and remembering it would be inventing evidence. `remaining` is the one forward-looking field and
|
|
19
|
+
* is derived mechanically from declared bindings, so it reports a fact rather than a prediction.
|
|
41
20
|
*/
|
|
42
|
-
import { isSameDocument } from '
|
|
43
|
-
import { isSameEditEpoch } from '
|
|
21
|
+
import { isSameDocument } from '../identity/document-identity.js';
|
|
22
|
+
import { isSameEditEpoch } from '../identity/edit-epoch.js';
|
|
44
23
|
import { IntentState } from './intent.js';
|
|
45
24
|
/**
|
|
46
25
|
* How many rows either block may carry.
|
|
@@ -1,40 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Labels that can trigger an irreversible or money-moving effect.
|
|
3
3
|
*
|
|
4
|
-
* `send`
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* outcome that makes this guard worthless.
|
|
4
|
+
* `send` is deliberately NOT a bare token here. It taxes every ordinary button that sends
|
|
5
|
+
* something — `Send message`, `Send invite`, `Send feedback`, `Send check-in` — and a false block
|
|
6
|
+
* costs a round-trip and, repeated, trains an agent to pass confirmDangerous reflexively, which is
|
|
7
|
+
* the one outcome that makes this guard worthless.
|
|
9
8
|
*
|
|
10
9
|
* The money cases are still covered, through the thing being SENT rather than the act of sending:
|
|
11
10
|
* `payment` catches "Send payment" and "Confirm payment" (which the bare-verb list missed entirely,
|
|
12
11
|
* because `\bpay\b` does not match "payment"), and `send money`/`send funds` catch the rest.
|
|
13
12
|
*
|
|
14
|
-
* `logout` / `log out` / `sign out`
|
|
15
|
-
* words fire on almost every authenticated drive
|
|
16
|
-
* session. Same cost as `send`: a guard that fires on routine controls trains agents to pass
|
|
17
|
-
* `confirmDangerous` reflexively.
|
|
13
|
+
* `logout` / `log out` / `sign out` are deliberately absent for the same reason: signing out is
|
|
14
|
+
* reversible, and the words fire on almost every authenticated drive.
|
|
18
15
|
*
|
|
19
16
|
* The guard stays deliberately asymmetric — a false block costs one round-trip, a missed block can
|
|
20
|
-
* charge somebody's card — so
|
|
21
|
-
*
|
|
17
|
+
* charge somebody's card — so the trigger narrows without lowering money coverage. Both directions
|
|
18
|
+
* are pinned in security.test.ts.
|
|
22
19
|
*/
|
|
23
20
|
/**
|
|
24
21
|
* Labels that read as irreversible: something is destroyed, or money moves.
|
|
25
22
|
*
|
|
26
|
-
* `deploy` and `publish`
|
|
23
|
+
* `deploy` and `publish` are deliberately absent. The guard's contract — written at the top of
|
|
27
24
|
* act-danger.ts — is "a money-moving or destructive control", and a deploy is neither: nothing is
|
|
28
|
-
* destroyed, nothing is paid, and the thing it produces did not exist before.
|
|
25
|
+
* destroyed, nothing is paid, and the thing it produces did not exist before. CONSEQUENTIAL is a
|
|
29
26
|
* wider net than this list is allowed to be, or half the buttons in a dev tool sit behind a
|
|
30
|
-
* permission flag
|
|
31
|
-
*
|
|
32
|
-
* Removed on measurement, not taste. Three benchmark runs against an app with a "New deploy" button
|
|
33
|
-
* lost their ENTIRE turn budget to the refusal. Improving its wording did not rescue the last one:
|
|
34
|
-
* the agent spent its remaining turns weighing a bug report about the block and looking for a
|
|
35
|
-
* webmcp workaround. A guard that costs a whole run on a control it was never written to catch is
|
|
36
|
-
* not protecting anybody — it is training agents to route around it, which is worse than not having
|
|
37
|
-
* it, because the routing-around generalises to the buttons that DO matter.
|
|
27
|
+
* permission flag — and a guard that fires on a control it was never written to catch trains agents
|
|
28
|
+
* to route around it, which generalises to the buttons that DO matter.
|
|
38
29
|
*/
|
|
39
30
|
const DANGEROUS_ACTION = /\b(delete|remove|destroy|erase|drop|terminate|revoke|reset|close account|cancel subscription|purchase|buy|pay|payment|place order|confirm order|send money|send funds|transfer|withdraw|refund)\b/i;
|
|
40
31
|
/**
|