src/documate/core.py
Module

core.py

core.py — the per-invocation Context: root + config + graph adapter.

src/documate/core.py4 documented symbols

Overview

core.py — the per-invocation Context: root + config + graph adapter.

A documate command runs against one repo (or one sub-tree of a monorepo). The CLI resolves the root, loads its config, wires the graph adapter, and hands this Context to every command. No import-time globals — the same process can point at different roots, and nothing is hard-bound to one checkout.

depends on src/documate/config.py, src/documate/graphdb.py  ·  used by src/documate/anchors.py, src/documate/briefs.py, src/documate/check.py, src/documate/cli.py, src/documate/docs.py, src/documate/drift.py, src/documate/prose.py, src/documate/resolve.py, src/documate/rewrap.py, src/documate/site.py, src/documate/stats.py, src/documate/undo.py

API

Fresolve_root(root: str | Path | None=None) -> Path

src/documate/core.py:32

Explicit path wins; else the git toplevel of cwd; else cwd (non-git trees).

called by Context.make

Cclass Context

src/documate/core.py:48

Per-invocation bundle: resolved root, loaded Config, wired graph adapter. No import-time globals.

FContext.make(cls, root: str | Path | None=None) -> 'Context'

src/documate/core.py:56

Resolve the root, load its config, and wire a GraphDB into a ready Context.

calls resolve_root

FContext.rel(self, abspath: str) -> str

src/documate/core.py:62

Strip the absolute root off a graph path (file or <abspath>::scope), returning a repo-relative POSIX path. Idempotent on already-relative input.