Skip to content
Python

Personas: requires_folder/subagents/scheduling traits replace family and the workspace enum

Rohit C Prasad12997604009f
diff --git a/coworker/agent.py b/coworker/agent.py
index 451871f8..1eb8b025 100644
--- a/coworker/agent.py
+++ b/coworker/agent.py
@@ -226,7 +226,7 @@ def build_engine(
extra_skill_dirs: Optional[list[str | Path]] = None,
) -> TurnEngine:
ws = Path(workspace).expanduser().resolve() if workspace else None
- if agent.needs_workspace and ws is None:
+ if agent.requires_folder and ws is None:
raise ValueError(f"agent '{agent.name}' requires a workspace")
# The session's directories. Explicit `roots` (orphan Cowork: scratch + added folders) wins;
@@ -241,9 +241,7 @@ def build_engine(
workspace_trusted = bool(ws and WorkspaceTrustStore().is_trusted(ws))
config = load_config(ws, workspace_trusted=workspace_trusted)
- executor = (
- LocalExecutor(cwd=ws) if (agent.needs_workspace and ws is not None) else None
- )
+ executor = LocalExecutor(cwd=ws) if ws is not None else None
todo = TodoList()
context = AgentContext(
workspace=ws, executor=executor, todo=todo, roots=root_list or None
@@ -275,8 +273,8 @@ def build_engine(
routing_targets=routing_targets,
)
)
- # Knowledge surfaces with a multi-root workspace can ask the user mid-task for another folder.
- if agent.family == "knowledge" and root_list:
+ # Surfaces with a multi-root workspace can ask the user mid-task for another folder.
+ if root_list:
registry.register(request_directory_tool())
# Anything with a shell can hit a missing CLI (a scanner, aws, kubectl). Give it a way to
# ask instead of silently dropping the check that needed it (OPE-85).
@@ -313,9 +311,9 @@ def build_engine(
# passes its shared router; this fallback covers the TUI / direct build_engine() callers.
# Resolved here (not at engine construction) because the explorer subagent captures it.
provider = provider or ProviderRouter(secrets, default_provider="openai")
- # Code-family personas can fan broad research out to read-only explorer subagents, keeping
+ # Repo-focused personas can fan broad research out to read-only explorer subagents, keeping
# their own context for the actual change.
- if agent.family == "code" and ws is not None:
+ if agent.subagents and ws is not None:
registry.register_all(
explorer_tools(
workspace=ws,
@@ -324,9 +322,9 @@ def build_engine(
model_settings=model_settings,
)
)
- # Scheduling: knowledge surfaces with a workspace can set up scheduled tasks (origin = this
+ # Scheduling: opted-in surfaces with a workspace can set up scheduled tasks (origin = this
# session). Code stays out (it fans out to explorers instead).
- if task_store is not None and ws is not None and agent.family == "knowledge":
+ if task_store is not None and ws is not None and agent.scheduling:
origin = {
"surface": agent.name,
"session_id": session_id or "",
@@ -336,9 +334,9 @@ def build_engine(
registry.register_all(
scheduling_tools(task_store, origin=origin, default_workspace=str(ws))
)
- # Self-wake: knowledge surfaces can suspend + schedule their own resumption (timer /
+ # Self-wake: scheduling surfaces can suspend + schedule their own resumption (timer /
# on-completion / on-event). The scheduler tick resumes due wakes.
- if wake_store is not None and session_id and agent.family == "knowledge":
+ if wake_store is not None and session_id and agent.scheduling:
registry.register_all(selfwake_tools(wake_store, session_id))
instructions = f"{agent.system_prompt}\n\n{_NARRATION_GUIDANCE}"
@@ -445,15 +443,11 @@ def build_engine(
# Per-turn ephemeral context, appended to the latest user message since mid-thread system
# messages aren't reliable across providers. Three producers: the plan-mode reminder (mode can
# flip mid-session, so it's checked each turn, not baked into the instructions), the live
- # directory list (orphan Cowork can gain folders mid-session; Cowork/MyHelper only), and the
+ # directory list (any multi-root session can gain folders mid-session), and the
# memory-SAVING notice (same reason as plan mode — the switch flips either way mid-chat).
# Note what is NOT here: the memories and the user's rules. Those are knowledge, fixed at
# session start (§7.1).
- roots_context = (
- (lambda: render_context(root_list))
- if root_list and agent.family == "knowledge"
- else None
- )
+ roots_context = (lambda: render_context(root_list)) if root_list else None
# Late-bound engine ref: the closure needs the conversation history (for the disable
# countermand) but the engine is constructed after the closure. Filled below.
diff --git a/coworker/agents/base.py b/coworker/agents/base.py
index bfd11b0b..43ac03de 100644
--- a/coworker/agents/base.py
+++ b/coworker/agents/base.py
@@ -30,15 +30,19 @@ class Agent:
name: str
title: str
system_prompt: str
- needs_workspace: bool = False
tool_factory: Optional[Callable[[AgentContext], list]] = None
# Traits that replace the old per-agent-name branching in build_engine / manager.
- # family: "code" gets explorer subagents; "knowledge" gets scheduling / request_directory /
- # roots context (when it has a workspace). messaging: exposes send_message. connectors:
- # loads the integration toolset — True = every connected connector (general builtins
- # only), a tuple = allowlist (session gets declared ∩ connected; OPE-93), False = none.
- # Defaults keep non-persona callers behaving as before.
- family: str = "knowledge"
+ # requires_folder: the session cannot start without a user-picked primary folder
+ # (composer + engine gate; everything else starts on a scratch dir). subagents:
+ # read-only explorer fan-out. scheduling: scheduled tasks + self-wake. messaging:
+ # exposes send_message. connectors: loads the integration toolset — True = every
+ # connected connector (general builtins only), a tuple = allowlist (session gets
+ # declared ∩ connected; OPE-93), False = none. Defaults keep non-persona callers
+ # behaving as before. (The old family/needs_workspace/workspace trio collapsed into
+ # these — see ocw-context/docs/workspace-scratch-design.md.)
+ requires_folder: bool = False
+ subagents: bool = False
+ scheduling: bool = False
messaging: bool = False
connectors: bool | tuple[str, ...] = False
# Team identity: "lead" | "worker" | None (solo-only). Gates the board/journal
diff --git a/coworker/agents/chat.py b/coworker/agents/chat.py
index 7343c0fd..4d2106e1 100644
--- a/coworker/agents/chat.py
+++ b/coworker/agents/chat.py
@@ -17,6 +17,5 @@ def chat_agent() -> Agent:
name="chat",
title="Chat",
system_prompt=CHAT_INSTRUCTIONS,
- needs_workspace=False,
tool_factory=None,
)
diff --git a/coworker/agents/code.py b/coworker/agents/code.py
index 4455704a..41f29407 100644
--- a/coworker/agents/code.py
+++ b/coworker/agents/code.py
@@ -68,7 +68,7 @@ def code_agent() -> Agent:
name="code",
title="Code",
system_prompt=CODE_INSTRUCTIONS,
- needs_workspace=True,
tool_factory=lambda context: expand(CODE_CAPABILITIES, context),
- family="code",
+ requires_folder=True,
+ subagents=True,
)
diff --git a/coworker/agents/cowork.py b/coworker/agents/cowork.py
index cec60aa3..d72ddc6f 100644
--- a/coworker/agents/cowork.py
+++ b/coworker/agents/cowork.py
@@ -48,9 +48,8 @@ def cowork_agent() -> Agent:
name="cowork",
title="Cowork",
system_prompt=COWORK_INSTRUCTIONS,
- needs_workspace=True,
tool_factory=cowork_tool_factory,
- family="knowledge",
+ scheduling=True,
messaging=True,
connectors=True,
)
diff --git a/coworker/agents/myhelper.py b/coworker/agents/myhelper.py
index 6cd62121..07582c82 100644
--- a/coworker/agents/myhelper.py
+++ b/coworker/agents/myhelper.py
@@ -32,8 +32,7 @@ def myhelper_agent(name: str = DEFAULT_HELPER_NAME) -> Agent:
name="myhelper",
title=name,
system_prompt=myhelper_instructions(name),
- needs_workspace=True,
tool_factory=cowork_tool_factory,
- family="knowledge",
+ scheduling=True,
messaging=True,
)
diff --git a/coworker/personas/builtin/appsec-worker/manifest.md b/coworker/personas/builtin/appsec-worker/manifest.md
index dd57bf73..75cea36b 100644
--- a/coworker/personas/builtin/appsec-worker/manifest.md
+++ b/coworker/personas/builtin/appsec-worker/manifest.md
@@ -4,7 +4,8 @@ id: appsec-worker
name: AppSec Worker
icon: code
tagline: Code security review under a team lead — scan, triage, fix
-family: code
+requires_folder: true
+subagents: true
version: "1"
team: worker
tools: [code_files, git, search, shell, todo]
diff --git a/coworker/personas/builtin/change-worker/manifest.md b/coworker/personas/builtin/change-worker/manifest.md
index eb50467e..95940963 100644
--- a/coworker/personas/builtin/change-worker/manifest.md
+++ b/coworker/personas/builtin/change-worker/manifest.md
@@ -4,7 +4,8 @@ id: change-worker
name: Change Worker
icon: code
tagline: Incident diagnosis from the change side — what shipped, when, and what it touched
-family: code
+requires_folder: true
+subagents: true
version: "1"
team: worker
tools: [shell, code_files, git, search, todo]
diff --git a/coworker/personas/builtin/cloud-posture/manifest.md b/coworker/personas/builtin/cloud-posture/manifest.md
index 165a2cae..85f99fbb 100644
--- a/coworker/personas/builtin/cloud-posture/manifest.md
+++ b/coworker/personas/builtin/cloud-posture/manifest.md
@@ -4,7 +4,8 @@ id: cloud-posture
name: Cloud Posture Coworker
icon: sliders
tagline: Review Terraform & cloud config — read-only, evidence first
-family: code
+requires_folder: true
+subagents: true
version: "1"
tools: [code_files, git, search, shell, todo]
connectors: [github]
diff --git a/coworker/personas/builtin/dep-audit/manifest.md b/coworker/personas/builtin/dep-audit/manifest.md
index bc410009..85d38f83 100644
--- a/coworker/personas/builtin/dep-audit/manifest.md
+++ b/coworker/personas/builtin/dep-audit/manifest.md
@@ -4,7 +4,8 @@ id: dep-audit
name: Dependency Audit Coworker
icon: audit
tagline: Vulnerable dependencies — audit, minimal upgrades, PRs
-family: code
+requires_folder: true
+subagents: true
version: "1"
tools: [code_files, git, search, shell, todo]
connectors: [github]
diff --git a/coworker/personas/builtin/design-worker/manifest.md b/coworker/personas/builtin/design-worker/manifest.md
index e6c5f841..9b4bbc33 100644
--- a/coworker/personas/builtin/design-worker/manifest.md
+++ b/coworker/personas/builtin/design-worker/manifest.md
@@ -4,7 +4,8 @@ id: design-worker
name: Design Worker
icon: layout
tagline: UI/UX implementation under a team lead
-family: code
+requires_folder: true
+subagents: true
version: "1"
team: worker
tools: [code_files, git, search, shell, todo]
diff --git a/coworker/personas/builtin/devops-lead/manifest.md b/coworker/personas/builtin/devops-lead/manifest.md
index cf6fc42c..a3498f50 100644
--- a/coworker/personas/builtin/devops-lead/manifest.md
+++ b/coworker/personas/builtin/devops-lead/manifest.md
@@ -4,7 +4,8 @@ id: devops-lead
name: DevOps Lead
icon: audit
tagline: Stands watch over production — correlates what broke with what shipped, staffs an incident team only when it matters
-family: code
+requires_folder: true
+subagents: true
version: "1"
team: lead
tools: [shell, code_files, search, todo]
diff --git a/coworker/personas/builtin/devsecops-lead/manifest.md b/coworker/personas/builtin/devsecops-lead/manifest.md
index cec3e010..131e8dc2 100644
--- a/coworker/personas/builtin/devsecops-lead/manifest.md
+++ b/coworker/personas/builtin/devsecops-lead/manifest.md
@@ -4,7 +4,8 @@ id: devsecops-lead
name: DevSecOps Lead
icon: shield
tagline: Leads a security review team — scopes, staffs, assigns, verifies evidence
-family: code
+requires_folder: true
+subagents: true
version: "1"
team: lead
tools: [code_files, search, todo]
diff --git a/coworker/personas/builtin/infra-worker/manifest.md b/coworker/personas/builtin/infra-worker/manifest.md
index 0fc6c319..9db4ffb6 100644
--- a/coworker/personas/builtin/infra-worker/manifest.md
+++ b/coworker/personas/builtin/infra-worker/manifest.md
@@ -4,7 +4,8 @@ id: infra-worker
name: Infra Worker
icon: sliders
tagline: Incident diagnosis from the platform side — resources, cloud state, IaC
-family: code
+requires_folder: true
+subagents: true
version: "1"
team: worker
tools: [shell, code_files, git, search, todo]
diff --git a/coworker/personas/builtin/logs-worker/manifest.md b/coworker/personas/builtin/logs-worker/manifest.md
index ebcf930a..d08a9873 100644
--- a/coworker/personas/builtin/logs-worker/manifest.md
+++ b/coworker/personas/builtin/logs-worker/manifest.md
@@ -4,7 +4,8 @@ id: logs-worker
name: Logs Worker
icon: search
tagline: Incident diagnosis from the symptom side — errors, traces, reproduction
-family: code
+requires_folder: true
+subagents: true
version: "1"
team: worker
tools: [shell, code_files, git, search, todo]
diff --git a/coworker/personas/builtin/ops.md b/coworker/personas/builtin/ops.md
index 242baf10..f8ca9a39 100644
--- a/coworker/personas/builtin/ops.md
+++ b/coworker/personas/builtin/ops.md
@@ -4,7 +4,6 @@ id: ops
name: Ops Coworker
icon: wrench
tagline: Operate and investigate — runbooks, logs, infrastructure
-family: knowledge
tools: [files, search, shell, todo]
messaging: true
connectors: true
diff --git a/coworker/personas/builtin/posture-worker/manifest.md b/coworker/personas/builtin/posture-worker/manifest.md
index 542daf1b..dbe0f891 100644
--- a/coworker/personas/builtin/posture-worker/manifest.md
+++ b/coworker/personas/builtin/posture-worker/manifest.md
@@ -4,7 +4,8 @@ id: posture-worker
name: Posture Worker
icon: sliders
tagline: IaC & cloud posture under a team lead — read-only, evidence first
-family: code
+requires_folder: true
+subagents: true
version: "1"
team: worker
tools: [code_files, git, search, shell, todo]
diff --git a/coworker/personas/builtin/secrets-worker/manifest.md b/coworker/personas/builtin/secrets-worker/manifest.md
index 0880fab3..af4b4d63 100644
--- a/coworker/personas/builtin/secrets-worker/manifest.md
+++ b/coworker/personas/builtin/secrets-worker/manifest.md
@@ -4,7 +4,8 @@ id: secrets-worker
name: Secrets Worker
icon: search
tagline: Secret hunting under a team lead — working tree and full git history
-family: code
+requires_folder: true
+subagents: true
version: "1"
team: worker
tools: [code_files, git, search, shell, todo]
diff --git a/coworker/personas/builtin/security/manifest.md b/coworker/personas/builtin/security/manifest.md
index 1c1dbd23..f6c0d2bb 100644
--- a/coworker/personas/builtin/security/manifest.md
+++ b/coworker/personas/builtin/security/manifest.md
@@ -4,7 +4,8 @@ id: security
name: Security Coworker
icon: shield
tagline: Find and fix security issues — scan, triage, PR
-family: code
+requires_folder: true
+subagents: true
version: "1"
tools: [code_files, git, search, shell, todo]
connectors: [github]
diff --git a/coworker/personas/builtin/swe-lead/manifest.md b/coworker/personas/builtin/swe-lead/manifest.md
index 5627dde6..7be551b0 100644
--- a/coworker/personas/builtin/swe-lead/manifest.md
+++ b/coworker/personas/builtin/swe-lead/manifest.md
@@ -4,7 +4,8 @@ id: swe-lead
name: SWE Lead
icon: users
tagline: Leads a software team — plans, staffs, assigns, verifies
-family: code
+requires_folder: true
+subagents: true
version: "1"
team: lead
tools: [code_files, search, todo]
diff --git a/coworker/personas/builtin/swe-worker/manifest.md b/coworker/personas/builtin/swe-worker/manifest.md
index 315bbaf2..1cb2fb7d 100644
--- a/coworker/personas/builtin/swe-worker/manifest.md
+++ b/coworker/personas/builtin/swe-worker/manifest.md
@@ -4,7 +4,8 @@ id: swe-worker
name: SWE Worker
icon: code
tagline: Implements work items under a team lead
-family: code
+requires_folder: true
+subagents: true
version: "1"
team: worker
tools: [code_files, git, search, shell, todo]
diff --git a/coworker/personas/builtin/test-worker/manifest.md b/coworker/personas/builtin/test-worker/manifest.md
index 82ec780a..a76fc5b4 100644
--- a/coworker/personas/builtin/test-worker/manifest.md
+++ b/coworker/personas/builtin/test-worker/manifest.md
@@ -4,7 +4,8 @@ id: test-worker
name: Test Worker
icon: check
tagline: Verifies teammates' work against acceptance criteria
-family: code
+requires_folder: true
+subagents: true
version: "1"
team: worker
tools: [code_files, git, search, shell, todo]
diff --git a/coworker/personas/manifest.py b/coworker/personas/manifest.py
index 80a81e15..45a88183 100644
--- a/coworker/personas/manifest.py
+++ b/coworker/personas/manifest.py
@@ -20,9 +20,8 @@ import yaml
# (traversal), no `:*?"<>|` (invalid on Windows), bounded length.
_ID_RE = re.compile(r"^[a-z0-9][a-z0-9_-]{0,63}$")
-VALID_FAMILIES = {"code", "knowledge"}
+VALID_FAMILIES = {"code", "knowledge"} # legacy key, shimmed in parse()
VALID_TEAM = {"lead", "worker"}
-VALID_WORKSPACES = {"git", "project", "deliverable", "none"}
VALID_MODES = {"discuss", "plan", "interactive", "custom", "auto"}
VALID_REC_KINDS = {"connector", "mcp"}
VALID_REC_TIERS = {"core", "optional"}
@@ -55,10 +54,14 @@ class PersonaManifest:
tagline: str = ""
description: str = ""
tools: list[str] = field(default_factory=list)
- family: str = "knowledge" # "code" | "knowledge"
- # Derived from family since the enum collapse (§16): code → "git", knowledge →
- # "deliverable". Builtins registered via builders may still carry "none" (Chat).
- workspace: str = "deliverable"
+ # Workspace/toolset traits (workspace-scratch-design.md — replaces the old
+ # family/workspace pair). requires_folder: the composer/engine gate on a
+ # user-picked primary folder. subagents: explorer fan-out. scheduling:
+ # scheduled tasks + self-wake (defaults to the opposite of requires_folder
+ # when the manifest is silent — folder personas fan out instead).
+ requires_folder: bool = False
+ subagents: bool = False
+ scheduling: bool = True
messaging: bool = False
# Connector grant (OPE-93): False = none, a tuple = allowlist of connector ids
# (session exposes declared ∩ connected), True = every connected connector — the
@@ -93,10 +96,6 @@ class PersonaManifest:
None # where it was loaded from (path / url), for provenance
)
- @property
- def needs_workspace(self) -> bool:
- return self.workspace != "none"
-
def to_agent(self):
"""Materialize the runtime Agent (prompt + catalog-expanded tools + traits)."""
from ..agents.base import Agent
@@ -108,9 +107,10 @@ class PersonaManifest:
name=self.id,
title=self.name,
system_prompt=self.system_prompt,
- needs_workspace=self.needs_workspace,
tool_factory=factory,
- family=self.family,
+ requires_folder=self.requires_folder,
+ subagents=self.subagents,
+ scheduling=self.scheduling,
messaging=self.messaging,
connectors=self.connectors,
team=self.team,
@@ -273,22 +273,21 @@ def parse_manifest(
if not body.strip():
raise ManifestError(f"persona {persona_id!r} has no body (the system prompt)")
- family = str(meta.get("family", "knowledge")).strip().lower()
- if family not in VALID_FAMILIES:
- raise ManifestError(
- f"persona {persona_id!r}: family must be one of {sorted(VALID_FAMILIES)}"
- )
-
- # The workspace enum collapsed into family (owner decision 2026-07-03, UX-DECISIONS §16):
- # knowledge → transparent scratch + user-added roots (no folder gate, ever); code → an
- # explicit directory picked by the user. The manifest key is still accepted — and
- # typo-checked — so older manifests parse, but it no longer drives behavior.
- declared = str(meta.get("workspace", "")).strip().lower()
- if declared and declared not in VALID_WORKSPACES:
+ # Workspace/toolset traits (workspace-scratch-design.md). Legacy shim: pre-trait
+ # bundles declared `family: code|knowledge` (and a dead `workspace:` enum, ignored
+ # here) — when the new keys are absent, `family: code` maps to the folder-gated
+ # profile so an old bundle keeps its gate. New keys always win.
+ legacy_family = str(meta.get("family", "")).strip().lower()
+ if legacy_family and legacy_family not in VALID_FAMILIES:
raise ManifestError(
- f"persona {persona_id!r}: workspace must be one of {sorted(VALID_WORKSPACES)}"
+ f"persona {persona_id!r}: family (legacy) must be one of {sorted(VALID_FAMILIES)}"
)
- workspace = "git" if family == "code" else "deliverable"
+ legacy_code = legacy_family == "code"
+ requires_folder = bool(meta.get("requires_folder", legacy_code))
+ subagents = bool(meta.get("subagents", legacy_code))
+ # Folder personas fan out to explorers instead of scheduling — the silent default
+ # mirrors that split; either can be declared explicitly.
+ scheduling = bool(meta.get("scheduling", not requires_folder))
mode = str(meta.get("default_permission_mode", "interactive")).strip().lower()
if mode not in VALID_MODES:
@@ -322,8 +321,9 @@ def parse_manifest(
tagline=str(meta.get("tagline", "")).strip(),
description=str(meta.get("description", "")).strip(),
tools=tools,
- family=family,
- workspace=workspace,
+ requires_folder=requires_folder,
+ subagents=subagents,
+ scheduling=scheduling,
messaging=bool(meta.get("messaging", False)),
connectors=connectors,
team=team_raw or None,
diff --git a/coworker/personas/registry.py b/coworker/personas/registry.py
index fdf9f84f..41e58aeb 100644
--- a/coworker/personas/registry.py
+++ b/coworker/personas/registry.py
@@ -49,13 +49,13 @@ class PersonaEntry:
name: str
icon: str = ""
tagline: str = ""
- needs_workspace: bool = True
builtin: bool = True
- family: str = "knowledge"
- # The persona's workspace requirement (git|project|deliverable|none) — surfaced to the GUI so it
- # can detect project-scoped personas (git/project) uniformly. Manifest-backed personas carry it
- # verbatim; builtins set it at registration to match their family/needs_workspace.
- workspace: str = "deliverable"
+ # Workspace/toolset traits (workspace-scratch-design.md): requires_folder is the
+ # composer/engine gate on a user-picked primary folder — surfaced to the GUI, which
+ # groups gated sessions by project. subagents/scheduling gate the matching toolsets.
+ requires_folder: bool = False
+ subagents: bool = False
+ scheduling: bool = True
tools: list[str] = field(default_factory=list)
default_surfaced: bool = (
True # whether it shows in the picker before any user choice
@@ -117,10 +117,10 @@ class PersonaRegistry:
icon,
tagline,
builder,
- needs_workspace,
- family,
tools,
- workspace="deliverable",
+ requires_folder=False,
+ subagents=False,
+ scheduling=True,
default_surfaced=True,
default_enabled=True,
group="general",
@@ -130,10 +130,10 @@ class PersonaRegistry:
name=name,
icon=icon,
tagline=tagline,
- needs_workspace=needs_workspace,
builtin=True,
- family=family,
- workspace=workspace,
+ requires_folder=requires_folder,
+ subagents=subagents,
+ scheduling=scheduling,
tools=list(tools),
default_surfaced=default_surfaced,
default_enabled=default_enabled,
@@ -154,10 +154,7 @@ class PersonaRegistry:
"cowork",
"Produce a deliverable — research, analysis, scripts",
cowork_agent,
- True,
- "knowledge",
COWORK_CAPABILITIES,
- workspace="deliverable",
)
self._register_builder(
"code",
@@ -165,10 +162,10 @@ class PersonaRegistry:
"code",
"Work in a codebase — files, git, shell",
code_agent,
- True,
- "code",
CODE_CAPABILITIES,
- workspace="git",
+ requires_folder=True,
+ subagents=True,
+ scheduling=False,
default_surfaced=False,
default_enabled=False,
)
@@ -200,10 +197,10 @@ class PersonaRegistry:
name=m.name,
icon=m.icon,
tagline=m.tagline,
- needs_workspace=m.needs_workspace,
builtin=builtin,
- family=m.family,
- workspace=m.workspace,
+ requires_folder=m.requires_folder,
+ subagents=m.subagents,
+ scheduling=m.scheduling,
tools=list(m.tools),
ships=m.ships,
group=m.group,
@@ -317,7 +314,7 @@ class PersonaRegistry:
{
"name": e.id,
"title": e.name,
- "needs_workspace": e.needs_workspace,
+ "requires_folder": e.requires_folder,
"icon": e.icon,
"tagline": e.tagline,
"default": e.id == self.default_id(),
@@ -333,10 +330,8 @@ class PersonaRegistry:
"name": e.name,
"icon": e.icon,
"tagline": e.tagline,
- "needs_workspace": e.needs_workspace,
+ "requires_folder": e.requires_folder,
"builtin": e.builtin,
- "family": e.family,
- "workspace": e.workspace,
"tools": e.tools,
"enabled": self.is_enabled(e.id),
"surfaced": self.is_surfaced(e.id),
diff --git a/coworker/server/manager.py b/coworker/server/manager.py
index 190ce748..76322867 100644
--- a/coworker/server/manager.py
+++ b/coworker/server/manager.py
@@ -481,8 +481,7 @@ class SessionManager:
record = self.session_store.load(session_id)
if record:
return record.workspace or None
- ag = get_agent(agent or "code")
- return self.resolve_workspace(workspace) if ag.needs_workspace else None
+ return self.resolve_workspace(workspace)
def get_engine(
self,
@@ -526,14 +525,14 @@ class SessionManager:
ws = record.workspace or None
model, mode, messages = record.model, Mode(record.mode), record.messages
else:
- ws = self.resolve_workspace(workspace) if ag.needs_workspace else None
+ ws = self.resolve_workspace(workspace)
model, mode, messages = self.model, self.mode, None
- if ag.needs_workspace and (not ws or not Path(ws).is_dir()):
- # Knowledge surfaces (Cowork, Ops, …) start "orphan": no folder picked →
- # auto-provision a per-conversation scratch directory (generalizes MyHelper's
- # auto-workspace). Code-family surfaces still require a real repo; Chat needs none.
- if ag.family == "knowledge":
+ if not ws or not Path(ws).is_dir():
+ # Sessions without a folder start "orphan": auto-provision a per-conversation
+ # scratch directory (generalizes MyHelper's auto-workspace). Folder-gated
+ # personas (requires_folder) still demand a real directory picked by the user.
+ if not ag.requires_folder:
ws = self._provision_scratch(session_id)
else:
return None
@@ -541,9 +540,10 @@ class SessionManager:
if ws:
self.session_store.touch_workspace(ws)
# Orphan surfaces are multi-root: the scratch (ws) is the primary writable root, plus any
- # folders the user added (persisted per session). Code/Chat stay single-root (roots=None).
+ # folders the user added (persisted per session). Folder-gated personas stay single-root
+ # (roots=None) until universal scratch lands (workspace-scratch-design.md phase B).
roots = None
- if ag.family == "knowledge" and ws:
+ if not ag.requires_folder and ws:
extra = [
r
for r in ((record.extra_roots if record else []) or [])
@@ -644,8 +644,11 @@ class SessionManager:
from ..config import load_config
entry = self.personas.get(persona_id)
- family = entry.family if entry else ""
- workspace_kind = entry.workspace if entry else ""
+ # Wire fields kept stable; both now carry the workspace shape ("folder" = gated
+ # primary folder, "scratch" = starts on the per-session scratch dir).
+ kind = ("folder" if entry.requires_folder else "scratch") if entry else ""
+ family = kind
+ workspace_kind = kind
def _send() -> None:
try:
@@ -734,19 +737,6 @@ class SessionManager:
return connector in self.effective_connectors(session_id)
# -- persona + session connection surfaces (UI-REFRESH §5/§6) ----------------
- @staticmethod
- def _workspace_kind(entry) -> str:
- """The persona's workspace requirement as a stable string for the GUI. Manifest-backed
- personas carry it verbatim (git|deliverable|none); builtins (which have no manifest) map
- family/needs_workspace into the SAME vocabulary so the frontend reads one enum:
- code-family → git, knowledge-family with a workspace → deliverable, none → none.
- """
- if entry.manifest is not None:
- return entry.manifest.workspace
- if not entry.needs_workspace:
- return "none"
- return "git" if entry.family == "code" else "deliverable"
-
def _connected_connectors(self) -> set[str]:
"""The account-connected connector names (the first layer of the §4 hierarchy)."""
return {c["name"] for c in connector_list(self.secrets) if c["connected"]}
@@ -811,7 +801,7 @@ class SessionManager:
"default_permission_mode": (
manifest.default_permission_mode if manifest else "interactive"
),
- "workspace": self._workspace_kind(entry),
+ "requires_folder": entry.requires_folder,
"recommends": recommends,
"default_connections": self._persona_default_connections(
persona_id, manifest, connected
diff --git a/surfaces/gui/e2e/fixtures.ts b/surfaces/gui/e2e/fixtures.ts
index 00a587d7..94c3e69f 100644
--- a/surfaces/gui/e2e/fixtures.ts
+++ b/surfaces/gui/e2e/fixtures.ts
@@ -58,13 +58,13 @@ const SETTINGS = {
const PERSONAS = {
internal: true,
personas: [
- { id: "cowork", name: "OpenWorker", icon: "cowork", tagline: "Produce a deliverable — research, analysis, scripts", needs_workspace: true, builtin: true, family: "knowledge", workspace: "deliverable", tools: ["files", "search"], enabled: true, surfaced: true, default: true, ships: true, group: "general" },
- { id: "code", name: "Code", icon: "code", tagline: "Work in a codebase — files, git, shell", needs_workspace: true, builtin: true, family: "code", workspace: "git", tools: ["code_files", "git"], enabled: false, surfaced: false, default: false, ships: true, group: "general" },
- { id: "security", name: "Security Coworker", icon: "shield", tagline: "Find and fix security issues — scan, triage, PR", needs_workspace: true, builtin: true, family: "code", workspace: "git", tools: ["code_files", "git", "shell"], enabled: true, surfaced: true, default: false, ships: true, group: "security" },
- { id: "ops", name: "Ops Coworker", icon: "wrench", tagline: "Operate and investigate — runbooks, logs, infrastructure", needs_workspace: true, builtin: true, family: "knowledge", workspace: "deliverable", tools: ["files", "shell"], enabled: true, surfaced: true, default: false, ships: false, group: "general" },
+ { id: "cowork", name: "OpenWorker", icon: "cowork", tagline: "Produce a deliverable — research, analysis, scripts", requires_folder: false, builtin: true, tools: ["files", "search"], enabled: true, surfaced: true, default: true, ships: true, group: "general" },
+ { id: "code", name: "Code", icon: "code", tagline: "Work in a codebase — files, git, shell", requires_folder: true, builtin: true, tools: ["code_files", "git"], enabled: false, surfaced: false, default: false, ships: true, group: "general" },
+ { id: "security", name: "Security Coworker", icon: "shield", tagline: "Find and fix security issues — scan, triage, PR", requires_folder: true, builtin: true, tools: ["code_files", "git", "shell"], enabled: true, surfaced: true, default: false, ships: true, group: "security" },
+ { id: "ops", name: "Ops Coworker", icon: "wrench", tagline: "Operate and investigate — runbooks, logs, infrastructure", requires_folder: false, builtin: true, tools: ["files", "shell"], enabled: true, surfaced: true, default: false, ships: false, group: "general" },
// A non-builtin install (disabled pending consent — invisible to picker specs) so the
// Personas page's delete/enable affordances have a target.
- { id: "acme-notes", name: "Acme Notes", icon: "pencil", tagline: "Acme's note-taking coworker", needs_workspace: true, builtin: false, family: "knowledge", workspace: "deliverable", tools: ["files"], enabled: false, surfaced: false, default: false, ships: true, group: "general" },
+ { id: "acme-notes", name: "Acme Notes", icon: "pencil", tagline: "Acme's note-taking coworker", requires_folder: false, builtin: false, tools: ["files"], enabled: false, surfaced: false, default: false, ships: true, group: "general" },
],
};
@@ -1334,8 +1334,8 @@ export async function mockApi(page: import("@playwright/test").Page) {
// Sharing v1: a bundle zip import — consent with version + replaces + recommends.
const imported = {
id: "team-sec", name: "Team Security Coworker", icon: "shield",
- tagline: "Our security playbook", needs_workspace: true, builtin: false,
- family: "code", workspace: "git", tools: ["code_files", "search", "shell"],
+ tagline: "Our security playbook", requires_folder: true, builtin: false,
+ tools: ["code_files", "search", "shell"],
enabled: false, surfaced: false, default: false, version: "2",
};
if (!personas.some((x) => x.id === "team-sec")) personas.push(imported);
diff --git a/surfaces/gui/src/App.tsx b/surfaces/gui/src/App.tsx
index 06e84090..9fd31e3f 100644
--- a/surfaces/gui/src/App.tsx
+++ b/surfaces/gui/src/App.tsx
@@ -113,9 +113,8 @@ function normalizeTodos(raw: unknown): TodoItem[] {
});
}
-// Fallbacks used only before the persona list loads (the in-component, family-aware
-// needsWorkspace/gatesWorkspace consult the real persona once available).
-const needsWorkspaceFallback = (a: string) => a === "code" || a === "cowork";
+// Fallback used only before the persona list loads (the in-component gatesWorkspace
+// consults the real persona's requires_folder once available).
const gatesWorkspaceFallback = (a: string) => a === "code";
const LAST_SESSION_KEY = "coworker:last-session-by-agent:v1";
const NAV_COLLAPSED_KEY = "coworker:nav-collapsed:v1";
@@ -404,11 +403,9 @@ export function App() {
getInbox(sessionId, "pending").then(setSessionInbox).catch(() => setSessionInbox([]));
refreshSessions(); // attention badge should drop right away
};
- // Shows a working-area chip / project grouping. Persona's needs_workspace; fallback before load.
- const needsWorkspace = (a: string) => personaOf(a)?.needs_workspace ?? needsWorkspaceFallback(a);
- // MUST pick a folder before starting — project-scoped personas (git-bound Code, project-bound
- // Ops). Scratch/deliverable personas start orphan: the server auto-provisions a per-conversation
- // scratch dir and reports it in the `ready` event.
+ // MUST pick a folder before starting — requires_folder personas (git-bound Code, the
+ // security coworkers). Everything else starts orphan: the server auto-provisions a
+ // per-conversation scratch dir and reports it in the `ready` event.
const gatesWorkspace = (a: string) => {
const p = personaOf(a);
return p ? isProjectScoped(p) : gatesWorkspaceFallback(a);
@@ -1343,9 +1340,7 @@ export function App() {
// starts orphan ("" → server provisions). Chat has no workspace.
const targetWorkspace = gatesWorkspace(name)
? target.workspace || fallbackWorkspace(inheritable, knownProjects)
- : needsWorkspace(name)
- ? target.workspace || ""
- : "";
+ : target.workspace || "";
if (targetWorkspace && targetWorkspace !== workspace) {
setWorkspace(targetWorkspace);
setBranch(null);
@@ -1372,7 +1367,7 @@ export function App() {
if (fallback && fallback !== workspace) {
setWorkspace(fallback);
setBranch(null);
- } else if (!fallback && needsWorkspace(name)) {
+ } else if (!fallback) {
setWorkspace(null); // orphan cowork: server provisions a fresh scratch on connect
}
setSessionId(id);
@@ -1864,7 +1859,7 @@ export function App() {
<span className="mark">✦</span>
{agent === "chat" ? "How can I help?" : "Let's build something."}
</h1>
- {needsWorkspace(agent) && (
+ {(
<div className="suggestions">
<div className="suggest-head">Try a task</div>
{SUGGESTIONS.map((s, i) => (
@@ -1943,7 +1938,7 @@ export function App() {
<SessionSetupRow
personas={personas}
agent={agent}
- showFolder={needsWorkspace(agent)}
+ showFolder
folderName={workspace && !tempWorkspace ? baseName(workspace) : null}
onPickCoworker={pickCoworker}
onPickFolder={pickDraftFolder}
@@ -2002,7 +1997,7 @@ export function App() {
onModeChange={changeMode}
onModelChange={changeModel}
sessionId={sessionId}
- workspace={needsWorkspace(agent) ? workspace || "" : undefined}
+ workspace={workspace || ""}
unattended={unattended}
onUnattendedChange={agent !== "chat" ? toggleUnattended : undefined}
prefill={composerPrefill}
diff --git a/surfaces/gui/src/api.ts b/surfaces/gui/src/api.ts
index 9623a2be..6fa11f09 100644
--- a/surfaces/gui/src/api.ts
+++ b/surfaces/gui/src/api.ts
@@ -1030,10 +1030,8 @@ export interface Persona {
name: string;
icon: string;
tagline: string;
- needs_workspace: boolean;
+ requires_folder: boolean; // folder gate — drives project-scoping
builtin: boolean;
- family: string;
- workspace: string; // "git" | "project" | "deliverable" | "none" — drives project-scoping
tools: string[];
enabled: boolean;
surfaced: boolean;
@@ -1213,7 +1211,7 @@ export interface PersonaDetail {
tools: string[];
recommended_models: string[];
default_permission_mode: string;
- workspace: string;
+ requires_folder: boolean; // folder gate (workspace-scratch-design.md)
recommends: PersonaRecommendation[];
default_connections: PersonaDefaultConnection[];
}
diff --git a/surfaces/gui/src/components/PersonaView.tsx b/surfaces/gui/src/components/PersonaView.tsx
index 1f52b93f..126c7325 100644
--- a/surfaces/gui/src/components/PersonaView.tsx
+++ b/surfaces/gui/src/components/PersonaView.tsx
@@ -357,11 +357,10 @@ export function PersonaView({
<span className="text-faint">Default mode</span> · {detail.default_permission_mode}
</div>
)}
- {detail.workspace && (
- <div>
- <span className="text-faint">Workspace</span> · {detail.workspace}
- </div>
- )}
+ <div>
+ <span className="text-faint">Workspace</span> ·{" "}
+ {detail.requires_folder ? "picked folder" : "scratch"}
+ </div>
</section>
{/* management — the controls that left the list page (UX-035) */}
diff --git a/surfaces/gui/src/components/Sidebar.test.tsx b/surfaces/gui/src/components/Sidebar.test.tsx
index 59ddca0b..1ef31420 100644
--- a/surfaces/gui/src/components/Sidebar.test.tsx
+++ b/surfaces/gui/src/components/Sidebar.test.tsx
@@ -24,10 +24,10 @@ function stubFetch(routes: { match: string; method?: string; json: any }[]) {
const PERSONAS = {
personas: [
- { id: "cowork", name: "OpenWorker", icon: "cowork", tagline: "general assistant", family: "knowledge", enabled: true, surfaced: true, default: true },
- { id: "ops", name: "Ops", icon: "ops", tagline: "incidents, runbooks", family: "code", enabled: true, surfaced: true, default: false },
- { id: "code", name: "Code", icon: "code", tagline: "repository work", family: "code", enabled: true, surfaced: true, default: false },
- { id: "secret", name: "Disabled One", icon: "cowork", tagline: "off", family: "knowledge", enabled: false, surfaced: false, default: false },
+ { id: "cowork", name: "OpenWorker", icon: "cowork", tagline: "general assistant", requires_folder: false, enabled: true, surfaced: true, default: true },
+ { id: "ops", name: "Ops", icon: "ops", tagline: "incidents, runbooks", requires_folder: true, enabled: true, surfaced: true, default: false },
+ { id: "code", name: "Code", icon: "code", tagline: "repository work", requires_folder: true, enabled: true, surfaced: true, default: false },
+ { id: "secret", name: "Disabled One", icon: "cowork", tagline: "off", requires_folder: false, enabled: false, surfaced: false, default: false },
],
};
diff --git a/surfaces/gui/src/components/Sidebar.tsx b/surfaces/gui/src/components/Sidebar.tsx
index b3aaa381..4646985f 100644
--- a/surfaces/gui/src/components/Sidebar.tsx
+++ b/surfaces/gui/src/components/Sidebar.tsx
@@ -38,7 +38,7 @@ const SURFACES: { key: string; label: string; icon: IconName; cls: string }[] =
const surfaceFromPersona = (p: Persona) => ({
key: p.id,
label: shortPersonaName(p.name, p.id),
- icon: personaGlyph(p.icon, p.family),
+ icon: personaGlyph(p.icon, p.requires_folder),
cls: `ico-${p.icon || "cowork"}`,
});
diff --git a/surfaces/gui/src/components/personaIcon.tsx b/surfaces/gui/src/components/personaIcon.tsx
index eb37295d..ec496f99 100644
--- a/surfaces/gui/src/components/personaIcon.tsx
+++ b/surfaces/gui/src/components/personaIcon.tsx
@@ -39,24 +39,24 @@ export function isEmojiIcon(icon?: string): boolean {
return !!icon && /[^\x00-\x7F]/.test(icon);
}
-export function personaGlyph(icon?: string, family?: string): IconName {
+export function personaGlyph(icon?: string, folderScoped?: boolean): IconName {
if (icon && NAMED.has(icon)) return icon as IconName;
if (icon && LEGACY[icon]) return LEGACY[icon];
- return family === "code" ? "code" : "sparkle";
+ return folderScoped ? "code" : "sparkle";
}
/** Renders a persona's icon: an emoji as text, otherwise the resolved line glyph. */
export function PersonaGlyph({
icon,
- family,
+ folderScoped,
size = 14,
}: {
icon?: string;
- family?: string;
+ folderScoped?: boolean;
size?: number;
}) {
if (isEmojiIcon(icon)) {
return <span style={{ fontSize: size, lineHeight: 1 }}>{icon}</span>;
}
- return <Icon name={personaGlyph(icon, family)} size={size} />;
+ return <Icon name={personaGlyph(icon, folderScoped)} size={size} />;
}
diff --git a/surfaces/gui/src/personaScope.ts b/surfaces/gui/src/personaScope.ts
index e16157ca..ba83f9a6 100644
--- a/surfaces/gui/src/personaScope.ts
+++ b/surfaces/gui/src/personaScope.ts
@@ -1,10 +1,9 @@
-// A persona is "project-scoped" only when it's code-family: an explicit directory the user
-// picks, sessions grouped by project in the sidebar. Everything else (knowledge, chat) runs on
-// a transparent per-conversation scratch dir, with real folders added as roots when needed —
-// no folder gate, ever. (The old workspace enum — git/project/deliverable/none — collapsed
-// into family; owner decision 2026-07-03, UX-DECISIONS §16.)
-export function isProjectScoped(p?: { workspace?: string; family?: string }): boolean {
- return p?.family === "code";
+// A persona is "project-scoped" when it declares requires_folder: an explicit directory the
+// user picks, sessions grouped by project in the sidebar. Everything else runs on a transparent
+// per-conversation scratch dir, with real folders added as roots when needed — no folder gate.
+// (The old family/workspace-enum pair collapsed into this trait; workspace-scratch-design.md.)
+export function isProjectScoped(p?: { requires_folder?: boolean }): boolean {
+ return p?.requires_folder === true;
}
// Persona naming: the product is "OpenWorker"; the personas are a "Coworker" family — Coworker
diff --git a/tests/test_builtin_personas.py b/tests/test_builtin_personas.py
index e08f7121..49a1a449 100644
--- a/tests/test_builtin_personas.py
+++ b/tests/test_builtin_personas.py
@@ -25,7 +25,7 @@ def test_code_persona_matches_builder(tmp_path):
reg = PersonaRegistry()
ctx = _ctx(tmp_path)
assert _names(reg.agent("code"), ctx) == _names(code_agent(), ctx)
- assert reg.agent("code").family == "code"
+ assert reg.agent("code").requires_folder and reg.agent("code").subagents
def test_cowork_persona_matches_builder(tmp_path):
@@ -42,7 +42,7 @@ def test_ops_persona_composes_knowledge_toolset(tmp_path):
# Ops uses the same capability list as Cowork (files/search/shell/todo).
assert _names(reg.agent("ops"), ctx) == _names(cowork_agent(), ctx)
a = reg.agent("ops")
- assert a.family == "knowledge" and a.messaging and a.connectors
+ assert not a.requires_folder and a.scheduling and a.messaging and a.connectors
assert "read_file_lines" in _names(a, ctx) # multi-root knowledge files
diff --git a/tests/test_persona_connections.py b/tests/test_persona_connections.py
index f1f9b5c6..a235d942 100644
--- a/tests/test_persona_connections.py
+++ b/tests/test_persona_connections.py
@@ -66,9 +66,7 @@ def test_persona_detail_endpoint(tmp_path, monkeypatch):
assert detail["id"] == "ops"
assert detail["name"] == "Ops Coworker"
assert detail["enabled"] is True # builtins ship enabled (UX-029)
- assert (
- detail["workspace"] == "deliverable"
- ) # §16 collapse: ops is a scratch persona now
+ assert detail["requires_folder"] is False # ops is a scratch persona
assert detail["default_permission_mode"] == "interactive"
assert "anthropic:claude-opus-4-8" in detail["recommended_models"]
assert set(detail["tools"]) == {"files", "search", "shell", "todo"}
diff --git a/tests/test_persona_loading.py b/tests/test_persona_loading.py
index e832659d..a78ac2a5 100644
--- a/tests/test_persona_loading.py
+++ b/tests/test_persona_loading.py
@@ -54,7 +54,7 @@ def test_install_from_dir_lands_disabled_pending_consent(tmp_path):
reg.set_enabled("acme-ops", True)
reg.set_surfaced("acme-ops", True)
assert "acme-ops" in [e["name"] for e in reg.sidebar()]
- assert reg.agent("acme-ops").family == "knowledge"
+ assert reg.agent("acme-ops").requires_folder is False
def test_installed_persona_persists_across_restart(tmp_path):
@@ -131,7 +131,7 @@ def test_install_snapshots_independently_of_source(tmp_path):
shutil.rmtree(src) # source gone
reg2 = PersonaRegistry(state_path=tmp_path / "personas.json")
assert "acme-ops" in reg2.ids() and reg2.is_enabled("acme-ops")
- assert reg2.agent("acme-ops").family == "knowledge"
+ assert reg2.agent("acme-ops").requires_folder is False
def test_adding_a_connector_grows_capabilities_and_forces_reconsent(tmp_path):
diff --git a/tests/test_persona_manifest.py b/tests/test_persona_manifest.py
index d4680bf1..3bec9950 100644
--- a/tests/test_persona_manifest.py
+++ b/tests/test_persona_manifest.py
@@ -27,10 +27,9 @@ def test_parse_valid():
m = parse_manifest(VALID)
assert m.id == "demo" and m.name == "Demo Coworker"
assert m.tools == ["files", "search", "shell", "todo"]
- assert m.family == "knowledge" and m.workspace == "deliverable"
+ assert m.requires_folder is False and m.scheduling is True
assert m.messaging is True and m.connectors == ("github",)
assert m.recommended_models == ["anthropic:claude-opus-4-8"]
- assert m.needs_workspace is True
assert m.system_prompt.startswith("You are a demo coworker")
@@ -81,7 +80,7 @@ def test_to_agent_carries_traits_and_tools(tmp_path):
from coworker.tools.todo import TodoList
agent = parse_manifest(VALID).to_agent()
- assert agent.name == "demo" and agent.family == "knowledge"
+ assert agent.name == "demo" and agent.requires_folder is False
assert agent.messaging and agent.connectors
ctx = AgentContext(workspace=tmp_path, executor=object(), todo=TodoList())
names = {getattr(t, "__name__", "") for t in agent.build_tools(ctx)}
@@ -93,10 +92,10 @@ def test_list_field_accepts_comma_string():
assert parse_manifest(text).tools == ["files", "search"]
-def test_workspace_key_is_accepted_but_derived_from_family():
- # §16 collapse: the old enum still parses (back-compat + typo detection) but behavior
- # derives from family — knowledge → scratch ("deliverable"), code → "git". A manifest
- # can no longer demand a folder gate (`project`) or opt out of a workspace (`none`).
+def test_legacy_family_key_maps_to_traits():
+ # Legacy shim (workspace-scratch-design.md): pre-trait bundles declared
+ # `family: code|knowledge` (plus a dead `workspace:` enum, ignored). `family: code`
+ # maps to the folder-gated profile; explicit new keys always win.
text = """---
id: opsy
workspace: project
@@ -105,12 +104,18 @@ tools: [files, search, shell, todo]
Operate things.
"""
m = parse_manifest(text)
- assert m.workspace == "deliverable" and m.needs_workspace is True
+ assert m.requires_folder is False and m.subagents is False and m.scheduling is True
coded = parse_manifest(
"---\nid: dev\nfamily: code\nworkspace: none\ntools: [git]\n---\nCode."
)
- assert coded.workspace == "git" and coded.needs_workspace is True
+ assert coded.requires_folder and coded.subagents and not coded.scheduling
+
+ # New keys override the shim.
+ mixed = parse_manifest(
+ "---\nid: dev2\nfamily: code\nrequires_folder: false\ntools: [git]\n---\nCode."
+ )
+ assert mixed.requires_folder is False and mixed.subagents is True
@pytest.mark.parametrize(
@@ -122,7 +127,6 @@ Operate things.
("---\nid: x\ntools: [files]\n---\n", "no body"),
("---\nid: x\ntools: [nope]\n---\nbody", "unknown tool"),
("---\nid: x\nfamily: alien\ntools: []\n---\nbody", "family"),
- ("---\nid: x\nworkspace: cloud\ntools: []\n---\nbody", "workspace"),
(
"---\nid: x\ndefault_permission_mode: yolo\ntools: []\n---\nbody",
"permission",
diff --git a/tests/test_persona_registry.py b/tests/test_persona_registry.py
index c2e7f9f0..1c9ad8b6 100644
--- a/tests/test_persona_registry.py
+++ b/tests/test_persona_registry.py
@@ -137,20 +137,20 @@ def test_set_default_enables_and_persists(tmp_path):
def test_agent_resolution(tmp_path):
reg = _reg(tmp_path)
- assert reg.agent("ops").family == "knowledge"
- assert reg.agent("code").family == "code"
+ assert reg.agent("ops").requires_folder is False
+ assert reg.agent("code").requires_folder is True
# Unknown id → default persona.
assert reg.agent("does-not-exist").name == reg.default_id()
-def test_list_all_carries_workspace_enum(tmp_path, internal):
- # Post-§16 collapse: workspace derives from family — code → git, knowledge →
- # deliverable (scratch). Ops is a scratch persona now.
+def test_list_all_carries_requires_folder(tmp_path, internal):
+ # The workspace enum collapsed into the requires_folder trait
+ # (workspace-scratch-design.md): Code gates a folder; scratch personas don't.
reg = _reg(tmp_path)
- ws = {p["id"]: p["workspace"] for p in reg.list_all()}
- assert ws["code"] == "git"
- assert ws["cowork"] == "deliverable"
- assert ws["ops"] == "deliverable"
+ gated = {p["id"]: p["requires_folder"] for p in reg.list_all()}
+ assert gated["code"] is True
+ assert gated["cowork"] is False
+ assert gated["ops"] is False
def test_set_unknown_persona_raises(tmp_path):
diff --git a/tests/test_security_bundles.py b/tests/test_security_bundles.py
index 4007373b..9c810df1 100644
--- a/tests/test_security_bundles.py
+++ b/tests/test_security_bundles.py
@@ -38,10 +38,10 @@ def test_bundles_register_as_enabled_code_builtins(tmp_path):
for pid in BUNDLES:
entry = reg.get(pid)
assert entry is not None and entry.builtin
- assert entry.family == "code" # folder pick at send, like Code
+ assert entry.requires_folder # folder pick at send, like Code
assert reg.is_enabled(pid) is True # in the picker out of the box
agent = reg.agent(pid) # catalog-expanded tools materialize
- assert agent.family == "code" and agent.needs_workspace
+ assert agent.requires_folder and agent.subagents
def test_bundle_skill_folders_match_their_manifests(tmp_path):
diff --git a/tests/test_skills.py b/tests/test_skills.py
index ac7cdfa9..84c4bdb3 100644
--- a/tests/test_skills.py
+++ b/tests/test_skills.py
@@ -40,8 +40,8 @@ def test_code_agent_tools(tmp_path):
def test_chat_agent_has_no_workspace_tools():
assert chat_agent().build_tools(AgentContext()) == []
- assert chat_agent().needs_workspace is False
- assert code_agent().needs_workspace is True
+ assert chat_agent().requires_folder is False
+ assert code_agent().requires_folder is True
def test_get_agent_fallback():