Pipeline Workspace.hs: worktree pool management

t-603.4·WorkTask·
·
·
·Omni/Pipeline.hs
Parent:t-603·Created4 days ago·Updated4 days ago

Description

Edit

Create Omni/Pipeline/Workspace.hs - worktree pool management.

Depends on: Omni/Pipeline/Core.hs, Omni/Pipeline/Git.hs

Manages per-task dev worktrees and the persistent integration worktree.

Types:

  • WorkspacePool: TVar (Map Text FilePath) for active workspaces, max concurrency, root path

Functions:

  • newPool :: PipelineConfig -> IO WorkspacePool
  • acquireWorkspace :: WorkspacePool -> Text -> Text -> IO (Either Text FilePath)

-- (pool, taskId, baseBranch) -> creates worktree, returns path

  • releaseWorkspace :: WorkspacePool -> Text -> IO ()

-- removes worktree and deletes task branch

  • resetWorkspace :: WorkspacePool -> Text -> Text -> IO (Either Text FilePath)

-- deletes branch, recreates from baseBranch (for retry)

  • slotsAvailable :: WorkspacePool -> IO Int
  • ensureIntegrationWorktree :: WorkspacePool -> Text -> IO (Either Text FilePath)
  • recoverStaleWorkspaces :: WorkspacePool -> IO ()

-- startup: scan root dir, clean up orphaned worktrees

Verify: typecheck.sh Omni/Pipeline/Workspace.hs

Timeline (1)

🔄[human]Open → Done4 days ago