Skip to main content
  • Version 0.1.0
  • Purity server-only (shells out to the git CLI via node:child_process, reads/writes files via node:fs)
  • Purpose Provision per-task git worktrees, write the runtime-agnostic system-of-record scaffold, and validate the structured AGENT_HANDOFF.json so any runtime, or a human, can pick up a task cold.
  • Workspace deps none
  • External deps zod ^3.25.0
The board is the dispatcher; the task’s worktree is the durable, on-disk world. A worktree gives concurrency isolation (no write races between parallel teammates), NOT a privilege boundary; that escalation is the container tier, which this package never provisions. The package exposes a single . entry point (no subpath exports). DB-bound bookkeeping (the workspaces row, the task status drive) lives server-side in apps/web/server/lib/worktrees.ts; this package is purely the git/file mechanism.

Public API

Functions

isolation (./isolation) scaffold (./scaffold) handoff (./handoff) lifecycle (./lifecycle) git (./git, low-level plumbing, exported for the server orchestrator + tests)

Types & interfaces

Constants

Classes

Used by

  • apps/web (server): lib/worktrees.ts (the board orchestrator: provision/load/pause/resume/complete/GC, scaffold, handoff round-trip, SOR_FILES, IsolationLevel), lib/executorRunner.ts (claim → worktree → run → verify → handoff), lib/verification/{index,critic,deterministicGate}.ts (commitWorktreeWork, provisionReviewWorktree/removeReviewWorktree, DiffStat/Worktree, SOR_FILES), lib/routines/openclawDispatch.ts (KeyedMutex), api/board.ts (agentHandoffSchema).

Source

Barrel: packages/worktrees/src/index.ts (re-exports ./types, ./isolation, ./scaffold, ./handoff, ./lifecycle, ./git).

See also

Last modified on August 21, 2026