Git database adapter for Fulcro RAD.
Agent-scoped, git-backed storage. Entities are EDN files in directories, commits are the transaction log. Designed for agent communication and knowledge persistence via the mementum protocol.
Hybrid engine: JGit in-process is the primary path for most read and write operations (10-50x faster than CLI shell-outs). The git CLI is used as a fallback and for worktree operations JGit 7.x does not support. Repository objects are cached in a pool — call close-jgit-repos! at shutdown.
Main functions:
Git database adapter for Fulcro RAD. Agent-scoped, git-backed storage. Entities are EDN files in directories, commits are the transaction log. Designed for agent communication and knowledge persistence via the mementum protocol. Hybrid engine: JGit in-process is the primary path for most read and write operations (10-50x faster than CLI shell-outs). The git CLI is used as a fallback and for worktree operations JGit 7.x does not support. Repository objects are cached in a pool — call close-jgit-repos! at shutdown. Main functions: - start-repositories: Initialize git repos from config - stop-repositories: Shut down repos - wrap-env: Pathom env middleware to inject repos - generate-resolvers: Auto-generate resolvers from RAD attributes - wrap-git-save: Form save middleware (EDN write + git commit) - wrap-git-delete: Form delete middleware (file remove + git commit)
Options and configuration keys for Git database adapter.
Git repos serve as agent-scoped databases. Entities are EDN files in directories, commits are the transaction log.
Options and configuration keys for Git database adapter. Git repos serve as agent-scoped databases. Entities are EDN files in directories, commits are the transaction log.
In-process embedding index — format-compatible with git-embed CLI.
Provides:
The binary format is: [version: i32 BE] [model: java-utf] [dims: i32 BE] [count: i32 BE] for each entry: [sha: java-utf] [vector: f32 × dims, each BE IEEE 754]
'java-utf' = DataOutputStream.writeUTF — 2-byte BE length + MUTF-8 bytes. This matches the Rust serialization used by git-embed exactly.
In-process embedding index — format-compatible with git-embed CLI. Provides: - Index serialization / deserialization (byte-identical to git-embed Rust format) - Git-backed persistence via refs/embed/v1/index blob - Vector math: cosine similarity, truncate-and-normalize, centroid - Search, similar, score, score-file, cohesion - ONNX inference: ensure-model!, load-model, embed-document, embed-query, embed-documents (batched), embed-text (chunked) - update! — walk tree, embed un-indexed blobs, save index - gc-index — remove embeddings for SHAs no longer in HEAD tree The binary format is: [version: i32 BE] [model: java-utf] [dims: i32 BE] [count: i32 BE] for each entry: [sha: java-utf] [vector: f32 × dims, each BE IEEE 754] 'java-utf' = DataOutputStream.writeUTF — 2-byte BE length + MUTF-8 bytes. This matches the Rust serialization used by git-embed exactly.
Resolver generation for Git database adapter.
Generates Pathom resolvers per identity attribute:
Pathom 2 is the default. Pathom 3 is opt-in via generate-resolvers-pathom3
and is loaded lazily, so pathom3 is never a hard dependency of this library
(mirrors com.fulcrologic.rad.database-adapters.datomic).
Resolver generation for Git database adapter. Generates Pathom resolvers per identity attribute: 1. ID resolver — fetch entity by ID (read EDN file) 2. All-IDs resolver — list all entities of a type (list directory) Pathom 2 is the default. Pathom 3 is opt-in via `generate-resolvers-pathom3` and is loaded lazily, so pathom3 is never a hard dependency of this library (mirrors com.fulcrologic.rad.database-adapters.datomic).
JGit in-process implementations of git read and write operations.
Repository objects are thread-safe and cached in a pool (one per directory).
All read operations use Git/wrap (non-owning) for command construction.
Write operations acquire a per-directory ReentrantLock before touching the
index or committing — shell-outs serialized naturally, JGit in-process writes
from concurrent futures need explicit coordination.
The pool is closed at shutdown via close-all!.
Read operations provided:
log — git log with path filter + max-countgrep — git grep -i -n (TreeWalk over HEAD tree)branch-list — git branch --listresolve-head — git rev-parse HEAD (short + full)is-bare? — git rev-parse --is-bare-repositorylist-worktrees — git worktree list --porcelain (filesystem read)Write operations provided:
commit-files! — stage + commit one or more files (add or delete)commit! — stage + commit a single file (convenience wrapper)JGit in-process implementations of git read and write operations. Repository objects are thread-safe and cached in a pool (one per directory). All read operations use Git/wrap (non-owning) for command construction. Write operations acquire a per-directory ReentrantLock before touching the index or committing — shell-outs serialized naturally, JGit in-process writes from concurrent futures need explicit coordination. The pool is closed at shutdown via `close-all!`. Read operations provided: - `log` — git log with path filter + max-count - `grep` — git grep -i -n (TreeWalk over HEAD tree) - `branch-list` — git branch --list - `resolve-head` — git rev-parse HEAD (short + full) - `is-bare?` — git rev-parse --is-bare-repository - `list-worktrees` — git worktree list --porcelain (filesystem read) Write operations provided: - `commit-files!` — stage + commit one or more files (add or delete) - `commit!` — stage + commit a single file (convenience wrapper)
Pathom env middleware for the Git database adapter.
Injects git repo references into the Pathom env per-request. Version-neutral: works with both Pathom 2 and Pathom 3 (the env is a plain map in both).
Pathom env middleware for the Git database adapter. Injects git repo references into the Pathom env per-request. Version-neutral: works with both Pathom 2 and Pathom 3 (the env is a plain map in both).
Repository lifecycle management for Git adapter.
Initializes git repos from config, validates structure.
Repository lifecycle management for Git adapter. Initializes git repos from config, validates structure.
Git-backed statechart WorkingMemoryStore with Fulcro state atom as hot path.
Implements sp/WorkingMemoryStore using a two-layer strategy:
WM lives at [::sc/session-id session-id] in the Fulcro state atom — exactly where Tony's FulcroWorkingMemoryStore keeps it. This store is a drop-in replacement: same address space, adds git durability on top.
On restart: seed-from-git! reads EDN from worktrees and hydrates the atom
before the event loop starts, recovering all durable sessions.
Constructor: new-fulcro-git-wm-store — config map, all keys optional except
:fulcro-app.
Repo structure (bare repo, one worktree per durable session): statecharts.git/ worktrees/ lucrum/ ← committed on each ::sc/configuration change state.edn paper-trading/ state.edn agent-xyz/ ← ephemeral agents, if persist? selects them state.edn
Git-backed statechart WorkingMemoryStore with Fulcro state atom as hot path.
Implements `sp/WorkingMemoryStore` using a two-layer strategy:
- Hot path: Fulcro state atom (synchronous, always succeeds)
- Cold path: Async git persistence (selective, sanitized, config-change-only)
WM lives at [::sc/session-id session-id] in the Fulcro state atom — exactly
where Tony's FulcroWorkingMemoryStore keeps it. This store is a drop-in
replacement: same address space, adds git durability on top.
On restart: `seed-from-git!` reads EDN from worktrees and hydrates the atom
before the event loop starts, recovering all durable sessions.
Constructor: `new-fulcro-git-wm-store` — config map, all keys optional except
:fulcro-app.
Repo structure (bare repo, one worktree per durable session):
statecharts.git/
worktrees/
lucrum/ ← committed on each ::sc/configuration change
state.edn
paper-trading/
state.edn
agent-xyz/ ← ephemeral agents, if persist? selects them
state.ednGit operations and EDN file I/O for the git adapter.
Hybrid engine: most read and write operations use JGit in-process when a Repository is available, falling back to CLI shell-outs. The git CLI is also used for worktree operations JGit 7.x does not support. Files are EDN maps, one entity per file.
Git operations and EDN file I/O for the git adapter. Hybrid engine: most read and write operations use JGit in-process when a Repository is available, falling back to CLI shell-outs. The git CLI is also used for worktree operations JGit 7.x does not support. Files are EDN maps, one entity per file.
Delete form middleware for Git database adapter.
Removes EDN entity file and commits the deletion.
Delete form middleware for Git database adapter. Removes EDN entity file and commits the deletion.
Save form middleware for Git database adapter.
Converts RAD form deltas → EDN file writes → git commits.
Save form middleware for Git database adapter. Converts RAD form deltas → EDN file writes → git commits.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |