Skip to content

Workspaces phase 2m: what the review of 2l found (#277) - #331

Merged
antiv merged 1 commit into
mainfrom
workspaces-phase-2m
Nov 7, 2026
Merged

antiv merged 1 commit into
mainfrom
workspaces-phase-2m

Conversation

@antiv

@antiv antiv commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Part of #277. A review of 2l alone (5cad65f..484f9f3) found no cross-workspace path, which closes phase 2. This PR fixes the bugs it did find.

Changes

  • Non-ASCII parent names. is_agent_name accepts any identifier, such as pomoćnik. parent_agents is written with json.dumps, which stores that name as "pomoćnik". The LIKE '%"pomoćnik"%' lookup therefore found no children:

    • the tree builder (AgentManager.get_subagents) gave such a parent no sub-agents;
    • a rename (added in 2l) didn't rewrite them;
    • a project move didn't carry them along.

    The new may_name_as_parent matches both spellings, with _ and % escaped, and the list is then compared exactly. Checked on MySQL 8.

  • Eval pages. These queries now count only the current workspace's test cases, as the playground has since 2l:

    • the agent's test case list;
    • its score history;
    • the per-suite score;
    • the regression check after a run.

    A test case always has its agent's workspace, so this is consistency, not a leak.

  • Dashboard admin check.

    • A platform admin is allowed before the workspace is resolved. The check now resolves the workspace in the same thread, so the route reuses it. A workspace the admin can't open is still the route's to answer.
    • A denial's audit row is written off the event loop.
  • Trigger project_id. true and 2.5 are a 400; before, they became projects 1 and 2. Create and update parse the value once.

  • Import. An agent or memory block naming no project goes to project 1 when the workspace has it, and to the workspace's oldest project otherwise. This covers a Default workspace whose project 1 was deleted.

  • 2l tests. They now follow PEP 8 and carry type hints: no lambda assignment, hinted helpers.

Not changed:

  • Rolling back a child to an older version restores the parent name it had then. A rollback restores everything in the version.
  • The RBAC check's rollback() runs on every model call. It costs one round trip, and get_or_create_user doesn't report whether it created the user.

Tests

TestReviewOfPhase2l: six tests, and each fails without its fix.

  • Full suite: 1901 OK (1 skipped).
  • test_client_contract: 12/12, unchanged.
  • gen_docs --check: OK.

Docs

Updated:

  • docs/user/agents.md: the import rule.
  • docs/user/evals.md: the page shows the workspace's evals.
  • The 2.0 plan: entry 13.

drift also lists these guides, which still hold:

  • docs/user/triggers.md and docs/dev/trigger-engine.md: project_id validation isn't described.
  • docs/dev/agent-runtime.md: "rows whose parent_agents JSON list contains the parent's name" is still what the code does.
  • docs/dev/alerts.md and docs/dev/template-format.md: untouched code in dashboard_server.py.
  • docs/dev/auth-and-access.md: "makes it to check for an admin, in a thread … the route's dependency reuses it and the workspace it resolved" is now true for platform admins too.

A review of 2l alone (5cad65f..484f9f3) found no cross-workspace path,
which closes phase 2. These are its bugs:

- A parent with a non-ASCII name had no sub-agents: json.dumps stores
  the name with \u escapes, which the parent_agents LIKE missed. Building
  the tree, a rename and a project move now match both spellings
  (may_name_as_parent).
- The eval pages' test case list, history, suite scores and the
  regression check count the workspace's test cases only.
- The admin check resolves a platform admin's workspace off the event
  loop too, and writes a denial's audit row off it.
- A trigger's project_id of true or 2.5 is a 400; create and update
  parse it once.
- An import naming no project goes to project 1 where the workspace
  has it, else to its oldest project.
- The 2l tests follow PEP 8 and carry type hints.
@antiv
antiv merged commit 4c5430c into main Nov 7, 2026
2 checks passed
@antiv
antiv deleted the workspaces-phase-2m branch November 22, 2026 07:26
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