Skip to content

Rename tenant to workspace; teams become workspace folders#8

Merged
mishanefedov merged 2 commits into
mainfrom
tenant-to-workspace
Jun 13, 2026
Merged

Rename tenant to workspace; teams become workspace folders#8
mishanefedov merged 2 commits into
mainfrom
tenant-to-workspace

Conversation

@mishanefedov

@mishanefedov mishanefedov commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace the tenant concept with workspace across code, API surface, and docs
  • teams are now a folder convention under /workspace/teams/<slug>/, not a separate scope
  • Brain user scopes are /private/ and /workspace/ (plus read-only /system/)
  • Clients/docs updated to the new workspace API

Test plan

  • lint + tests pass on the branch
  • zero residual tenant references

Summary by cubic

Renamed the “tenant” model to “workspace” across the SDK and API, and moved teams to folders under /workspace/teams/<slug>/. This is a breaking change that standardizes writable roots to /private/ and /workspace/.

  • Refactors

    • Types and fields: WhoAmITenantWhoAmIWorkspace; response tenantworkspace; tenantIdworkspaceId.
    • Paths: /tenant//workspace/; removed /teams/ as a root. Legacy /tenant/ and /teams/ now raise BrainContractError.
    • Updated docstrings, examples, README, and tests to use workspace naming and paths.
  • Migration

    • Replace paths: /tenant/.../workspace/...; /teams/<slug>/.../workspace/teams/<slug>/....
    • Update code for response fields and types: tenantworkspace, tenantIdworkspaceId, WhoAmITenantWhoAmIWorkspace.
    • Only write under /private/ or /workspace/; using /teams/ or other removed roots will error.

Written for commit 2191cb1. Summary will update on new commits.

Review in cubic

Replace all uses of the old tenant model with the workspace model:
- WhoAmITenant → WhoAmIWorkspace, response field tenant → workspace
- ProvisionResponse.tenantId / VerifyResponse.tenantId → workspaceId
- /tenant/ path root → /workspace/ (old /tenant/ and /teams/ roots are
  now removed roots that raise BrainContractError)
- Error messages, docstrings, examples, and README updated to match
- New tests assert /tenant/ and /teams/ prefixes raise; old passthrough
  tests replaced with /workspace/ and /workspace/teams/ equivalents

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 10 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="README.md">

<violation number="1" location="README.md:259">
P2: Team-folder example path is missing the leading `/`. Copying this path makes it unqualified and can be rewritten to `/private/notes/...` instead of workspace storage.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread README.md
| `/private/...` | Private to the calling user |
| `/tenant/...` | Entire tenant |
| `/teams/<slug>/...` | That team-space |
| `/workspace/...` | Entire workspace (use `workspace/teams/<slug>/` for team folders) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Team-folder example path is missing the leading /. Copying this path makes it unqualified and can be rewritten to /private/notes/... instead of workspace storage.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 259:

<comment>Team-folder example path is missing the leading `/`. Copying this path makes it unqualified and can be rewritten to `/private/notes/...` instead of workspace storage.</comment>

<file context>
@@ -256,18 +256,17 @@ All document paths must end in `.md`. Writable roots:
 | `/private/...` | Private to the calling user |
-| `/tenant/...` | Entire tenant |
-| `/teams/<slug>/...` | That team-space |
+| `/workspace/...` | Entire workspace (use `workspace/teams/<slug>/` for team folders) |
 
-Unqualified paths (no leading `/`) are automatically rewritten to `/private/notes/<slug>.md`. Invalid roots (`/actions/`, `/raw/`, unknown namespaces) raise `BrainContractError` before any network call.
</file context>
Suggested change
| `/workspace/...` | Entire workspace (use `workspace/teams/<slug>/` for team folders) |
| `/workspace/...` | Entire workspace (use `/workspace/teams/<slug>/` for team folders) |

@mishanefedov mishanefedov merged commit f573e43 into main Jun 13, 2026
4 checks passed
@mishanefedov mishanefedov deleted the tenant-to-workspace branch June 13, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant