Sign inSign up

nacrecontextlayer/connector-git

By nacrecontextlayer

•Updated about 11 hours ago

Keeps the text files of a git repository in Nacre layers: a path rule per layer, deletes on removal.

Image
Machine learning & AI
Data science
Databases & storage
0

59

nacrecontextlayer/connector-git repository overview

⁠Nacre connector — git

Keeps the text files of a git repository in Nacre⁠ layers. A file is a document, its path is the external_id, a path rule picks its layer, and a file that left the tree is a document that leaves the index. A blob's hash is its version, so a sweep over a large repository reads only what moved.

docker run -v git-state:/state \
  -e NACRE_URL=https://nacre.example.com -e NACRE_TOKEN=... \
  -e GIT_URL=https://github.com/acme/handbook -e GIT_TOKEN=... \
  -e 'GIT_LAYERS=docs/**=handbook;src/**=code' \
  nacrecontextlayer/connector-git:0.1.1

GIT_URL is what to clone (https://, ssh:// or a path), GIT_REF a branch or tag, GIT_TOKEN a token for an https:// remote handed to git through a credential helper and never on a command line. GIT_LAYERS is glob=layer;glob=layer, first match wins, and the layer is a template over the path's fields — src/**=code-${ext} is a layer per language. GIT_INCLUDE, GIT_EXCLUDE, GIT_TITLE and GIT_MAX_BYTES are in the connector's README⁠.

Binary files are skipped; symlinks and submodules are not listed. Every document carries metadata.path, metadata.ext and metadata.ref. This connector may delete where the core's nacre ingest --watch must not: a commit has no editor-save race, so a path absent from the tree was removed by somebody who meant it.

⁠Every connector

Reads these, whatever its source, and refuses to start on a missing or malformed one, naming it:

variablemeaningdefault
NACRE_URLthe API's base URLrequired
NACRE_TOKENa service account key holding write on every layer the connector maps to. write does not imply read, and the connector needs no read: it never searchesrequired
CONNECTOR_STATEthe SQLite file remembering what was sent, in a volume/state/connector.sqlite
SYNC_INTERVALseconds between sweeps, at least 10300
SYNC_ONCEtrue runs one sweep and exits with the sweep's verdictfalse
PORTwhere /healthz, /status and /metrics answer9400

A sweep is a complete listing of the source. What it lists is added or changed as its content hash decides; what a complete listing did not contain is removed. A listing that breaks off removes nothing — the half it never reached has not been called gone. GET /status is a versioned contract (contract: 1) and GET /metrics is the same in Prometheus's shape, every name prefixed nacre_connector_.

⁠The product

Nacre⁠ is a self-hosted knowledge index with fine-grained access control. Agents reach it over MCP, applications over a REST API, and a search returns exactly what the calling principal is permitted to see — the filter runs inside the index traversal, never after it. Apache 2.0; the index is nacrecontextlayer/nacre⁠, the source is github.com/nacre-work/nacre⁠.

Connectors are a simplification, not the way in. Nacre takes documents pushed over its API, MCP, SDK or CLI, and the customer owns the sync; a connector is that sync written once for a source many customers have. Six exist — git, s3, sql, drive, mongo, imap — each one image, configured entirely through its environment, all released together at one version.

Tags: {version}, amd64 and arm64. ghcr.io/nacre-work/connectors/git is the canonical address; this repository is a mirror pushed by the same build at the same version.

nacre.work⁠ · All connectors⁠ · This connector's README⁠ · Nacre quickstart⁠ · Releases⁠

Tag summary

Content type

Image

Digest

sha256:7f36375fe…

Size

65.5 MB

Last updated

about 11 hours ago

docker pull nacrecontextlayer/connector-git:0.1.1