Skip to content

Team mode M6: Workspace roots and audience-contained grants #4145

Closed

Description

@DoodleBears

Parent: hub #4138 (spec #4137, ADR-0336, amends ADR-0067). Blocked by: #4142.

Behavior

  • Each member has an account space (spaces/<humanId>), which is their personal Workspace root. Admins create audience-scoped shared spaces (for example shared/team, shared/finance) and grant them to roles or members.
  • A personal root can be granted only to its owner's private Bots. A shared root can be granted only to Bots whose audience it covers.
  • Grants into another member's root, any Bot's Memory repository or the Host data directory are refused for everyone, including holders of grant-workspace.

Acceptance

  • A regression proves that Alice's Bot cannot read Bob's root, through every path-addressed tool and through symlink escapes.
  • Refusals are coded and shown in the UI and the CLI.
  • Merged M2 stores member Tob and private Bot Memory under the Host's managed Bot root. Moving that Memory into spaces/<humanId>/bots/<slug>/memory needs a migration that moves existing member Memory and rewrites the Memory ownership proofs (persona_bot_memory_ownership). Take the next free migration generation at implementation time; do not reuse a number reserved by in-flight slices.
  • M9's transfer and purge cover spaces/<humanId> and the shared spaces (files and Bot Memory), in addition to Channels, private Bots, Tob and Memory.
  • Shell reads are out of scope here and are covered by M12 (Team mode M12: Bot execution confinement on Linux Hosts #4183). This slice exposes the per-Session root computation (currentRoots(session, kind)) that M12 reuses.

Activity

  1. DoodleBears commented on Nov 14, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim

    • Agent: Claude Code (orchestrator, UI/UX) + Codex CLI (logic)
    • Task: claude/local/74a5ee4a-f6fe-4aab-870f-5e465b0b8474 (not a DSH Session)
    • Issue scope: M6 per the contract below
    • Branch: claude/4145-… (from main; Codex sub-branch codex/4145-logic)
    • Started: 2026-11-14 10:46 UTC
    • State: active

    M6 wire contract (agreed before parallel work; Claude = UI, Codex = logic)

    Based on main after M2 (#4166), M9 (#4167); M4 (#4169) and M10 are landing in parallel — whichever lands later reconciles migrations (next free generation, never hard-coded) and member-methods.ts.

    Spaces

    • Each active member has an account space spaces/<humanId> (their personal Workspace root), created on member creation / first sign-in and for existing members by migration. The Owner has one too.
    • Shared spaces shared/<slug> with an audience { kind: 'roles', roleIds } | { kind: 'members', humanIds } | { kind: 'everyone' } (Host Role IDs from M3/M4).
    • spaces → [{ spaceId, kind: 'account' | 'shared', name, ownerHumanId?, audience?, canManage }] — the caller sees their own account space and every shared space whose audience includes them; holders of workspaces.manageShared see all shared spaces. No other member's account space is listed.
    • spaceCreate { name, audience }, spaceUpdate { spaceId, name?, audience? }, spaceDelete { spaceId, confirm: true } — shared only; need workspaces.manageShared. Refusals: permission-required (details.permission), space-name-taken, space-not-empty (delete refuses while files or Bot Memory remain), space-not-found, role-not-found, member-not-found.

    Grants (extends ADR-0067 grants)

    • A grant into an account space is allowed only to its owner's private Bots; into a shared space only to Bots whose audience is covered by the space audience (M7 refines Bot audience; until then a private Bot's audience is its owner, a Host Bot's audience is the Owner).
    • Refused for everyone, including grant-workspace holders: another member's account space (grant-foreign-space), any Bot's Memory repository (grant-protected-path), the Host data directory (grant-protected-path), and a shared space whose audience does not cover the Bot (grant-outside-audience). details.path and details.spaceId when known.
    • Path-addressed tools resolve real paths (symlinks, .., hard links where detectable) before checking roots; escapes are refused with the same codes.
    • Export currentRoots(session, kind) for M12 (Team mode M12: Bot execution confinement on Linux Hosts #4183).

    Memory move: migration moves existing member Tob/private Bot Memory to spaces/<humanId>/bots/<slug>/memory and rewrites persona_bot_memory_ownership; new member Bots are created there.

    M9 integration: transfer moves a member's account-space files and Bot Memory to the target's account space (preview lists them); purge removes the account space; shared spaces are untouched by purge except files the member alone owns per Content Purge rules.

    CLI: spaces list | create --name --audience roles:<id,…>|members:<u,…>|everyone | update <spaceId> … | delete <spaceId> --confirm; --as for all.

    Client (Claude): Settings › Team › Shared spaces (list, create with audience picker, edit, delete) for workspaces.manageShared; "Your space" row under My account; workspace pickers show account/shared spaces; grant refusal codes mapped to plain messages; en + zh.

    Tests: Alice's Bot cannot read Bob's account space through every path-addressed tool and symlink escape; grant refusals for each code; Memory move migration with ownership proofs; transfer/purge of spaces; CLI --as parity.

  2. DoodleBears commented on Nov 14, 2026

    @DoodleBears
    ContributorAuthor

    Human decisions (Vain, 2026-11-15):

    • UI calls spaces folders ("Your folder", "Shared folders"); code and wire names stay spaces.
    • Owner keeps single-user behaviour: the Owner's Bots can be granted any folder on the computer (with the usual approval card). Members are limited to their own folder and shared folders whose audience covers the Bot.
    • A member's new private Bot is automatically granted read/write on the member's own files/ (revocable, or narrowed to read-only); shared folders need an explicit grant. Its Memory lives at spaces/<humanId>/bots/<slug>/memory and never moves outside the member's folder.
    • No file browser for now: files move through Channels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions