@intentic/sandbox-contract 1.423.0 → 1.425.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.
Files changed (224) hide show
  1. package/dist/contracts/access-profiles.contract.d.ts +7 -3
  2. package/dist/contracts/access-profiles.contract.d.ts.map +1 -1
  3. package/dist/contracts/agent.contract.d.ts +51 -10
  4. package/dist/contracts/agent.contract.d.ts.map +1 -1
  5. package/dist/contracts/agent.contract.js +1 -1
  6. package/dist/contracts/agent.contract.js.map +1 -1
  7. package/dist/contracts/agents.contract.d.ts +13 -5
  8. package/dist/contracts/agents.contract.d.ts.map +1 -1
  9. package/dist/contracts/agents.contract.js +1 -1
  10. package/dist/contracts/agents.contract.js.map +1 -1
  11. package/dist/contracts/approvals.contract.d.ts +1 -1
  12. package/dist/contracts/needs.contract.d.ts +41 -26
  13. package/dist/contracts/needs.contract.d.ts.map +1 -1
  14. package/dist/contracts/needs.contract.js +2 -2
  15. package/dist/contracts/needs.contract.js.map +1 -1
  16. package/dist/contracts/org.contract.d.ts +3 -0
  17. package/dist/contracts/org.contract.d.ts.map +1 -1
  18. package/dist/contracts/{personas.contract.d.ts → roles.contract.d.ts} +3 -39
  19. package/dist/contracts/roles.contract.d.ts.map +1 -0
  20. package/dist/contracts/roles.contract.js +78 -0
  21. package/dist/contracts/roles.contract.js.map +1 -0
  22. package/dist/contracts/runner.contract.d.ts +276 -252
  23. package/dist/contracts/runner.contract.d.ts.map +1 -1
  24. package/dist/contracts/seal.contract.d.ts +1 -25
  25. package/dist/contracts/seal.contract.d.ts.map +1 -1
  26. package/dist/contracts/seal.contract.js +3 -14
  27. package/dist/contracts/seal.contract.js.map +1 -1
  28. package/dist/contracts/sessions.contract.d.ts +5 -1
  29. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  30. package/dist/contracts/settings.contract.d.ts +2 -2
  31. package/dist/contracts/skills.contract.d.ts +3 -3
  32. package/dist/contracts/skills.contract.js +1 -1
  33. package/dist/contracts/skills.contract.js.map +1 -1
  34. package/dist/contracts/system.contract.d.ts +11 -16
  35. package/dist/contracts/system.contract.d.ts.map +1 -1
  36. package/dist/events/agent-events.d.ts +20 -4
  37. package/dist/events/agent-events.d.ts.map +1 -1
  38. package/dist/events/agent-transcript.d.ts +5 -1
  39. package/dist/events/agent-transcript.d.ts.map +1 -1
  40. package/dist/events/system-events.d.ts +7 -7
  41. package/dist/events/system-events.d.ts.map +1 -1
  42. package/dist/events/system-events.js +3 -3
  43. package/dist/events/system-events.js.map +1 -1
  44. package/dist/events/transcript.d.ts +25 -5
  45. package/dist/events/transcript.d.ts.map +1 -1
  46. package/dist/index.d.ts +2 -2
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +2 -2
  49. package/dist/index.js.map +1 -1
  50. package/dist/models/model-roles.d.ts +1 -1
  51. package/dist/models/model-roles.d.ts.map +1 -1
  52. package/dist/models/model-roles.js +1 -1
  53. package/dist/models/model-roles.js.map +1 -1
  54. package/dist/policy/org-locks.d.ts +1 -1
  55. package/dist/policy/org-locks.d.ts.map +1 -1
  56. package/dist/policy/org-locks.js +1 -1
  57. package/dist/policy/org-locks.js.map +1 -1
  58. package/dist/policy/role-capability.d.ts +7 -0
  59. package/dist/policy/role-capability.d.ts.map +1 -0
  60. package/dist/policy/role-capability.js +3 -0
  61. package/dist/policy/role-capability.js.map +1 -0
  62. package/dist/policy/role-home.d.ts +9 -0
  63. package/dist/policy/role-home.d.ts.map +1 -0
  64. package/dist/policy/role-home.js +7 -0
  65. package/dist/policy/role-home.js.map +1 -0
  66. package/dist/protocol/member-reach.d.ts +4 -4
  67. package/dist/protocol/member-reach.js +3 -3
  68. package/dist/protocol/raw/raw-json-routes.d.ts +29 -23
  69. package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
  70. package/dist/protocol/route-meta.d.ts +4 -4
  71. package/dist/schemas/access-profiles.d.ts +10 -4
  72. package/dist/schemas/access-profiles.d.ts.map +1 -1
  73. package/dist/schemas/access-profiles.js +9 -4
  74. package/dist/schemas/access-profiles.js.map +1 -1
  75. package/dist/schemas/agent.js +3 -3
  76. package/dist/schemas/agent.js.map +1 -1
  77. package/dist/schemas/agents.js +2 -2
  78. package/dist/schemas/agents.js.map +1 -1
  79. package/dist/schemas/approvals.d.ts +3 -3
  80. package/dist/schemas/approvals.js +3 -3
  81. package/dist/schemas/approvals.js.map +1 -1
  82. package/dist/schemas/automations.js +6 -6
  83. package/dist/schemas/automations.js.map +1 -1
  84. package/dist/schemas/chat-route.d.ts +7 -2
  85. package/dist/schemas/chat-route.d.ts.map +1 -1
  86. package/dist/schemas/chat-route.js +11 -6
  87. package/dist/schemas/chat-route.js.map +1 -1
  88. package/dist/schemas/context-trim.js +1 -1
  89. package/dist/schemas/context-trim.js.map +1 -1
  90. package/dist/schemas/diagnostics.d.ts +3 -3
  91. package/dist/schemas/git/git.js +1 -1
  92. package/dist/schemas/git/git.js.map +1 -1
  93. package/dist/schemas/links.d.ts +1 -1
  94. package/dist/schemas/links.js +4 -4
  95. package/dist/schemas/links.js.map +1 -1
  96. package/dist/schemas/loops.js +1 -1
  97. package/dist/schemas/loops.js.map +1 -1
  98. package/dist/schemas/members.d.ts +162 -20
  99. package/dist/schemas/members.d.ts.map +1 -1
  100. package/dist/schemas/members.js +19 -16
  101. package/dist/schemas/members.js.map +1 -1
  102. package/dist/schemas/needs.d.ts +37 -42
  103. package/dist/schemas/needs.d.ts.map +1 -1
  104. package/dist/schemas/needs.js +18 -16
  105. package/dist/schemas/needs.js.map +1 -1
  106. package/dist/schemas/organisation.d.ts +10 -0
  107. package/dist/schemas/organisation.d.ts.map +1 -1
  108. package/dist/schemas/organisation.js.map +1 -1
  109. package/dist/schemas/{personas.d.ts → roles.d.ts} +37 -72
  110. package/dist/schemas/roles.d.ts.map +1 -0
  111. package/dist/schemas/{personas.js → roles.js} +45 -67
  112. package/dist/schemas/roles.js.map +1 -0
  113. package/dist/schemas/seal.d.ts +2 -21
  114. package/dist/schemas/seal.d.ts.map +1 -1
  115. package/dist/schemas/seal.js +1 -16
  116. package/dist/schemas/seal.js.map +1 -1
  117. package/dist/schemas/settings-history.d.ts +1 -1
  118. package/dist/schemas/settings-history.d.ts.map +1 -1
  119. package/dist/schemas/settings-history.js +2 -1
  120. package/dist/schemas/settings-history.js.map +1 -1
  121. package/dist/schemas/settings.d.ts +11 -11
  122. package/dist/schemas/settings.d.ts.map +1 -1
  123. package/dist/schemas/settings.js +3 -3
  124. package/dist/schemas/settings.js.map +1 -1
  125. package/dist/schemas/shared.d.ts +6 -5
  126. package/dist/schemas/shared.d.ts.map +1 -1
  127. package/dist/schemas/shared.js +14 -5
  128. package/dist/schemas/shared.js.map +1 -1
  129. package/dist/schemas/system-prompt.d.ts +12 -12
  130. package/dist/schemas/system-prompt.d.ts.map +1 -1
  131. package/dist/schemas/system-prompt.js +1 -1
  132. package/dist/schemas/system-prompt.js.map +1 -1
  133. package/dist/schemas/terminal.d.ts +18 -0
  134. package/dist/schemas/terminal.d.ts.map +1 -1
  135. package/dist/schemas/terminal.js +16 -1
  136. package/dist/schemas/terminal.js.map +1 -1
  137. package/dist/schemas/tool-ceiling.d.ts +4 -2
  138. package/dist/schemas/tool-ceiling.d.ts.map +1 -1
  139. package/dist/schemas/tool-ceiling.js +29 -3
  140. package/dist/schemas/tool-ceiling.js.map +1 -1
  141. package/dist/schemas/workflows.js +1 -1
  142. package/dist/schemas/workflows.js.map +1 -1
  143. package/dist/state/definition.d.ts +4 -4
  144. package/dist/state/workspace-state.d.ts +4 -4
  145. package/dist/state/workspace-state.d.ts.map +1 -1
  146. package/dist/state/workspace-state.js +2 -2
  147. package/dist/state/workspace-state.js.map +1 -1
  148. package/package.json +5 -5
  149. package/src/contracts/agent.contract.ts +2 -2
  150. package/src/contracts/agents.contract.ts +1 -1
  151. package/src/contracts/automations.contract.ts +1 -1
  152. package/src/contracts/logs.contract.ts +1 -1
  153. package/src/contracts/needs.contract.ts +2 -2
  154. package/src/contracts/roles.contract.ts +108 -0
  155. package/src/contracts/seal.contract.ts +3 -18
  156. package/src/contracts/skills.contract.ts +2 -2
  157. package/src/events/system-events.ts +5 -4
  158. package/src/index.ts +3 -3
  159. package/src/models/agent-runtimes.ts +8 -8
  160. package/src/models/model-roles.ts +3 -3
  161. package/src/policy/control-scopes.ts +1 -1
  162. package/src/policy/fence-paths.ts +2 -2
  163. package/src/policy/org-locks.ts +2 -1
  164. package/src/policy/role-capability.ts +29 -0
  165. package/src/policy/role-home.ts +29 -0
  166. package/src/policy/tests/fence-paths.test.ts +1 -1
  167. package/src/policy/tests/role-home.test.ts +40 -0
  168. package/src/protocol/member-reach.test.ts +17 -17
  169. package/src/protocol/member-reach.ts +7 -7
  170. package/src/protocol/route-meta.ts +6 -6
  171. package/src/schemas/access-profiles.ts +20 -9
  172. package/src/schemas/agent.ts +4 -4
  173. package/src/schemas/agents.ts +2 -2
  174. package/src/schemas/approvals.ts +3 -3
  175. package/src/schemas/automations.ts +14 -14
  176. package/src/schemas/capabilities.ts +1 -1
  177. package/src/schemas/chat-route.ts +18 -9
  178. package/src/schemas/context-trim.ts +1 -1
  179. package/src/schemas/diagnostics.ts +1 -1
  180. package/src/schemas/git/git.ts +1 -1
  181. package/src/schemas/internal.ts +1 -1
  182. package/src/schemas/links.ts +7 -7
  183. package/src/schemas/loops.ts +1 -1
  184. package/src/schemas/members.test.ts +31 -31
  185. package/src/schemas/members.ts +37 -29
  186. package/src/schemas/needs.ts +35 -22
  187. package/src/schemas/organisation.ts +2 -0
  188. package/src/schemas/{personas.ts → roles.ts} +83 -113
  189. package/src/schemas/seal.ts +5 -30
  190. package/src/schemas/settings-history.ts +3 -1
  191. package/src/schemas/settings.ts +10 -6
  192. package/src/schemas/shared.ts +24 -10
  193. package/src/schemas/state-plan.test.ts +3 -3
  194. package/src/schemas/system-prompt.ts +2 -1
  195. package/src/schemas/terminal.ts +18 -1
  196. package/src/schemas/tool-ceiling.test.ts +14 -8
  197. package/src/schemas/tool-ceiling.ts +42 -11
  198. package/src/schemas/workflows.ts +1 -1
  199. package/src/state/auth-state.ts +1 -1
  200. package/src/state/definition.ts +1 -1
  201. package/src/state/workspace-state.test.ts +5 -5
  202. package/src/state/workspace-state.ts +11 -11
  203. package/dist/contracts/personas.contract.d.ts.map +0 -1
  204. package/dist/contracts/personas.contract.js +0 -78
  205. package/dist/contracts/personas.contract.js.map +0 -1
  206. package/dist/policy/persona-capability.d.ts +0 -14
  207. package/dist/policy/persona-capability.d.ts.map +0 -1
  208. package/dist/policy/persona-capability.js +0 -24
  209. package/dist/policy/persona-capability.js.map +0 -1
  210. package/dist/policy/persona-home.d.ts +0 -10
  211. package/dist/policy/persona-home.d.ts.map +0 -1
  212. package/dist/policy/persona-home.js +0 -11
  213. package/dist/policy/persona-home.js.map +0 -1
  214. package/dist/schemas/personas.d.ts.map +0 -1
  215. package/dist/schemas/personas.js.map +0 -1
  216. package/dist/schemas/seal-proof.d.ts +0 -20
  217. package/dist/schemas/seal-proof.d.ts.map +0 -1
  218. package/dist/schemas/seal-proof.js +0 -8
  219. package/dist/schemas/seal-proof.js.map +0 -1
  220. package/src/contracts/personas.contract.ts +0 -106
  221. package/src/policy/persona-capability.ts +0 -64
  222. package/src/policy/persona-home.ts +0 -39
  223. package/src/policy/tests/persona-home.test.ts +0 -51
  224. package/src/schemas/seal-proof.ts +0 -12
@@ -13,7 +13,7 @@ export interface ControlScopeReach {
13
13
  readonly note: string;
14
14
  }
15
15
 
16
- // Derived in the daemon from the same role floors a member holds (read=viewer, drive=collaborator).
16
+ // Derived in the daemon from the same tier floors a member holds (read=viewer, drive=collaborator).
17
17
  export const CONTROL_SCOPE_REACH: readonly ControlScopeReach[] = [
18
18
  {
19
19
  scope: "editor",
@@ -39,7 +39,7 @@ export const pathInsideFolder = (folder: string, path: string): boolean => {
39
39
  };
40
40
 
41
41
  // "Change the sandbox" as paths: the daemon's own configuration, and the outbox the internet reads. One list, read by
42
- // the persona hook that judges a turn's writes and by the area schema that decides what a grant may name.
42
+ // the role hook that judges a turn's writes and by the area schema that decides what a grant may name.
43
43
  export const SANDBOX_PATHS: readonly string[] = [STATE_DIR, PUBLIC_DIR];
44
44
 
45
45
  // Whether a path is one of those folders or sits inside one, by segment: `publications` is not `public`.
@@ -82,7 +82,7 @@ export const fenceCovers = (outer: Fence, inner: Fence): boolean => {
82
82
  };
83
83
 
84
84
  /**
85
- * The tighter of two fences: what a turn may touch when a persona's folders meet the member's own. Undefined on both
85
+ * The tighter of two fences: what a turn may touch when a role's folders meet the member's own. Undefined on both
86
86
  * sides is the whole workspace; either side alone narrows to itself.
87
87
  */
88
88
  export const fenceIntersection = (left: Fence, right: Fence): Fence => {
@@ -93,7 +93,8 @@ export const ORG_SECTION_ROUTES = {
93
93
  ],
94
94
  },
95
95
  areas: { changes: ["areas.save", "areas.remove"] },
96
- personas: { changes: ["personas.save", "personas.remove", "personas.savePrompt", "personas.saveSkill", "personas.removeSkill"] },
96
+ // The Roles section, under the id it had as Personas (organisation.ts ORG_SECTIONS).
97
+ personas: { changes: ["roles.save", "roles.remove", "roles.savePrompt", "roles.saveSkill", "roles.removeSkill"] },
97
98
  updates: { changes: ["system.autoUpdate", "system.skipUpdate"] },
98
99
  } as const satisfies Readonly<Record<OrgSection, SectionRoutes>>;
99
100
 
@@ -0,0 +1,29 @@
1
+ // WHETHER A ROLE LETS A TURN ACT THROUGH ONE CONNECTED CAPABILITY. Pure and shared, because the daemon mounts a turn's
2
+ // tools on this answer (roles/roles.ts `turnRole`) and the Sandbox ▸ Map view draws who reaches what from it,
3
+ // and two implementations would disagree at exactly the boundary that matters.
4
+ // A card decides one thing about reach: which signed-in accounts it speaks through. Every other limit on a conversation
5
+ // wearing it (connectors, devices, servers, shelves, folders) is an access profile that lists the card
6
+ // (schemas/access-profiles.ts `roles`), held in the principal chain like a person's or a service's.
7
+
8
+ // The two fields of a connection the rule reads; structural, so neither side has to hand over its own record type.
9
+ export interface CapabilityRef {
10
+ readonly id: string;
11
+ readonly kind: string;
12
+ }
13
+
14
+ /**
15
+ * The kinds that are someone signed in: a site account, the identity whose browser holds every account born of it, and
16
+ * the owner's own browser (its extension), which holds every session they have. The last one was missing until
17
+ * 2026-10-25, and it fell through to "passes untouched": an X-only role's unattended run reached the owner's Brave,
18
+ * and an unpinned wake that lost every sandbox account kept it.
19
+ */
20
+ export const isSignedInAccount = (kind: string): boolean => kind === "browser" || kind === "identity" || kind === "webext";
21
+
22
+ /**
23
+ * Whether a role speaking through these accounts (its `capabilities`) may act through a capability. Granting an
24
+ * account (`reddit-work`) grants its hands; granting the identity itself grants the someone. The owner's own browser is
25
+ * named the same way: a role reaches it only when its list says so. Every other kind passes here and is decided by
26
+ * access.
27
+ */
28
+ export const roleAllowsCapability = (capability: CapabilityRef, accounts: readonly string[]): boolean =>
29
+ !isSignedInAccount(capability.kind) || accounts.includes(capability.id);
@@ -0,0 +1,29 @@
1
+ import { type Fence, fenceCovers } from "./fence-paths.js";
2
+
3
+ // Where a role card LIVES, and therefore who may act through it. A card is not granted per person any more: a
4
+ // person holds areas, an area is folders, and a card whose home those folders cover is one that person may wear.
5
+ // Pure and shared, because the daemon refuses on this answer and the Access tab draws the consequence from it, and
6
+ // two implementations would disagree at exactly the boundary that matters.
7
+
8
+ // The field a card names a place with; structural rather than the Role type, so this stays free of the schema
9
+ // layer that imports it.
10
+ export interface RolePlace {
11
+ readonly workspace?: { readonly startIn?: string | undefined } | undefined;
12
+ }
13
+
14
+ /**
15
+ * The card's home as a fence: the folder it opens in, else undefined, the workspace root, which only somebody holding
16
+ * the whole workspace covers. Where a conversation OPENS is the one place the card certainly works. (Until 2026-11-18 a
17
+ * card with no `startIn` was homed in its own folder list; those folders are a profile's areas now, and the step that
18
+ * moved them gave a card with a single folder that folder as its `startIn`.)
19
+ */
20
+ export const roleHome = (card: RolePlace): Fence => {
21
+ const startIn = card.workspace?.startIn;
22
+ return startIn !== undefined && startIn !== "" ? [startIn] : undefined;
23
+ };
24
+
25
+ /**
26
+ * Whether a person fenced to these folders may act through this card. An unfenced holder reaches every card; a fenced
27
+ * one reaches those homed inside its folders, and never a card that lives at the workspace root.
28
+ */
29
+ export const fenceHoldsRole = (fence: Fence, card: RolePlace): boolean => fenceCovers(fence, roleHome(card));
@@ -96,7 +96,7 @@ describe("fenceIntersection", () => {
96
96
  expect(fenceIntersection(undefined, undefined)).toBeUndefined();
97
97
  });
98
98
 
99
- // The narrower of the pair survives, whichever side it came from, so a persona asking for more than its starter
99
+ // The narrower of the pair survives, whichever side it came from, so a role asking for more than its starter
100
100
  // holds gets the starter's answer.
101
101
  test("the tighter folder is what survives, from whichever side", () => {
102
102
  expect(fenceIntersection(["apps"], ["apps/web"])).toEqual(["apps/web"]);
@@ -0,0 +1,40 @@
1
+ import { fenceHoldsRole, roleHome } from "../role-home.js";
2
+
3
+ // Where a card lives, and therefore who may wear it. This is the whole of the rule the Access tab draws and the
4
+ // daemon refuses on, so both shapes a card can name a place in are each pinned here.
5
+
6
+ describe("roleHome", () => {
7
+ test("the folder it opens in is its home", () => {
8
+ expect(roleHome({ workspace: { startIn: "support" } })).toEqual(["support"]);
9
+ });
10
+
11
+ test("naming no place at all is the workspace root, which is not a folder any fence can hold", () => {
12
+ expect(roleHome({})).toBeUndefined();
13
+ expect(roleHome({ workspace: {} })).toBeUndefined();
14
+ expect(roleHome({ workspace: { startIn: "" } })).toBeUndefined();
15
+ });
16
+ });
17
+
18
+ describe("fenceHoldsRole", () => {
19
+ const support = { workspace: { startIn: "support/inbox" } };
20
+ const finance = { workspace: { startIn: "finance" } };
21
+
22
+ test("an unfenced holder wears every card, root-homed ones included", () => {
23
+ expect(fenceHoldsRole(undefined, support)).toBe(true);
24
+ expect(fenceHoldsRole(undefined, {})).toBe(true);
25
+ });
26
+
27
+ test("a fenced holder wears the cards homed inside its folders and no others", () => {
28
+ expect(fenceHoldsRole(["support"], support)).toBe(true);
29
+ expect(fenceHoldsRole(["support"], finance)).toBe(false);
30
+ // By segment, not by string prefix: `support2` is not inside `support`.
31
+ expect(fenceHoldsRole(["support"], { workspace: { startIn: "support2" } })).toBe(false);
32
+ });
33
+
34
+ // The one card no fence can reach, whatever it names: everything is inside the root, so holding it would be
35
+ // holding the workspace.
36
+ test("a card homed at the root is the owner's alone", () => {
37
+ expect(fenceHoldsRole(["support"], {})).toBe(false);
38
+ expect(fenceHoldsRole([], {})).toBe(false);
39
+ });
40
+ });
@@ -94,7 +94,7 @@ describe("routeFloor", () => {
94
94
  });
95
95
 
96
96
  describe("memberRefusal for a person given part of the sandbox", () => {
97
- const collaborator = { role: "collaborator" as const, agents: "run" as const };
97
+ const collaborator = { tier: "collaborator" as const, agents: "run" as const };
98
98
 
99
99
  test("People & access opens the roster, its requests, areas, profiles and the preview guard, and nothing else", () => {
100
100
  const people = { ...collaborator, manages: ["people" as const] };
@@ -139,7 +139,7 @@ describe("memberRefusal for a person given part of the sandbox", () => {
139
139
  });
140
140
 
141
141
  test("Full access reaches what the owner ran alone before, short of the owner's own door", () => {
142
- const maintainer = { role: "maintainer" as const };
142
+ const maintainer = { tier: "maintainer" as const };
143
143
  expect(memberRefusal(maintainer, "GET", "/members")).toBeUndefined();
144
144
  expect(memberRefusal(maintainer, "POST", "/privacy/reveal")).toBeUndefined();
145
145
  expect(memberRefusal(maintainer, "POST", "/settings/agent-domain")).toBeUndefined();
@@ -196,33 +196,33 @@ describe("guestReach", () => {
196
196
 
197
197
  describe("memberRefusal", () => {
198
198
  test("a tier below the floor is refused with the floor named; a guest off its list with its own sentence", () => {
199
- expect(memberRefusal({ role: "viewer" }, "POST", "/agent")).toEqual({ error: "collaborator access required", floor: "collaborator", reason: "floor" });
200
- expect(memberRefusal({ role: "collaborator" }, "POST", "/agent")).toBeUndefined();
201
- expect(memberRefusal({ role: "guest", areas: ["support"] }, "POST", "/agent")).toBeUndefined();
202
- expect(memberRefusal({ role: "guest", areas: ["support"] }, "POST", "/workspace/move")).toEqual({
199
+ expect(memberRefusal({ tier: "viewer" }, "POST", "/agent")).toEqual({ error: "collaborator access required", floor: "collaborator", reason: "floor" });
200
+ expect(memberRefusal({ tier: "collaborator" }, "POST", "/agent")).toBeUndefined();
201
+ expect(memberRefusal({ tier: "guest", areas: ["support"] }, "POST", "/agent")).toBeUndefined();
202
+ expect(memberRefusal({ tier: "guest", areas: ["support"] }, "POST", "/workspace/move")).toEqual({
203
203
  error: "not open to a guest member",
204
204
  floor: "viewer",
205
205
  reason: "guest",
206
206
  });
207
207
  // A guest never clears a floor by rank: the list is the whole of its admission.
208
- expect(memberRefusal({ role: "guest", areas: ["support"] }, "GET", "/no/such/route")).toEqual({
208
+ expect(memberRefusal({ tier: "guest", areas: ["support"] }, "GET", "/no/such/route")).toEqual({
209
209
  error: "not open to a guest member",
210
210
  floor: "viewer",
211
211
  reason: "guest",
212
212
  });
213
- expect(memberRefusal({ role: "viewer" }, "GET", "/no/such/route")).toBeUndefined();
213
+ expect(memberRefusal({ tier: "viewer" }, "GET", "/no/such/route")).toBeUndefined();
214
214
  });
215
215
 
216
216
  test("a writer clears the file routes and nothing that ships or operates", () => {
217
- expect(memberRefusal({ role: "writer", areas: ["support"] }, "POST", "/workspace/move")).toBeUndefined();
218
- expect(memberRefusal({ role: "writer", areas: ["support"] }, "POST", "/workspace/upload", "support/note.md")).toBeUndefined();
219
- expect(memberRefusal({ role: "collaborator" }, "POST", "/workspace/move")).toEqual({ error: "writer access required", floor: "writer", reason: "floor" });
220
- expect(memberRefusal({ role: "writer", areas: ["support"] }, "POST", "/agents/abc/land")).toEqual({
217
+ expect(memberRefusal({ tier: "writer", areas: ["support"] }, "POST", "/workspace/move")).toBeUndefined();
218
+ expect(memberRefusal({ tier: "writer", areas: ["support"] }, "POST", "/workspace/upload", "support/note.md")).toBeUndefined();
219
+ expect(memberRefusal({ tier: "collaborator" }, "POST", "/workspace/move")).toEqual({ error: "writer access required", floor: "writer", reason: "floor" });
220
+ expect(memberRefusal({ tier: "writer", areas: ["support"] }, "POST", "/agents/abc/land")).toEqual({
221
221
  error: "maintainer access required",
222
222
  floor: "maintainer",
223
223
  reason: "floor",
224
224
  });
225
- expect(memberRefusal({ role: "writer", areas: ["support"] }, "GET", "/secrets")).toEqual({
225
+ expect(memberRefusal({ tier: "writer", areas: ["support"] }, "GET", "/secrets")).toEqual({
226
226
  error: "maintainer access required",
227
227
  floor: "maintainer",
228
228
  reason: "floor",
@@ -234,19 +234,19 @@ describe("memberRefusal", () => {
234
234
  // which clears the collaborator floor by rank, and is kept off it by their own answer.
235
235
  describe("memberRefusal for a person with agents off", () => {
236
236
  test("refuses every agent door and keeps the file doors open", () => {
237
- const editor = { role: "writer" as const, agents: "off" as const };
237
+ const editor = { tier: "writer" as const, agents: "off" as const };
238
238
  expect(memberRefusal(editor, "POST", "/agent")).toEqual({ error: "running agents is not on for you here", floor: "collaborator", reason: "agents-off" });
239
239
  expect(memberRefusal(editor, "POST", "/agents/abc/request-land")).toMatchObject({ floor: "collaborator" });
240
240
  expect(memberRefusal(editor, "POST", "/workspace/dir")).toBeUndefined();
241
241
  expect(memberRefusal(editor, "GET", "/workspace/tree")).toBeUndefined();
242
- expect(memberRefusal({ role: "writer", agents: "run" }, "POST", "/agent")).toBeUndefined();
242
+ expect(memberRefusal({ tier: "writer", agents: "run" }, "POST", "/agent")).toBeUndefined();
243
243
  });
244
244
  });
245
245
 
246
246
  // A home-only member is a guest whose one conversation is its home (conversations/home/home-conversation.ts): the guest
247
247
  // list, and the land press when its home lands by itself, which the route then admits on that home alone.
248
248
  describe("a home-only member", () => {
249
- const homeOnly = { role: "guest", agents: "home" } as const;
249
+ const homeOnly = { tier: "guest", agents: "home" } as const;
250
250
 
251
251
  test("reaches what a guest reaches, and the land press only when its work lands by itself", () => {
252
252
  expect(memberRefusal(homeOnly, "POST", "/agent")).toBeUndefined();
@@ -268,7 +268,7 @@ describe("a home-only member", () => {
268
268
  });
269
269
 
270
270
  test("a chatting guest granted nothing of the kind does not reach the land press", () => {
271
- expect(memberRefusal({ role: "guest", agents: "chat", lands: true }, "POST", "/agents/abc/land")).toEqual({
271
+ expect(memberRefusal({ tier: "guest", agents: "chat", lands: true }, "POST", "/agents/abc/land")).toEqual({
272
272
  error: "not open to a guest member",
273
273
  floor: "viewer",
274
274
  reason: "guest",
@@ -1,11 +1,11 @@
1
1
  import type { AgentAccess, ManageRight } from "../schemas/members.js";
2
- import { type MemberRole, roleAtLeast } from "../schemas/shared.js";
2
+ import { type MemberTier, tierAtLeast } from "../schemas/shared.js";
3
3
  import { defaultFloor } from "./route-meta.js";
4
4
  import { isAttachmentPath } from "../state/workspace-state.js";
5
5
  import { sandboxRouteFor } from "../index.js";
6
6
 
7
7
  // Role floors: the minimum trust tier each route demands, read from the route's own RouteMeta (route-meta.ts). One
8
- // function for both sides: the daemon's bearer middleware refuses with it right after the caller's role resolves, and
8
+ // function for both sides: the daemon's bearer middleware refuses with it right after the caller's tier resolves, and
9
9
  // the editor asks it before sending, so a request the daemon would refuse is never sent and the two cannot disagree.
10
10
  // A floor, not the whole answer: operating routes still keep their own in-route gates (members.ts `holdsRight`,
11
11
  // `peopleChangeRefusal`). A route that runs one part of the sandbox names it (`right`), and a person given that part
@@ -22,7 +22,7 @@ export type MemberRefusalReason = "floor" | "agents-off" | "guest";
22
22
  // The body of that refusal, as the daemon sends it and as the editor predicts it before sending.
23
23
  export interface MemberRefusal {
24
24
  readonly error: string;
25
- readonly floor: MemberRole;
25
+ readonly floor: MemberTier;
26
26
  readonly reason: MemberRefusalReason;
27
27
  }
28
28
 
@@ -31,7 +31,7 @@ export interface MemberRefusal {
31
31
  // the bytes land.
32
32
  export const memberRefusal = (
33
33
  caller: {
34
- readonly role: MemberRole;
34
+ readonly tier: MemberTier;
35
35
  readonly areas?: readonly string[] | undefined;
36
36
  readonly agents?: AgentAccess | undefined;
37
37
  readonly lands?: true | undefined;
@@ -41,13 +41,13 @@ export const memberRefusal = (
41
41
  path: string,
42
42
  target?: string,
43
43
  ): MemberRefusal | undefined => {
44
- if (caller.role === "guest") {
44
+ if (caller.tier === "guest") {
45
45
  return guestReach(method, path, target) || homeReach(caller, method, path)
46
46
  ? undefined
47
47
  : { error: "not open to a guest member", floor: "viewer", reason: "guest" };
48
48
  }
49
49
  const floor = routeFloor(method, path, target);
50
- if (!roleAtLeast(caller.role, floor) && !givenRight(caller, method, path)) {
50
+ if (!tierAtLeast(caller.tier, floor) && !givenRight(caller, method, path)) {
51
51
  return { error: `${floor} access required`, floor, reason: "floor" };
52
52
  }
53
53
  // The collaborator floor is driving agents. A person who edits files by hand without running agents holds the
@@ -77,7 +77,7 @@ const homeReach = (caller: { readonly agents?: AgentAccess | undefined; readonly
77
77
  export const homeLandReach = (method: string, path: string): boolean => sandboxRouteFor(method, path)?.meta.home === "land";
78
78
 
79
79
  // `target` is the workspace path a byte-write addresses (upload's `?path=`); absent for every other route.
80
- export const routeFloor = (method: string, path: string, target?: string): MemberRole => {
80
+ export const routeFloor = (method: string, path: string, target?: string): MemberTier => {
81
81
  const meta = sandboxRouteFor(method, path)?.meta;
82
82
  if (meta?.attachmentFloor !== undefined && attachment(target)) {
83
83
  return meta.attachmentFloor;
@@ -1,10 +1,10 @@
1
1
  import { oc } from "@orpc/contract";
2
2
  import type { ManageRight } from "../schemas/members.js";
3
- import type { MemberRole } from "../schemas/shared.js";
3
+ import type { MemberTier } from "../schemas/shared.js";
4
4
 
5
5
  // Every route's policy, declared beside it: how a request authenticates, which member tier and which machine
6
6
  // credentials reach it, and how the daemon's outer middleware treats it. Each field has a default, so most routes
7
- // declare nothing; the daemon's bearer, boot, timer, role-floor and grant decisions all derive from this.
7
+ // declare nothing; the daemon's bearer, boot, timer, tier-floor and grant decisions all derive from this.
8
8
 
9
9
  // How far a control token reaches a route beyond what its floor alone gives the `read`/`drive` rungs.
10
10
  // `never`: no rung; `editor`: the editor slice too; `read`: the read rung and the editor slice, though no GET (watching
@@ -20,8 +20,8 @@ export interface RouteMeta {
20
20
  readonly beforeBoot?: true;
21
21
  // Held open by design, so the request timer leaves it out.
22
22
  readonly stream?: true;
23
- // The lowest member role that may call it. Absent: viewer for a read (GET, HEAD), maintainer for anything else.
24
- readonly floor?: MemberRole;
23
+ // The lowest member tier that may call it. Absent: viewer for a read (GET, HEAD), maintainer for anything else.
24
+ readonly floor?: MemberTier;
25
25
  // The part of the sandbox it runs (members.ts `ManageRightSchema`): a person below the floor who was given that part
26
26
  // reaches it too. The handler holds anything finer (members.ts `peopleChangeRefusal`).
27
27
  readonly right?: ManageRight;
@@ -31,7 +31,7 @@ export interface RouteMeta {
31
31
  // (`landsHere`): `land` is the press on their own home conversation, the one conversation the handler then admits.
32
32
  readonly home?: "land";
33
33
  // The floor an upload aimed inside ATTACHMENTS_DIR gets instead, one a guest may also make.
34
- readonly attachmentFloor?: MemberRole;
34
+ readonly attachmentFloor?: MemberTier;
35
35
  // A passkey-registration door: a proof with no passkey yet may pass the require-passkey policy.
36
36
  readonly enrolment?: true;
37
37
  // The agent token, which the CLIs on the agent's PATH carry, reaches it.
@@ -50,7 +50,7 @@ export interface RouteMeta {
50
50
 
51
51
  // The floor a route gets when it declares none: a read (GET, HEAD) floors at viewer, anything else (`ALL` included) at
52
52
  // maintainer, so a route nobody classified can under-serve, never over-grant.
53
- export const defaultFloor = (method: string): MemberRole => (method === "GET" || method === "HEAD" ? "viewer" : "maintainer");
53
+ export const defaultFloor = (method: string): MemberTier => (method === "GET" || method === "HEAD" ? "viewer" : "maintainer");
54
54
 
55
55
  // The fields that say how a request travels, not who may send it; every other RouteMeta field decides reach.
56
56
  type TransportField = "lane" | "netd";
@@ -9,16 +9,19 @@ import {
9
9
  EditScopeSchema,
10
10
  type MemberAccess,
11
11
  } from "./members.js";
12
- import { GrantedRoleSchema } from "./shared.js";
12
+ import { GrantedTierSchema, withLegacyTier } from "./shared.js";
13
13
  import { ToolCeilingSchema } from "./tool-ceiling.js";
14
14
 
15
- // AN ACCESS PROFILE: the hard half of access, named and reusable (docs/architecture/access.md). One shape serves every
16
- // kind of principal: a person holds one instead of answers of their own, and a service (schemas/services.ts) holds one
17
- // to narrow what it does for its steward. So an intern and the marketing bot can be pointed at the same thing, and
18
- // widening what both may spend is one edit.
15
+ // AN ACCESS PROFILE: every limit there is, named and reusable (docs/architecture/access.md). One shape serves every
16
+ // kind of holder: a person holds one instead of answers of their own, a service (schemas/services.ts) holds one to
17
+ // narrow what it does for its steward, and a role card is held to every profile whose `roles` lists it. So an intern,
18
+ // the marketing bot and the Reviewer card can be pointed at the same thing, and widening what all three may spend is one
19
+ // edit. The card-to-profile link lives here, off the workspace, rather than on the card in the tracked roles.json:
20
+ // a conversation that could edit the file bounding it would be held to nothing.
19
21
  // Every answer means what the same field on a roster row means (schemas/members.ts), absent included: absent areas is
20
22
  // the whole workspace, absent credentials every one, absent AI accounts every one, absent tools no limit. `agents`,
21
- // `edit`, `lands` and `assistants` are a person's answers and mean nothing for a service, which drives no editor.
23
+ // `edit`, `lands` and `assistants` are a person's answers and mean nothing for a service or a card, which drive no
24
+ // editor.
22
25
  // A profile cannot make a maintainer: that tier holds the owner's operating authority and is granted to a person,
23
26
  // never through something shared.
24
27
  export const AccessProfileSchema = z.object({
@@ -46,12 +49,20 @@ export const AccessProfileSchema = z.object({
46
49
  .max(500)
47
50
  .optional()
48
51
  .describe("The AI accounts its holders' turns may run on, `provider:account` or a provider alone. Absent means every one."),
49
- tools: ToolCeilingSchema.optional().describe("The most its holders' turns' tools may be; a persona only narrows inside it. Absent means no limit."),
52
+ tools: ToolCeilingSchema.optional().describe("The most its holders' turns' tools may be. Absent means no limit."),
50
53
  assistants: z
51
54
  .array(entryId)
52
55
  .max(50)
53
56
  .optional()
54
57
  .describe("For a guest who chats: which assistants working in their areas they may talk to. Absent means every one that works there."),
58
+ // Added 2026-11-18, optional: the limits a card held on itself (its shelves, connector lists and folders) moved here.
59
+ roles: z
60
+ .array(entryId)
61
+ .max(100)
62
+ .optional()
63
+ .describe(
64
+ "The role cards held to it: a conversation wearing one reaches no more than this profile allows, whoever it acts for. A card listed by several profiles is held to all of them. Absent holds no card.",
65
+ ),
55
66
  });
56
67
  export type AccessProfile = z.infer<typeof AccessProfileSchema>;
57
68
 
@@ -76,11 +87,11 @@ export const AccessProfileIdParamSchema = z.object({ id: entryId.describe("Which
76
87
  // bring the platform's copy of their tier along (the daemon only enforces its own).
77
88
  export const AccessProfileHolderSchema = z.object({
78
89
  email: z.string().describe("Who holds it, lowercased."),
79
- role: GrantedRoleSchema.exclude(["maintainer"]).describe("The tier the profile makes for them now."),
90
+ tier: GrantedTierSchema.exclude(["maintainer"]).describe("The tier the profile makes for them now."),
80
91
  });
81
92
  export const AccessProfileSavedSchema = z.object({
82
93
  ok: z.literal(true),
83
- holders: z.array(AccessProfileHolderSchema).describe("The people whose rows were rewritten, with the tier each now holds."),
94
+ holders: z.array(withLegacyTier(AccessProfileHolderSchema)).describe("The people whose rows were rewritten, with the tier each now holds."),
84
95
  });
85
96
  export type AccessProfileSaved = z.infer<typeof AccessProfileSavedSchema>;
86
97
 
@@ -149,7 +149,7 @@ const AgentTurnFieldsSchema = z.object({
149
149
  ),
150
150
  // Distinct from `account` (who pays): whose name the turn posts as; absent means something different for each
151
151
  // mode.
152
- actsAs: entryId.optional().describe("Which persona the turn speaks as out in the world. Not the same as which account pays for it."),
152
+ actsAs: entryId.optional().describe("Which role the turn speaks as out in the world. Not the same as which account pays for it."),
153
153
  sessionId: z.string().optional().describe("Resume this provider session instead of starting a fresh one."),
154
154
  // Stable id surviving provider/account/harness switches; keys the registry entry, the turn run, and the
155
155
  // worktree when isolated.
@@ -164,13 +164,13 @@ const AgentTurnFieldsSchema = z.object({
164
164
  .describe(
165
165
  "Work in this conversation's own private copy of the repos rather than the shared tree, so several agents can work at once. Needs a conversation id.",
166
166
  ),
167
- // Decided like `isolated`: the first turn's choice, latched. A persona's own start folder wins over it.
167
+ // Decided like `isolated`: the first turn's choice, latched. A role's own start folder wins over it.
168
168
  startIn: z
169
169
  .string()
170
170
  .max(200)
171
171
  .optional()
172
172
  .describe(
173
- "Which folder the conversation opens in, relative to the workspace root; the project it belongs to. Decided on the first turn. A persona that names its own start folder wins.",
173
+ "Which folder the conversation opens in, relative to the workspace root; the project it belongs to. Decided on the first turn. A role that names its own start folder wins.",
174
174
  ),
175
175
  // Decided like `isolated`: the request's choice on the first turn, the registry's after. `runner` implies
176
176
  // isolation; absent means local.
@@ -220,7 +220,7 @@ const AgentTurnFieldsSchema = z.object({
220
220
  .boolean()
221
221
  .optional()
222
222
  .describe(
223
- "Nobody is watching this turn: a schedule, a queue or another agent started it and no chat is open on it. A card that needs a person is refused rather than raised, plan mode and the terminal hand-off are withheld, and the sandbox's signed-in accounts stay out of it unless a persona carries them.",
223
+ "Nobody is watching this turn: a schedule, a queue or another agent started it and no chat is open on it. A card that needs a person is refused rather than raised, plan mode and the terminal hand-off are withheld, and the sandbox's signed-in accounts stay out of it unless a role carries them.",
224
224
  ),
225
225
  // Outside content caused this turn, naming the source; distinct from `unattended` (whether anyone is watching).
226
226
  outsideWake: z
@@ -333,12 +333,12 @@ export const AgentSummarySchema = z.object({
333
333
  runner: z.string().optional().describe("The runner this conversation runs on. Absent means this sandbox."),
334
334
  // Both latched at the first turn, so a board scoped to one project can say which conversations are its own.
335
335
  startIn: z.string().optional().describe("Which folder it opened in, relative to the workspace root. Absent means the root."),
336
- actsAs: z.string().optional().describe("Which persona its first turn acted as. Absent for an ordinary chat."),
336
+ actsAs: z.string().optional().describe("Which role its first turn acted as. Absent for an ordinary chat."),
337
337
  lastActsAs: z
338
338
  .string()
339
339
  .optional()
340
340
  .describe(
341
- "Which persona its last turn acted as: each turn runs as the persona it names, so this is who the conversation speaks as now, and what a view groups it under. Absent for an ordinary chat.",
341
+ "Which role its last turn acted as: each turn runs as the role it names, so this is who the conversation speaks as now, and what a view groups it under. Absent for an ordinary chat.",
342
342
  ),
343
343
  // Per-conversation, so opening it restores its own choices rather than another tab's; `fast` here is what was asked
344
344
  // for, not what was served.
@@ -201,11 +201,11 @@ export const HookModuleSchema = z.object({
201
201
  export type HookModule = z.infer<typeof HookModuleSchema>;
202
202
 
203
203
  export const HookPluginSchema = z.object({
204
- name: z.string().describe("The plugin, as the sandbox lists it: the connection, extension or persona that brought it, or the name settings enable it under."),
204
+ name: z.string().describe("The plugin, as the sandbox lists it: the connection, extension or role that brought it, or the name settings enable it under."),
205
205
  from: z
206
- .enum(["plugin", "extension", "persona", "skills", "settings"])
206
+ .enum(["plugin", "extension", "role", "skills", "settings"])
207
207
  .describe(
208
- "What brought it into the turn: a plugin connection, an extension, a persona's kit, a plugin folder among Claude Code's skills, or Claude Code's own settings enabling it.",
208
+ "What brought it into the turn: a plugin connection, an extension, a role's kit, a plugin folder among Claude Code's skills, or Claude Code's own settings enabling it.",
209
209
  ),
210
210
  source: z
211
211
  .enum(["user", "project"])
@@ -296,7 +296,7 @@ export const WebchatPendingSchema = z.object({
296
296
  export type WebchatPending = z.infer<typeof WebchatPendingSchema>;
297
297
  // Who may talk to a listener automation, and as whom. Matched on the ids a provider vouches for (a Discord user id, a
298
298
  // Slack member id, a WhatsApp number, an e-mail address) or the groups it reports (Discord role ids), never on a display
299
- // name, which the sender chooses. A rule's `actsAs` means exactly what the automation's does: absent is no persona,
299
+ // name, which the sender chooses. A rule's `actsAs` means exactly what the automation's does: absent is no role,
300
300
  // the full toolbox reaching no account, which is the whole agent an owner talks to themselves.
301
301
  export const SenderRuleSchema = z
302
302
  .object({
@@ -307,7 +307,7 @@ export const SenderRuleSchema = z
307
307
  .max(50)
308
308
  .optional()
309
309
  .describe("Group ids the service reports on a sender, a Discord role. Only for a source whose messages carry them."),
310
- actsAs: entryId.optional().describe("Which persona their wakes speak as. Absent is no persona: the full toolbox, reaching no account."),
310
+ actsAs: entryId.optional().describe("Which role their wakes speak as. Absent is no role: the full toolbox, reaching no account."),
311
311
  // The service (schemas/services.ts) their wakes act as, in place of the automation's own: a narrower one for
312
312
  // strangers, a wider one for people the owner trusts. Never more than that service's steward may.
313
313
  runAs: entryId
@@ -375,8 +375,8 @@ export const AutomationSchema = z.object({
375
375
  issues: IssuesConfigSchema.optional().describe(
376
376
  "Settings for the bug reporter, for an automation that takes crash reports from your own sites and apps.",
377
377
  ),
378
- // Narrows this job's toolbox further than its persona allows; the composer enforces that it can only remove, never
379
- // restore, a shelf the persona switched off.
378
+ // Narrows this job's toolbox further than its role allows; the composer enforces that it can only remove, never
379
+ // restore, a shelf the role switched off.
380
380
  allowedTools: z
381
381
  .array(z.string().min(1))
382
382
  .optional()
@@ -403,18 +403,18 @@ export const AutomationSchema = z.object({
403
403
  account: z.string().optional().describe("Which account pays for it."),
404
404
  // Absent means the wake reaches no logged-in account at all, the strictest default here, since nobody is at the
405
405
  // composer when it fires. Posture only: what the wake may reach is `runAs`'s (docs/architecture/access.md).
406
- actsAs: entryId.optional().describe("Which persona it speaks as. An unwatched turn naming none reaches no signed-in account at all."),
406
+ actsAs: entryId.optional().describe("Which role it speaks as. An unwatched turn naming none reaches no signed-in account at all."),
407
407
  // Who its wakes act for (schemas/services.ts): that service's steward, held to the service's access profile. Absent
408
- // keeps what a wake always did: it acts for the sandbox's owner with no profile, its persona the only narrowing.
408
+ // keeps what a wake always did: it acts for the sandbox's owner with no profile, its role the only narrowing.
409
409
  runAs: entryId
410
410
  .optional()
411
411
  .describe(
412
- "Which service it acts as: whose authority its wakes use, held to that service's access profile. Absent means the sandbox's owner, limited only by its persona.",
412
+ "Which service it acts as: whose authority its wakes use, held to that service's access profile. Absent means the sandbox's owner, limited only by its role.",
413
413
  ),
414
414
  // Listener triggers on a source that identifies senders only (TriggerSource.sender); refused elsewhere at upsert.
415
415
  // Absent means everyone the filters admit, wearing `actsAs`.
416
416
  senders: SendersSchema.optional().describe(
417
- "Who may talk to it, and as whom: rules by sender id or group, each naming the persona those people get, plus what everyone else gets. Absent admits everyone the trigger's filters do.",
417
+ "Who may talk to it, and as whom: rules by sender id or group, each naming the role those people get, plus what everyone else gets. Absent admits everyone the trigger's filters do.",
418
418
  ),
419
419
  // Held in the approvals queue rather than run; only a person releases it.
420
420
  requireApproval: z.boolean().optional().describe("Hold every fire for a person instead of running it. Only a person can release one of those."),
@@ -427,7 +427,7 @@ export const AutomationSchema = z.object({
427
427
  .boolean()
428
428
  .optional()
429
429
  .describe("This automation is a maintenance job, which is what files it under chores rather than among ordinary automations."),
430
- // Pure filing, like `chore`: the daemon never reads it. Absent, the panel files it by its persona instead, so a set
430
+ // Pure filing, like `chore`: the daemon never reads it. Absent, the panel files it by its role instead, so a set
431
431
  // of jobs one role runs reads as one shelf without anybody naming it.
432
432
  group: z
433
433
  .string()
@@ -435,7 +435,7 @@ export const AutomationSchema = z.object({
435
435
  .max(40)
436
436
  .optional()
437
437
  .describe(
438
- "Which shelf of the Automations panel it is filed on, like 'Marketing' or 'Releases'. Automations naming the same group are listed together. Absent files it under its persona, or with the code chores.",
438
+ "Which shelf of the Automations panel it is filed on, like 'Marketing' or 'Releases'. Automations naming the same group are listed together. Absent files it under its role, or with the code chores.",
439
439
  ),
440
440
  enabled: z.boolean().describe("Whether it fires at all."),
441
441
  // Stamped by the sandbox on its first save (automation-save.ts), whatever a request sends: who its notices are for.
@@ -476,12 +476,12 @@ export const AutomationApprovalSchema = z.object({
476
476
  ),
477
477
  sessionId: z.string().optional().describe("The provider session that thread last ran on."),
478
478
  // The thread-sessions key the message arrived on, so the approved run settles the same thread; not derivable from
479
- // `origin`, since a thread is also keyed by the persona the sender's lane resolved to.
479
+ // `origin`, since a thread is also keyed by the role the sender's lane resolved to.
480
480
  thread: z.string().optional().describe("Which inbound thread this belongs to, so the approved run continues that thread's memory rather than a fresh one."),
481
- // The persona the fire resolved to (a sender rule's, or the automation's), snapshotted at hold time and worn by the
481
+ // The role the fire resolved to (a sender rule's, or the automation's), snapshotted at hold time and worn by the
482
482
  // approved run; also what a project-scoped board files the wake under.
483
- actsAs: entryId.optional().describe("Which persona the approved run speaks as, decided when it was held."),
484
- // The service the fire resolved to (a sender rule's, or the automation's), snapshotted beside the persona.
483
+ actsAs: entryId.optional().describe("Which role the approved run speaks as, decided when it was held."),
484
+ // The service the fire resolved to (a sender rule's, or the automation's), snapshotted beside the role.
485
485
  runAs: entryId.optional().describe("Which service the approved run acts as, decided when it was held."),
486
486
  createdAt: z.number().describe("When it started waiting, in milliseconds."),
487
487
  // When the daemon may run this itself, for a `holdForSeconds` hold; absent for a `requireApproval` hold, which only
@@ -146,7 +146,7 @@ export const BrowserConfigSchema = z
146
146
  })
147
147
  .catchall(z.string());
148
148
  // One email identity the sandbox acts as online: one persisted Chromium profile, signed in once by the owner, that
149
- // every browser account naming it in `identity` shares. A capability, not a persona, since it holds live secrets (email
149
+ // every browser account naming it in `identity` shares. A capability, not a role, since it holds live secrets (email
150
150
  // password, profile identity) that must never be committed to git. `mailbox` feeds the code-reading tool;
151
151
  // `openAccounts` is the explicit, off-by-default consent to sign up unattended.
152
152
  export const IdentityConfigSchema = z.object({