Skip to content

Workspaces are their own module, not sandbox plumbing - #317

Merged
czpython merged 1 commit into
mainfrom
workspaces-own-module
Aug 24, 2026
Merged

czpython merged 1 commit into
mainfrom
workspaces-own-module

Conversation

@czpython

Copy link
Copy Markdown
Owner

The Workspace abstraction was split across two wrong layers. The base Workspace lived in druks.sandbox.datastructures, yet it resolves OAuth, folds the MCP registry, reads user settings, and commits the DB session — that is agent-execution policy, not VM plumbing. RepoWorkspace (the base plus a cloned repo, a short-lived GitHub token, and git-identity setup) was buried inside the ship app, so no other app could reuse it without depending on ship's package.

This gives the whole concern one home: a new top-level druks.workspaces module holding both classes.

from druks.workspaces import Workspace, RepoWorkspace
  • druks.sandbox.datastructures keeps only its data shapes and loses its OAuth / MCP / DB imports — sandbox moves closer to pure plumbing.
  • druks.workspaces stays out of the pinned author surface (test_author_surface.py). It is platform machinery first-party apps borrow directly, not a frozen v1 contract — the same latitude contrib already has.

Behavior-preserving: both classes move verbatim (the base Workspace body is byte-for-byte unchanged), and the importers switch to the new path — workflows.py (the runtime workspace_class default), agents.py, ship, review, and the mcp/build tests.

Unblocks the site_builder workspace simplification (separate druks-apps PR): it subclasses RepoWorkspace without reaching into another app's package.

Move the Workspace base and RepoWorkspace into a new druks.workspaces
module. Both sat in the wrong layer: the base lived in
druks.sandbox.datastructures although it resolves OAuth, folds the MCP
registry, and commits the DB — execution policy, not VM plumbing — while
RepoWorkspace was buried inside the ship app, out of reach of any other app.

Now they share one home. Apps subclass and import from druks.workspaces, and
sandbox.datastructures keeps only its data shapes. Behavior is unchanged: both
classes move verbatim, and workflows, agents, and the apps switch to the new
import path. druks.workspaces stays out of the pinned author surface — first-
party apps borrow it directly, the same way contrib borrows other platform
machinery.
@czpython
czpython merged commit 01da5fa into main Aug 24, 2026
2 checks passed
@czpython
czpython deleted the workspaces-own-module branch August 24, 2026 07:30
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