Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.workspace.core

Backend-neutral workspaces, DB-pinned to session_state 1:1.

The user's real cwd is trunk — Vis never mutates it, and Vis no longer requires it to be a git repo. A session works in trunk by default. Isolation operations are backend primitives reserved for engine-managed work. Vis ships two draft backends: a linked Git worktree (git worktree add on a fresh vis/<label> branch, sharing the repository's objects and refs) and a Rift copy-on-write clone for projects without Git history. draft-backend-for selects between them under the draft_backend toggle; the capability matrix is a diagnostics/feature-discovery surface.

'What changed since the fork' is computed git-free: clonefile preserves source mtimes, so files the agent touches in the clone get a fresh mtime greater than the fork timestamp we capture at clone time. apply! lands exactly those files back into cwd, uncommitted; the workspace.drafts/approve! instead commits the draft and merges it into the repository's local default branch.

Vis never mutates JVM user.dir. Channels rebind workspace-root per turn from the active workspace; tools resolve paths via (workspace/cwd). There is NO process-cwd fallback in production - the env carries :workspace/root from create-environment onward.

Backend-neutral workspaces, DB-pinned to session_state 1:1.

The user's real cwd is *trunk* — Vis never mutates it, and Vis no
longer requires it to be a git repo. A session works in trunk by default.
Isolation operations are backend primitives reserved for engine-managed work.
Vis ships two draft backends: a linked Git worktree (`git worktree add` on a
fresh `vis/<label>` branch, sharing the repository's objects and refs) and a
Rift copy-on-write clone for projects without Git history. `draft-backend-for`
selects between them under the `draft_backend` toggle; the capability matrix is
a diagnostics/feature-discovery surface.

'What changed since the fork' is computed git-free: `clonefile`
preserves source mtimes, so files the agent touches in the clone get
a fresh mtime greater than the fork timestamp we capture at clone
time. `apply!` lands exactly those files back into cwd, uncommitted; the
`workspace.drafts/approve!` instead commits the draft and merges it into the
repository's local default branch.

Vis never mutates JVM user.dir. Channels rebind *workspace-root* per
turn from the active workspace; tools resolve paths via
(workspace/cwd). There is NO process-cwd fallback in production -
the env carries `:workspace/root` from `create-environment` onward.
raw docstring

com.blockether.vis.internal.workspace.drafts

Draft lifecycle above the workspace primitives: create, approve, discard and status. Each mutation crosses the extension op-hook boundary (:draft/create, :draft/approve, :draft/discard), so an extension can veto it with a :before guard or observe it with an :after hook.

Approval requires the draft to contain the local and fetched origin target. It fast-forwards locally, restores saved local work, then pushes to origin when configured. Conflicts must be resolved in the draft before approval. Every new commit crosses the :git/commit boundary.

Draft lifecycle above the workspace primitives: create, approve, discard and
status. Each mutation crosses the extension op-hook boundary (`:draft/create`,
`:draft/approve`, `:draft/discard`), so an extension can veto it with a
`:before` guard or observe it with an `:after` hook.

Approval requires the draft to contain the local and fetched origin target.
It fast-forwards locally, restores saved local work, then pushes to origin
when configured. Conflicts must be resolved in the draft before approval.
Every new commit crosses the `:git/commit` boundary.
raw docstring

com.blockether.vis.internal.workspace.fff-index

THE canonical way vis talks to fff.

Every fff instance in this process is born here and lives in ONE pool keyed by [canonical-root respect-ignore-files? ignore-overlay]. Nothing else may call fff/create — a second, unpooled instance would duplicate a whole tree's native path+content index, spin its own watcher threads, and go stale on our own writes.

Contract for callers:

(fff-index/with-index [idx (fff-index/lease root respect-ignore-files? overlay)] (fff/search idx …) (fff/grep idx …))

  • the index is watcher-live (:watch? true) and resynced before the body runs when this process wrote anything since it was last synced,
  • the body must NOT close idx; the pool owns it (LRU + idle TTL),
  • every filesystem mutation this process performs must call note-fs-write! so the next search reads its own writes.
THE canonical way vis talks to fff.

Every fff instance in this process is born here and lives in ONE pool keyed
by `[canonical-root respect-ignore-files? ignore-overlay]`. Nothing else may call
`fff/create` — a second, unpooled instance would duplicate a whole tree's
native path+content index, spin its own watcher threads, and go stale on our
own writes.

Contract for callers:

  (fff-index/with-index [idx (fff-index/lease root respect-ignore-files? overlay)]
    (fff/search idx …) (fff/grep idx …))

- the index is watcher-live (`:watch? true`) and resynced before the body
  runs when this process wrote anything since it was last synced,
- the body must NOT close `idx`; the pool owns it (LRU + idle TTL),
- every filesystem mutation this process performs must call `note-fs-write!`
  so the next search reads its own writes.
raw docstring

com.blockether.vis.internal.workspace.git

Shared workspace inspection, backed by the native git binary.

UI surfaces and extensions depend on this namespace instead of embedding their own git calls. It reports small, renderable facts about the current repository (branch, dirty buckets, ahead/behind, porcelain entries) by shelling out to git status --porcelain=v2 and git rev-parse, parsed into stable Clojure maps. No JGit — the only git implementation is the one already on the user's PATH, so behaviour matches their shell exactly.

Workspace lifecycle mutations stay in com.blockether.vis.internal.workspace.core.

Shared workspace inspection, backed by the native `git` binary.

UI surfaces and extensions depend on this namespace instead of embedding
their own git calls. It reports small, renderable facts about the current
repository (branch, dirty buckets, ahead/behind, porcelain entries) by
shelling out to `git status --porcelain=v2` and `git rev-parse`, parsed
into stable Clojure maps. No JGit — the only git implementation is the one
already on the user's PATH, so behaviour matches their shell exactly.

Workspace lifecycle mutations stay in
`com.blockether.vis.internal.workspace.core`.
raw docstring

com.blockether.vis.internal.workspace.gitignore

Minimal, pure-Clojure .gitignore matcher — the JGit-free replacement for IgnoreNode. Parses ONE .gitignore file (the one at a walk root) into ordered rules and evaluates a /-separated relative path against them with git's semantics: last matching rule wins, ! negates, a trailing / restricts to directories, a leading/embedded / anchors to the root, and a slash-free pattern matches at any depth.

Minimal, pure-Clojure `.gitignore` matcher — the JGit-free replacement for
`IgnoreNode`. Parses ONE `.gitignore` file (the one at a walk root) into
ordered rules and evaluates a `/`-separated relative path against them with
git's semantics: last matching rule wins, `!` negates, a trailing `/`
restricts to directories, a leading/embedded `/` anchors to the root, and a
slash-free pattern matches at any depth.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close