Workspace and execution

This page defines the current contract for workspace identity, execution roots, worktree isolation, and host-local execution policy.

Last verified: 2026-09-13 against src/types.rs ActiveWorkspaceEntry, WorkspaceOccupancyRecord, WorktreeSession, src/system/types.rs ExecutionSnapshot, and src/runtime/workspace.rs.

Source RFCs

Core model

Every agent has exactly one active workspace. The active workspace defines:

ConceptMeaning
workspace_idStable identifier for the workspace
workspace_anchorFilesystem path to the workspace root
execution_rootThe root for process execution (may differ from anchor)
cwdCurrent working directory for shell commands
projection_kindHow the workspace is projected (CanonicalRoot, GitWorktreeRoot)
access_modeHow the agent holds the workspace (SharedRead, ExclusiveWrite)

Active workspace vs shell cd

Agent home

agent_home is the built-in fallback workspace for agent-local state:

DirectoryPurpose
AGENTS.mdLong-lived agent contract (loaded as guidance)
memory/Curated memory markdown (self.md, operator.md)
notes/Working notes
work-items/WorkItem plan artifacts (plan.md)
skills/Agent-local skills
tmp/Short-lived working files; may be cleaned up at any time
.holon/Runtime-owned state, ledger, index, cache

Key contract:

Workspace occupancy

Workspaces track occupancy: which agent holds the workspace and how:

FieldPurpose
holder_agent_idThe agent currently occupying the workspace
access_modeSharedRead or ExclusiveWrite
acquired_atWhen occupancy was acquired
released_atWhen occupancy was released (if released)

Workspace occupancy is used for coordination; it is not a hard lock. The runtime uses occupancy records for diagnostics and cleanup, not for preventing concurrent access at the filesystem level.

Worktrees

When an agent needs isolated file changes, CreateWorktree creates or safely reuses a runtime-managed linked worktree from an explicit branch and base_ref:

Execution snapshot (ExecutionSnapshot)

The ExecutionSnapshot in AgentSummary captures the current execution context:

The surrounding AgentSummary also reports the active run id (agent.current_run_id), the active workspace occupancy, and the worktree session.

Host-local policy

Holon's current execution model is host-local: processes run on the host filesystem with the agent user's permissions. Key constraints:

File references and output delivery contract

Holon defines an explicit contract for output delivery and cross-surface file references:

Self-contained output delivery

Agent delivery is brief-centric. Final briefs and assistant messages must be self-contained: an operator should understand outcomes, verification status, risks, and required actions without digging into intermediate tool logs or opening referenced files. File references serve as entry points to supporting artifacts, not substitutes for the result summary itself.

Surface-specific file reference formats

The appropriate reference form depends on the output surface where it appears:

Location resolution

The runtime exposes POST /api/file-references/resolve to resolve absolute paths, legacy workspace URIs, and relative paths (with explicit base_file) against registered workspaces and execution roots. It deduplicates file roots by filesystem anchor with canonical workspace priority so references remain unambiguous across worktrees.

Known gaps