@capybara-hq/kernel 0.1.0-rc.54 → 0.1.0-rc.56
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/admin/admin.schemas.d.ts +11 -1
- package/dist/catalog/catalog.module.js +1 -1
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/catalog/requests.service.d.ts +5 -5
- package/dist/catalog/requests.service.js +9 -9
- package/dist/channels/cards.d.ts +4 -3
- package/dist/channels/cards.js +25 -16
- package/dist/channels/phrases.d.ts +15 -4
- package/dist/channels/phrases.js +15 -1
- package/dist/config/load.d.ts +26 -7
- package/dist/config/load.js +60 -9
- package/dist/config/permission-migration.d.ts +17 -9
- package/dist/config/permission-migration.js +60 -9
- package/dist/config/schema.d.ts +11 -1
- package/dist/config/schema.js +37 -11
- package/dist/conversations/events.d.ts +247 -5
- package/dist/conversations/events.js +127 -16
- package/dist/conversations/permission-profiles.controller.d.ts +12 -2
- package/dist/conversations/permission-profiles.service.d.ts +12 -2
- package/dist/conversations/permission-profiles.service.js +11 -4
- package/dist/db/kernel-schema.d.ts +8 -2
- package/dist/devices/device-projects.service.d.ts +1 -1
- package/dist/devices/device-projects.service.js +6 -6
- package/dist/devices/devices.controller.d.ts +10 -8
- package/dist/devices/devices.controller.js +14 -18
- package/dist/devices/devices.schemas.d.ts +5 -5
- package/dist/devices/devices.schemas.js +5 -5
- package/dist/devices/devices.service.d.ts +188 -175
- package/dist/devices/devices.service.js +284 -292
- package/dist/devices/dto.d.ts +43 -23
- package/dist/devices/dto.js +45 -49
- package/dist/devices/project-rules.d.ts +0 -10
- package/dist/devices/project-rules.js +0 -5
- package/dist/errors.d.ts +24 -19
- package/dist/errors.js +24 -19
- package/dist/evals/reconstruct.d.ts +12 -3
- package/dist/evals/reconstruct.js +10 -6
- package/dist/evals/recorded-permission-context.d.ts +6 -4
- package/dist/evals/recorded-permission-context.js +15 -9
- package/dist/evals/run-replay.d.ts +6 -1
- package/dist/evals/run-replay.js +7 -2
- package/dist/evals/worker.js +3 -1
- package/dist/identity/settings.d.ts +45 -18
- package/dist/identity/settings.js +151 -51
- package/dist/infra/config/kernel-config.service.d.ts +1 -1
- package/dist/infra/config/kernel-config.service.js +17 -5
- package/dist/local-devices/device-auth.controller.d.ts +1 -1
- package/dist/local-devices/device-auth.controller.js +1 -1
- package/dist/local-devices/device-auth.d.ts +4 -4
- package/dist/local-devices/device-auth.js +1 -1
- package/dist/local-devices/device-policy.service.d.ts +18 -9
- package/dist/local-devices/device-policy.service.js +21 -61
- package/dist/local-devices/device-routes.d.ts +3 -1
- package/dist/local-devices/device-routes.js +15 -4
- package/dist/local-devices/instance-bindings.js +5 -2
- package/dist/local-devices/local-device-gateway.d.ts +2 -2
- package/dist/local-devices/local-device-gateway.js +3 -3
- package/dist/local-devices/local-device-provider.d.ts +4 -4
- package/dist/local-devices/local-device-provider.js +23 -9
- package/dist/local-devices/local-devices.module.d.ts +1 -1
- package/dist/local-devices/local-devices.module.js +1 -1
- package/dist/local-devices/machines.d.ts +40 -16
- package/dist/local-devices/machines.js +89 -61
- package/dist/local-devices/owner-report.d.ts +16 -14
- package/dist/local-devices/owner-report.js +24 -30
- package/dist/local-devices/owner-reports.js +26 -8
- package/dist/local-devices/policy-summary.d.ts +25 -44
- package/dist/local-devices/policy-summary.js +26 -71
- package/dist/local-devices/relay.d.ts +6 -6
- package/dist/local-devices/relay.js +10 -8
- package/dist/net/public-address.d.ts +1 -1
- package/dist/net/public-address.js +5 -2
- package/dist/orgs/device-network-setting.d.ts +82 -0
- package/dist/orgs/device-network-setting.js +142 -0
- package/dist/orgs/settings.service.d.ts +103 -66
- package/dist/orgs/settings.service.js +201 -137
- package/dist/overrides.d.ts +5 -1
- package/dist/overrides.js +2 -0
- package/dist/platform/exclusions.js +1 -1
- package/dist/platform/operation.js +1 -1
- package/dist/platform/ops/admin.ops.js +20 -11
- package/dist/platform/ops/devices.ops.js +70 -5
- package/dist/platform/ops/org-settings.ops.js +10 -6
- package/dist/platform/ops/orgs.ops.js +2 -1
- package/dist/runtime/context/permission-profile.d.ts +17 -8
- package/dist/runtime/context/permission-profile.js +126 -45
- package/dist/runtime/permission-context.service.d.ts +1 -1
- package/dist/runtime/permission-context.service.js +5 -3
- package/dist/runtime/project/knowledge.d.ts +5 -4
- package/dist/runtime/project/knowledge.js +2 -1
- package/dist/runtime/project/knowledge.service.js +16 -13
- package/dist/sandbox/cloud-permission-snapshot.js +22 -3
- package/dist/sandbox/device-sandbox-settings.d.ts +230 -0
- package/dist/sandbox/device-sandbox-settings.js +470 -0
- package/dist/sandbox/device-sandbox.d.ts +187 -0
- package/dist/sandbox/device-sandbox.js +236 -0
- package/dist/sandbox/held-operations.js +15 -7
- package/dist/sandbox/modes.d.ts +49 -24
- package/dist/sandbox/modes.js +27 -19
- package/dist/sandbox/operation-authority-types.d.ts +6 -5
- package/dist/sandbox/operation-authority-types.js +7 -8
- package/dist/sandbox/operation-authority.d.ts +23 -9
- package/dist/sandbox/operation-authority.js +179 -97
- package/dist/sandbox/permission-auto-grants.d.ts +42 -0
- package/dist/sandbox/permission-auto-grants.js +145 -0
- package/dist/sandbox/permission-call-grants.d.ts +12 -4
- package/dist/sandbox/permission-call-grants.js +84 -35
- package/dist/sandbox/permission-call-grants.module.js +10 -3
- package/dist/sandbox/permission-call-types.d.ts +39 -5
- package/dist/sandbox/permission-ceiling-writes.d.ts +29 -3
- package/dist/sandbox/permission-ceiling-writes.js +38 -4
- package/dist/sandbox/permission-config-publication.d.ts +44 -2
- package/dist/sandbox/permission-config-publication.js +230 -59
- package/dist/sandbox/permission-context-types.d.ts +2 -2
- package/dist/sandbox/permission-facts.d.ts +144 -15
- package/dist/sandbox/permission-facts.js +258 -70
- package/dist/sandbox/permission-runtime-reports.d.ts +5 -4
- package/dist/sandbox/permission-runtime-reports.js +19 -29
- package/dist/sandbox/review/classifier.d.ts +8 -0
- package/dist/sandbox/review/classifier.js +10 -0
- package/dist/sandbox/review/permission-candidate.d.ts +69 -5
- package/dist/sandbox/review/permission-candidate.js +153 -30
- package/dist/sandbox/review/review.service.d.ts +19 -3
- package/dist/sandbox/review/review.service.js +59 -11
- package/dist/sandbox/review/rules.js +23 -3
- package/dist/sandbox/sandbox.service.d.ts +29 -11
- package/dist/sandbox/sandbox.service.js +51 -26
- package/dist/skills/invoke.js +3 -2
- package/dist/tools/approvals.service.d.ts +26 -116
- package/dist/tools/approvals.service.js +42 -346
- package/dist/tools/builtins/sandbox/bash.d.ts +16 -3
- package/dist/tools/builtins/sandbox/bash.js +80 -28
- package/dist/tools/builtins/sandbox/common.d.ts +39 -14
- package/dist/tools/builtins/sandbox/common.js +47 -24
- package/dist/tools/builtins/sandbox/deliver.js +7 -4
- package/dist/tools/builtins/skill-load.d.ts +2 -2
- package/dist/tools/builtins/skill-load.js +4 -3
- package/dist/tools/device-op-resolver.d.ts +4 -10
- package/dist/tools/device-op-resolver.js +8 -19
- package/dist/tools/network-asks.d.ts +52 -15
- package/dist/tools/network-asks.js +55 -25
- package/dist/tools/pipeline.d.ts +26 -14
- package/dist/tools/pipeline.js +144 -61
- package/dist/tools/registry.d.ts +6 -0
- package/dist/tools/tools.module.js +1 -1
- package/dist/ui/views.d.ts +3 -1
- package/dist/ui/views.js +2 -1
- package/package.json +4 -4
- package/src/migrations/0165_device_network_columns.sql +50 -0
- package/src/migrations/0166_permission_grant_full_access.sql +17 -0
- package/src/migrations/0167_device_network_backfill.sql +32 -0
- package/src/migrations/0168_binding_installed_connection.sql +6 -0
- package/dist/orgs/cloud-network-setting.d.ts +0 -33
- package/dist/orgs/cloud-network-setting.js +0 -47
- package/dist/sandbox/platform-full-access.d.ts +0 -110
- package/dist/sandbox/platform-full-access.js +0 -198
package/dist/devices/dto.d.ts
CHANGED
|
@@ -8,32 +8,50 @@ export declare const DeviceParams: z.ZodObject<{
|
|
|
8
8
|
id: z.ZodString;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* never
|
|
14
|
-
*
|
|
15
|
-
|
|
11
|
+
* A cloud device's sandbox network (approval-only profiles design, "Settings model"): `open` (the
|
|
12
|
+
* public internet), `allowlist` (its org's hosts, narrowed to `hosts` when given: a device list
|
|
13
|
+
* never adds a host, and an empty one follows the org's), `none` (closed), or `null` to follow its
|
|
14
|
+
* org again. `hosts` only with `allowlist`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const DeviceNetworkBody: z.ZodObject<{
|
|
17
|
+
mode: z.ZodNullable<z.ZodEnum<{
|
|
18
|
+
allowlist: "allowlist";
|
|
19
|
+
none: "none";
|
|
20
|
+
open: "open";
|
|
21
|
+
}>>;
|
|
22
|
+
hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
/**
|
|
25
|
+
* `PATCH /devices/:id`: a new name, and a cloud device's sandbox `network`
|
|
26
|
+
* ({@link DeviceNetworkBody}), within its org's and the platform's ceilings (`device.network_not_allowed`
|
|
27
|
+
* above them). A local device's network lives on its machine (`device.ceiling_on_machine`: narrow
|
|
28
|
+
* it with `POST /devices/:id/policy`, widen it on the machine). Through an API token or the
|
|
29
|
+
* Platform tool (`devices.set-network`) the network may only narrow.
|
|
16
30
|
*/
|
|
17
31
|
export declare const DevicePatchBody: z.ZodObject<{
|
|
18
32
|
name: z.ZodOptional<z.ZodString>;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
network: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
mode: z.ZodNullable<z.ZodEnum<{
|
|
35
|
+
allowlist: "allowlist";
|
|
36
|
+
none: "none";
|
|
37
|
+
open: "open";
|
|
38
|
+
}>>;
|
|
39
|
+
hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
40
|
}, z.core.$strict>>;
|
|
23
|
-
confirmWidening: z.ZodOptional<z.ZodLiteral<true>>;
|
|
24
41
|
}, z.core.$strict>;
|
|
25
42
|
/**
|
|
26
|
-
* `POST /devices/:id/policy` (
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
43
|
+
* `POST /devices/:id/policy` (approval-only profiles design, "Settings model"): the device owner
|
|
44
|
+
* narrows the local machine's sandbox from the web: `remove` hosts from its allowlist, and narrow
|
|
45
|
+
* its owner ceiling (`outsideSandbox: false`, `network: "allowlist"`, `restrictedProjectReach:
|
|
46
|
+
* "workspace"`). The web never widens it: the owner adds hosts, opens the network or allows
|
|
47
|
+
* running outside the sandbox on the machine (`capybara-device policy add allowedDomains`,
|
|
48
|
+
* `capybara-device ceiling set`).
|
|
30
49
|
*/
|
|
31
50
|
export declare const DevicePolicyBody: z.ZodObject<{
|
|
32
|
-
add: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
51
|
remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
-
mode: z.ZodOptional<z.ZodLiteral<"sandbox">>;
|
|
35
52
|
ownerCeiling: z.ZodOptional<z.ZodObject<{
|
|
36
|
-
|
|
53
|
+
outsideSandbox: z.ZodOptional<z.ZodLiteral<false>>;
|
|
54
|
+
network: z.ZodOptional<z.ZodLiteral<"allowlist">>;
|
|
37
55
|
restrictedProjectReach: z.ZodOptional<z.ZodLiteral<"workspace">>;
|
|
38
56
|
}, z.core.$strict>>;
|
|
39
57
|
}, z.core.$strict>;
|
|
@@ -63,11 +81,14 @@ export declare class DeviceCreateBodyDto extends DeviceCreateBodyDto_base {
|
|
|
63
81
|
}
|
|
64
82
|
declare const DevicePatchBodyDto_base: import("../infra/validation/create-zod-dto.js").ZodDtoClass<z.ZodObject<{
|
|
65
83
|
name: z.ZodOptional<z.ZodString>;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
84
|
+
network: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
mode: z.ZodNullable<z.ZodEnum<{
|
|
86
|
+
allowlist: "allowlist";
|
|
87
|
+
none: "none";
|
|
88
|
+
open: "open";
|
|
89
|
+
}>>;
|
|
90
|
+
hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
69
91
|
}, z.core.$strict>>;
|
|
70
|
-
confirmWidening: z.ZodOptional<z.ZodLiteral<true>>;
|
|
71
92
|
}, z.core.$strict>>;
|
|
72
93
|
export declare class DevicePatchBodyDto extends DevicePatchBodyDto_base {
|
|
73
94
|
}
|
|
@@ -77,11 +98,10 @@ declare const DeviceParamsDto_base: import("../infra/validation/create-zod-dto.j
|
|
|
77
98
|
export declare class DeviceParamsDto extends DeviceParamsDto_base {
|
|
78
99
|
}
|
|
79
100
|
declare const DevicePolicyBodyDto_base: import("../infra/validation/create-zod-dto.js").ZodDtoClass<z.ZodObject<{
|
|
80
|
-
add: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
81
101
|
remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
82
|
-
mode: z.ZodOptional<z.ZodLiteral<"sandbox">>;
|
|
83
102
|
ownerCeiling: z.ZodOptional<z.ZodObject<{
|
|
84
|
-
|
|
103
|
+
outsideSandbox: z.ZodOptional<z.ZodLiteral<false>>;
|
|
104
|
+
network: z.ZodOptional<z.ZodLiteral<"allowlist">>;
|
|
85
105
|
restrictedProjectReach: z.ZodOptional<z.ZodLiteral<"workspace">>;
|
|
86
106
|
}, z.core.$strict>>;
|
|
87
107
|
}, z.core.$strict>>;
|
package/dist/devices/dto.js
CHANGED
|
@@ -1,36 +1,10 @@
|
|
|
1
1
|
import { isDeviceProjectName, MAX_DEVICE_PROJECT_NAME_LENGTH, validateAllowHost, } from "@capybara-hq/plugin-sdk";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { createZodDto } from "../infra/validation/create-zod-dto.js";
|
|
4
|
-
import { publicSuffixWildcard } from "./public-suffix.js";
|
|
5
4
|
/** A device's name: trimmed, 1-64 characters (unique per person, case-insensitive). */
|
|
6
5
|
export const DeviceName = z.string().trim().min(1).max(64);
|
|
7
6
|
export const DeviceNameBody = z.object({ name: DeviceName }).strict();
|
|
8
7
|
export const DeviceParams = z.object({ id: z.string().min(1).max(100) });
|
|
9
|
-
/**
|
|
10
|
-
* `PATCH /devices/:id`: a new name, and a cloud device's `mode`: `sandbox` narrows it, `null`
|
|
11
|
-
* follows the org and the platform again (auto when they allow it; hardening spec D2). `auto` is
|
|
12
|
-
* never stored. A local device's mode lives on its machine, so the service refuses a `mode` for it
|
|
13
|
-
* (`device.mode_on_device`). The mode is a person's choice in a web session: an API token gets
|
|
14
|
-
* `device.mode_requires_session`, and the Platform operation (`devices.rename`) omits it.
|
|
15
|
-
*/
|
|
16
|
-
export const DevicePatchBody = z
|
|
17
|
-
.object({
|
|
18
|
-
name: DeviceName.optional(),
|
|
19
|
-
mode: z.literal("sandbox").nullable().optional(),
|
|
20
|
-
/**
|
|
21
|
-
* B2: a cloud device's explicit Full ceiling. `false` narrows; `true` widens and needs
|
|
22
|
-
* `confirmWidening: true` (a person in a web session only); it never opens the outer network.
|
|
23
|
-
*/
|
|
24
|
-
ownerCeiling: z.object({ fullAccess: z.boolean() }).strict().optional(),
|
|
25
|
-
confirmWidening: z.literal(true).optional(),
|
|
26
|
-
})
|
|
27
|
-
.strict()
|
|
28
|
-
.refine((b) => b.name !== undefined || b.mode !== undefined || b.ownerCeiling !== undefined, {
|
|
29
|
-
message: "Give at least one of name, mode or ownerCeiling",
|
|
30
|
-
})
|
|
31
|
-
.refine((b) => b.mode === undefined || b.ownerCeiling === undefined, {
|
|
32
|
-
message: "Give either mode or ownerCeiling, not both",
|
|
33
|
-
});
|
|
34
8
|
/** One host of a device's network allowlist (`validateAllowHost`: lowercase, `*.` allowed). */
|
|
35
9
|
const PolicyHost = z
|
|
36
10
|
.string()
|
|
@@ -39,44 +13,66 @@ const PolicyHost = z
|
|
|
39
13
|
for (const message of validateAllowHost(h))
|
|
40
14
|
ctx.addIssue({ code: "custom", message });
|
|
41
15
|
});
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
16
|
+
/**
|
|
17
|
+
* A cloud device's sandbox network (approval-only profiles design, "Settings model"): `open` (the
|
|
18
|
+
* public internet), `allowlist` (its org's hosts, narrowed to `hosts` when given: a device list
|
|
19
|
+
* never adds a host, and an empty one follows the org's), `none` (closed), or `null` to follow its
|
|
20
|
+
* org again. `hosts` only with `allowlist`.
|
|
21
|
+
*/
|
|
22
|
+
export const DeviceNetworkBody = z
|
|
23
|
+
.object({
|
|
24
|
+
mode: z.enum(["open", "allowlist", "none"]).nullable(),
|
|
25
|
+
hosts: z.array(PolicyHost).max(100).optional(),
|
|
26
|
+
})
|
|
27
|
+
.strict()
|
|
28
|
+
.refine((n) => n.hosts === undefined || n.hosts.length === 0 || n.mode === "allowlist", {
|
|
29
|
+
message: "Give hosts only with the allowlist network",
|
|
47
30
|
});
|
|
48
31
|
/**
|
|
49
|
-
* `
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* machine
|
|
32
|
+
* `PATCH /devices/:id`: a new name, and a cloud device's sandbox `network`
|
|
33
|
+
* ({@link DeviceNetworkBody}), within its org's and the platform's ceilings (`device.network_not_allowed`
|
|
34
|
+
* above them). A local device's network lives on its machine (`device.ceiling_on_machine`: narrow
|
|
35
|
+
* it with `POST /devices/:id/policy`, widen it on the machine). Through an API token or the
|
|
36
|
+
* Platform tool (`devices.set-network`) the network may only narrow.
|
|
37
|
+
*/
|
|
38
|
+
export const DevicePatchBody = z
|
|
39
|
+
.object({
|
|
40
|
+
name: DeviceName.optional(),
|
|
41
|
+
network: DeviceNetworkBody.optional(),
|
|
42
|
+
})
|
|
43
|
+
.strict()
|
|
44
|
+
.refine((b) => b.name !== undefined || b.network !== undefined, {
|
|
45
|
+
message: "Give at least one of name or network",
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* `POST /devices/:id/policy` (approval-only profiles design, "Settings model"): the device owner
|
|
49
|
+
* narrows the local machine's sandbox from the web: `remove` hosts from its allowlist, and narrow
|
|
50
|
+
* its owner ceiling (`outsideSandbox: false`, `network: "allowlist"`, `restrictedProjectReach:
|
|
51
|
+
* "workspace"`). The web never widens it: the owner adds hosts, opens the network or allows
|
|
52
|
+
* running outside the sandbox on the machine (`capybara-device policy add allowedDomains`,
|
|
53
|
+
* `capybara-device ceiling set`).
|
|
53
54
|
*/
|
|
54
55
|
export const DevicePolicyBody = z
|
|
55
56
|
.object({
|
|
56
|
-
add: z.array(AddHost).min(1).max(20).optional(),
|
|
57
57
|
remove: z.array(PolicyHost).min(1).max(100).optional(),
|
|
58
|
-
mode: z.literal("sandbox").optional(),
|
|
59
|
-
/**
|
|
60
|
-
* B2: narrow the machine's owner ceiling. Only `fullAccess: false` and `workspace` reach are
|
|
61
|
-
* accepted: the web never widens it (the owner does, on the machine, with `capybara-device
|
|
62
|
-
* ceiling set`).
|
|
63
|
-
*/
|
|
64
58
|
ownerCeiling: z
|
|
65
59
|
.object({
|
|
66
|
-
|
|
60
|
+
outsideSandbox: z.literal(false).optional(),
|
|
61
|
+
network: z.literal("allowlist").optional(),
|
|
67
62
|
restrictedProjectReach: z.literal("workspace").optional(),
|
|
68
63
|
})
|
|
69
64
|
.strict()
|
|
70
|
-
.refine((c) => c.
|
|
71
|
-
|
|
65
|
+
.refine((c) => c.outsideSandbox !== undefined ||
|
|
66
|
+
c.network !== undefined ||
|
|
67
|
+
c.restrictedProjectReach !== undefined, {
|
|
68
|
+
message: "Give outsideSandbox: false, network: allowlist or restrictedProjectReach: workspace",
|
|
72
69
|
})
|
|
73
70
|
.optional(),
|
|
74
71
|
})
|
|
75
72
|
.strict()
|
|
76
|
-
.refine((b) => b.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
b.ownerCeiling !== undefined, { message: "Give at least one of add, remove, mode or ownerCeiling" });
|
|
73
|
+
.refine((b) => b.remove !== undefined || b.ownerCeiling !== undefined, {
|
|
74
|
+
message: "Give at least one of remove or ownerCeiling",
|
|
75
|
+
});
|
|
80
76
|
/**
|
|
81
77
|
* A project's name (project root §4.1, `isDeviceProjectName`): 1-64 UTF-16 code units, not `.` or
|
|
82
78
|
* `..`, no `/`, no control characters, no leading or trailing whitespace; unique on its device.
|
|
@@ -14,18 +14,8 @@ export interface DeviceProjectScope {
|
|
|
14
14
|
/** The owner's home a local machine reported; null when unknown (and for a cloud device). */
|
|
15
15
|
home: string | null;
|
|
16
16
|
supported: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* A machine without an authenticated owner report whose own policy is auto mode while the
|
|
19
|
-
* organization allows only sandbox mode: the kernel reads nothing on it unasked.
|
|
20
|
-
*/
|
|
21
|
-
widerThanAllowed: boolean;
|
|
22
17
|
}
|
|
23
18
|
type Scope = DeviceProjectScope;
|
|
24
|
-
/**
|
|
25
|
-
* The protocol 2 read mode for list/scan on the device (`limits.mode`): the reach, encoded (B2: a
|
|
26
|
-
* restricted OS-user read is never a Full grant; the v3 browse scope carries roots instead).
|
|
27
|
-
*/
|
|
28
|
-
export declare const readModeOf: (s: Pick<Scope, "source" | "reach" | "mode">) => SandboxMode;
|
|
29
19
|
/** The base a relative path is resolved against in the scope's mode (project root §4.2). */
|
|
30
20
|
export declare const baseOf: (s: Scope, workspace?: string) => string | null;
|
|
31
21
|
/**
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { ApiError } from "../errors.js";
|
|
2
2
|
/** Only the owner's home bounds nothing: OS-user reach on a machine reads what its owner can. */
|
|
3
3
|
const homeBased = (s) => s.source === "local" && s.reach === "os-user";
|
|
4
|
-
/**
|
|
5
|
-
* The protocol 2 read mode for list/scan on the device (`limits.mode`): the reach, encoded (B2: a
|
|
6
|
-
* restricted OS-user read is never a Full grant; the v3 browse scope carries roots instead).
|
|
7
|
-
*/
|
|
8
|
-
export const readModeOf = (s) => s.source === "local" ? (s.reach === "os-user" ? "auto" : "sandbox") : s.mode;
|
|
9
4
|
/** The base a relative path is resolved against in the scope's mode (project root §4.2). */
|
|
10
5
|
export const baseOf = (s, workspace = s.workspace) => homeBased(s) ? s.home : workspace;
|
|
11
6
|
/**
|
package/dist/errors.d.ts
CHANGED
|
@@ -45,10 +45,15 @@ export declare const ERROR_CODES: {
|
|
|
45
45
|
readonly "org.owner_required": 403;
|
|
46
46
|
readonly "org.sandbox_egress_not_allowed": 400;
|
|
47
47
|
/**
|
|
48
|
-
* The org
|
|
49
|
-
* widened it through an API token or the Platform tool.
|
|
48
|
+
* The org allowed running outside the sandbox (`outsideSandbox: allowed`) where the platform
|
|
49
|
+
* turned it off, or widened it through an API token or the Platform tool.
|
|
50
50
|
*/
|
|
51
|
-
readonly "org.
|
|
51
|
+
readonly "org.outside_sandbox_not_allowed": 400;
|
|
52
|
+
/**
|
|
53
|
+
* The org's device network default or ceiling is above the platform's ceiling, or was opened
|
|
54
|
+
* through an API token or the Platform tool.
|
|
55
|
+
*/
|
|
56
|
+
readonly "org.network_not_allowed": 400;
|
|
52
57
|
/** An org network allowance entry that is malformed, names a link-local address, or is over the cap. */
|
|
53
58
|
readonly "org.network_allowance_invalid": 400;
|
|
54
59
|
readonly "org.network_allowance_not_found": 404;
|
|
@@ -61,8 +66,13 @@ export declare const ERROR_CODES: {
|
|
|
61
66
|
readonly "org.external_sharing_not_allowed": 400;
|
|
62
67
|
/** A deployment setting set in the startup config (file, Nacos or env): read-only in the admin console. */
|
|
63
68
|
readonly "deployment.setting_readonly": 409;
|
|
64
|
-
/** Allowing
|
|
65
|
-
readonly "deployment.
|
|
69
|
+
/** Allowing outside-sandbox runs platform-wide through an API token or the Platform tool (only off). */
|
|
70
|
+
readonly "deployment.outside_sandbox_not_allowed": 400;
|
|
71
|
+
/**
|
|
72
|
+
* The platform's network default above its ceiling, or a default or ceiling opened through an API
|
|
73
|
+
* token or the Platform tool.
|
|
74
|
+
*/
|
|
75
|
+
readonly "deployment.network_not_allowed": 400;
|
|
66
76
|
/** Allowing external sharing at the platform level through an API token or the Platform tool. */
|
|
67
77
|
readonly "deployment.external_sharing_not_allowed": 400;
|
|
68
78
|
/**
|
|
@@ -432,11 +442,6 @@ export declare const ERROR_CODES: {
|
|
|
432
442
|
* is admitted until a lifecycle action (a file reset) establishes them.
|
|
433
443
|
*/
|
|
434
444
|
readonly "device.permission_reconcile_required": 409;
|
|
435
|
-
/**
|
|
436
|
-
* B1: a cloud device's owner ceiling PATCH before its snapshot exists (not migrated yet); the old
|
|
437
|
-
* sandbox switch still narrows it. A file reset does not change this.
|
|
438
|
-
*/
|
|
439
|
-
readonly "device.permission_not_migrated": 409;
|
|
440
445
|
readonly "device.owner_report_stale": 409;
|
|
441
446
|
/** A local device's old instance may still run legacy work until the computer restarts (8.5). */
|
|
442
447
|
readonly "device.restart_required": 503;
|
|
@@ -444,19 +449,19 @@ export declare const ERROR_CODES: {
|
|
|
444
449
|
readonly "device.replace_required": 503;
|
|
445
450
|
/** A cloud device's earlier instance may run legacy work no evidence can cover (8.5). */
|
|
446
451
|
readonly "device.recreate_required": 503;
|
|
447
|
-
readonly "device.owner_ceiling_confirmation_required": 409;
|
|
448
|
-
readonly "device.full_access_not_allowed": 409;
|
|
449
452
|
/**
|
|
450
|
-
* A device's
|
|
451
|
-
*
|
|
452
|
-
* choose.
|
|
453
|
+
* A cloud device's network above its org's or the platform's ceiling, a host outside its org's
|
|
454
|
+
* list, or a widening through an API token or the Platform tool (narrow only).
|
|
453
455
|
*/
|
|
454
|
-
readonly "device.
|
|
456
|
+
readonly "device.network_not_allowed": 400;
|
|
457
|
+
/** Running outside the sandbox where the device, its org, the platform or its provider forbids it. */
|
|
458
|
+
readonly "device.outside_sandbox_not_allowed": 409;
|
|
455
459
|
/**
|
|
456
|
-
* A
|
|
457
|
-
*
|
|
460
|
+
* A local device's sandbox settings live on its machine: the web narrows them with
|
|
461
|
+
* `POST /devices/:id/policy`, the owner widens them on the machine (`capybara-device ceiling set`,
|
|
462
|
+
* `capybara-device policy add allowedDomains`).
|
|
458
463
|
*/
|
|
459
|
-
readonly "device.
|
|
464
|
+
readonly "device.ceiling_on_machine": 409;
|
|
460
465
|
/**
|
|
461
466
|
* The device offers no projects (project root §4.1): its `capybara-device` does not announce
|
|
462
467
|
* `projects` (update it), or its cloud sandbox provider has no `list` / `scan`.
|
package/dist/errors.js
CHANGED
|
@@ -45,10 +45,15 @@ export const ERROR_CODES = {
|
|
|
45
45
|
"org.owner_required": 403,
|
|
46
46
|
"org.sandbox_egress_not_allowed": 400,
|
|
47
47
|
/**
|
|
48
|
-
* The org
|
|
49
|
-
* widened it through an API token or the Platform tool.
|
|
48
|
+
* The org allowed running outside the sandbox (`outsideSandbox: allowed`) where the platform
|
|
49
|
+
* turned it off, or widened it through an API token or the Platform tool.
|
|
50
50
|
*/
|
|
51
|
-
"org.
|
|
51
|
+
"org.outside_sandbox_not_allowed": 400,
|
|
52
|
+
/**
|
|
53
|
+
* The org's device network default or ceiling is above the platform's ceiling, or was opened
|
|
54
|
+
* through an API token or the Platform tool.
|
|
55
|
+
*/
|
|
56
|
+
"org.network_not_allowed": 400,
|
|
52
57
|
/** An org network allowance entry that is malformed, names a link-local address, or is over the cap. */
|
|
53
58
|
"org.network_allowance_invalid": 400,
|
|
54
59
|
"org.network_allowance_not_found": 404,
|
|
@@ -61,8 +66,13 @@ export const ERROR_CODES = {
|
|
|
61
66
|
"org.external_sharing_not_allowed": 400,
|
|
62
67
|
/** A deployment setting set in the startup config (file, Nacos or env): read-only in the admin console. */
|
|
63
68
|
"deployment.setting_readonly": 409,
|
|
64
|
-
/** Allowing
|
|
65
|
-
"deployment.
|
|
69
|
+
/** Allowing outside-sandbox runs platform-wide through an API token or the Platform tool (only off). */
|
|
70
|
+
"deployment.outside_sandbox_not_allowed": 400,
|
|
71
|
+
/**
|
|
72
|
+
* The platform's network default above its ceiling, or a default or ceiling opened through an API
|
|
73
|
+
* token or the Platform tool.
|
|
74
|
+
*/
|
|
75
|
+
"deployment.network_not_allowed": 400,
|
|
66
76
|
/** Allowing external sharing at the platform level through an API token or the Platform tool. */
|
|
67
77
|
"deployment.external_sharing_not_allowed": 400,
|
|
68
78
|
/**
|
|
@@ -432,11 +442,6 @@ export const ERROR_CODES = {
|
|
|
432
442
|
* is admitted until a lifecycle action (a file reset) establishes them.
|
|
433
443
|
*/
|
|
434
444
|
"device.permission_reconcile_required": 409,
|
|
435
|
-
/**
|
|
436
|
-
* B1: a cloud device's owner ceiling PATCH before its snapshot exists (not migrated yet); the old
|
|
437
|
-
* sandbox switch still narrows it. A file reset does not change this.
|
|
438
|
-
*/
|
|
439
|
-
"device.permission_not_migrated": 409,
|
|
440
445
|
"device.owner_report_stale": 409,
|
|
441
446
|
/** A local device's old instance may still run legacy work until the computer restarts (8.5). */
|
|
442
447
|
"device.restart_required": 503,
|
|
@@ -444,19 +449,19 @@ export const ERROR_CODES = {
|
|
|
444
449
|
"device.replace_required": 503,
|
|
445
450
|
/** A cloud device's earlier instance may run legacy work no evidence can cover (8.5). */
|
|
446
451
|
"device.recreate_required": 503,
|
|
447
|
-
"device.owner_ceiling_confirmation_required": 409,
|
|
448
|
-
"device.full_access_not_allowed": 409,
|
|
449
452
|
/**
|
|
450
|
-
* A device's
|
|
451
|
-
*
|
|
452
|
-
* choose.
|
|
453
|
+
* A cloud device's network above its org's or the platform's ceiling, a host outside its org's
|
|
454
|
+
* list, or a widening through an API token or the Platform tool (narrow only).
|
|
453
455
|
*/
|
|
454
|
-
"device.
|
|
456
|
+
"device.network_not_allowed": 400,
|
|
457
|
+
/** Running outside the sandbox where the device, its org, the platform or its provider forbids it. */
|
|
458
|
+
"device.outside_sandbox_not_allowed": 409,
|
|
455
459
|
/**
|
|
456
|
-
* A
|
|
457
|
-
*
|
|
460
|
+
* A local device's sandbox settings live on its machine: the web narrows them with
|
|
461
|
+
* `POST /devices/:id/policy`, the owner widens them on the machine (`capybara-device ceiling set`,
|
|
462
|
+
* `capybara-device policy add allowedDomains`).
|
|
458
463
|
*/
|
|
459
|
-
"device.
|
|
464
|
+
"device.ceiling_on_machine": 409,
|
|
460
465
|
/**
|
|
461
466
|
* The device offers no projects (project root §4.1): its `capybara-device` does not announce
|
|
462
467
|
* `projects` (update it), or its cloud sandbox provider has no `list` / `scan`.
|
|
@@ -17,7 +17,10 @@ import { type CaseSnapshot } from "./snapshot.js";
|
|
|
17
17
|
* whose effective definition differs from the one frozen in its `subagent_started` (see
|
|
18
18
|
* {@link subagentChanged}); the request still renders the logged definition and preamble. A child
|
|
19
19
|
* case never consults `definitions` (no `definition_missing`);
|
|
20
|
-
* - `
|
|
20
|
+
* - `device_sandbox_changed`: the rebuilt permission context's `sandbox` block differs from the one
|
|
21
|
+
* the recorded metadata names (see {@link recordedPermissionContextDrift});
|
|
22
|
+
* - `params_changed`: without candidate params, sanitizing the recorded params against the model's
|
|
23
|
+
* declarations dropped a key or changed a value (another model, or its declarations changed);
|
|
21
24
|
* - `media_missing`:某附件记录里不是「不再可用」,还原时却取不到;
|
|
22
25
|
* - `media_changed`(只在基线判定):其余任何媒体结果与记录不同(按附件 id 比 outcome 与 etag:预算省略、
|
|
23
26
|
* 图片数 / 页数上限、对象被替换后 etag 变了等);
|
|
@@ -30,7 +33,13 @@ export type DriftReason = "system_hash" | "tools_changed" | "tool_spec_missing"
|
|
|
30
33
|
/** A child case's candidate has another effective definition than the logged one (phase C). */
|
|
31
34
|
| "subagent_changed"
|
|
32
35
|
/** Original bounded permission contributions or their recorded locator/hash differ. */
|
|
33
|
-
| "permission_profile_changed"
|
|
36
|
+
| "permission_profile_changed"
|
|
37
|
+
/**
|
|
38
|
+
* Approval-only profiles: the snapshot rebuilds another device `sandbox` block for the request
|
|
39
|
+
* than the one its recorded metadata names (`permissionContext.sandbox`). An ordinary sandbox
|
|
40
|
+
* change between runs is recorded input: zero drift.
|
|
41
|
+
*/
|
|
42
|
+
| "device_sandbox_changed" | "params_changed"
|
|
34
43
|
/**
|
|
35
44
|
* UI refresh B: a non-baseline reconstruction whose run used a person's mid-conversation model
|
|
36
45
|
* switch (`model_switched`) and whose candidate model (`modelRef`) replaces it.
|
|
@@ -104,7 +113,7 @@ type ModelCallEvent = Extract<ConversationEvent, {
|
|
|
104
113
|
export declare function assertSnapshotPermissionEvents(events: readonly ConversationEvent[]): void;
|
|
105
114
|
/**
|
|
106
115
|
* Compare only the original request range, never live state or candidate-generated history.
|
|
107
|
-
* Throws `eval.snapshot_invalid` first when any recorded
|
|
116
|
+
* Throws `eval.snapshot_invalid` first when any recorded permission event in the snapshot
|
|
108
117
|
* (inside or outside the range, covered by a summary or not) fails its strict schema.
|
|
109
118
|
*/
|
|
110
119
|
export declare function recordedPermissionContextDrift(events: readonly ConversationEvent[], call: ModelCallEvent): DriftReason[];
|
|
@@ -40,6 +40,7 @@ const DRIFT_ORDER = [
|
|
|
40
40
|
"definition_missing",
|
|
41
41
|
"subagent_changed",
|
|
42
42
|
"permission_profile_changed",
|
|
43
|
+
"device_sandbox_changed",
|
|
43
44
|
"params_changed",
|
|
44
45
|
"model_switched",
|
|
45
46
|
"media_missing",
|
|
@@ -76,7 +77,7 @@ export function assertSnapshotPermissionEvents(events) {
|
|
|
76
77
|
}
|
|
77
78
|
/**
|
|
78
79
|
* Compare only the original request range, never live state or candidate-generated history.
|
|
79
|
-
* Throws `eval.snapshot_invalid` first when any recorded
|
|
80
|
+
* Throws `eval.snapshot_invalid` first when any recorded permission event in the snapshot
|
|
80
81
|
* (inside or outside the range, covered by a summary or not) fails its strict schema.
|
|
81
82
|
*/
|
|
82
83
|
export function recordedPermissionContextDrift(events, call) {
|
|
@@ -87,12 +88,15 @@ export function recordedPermissionContextDrift(events, call) {
|
|
|
87
88
|
if (recorded === undefined && rebuilt === undefined)
|
|
88
89
|
return [];
|
|
89
90
|
const parsed = PermissionContextMetaV1Schema.safeParse(recorded);
|
|
90
|
-
if (!parsed.success ||
|
|
91
|
-
rebuilt === undefined ||
|
|
92
|
-
parsed.data.contextSeq !== rebuilt.contextSeq ||
|
|
93
|
-
parsed.data.hash !== rebuilt.hash)
|
|
91
|
+
if (!parsed.success || rebuilt === undefined)
|
|
94
92
|
return ["permission_profile_changed"];
|
|
95
|
-
|
|
93
|
+
const drift = [];
|
|
94
|
+
if (parsed.data.contextSeq !== rebuilt.contextSeq || parsed.data.hash !== rebuilt.hash)
|
|
95
|
+
drift.push("permission_profile_changed");
|
|
96
|
+
// the sandbox block the request saw, against the one the snapshot rebuilds
|
|
97
|
+
if (parsed.data.sandbox !== rebuilt.sandbox)
|
|
98
|
+
drift.push("device_sandbox_changed");
|
|
99
|
+
return drift;
|
|
96
100
|
}
|
|
97
101
|
/** 该请求的 agent 版本:所属运行的 `run_started`;没有(不应出现)时用快照运行的版本。 */
|
|
98
102
|
function recordedVersion(s, events, call) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EventLog } from "../conversations/event-log.js";
|
|
2
2
|
import type { ConversationEvent } from "../conversations/events.js";
|
|
3
3
|
import type { PermissionContextPort } from "../runtime/model-call.js";
|
|
4
|
+
import { type DriftReason } from "./reconstruct.js";
|
|
4
5
|
import { type CaseSnapshot } from "./snapshot.js";
|
|
5
6
|
/**
|
|
6
7
|
* Recorded-only permission context for a full-run replay (permission context replay spec B4).
|
|
@@ -63,11 +64,12 @@ export interface ReplayTarget {
|
|
|
63
64
|
}
|
|
64
65
|
/**
|
|
65
66
|
* Recorded original-coordinate diagnostics over every original request of the replayed run (spec
|
|
66
|
-
* "Replay and meaningful drift detection"):
|
|
67
|
-
*
|
|
68
|
-
*
|
|
67
|
+
* "Replay and meaningful drift detection"): the reasons (`permission_profile_changed`,
|
|
68
|
+
* `device_sandbox_changed`) of every request that cannot reproduce its recorded permission
|
|
69
|
+
* metadata from its own bounded range, deduplicated. Throws `eval.snapshot_invalid` for a recorded
|
|
70
|
+
* event its strict schema rejects. Never compares generated seqs or hashes with the original.
|
|
69
71
|
*/
|
|
70
|
-
export declare function recordedRunPermissionDrift(s: CaseSnapshot):
|
|
72
|
+
export declare function recordedRunPermissionDrift(s: CaseSnapshot): DriftReason[];
|
|
71
73
|
/**
|
|
72
74
|
* The recorded-only feeder for the replay of `s` (spec B4) into `target`, or undefined for a
|
|
73
75
|
* recording without any v1 permission marker, so the request boundary stays absent and old
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiError } from "../errors.js";
|
|
2
|
-
import {
|
|
2
|
+
import { readRecordedPermissionContext } from "../runtime/context/permission-profile.js";
|
|
3
|
+
import { assertSnapshotPermissionEvents, recordedPermissionContextDrift, } from "./reconstruct.js";
|
|
3
4
|
import { toEvents } from "./snapshot.js";
|
|
4
5
|
const invalid = (message) => new ApiError("eval.snapshot_invalid", message);
|
|
5
6
|
/** Whether the recording holds any v1 permission marker (event, managed path or metadata). */
|
|
@@ -87,18 +88,22 @@ export function selectOriginalRequest(requests, step, attempt) {
|
|
|
87
88
|
export const replayPermissionContextIdemKey = (generatedRunId, originalSeq) => `replay_permission_context:${generatedRunId}:${originalSeq}`;
|
|
88
89
|
/**
|
|
89
90
|
* Recorded original-coordinate diagnostics over every original request of the replayed run (spec
|
|
90
|
-
* "Replay and meaningful drift detection"):
|
|
91
|
-
*
|
|
92
|
-
*
|
|
91
|
+
* "Replay and meaningful drift detection"): the reasons (`permission_profile_changed`,
|
|
92
|
+
* `device_sandbox_changed`) of every request that cannot reproduce its recorded permission
|
|
93
|
+
* metadata from its own bounded range, deduplicated. Throws `eval.snapshot_invalid` for a recorded
|
|
94
|
+
* event its strict schema rejects. Never compares generated seqs or hashes with the original.
|
|
93
95
|
*/
|
|
94
96
|
export function recordedRunPermissionDrift(s) {
|
|
95
97
|
const events = toEvents(s);
|
|
96
98
|
if (!hasPermissionMarkers(events))
|
|
97
|
-
return
|
|
99
|
+
return [];
|
|
98
100
|
assertSnapshotPermissionEvents(events);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
const drift = new Set();
|
|
102
|
+
for (const e of events)
|
|
103
|
+
if (e.type === "model_call" && e.runId === s.runId)
|
|
104
|
+
for (const reason of recordedPermissionContextDrift(events, e))
|
|
105
|
+
drift.add(reason);
|
|
106
|
+
return [...drift];
|
|
102
107
|
}
|
|
103
108
|
/**
|
|
104
109
|
* The recorded-only feeder for the replay of `s` (spec B4) into `target`, or undefined for a
|
|
@@ -139,7 +144,8 @@ export function recordedPermissionContext(s, eventLog, target) {
|
|
|
139
144
|
type: "permission_context",
|
|
140
145
|
runId: target.runId,
|
|
141
146
|
idemKey: replayPermissionContextIdemKey(target.runId, c.seq),
|
|
142
|
-
|
|
147
|
+
// the eval log is new: a stored v1 context is written as its v2 form (same text)
|
|
148
|
+
payload: readRecordedPermissionContext(c.payload),
|
|
143
149
|
})));
|
|
144
150
|
for (const [i, c] of due.entries()) {
|
|
145
151
|
const w = written[i];
|
|
@@ -48,9 +48,14 @@ export interface RunReplayResult {
|
|
|
48
48
|
* reports `permission_profile_changed`.
|
|
49
49
|
*/
|
|
50
50
|
permissionContextDrift?: true;
|
|
51
|
+
/**
|
|
52
|
+
* Set when an original request of the run rebuilds another device sandbox block than its
|
|
53
|
+
* recorded metadata names; the result reports `device_sandbox_changed`.
|
|
54
|
+
*/
|
|
55
|
+
deviceSandboxDrift?: true;
|
|
51
56
|
}
|
|
52
57
|
/** 原运行(基线)的同形摘要。 */
|
|
53
|
-
export type RunBaseline = Omit<RunReplayResult, "conversationId" | "outcome" | "unmatched" | "permissionContextDrift">;
|
|
58
|
+
export type RunBaseline = Omit<RunReplayResult, "conversationId" | "outcome" | "unmatched" | "permissionContextDrift" | "deviceSandboxDrift">;
|
|
54
59
|
/** 测试钩子。 */
|
|
55
60
|
export interface EvalReplayHooks {
|
|
56
61
|
/** 种子已写入(评测对话已记到结果上)、loop 开始之前调用:抛错即模拟此时崩溃。 */
|
package/dist/evals/run-replay.js
CHANGED
|
@@ -375,7 +375,7 @@ export async function replayRun(d, s, candidate, evalRunId, signal) {
|
|
|
375
375
|
// recorded permission context (spec B4), both before anything is seeded so an invalid recording
|
|
376
376
|
// fails as `eval.snapshot_invalid` without an eval conversation: the original-coordinate
|
|
377
377
|
// diagnostics, and the recorded-only feeder (undefined for a recording without markers)
|
|
378
|
-
const
|
|
378
|
+
const permissionDrift = recordedRunPermissionDrift(s);
|
|
379
379
|
const permissionContext = recordedPermissionContext(s, eventLog, { conversationId, runId });
|
|
380
380
|
// the recorded tool results (reviews validated here) are read before the seed too, so an
|
|
381
381
|
// invalid recording leaves no eval conversation either
|
|
@@ -677,6 +677,11 @@ export async function replayRun(d, s, candidate, evalRunId, signal) {
|
|
|
677
677
|
outcome: outcome.kind,
|
|
678
678
|
...summary,
|
|
679
679
|
unmatched: pipeline.unmatched(),
|
|
680
|
-
...(
|
|
680
|
+
...(permissionDrift.includes("permission_profile_changed") && {
|
|
681
|
+
permissionContextDrift: true,
|
|
682
|
+
}),
|
|
683
|
+
...(permissionDrift.includes("device_sandbox_changed") && {
|
|
684
|
+
deviceSandboxDrift: true,
|
|
685
|
+
}),
|
|
681
686
|
};
|
|
682
687
|
}
|
package/dist/evals/worker.js
CHANGED
|
@@ -692,11 +692,13 @@ let EvalWorker = class EvalWorker {
|
|
|
692
692
|
return;
|
|
693
693
|
const baseline = runBaseline(s);
|
|
694
694
|
// in DRIFT_ORDER: subagent_changed, permission_profile_changed (a recorded permission
|
|
695
|
-
// context the snapshot cannot reproduce),
|
|
695
|
+
// context the snapshot cannot reproduce), device_sandbox_changed (another rebuilt device
|
|
696
|
+
// sandbox block than the recorded one), model_switched (the candidate replaced the person's
|
|
696
697
|
// switch), then tool_unmatched
|
|
697
698
|
const drift = [
|
|
698
699
|
...(subagentCaseChanged(s, resolved) ? ["subagent_changed"] : []),
|
|
699
700
|
...(out.permissionContextDrift ? ["permission_profile_changed"] : []),
|
|
701
|
+
...(out.deviceSandboxDrift ? ["device_sandbox_changed"] : []),
|
|
700
702
|
...(resolved.overridesSwitch ? ["model_switched"] : []),
|
|
701
703
|
...(out.unmatched > 0 ? ["tool_unmatched"] : []),
|
|
702
704
|
];
|