Repository navigation
Workspaces phase 2d: logs and operations keep to the workspace (#277) - #319
Merged
Merged
Conversation
The usage figures and pages, the usage, guardrail and audit logs, sessions, traces and replays, rate limits, alert rules, triggers, widget keys, feedback, personal access tokens and Slack integrations read and write the request's workspace only. A route naming another workspace's row answers 404, and a budget, rule, trigger, key or integration may name only the workspace's agents and projects. - workspaces.rows_of and in_projects_of filter on a row's workspace or project. A log row with no workspace (an agent with no config, an installation-wide audit entry, a row the backfill hasn't reached) counts as the default workspace's, so a 1.x installation sees all its rows. - A session belongs to the workspace of its app_name; a trace to the workspace of every agent its spans name. - rate_limit_config is looked up by scope, scope id and workspace, so a user has a limit in each workspace, counted on their usage there. Alert rules measure their own workspace; global means its agents. update_rule and upsert_config set only an allowlist of fields. - V047: UNIQUE (team_id) on channel_integrations, since a Slack event names only its team; a taken team answers 409. The migration fails on duplicates and says how to find them. - Audit entries about widget keys, template imports and syncs and memory block restores carry their project, and PAT entries their workspace. NOT_YET_SCOPED is empty and removed from the cross-workspace test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2d of #277 (
documents/design/2.0-plan.md). Logs and operations now read and write only the request's workspace. With one workspace the behaviour doesn't change, apart from what is listed below.What is scoped
/statsand/usage/logs.app_name, the root agent. Detail and delete answer 404 for another workspace's session.upsert_configsets only an allowlist of fields.globalmeans the workspace's agents.update_rulesets only an allowlist of fields.ctx.workspace_id. List and revoke cover the current workspace's tokens only.UNIQUE (team_id)onchannel_integrations.A log row with no workspace counts as the default workspace's (
workspaces.rows_ofandin_projects_of). That covers an agent with no config, an installation-wide audit entry, and a row the backfill hasn't reached yet. So a 1.x installation still sees all of its rows: locally, the audit log lists 371 of 371 entries, 246 of which have no workspace.NOT_YET_SCOPEDis empty, so it is removed fromtest_cross_workspace.py.BODIES_NAMING_Bgains eight writes. The newTestLogsAndOperationschecks that:Behaviour changes with one workspace
PUT /widget-keys/{id}andDELETE /widget-keys/{id};POST /triggerswith a project that doesn't exist;POST /alert-rules/{id}/test.DELETE /sessionsanswers 404 for a session it can't find. Before, it tried the delete anyway, and still answered 404.Verification
test_client_contract.pyis unchanged.X-MATE-Workspace: 2answers 404.Docs
python scripts/gen_docs.pywas rerun: the API reference and the database reference (V047).driftlists that still hold:docs/user/agents.md,templates.md,memory-blocks.md,users-and-roles.mdanddocs/dev/template-format.mdmatch only ondashboard_server.pyname patterns. Their behaviour is unchanged; only the audit entries for template import and sync and memory block restore gain a project.docs/user/evals.md: the thumbs-down list is unchanged. Only the Work Room's per-session ratings are filtered.Next is 2e: enforcing the platform-only list,
ctx.is_admintaking in workspace owners and admins, A2A, and the switcher.