Workspaces are their own module, not sandbox plumbing - #317
Merged
Merged
Conversation
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.
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.
The Workspace abstraction was split across two wrong layers. The base
Workspacelived indruks.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.workspacesmodule holding both classes.druks.sandbox.datastructureskeeps only its data shapes and loses its OAuth / MCP / DB imports — sandbox moves closer to pure plumbing.druks.workspacesstays 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
Workspacebody is byte-for-byte unchanged), and the importers switch to the new path —workflows.py(the runtimeworkspace_classdefault),agents.py, ship, review, and the mcp/build tests.Unblocks the site_builder workspace simplification (separate druks-apps PR): it subclasses
RepoWorkspacewithout reaching into another app's package.