Domain Model
The core domain objects and their relationships.
Entity diagram
Package ──────────── PackageVersion
│ │
│ ├── Asset[]
│ ├── sha256
│ └── channel
│
Workspace ─────────── WorkspaceTarget
│ │
│ ├── packages (name + constraint)
│ └── providers[]
│
├── Binding
├── revision (counter)
└── WorkspaceRevision (snapshot)
LockFile ──────────── LockFileEntry (name + version + sha256)
│
└── RenderedFileEntry (path + owner + sha256 + provider)
StateFile ─────────── installed packages + rendered files
Core types
Asset types
enum AssetType {
Instruction = "instruction",
Skill = "skill",
Agent = "agent",
Workflow = "workflow",
Prompt = "prompt",
Hook = "hook",
McpServer = "mcp_server",
ProviderConfig = "provider_config",
Template = "template",
Policy = "policy",
TelemetrySchema = "telemetry_schema",
}
Providers
enum Provider {
Claude = "claude",
Codex = "codex",
Gemini = "gemini",
Copilot = "copilot",
}
Package
A scoped, versioned bundle of assets. Owned by an organization. Versions are immutable.
Workspace
Binds an org's intent to a repo, monorepo, folder, or arbitrary key. Contains one or more targets, each with a package selection and provider list.
WorkspaceTarget
A sub-path within a workspace. For simple repos, there is one target at .. For monorepos, there are multiple targets at different paths.
Binding
Links a local directory to a remote workspace. Stored in .loom/binding.toml.
LockFile
The resolved desired state after wl pull. Records exact package versions and rendered file hashes. Analogous to package-lock.json.
StateFile
Tracks the actual local installed state. Records what was last synced, which files exist, and their ownership. Used for drift detection.
Version model
Two independent version systems:
- Package versions — immutable semver snapshots of asset content
- Workspace revisions — monotonically increasing counter tracking workspace configuration changes
A workspace revision selects specific package versions (via constraints). The lock file records the resolution.