Skip to content

Implement workspace isolation with WorkspaceIsolationStrategy protocol (DESIGN_SPEC §6.8) #133

@Aureliolo

Description

@Aureliolo

Context

When multiple agents work on the same codebase concurrently, they may edit overlapping files. The framework provides a pluggable WorkspaceIsolationStrategy protocol for managing concurrent file access. The default strategy combines intelligent task decomposition with git worktree isolation.

Acceptance Criteria

WorkspaceIsolationStrategy Protocol

  • WorkspaceIsolationStrategy protocol defined
  • Protocol is pluggable — new strategies can be registered via config

Planner + Git Worktrees Strategy (Default)

  • Task planner decomposes work to minimize file overlap across agents
  • Each agent operates in its own git worktree (shared .git, independent working tree)
  • max_concurrent_worktrees configurable (default: 8)
  • Sequential merge on completion (first done merges first, or by priority)
  • Textual conflicts detected by git → escalate to human or review agent
  • Semantic conflicts → review agent evaluates merged result
  • Worktree cleanup after merge

State Coordination Table

  • Framework state: centralized single-writer (TaskEngine) via asyncio.Queue
  • Code/files: workspace isolation via git worktrees
  • Agent memory: per-agent ownership
  • Org memory: single-writer with role-based access

Testing

  • Unit tests for WorkspaceIsolationStrategy protocol
  • Integration test: two agents edit different files → successful merge
  • Integration test: two agents edit same file → conflict detected and escalated

Dependencies

Design Spec Reference

  • §6.8 — Concurrent Workspace Isolation
  • §15.5 — Engineering Conventions (workspace isolation, state coordination rows)

Metadata

Metadata

Assignees

No one assigned

    Labels

    prio:highImportant, should be prioritizedscope:large3+ days of workspec:agent-systemDESIGN_SPEC Section 3 - Agent Systemspec:task-workflowDESIGN_SPEC Section 6 - Task & Workflow Enginespec:toolsDESIGN_SPEC Section 11 - Tool & Capability Systemtype:featureNew feature implementation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions