Story
As a workflow author, I want named Repositories and optional named Worktrees composed inside one retained Workspace, so one workflow can operate on multiple repositories without implicit repository-name resolution or a magical first directory.
Contract
Repository creates or attaches a normal primary checkout inside the Workspace. Its lexical form establishes cwd for descendants; its self-closing form returns a Workspace-relative path binding. Repository URLs and bases come from ordinary root props or expressions—names do not resolve configuration implicitly.
Worktree creates a named Git worktree for the contextual Repository. Its name is its stable identity within the Workspace. It checks out the default branch when base is absent or the specified base when present, then switches to the requested new branch. A Worktree may lexically contain any components, including Agent.
Dir remains lexical cwd only. Agent-readable directory registration belongs to Agent.AddDir in #302.
Worktrees are retained with the WorkflowRun. Cleanup is explicit; success does not silently delete useful state. A worktree is composition and isolation, not a security boundary.
Acceptance
- One Workspace can retain two Repositories and Worktrees from different remotes without path or identity collision.
- Repository and Worktree names are explicit stable component identities, not magic configuration lookup keys.
- Root props and expressions may supply repository, base, branch, and path values.
- Omitted Repository base uses the remote default branch.
- Worktree checkout follows the selected base and then switches to its new named branch.
- Lexical forms establish contextual cwd for all descendants.
- Self-closing forms return Workspace-relative paths without changing later cwd.
- Replay restores metadata and paths without recreating a completed checkout effect.
- Missing or conflicting retained Git state fails explicitly.
- Deletion or cleanup reports retained dirty, unpushed, or conflicting work and never discards it implicitly.
Dependencies
Story
As a workflow author, I want named Repositories and optional named Worktrees composed inside one retained Workspace, so one workflow can operate on multiple repositories without implicit repository-name resolution or a magical first directory.
Contract
Repositorycreates or attaches a normal primary checkout inside the Workspace. Its lexical form establishes cwd for descendants; its self-closing form returns a Workspace-relative path binding. Repository URLs and bases come from ordinary root props or expressions—names do not resolve configuration implicitly.Worktreecreates a named Git worktree for the contextual Repository. Its name is its stable identity within the Workspace. It checks out the default branch whenbaseis absent or the specified base when present, then switches to the requested new branch. A Worktree may lexically contain any components, including Agent.Dirremains lexical cwd only. Agent-readable directory registration belongs toAgent.AddDirin #302.Worktrees are retained with the WorkflowRun. Cleanup is explicit; success does not silently delete useful state. A worktree is composition and isolation, not a security boundary.
Acceptance
Dependencies