WorkspaceManager class
Creates and reuses per-issue workspaces backed by git worktrees.
The manager enforces the Symphony safety invariants:
- Workspace keys are sanitized to
[A-Za-z0-9._-]. - Workspace paths must remain inside the configured workspace root.
- Each workspace is the cwd handed to the agent runner.
Constructors
- WorkspaceManager({required WorkspaceWorkflowConfig workspaceConfig, required HooksWorkflowConfig hooksConfig, required Logger logger, String? repositoryRoot, WorkspaceHookRunner? hookRunner, String baseRef = 'HEAD', bool? useGitWorktrees, GitCommandRunner? gitRunner})
- Creates a workspace manager.
Properties
- baseRef → String
-
Branch ref (or commit) used as the base for new worktrees.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hookRunner → WorkspaceHookRunner
-
Hook runner used for
after_create/before_run/after_run/before_remove.final - hooksConfig → HooksWorkflowConfig
-
Hook configuration applied when running lifecycle hooks.
final
- logger → Logger
-
Logger for status messages.
final
- repositoryRoot → String
-
Repository root used as the source for git worktrees. Defaults to the
current working directory.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- useGitWorktrees → bool
-
Whether to actually create git worktrees.
final
- workspaceConfig → WorkspaceWorkflowConfig
-
Workspace settings derived from
WORKFLOW.md.final
Methods
-
createForIssue(
String issueIdentifier) → Future< Workspace> -
Creates or reuses the workspace for
issueIdentifier. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
String issueIdentifier) → Future< WorkspaceRemoval> - Removes the workspace directory and unregisters the worktree.
-
resolvePath(
String issueIdentifier) → String -
Resolves the workspace path for
issueIdentifierwithout creating it. -
runAfterRun(
Workspace workspace) → Future< WorkspaceHookOutcome> -
Runs the configured
after_runhook. Failures are swallowed per spec. -
runBeforeRun(
Workspace workspace) → Future< WorkspaceHookOutcome> -
Runs the configured
before_runhook. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
sanitizeKey(
String identifier) → String -
Sanitizes
identifierinto a workspace key.