Expand description
memnite-cli: the memnite binary’s library — wires core + store + stale.
Structs§
- AddSpec
- Inputs to create a memory.
- Anchor
Spec - One anchor to attach to a new memory (hash is computed from the file at add-time).
- App
- An open Memnite instance: the event log + its SQLite projection.
- Check
Summary - Result of a
checkrun. - Crumbex
Graph Source - Adapter for a crumbex
graph.json(crumbex graph --format json). Maps the static-architecture report into one memory per hub (god module), hotspot (central module, PageRank), import cycle, and community (Louvain cluster). Reads the file as a data contract — it never runs crumbex.rootis the path to the JSON file itself. - Doctor
Report - Result of
doctor: integrity of the projection vs. the log. Compares only projected fields (status, title, last_event_id);tagsare not projected so they are not compared. - Event
Ctx - Per-event context the caller supplies (kept out of
Appso tests are deterministic andmaininjects the real wall-clock/host). - Import
Summary - Result of a
sync import: how many events were newly appended, skipped as already-present duplicates, or skipped as corrupt (unparseable) lines. - Ingest
Summary - Outcome of an
App::ingestrun. - Ingested
Memory - The universal item every ingest source produces. memnite turns each into a
MemoryAdded/MemoryUpdatedevent. (Eqis not derived:Scopeis onlyPartialEq.) - Relation
Spec - Inputs to assert a relation between two memories. The direction (
from → to) is carried positionally byApp::relate; this holds the classification. - Repo
Brain Source - Adapter for guildgate’s Repo Brain. Reads
UBIQUITOUS_LANGUAGE.md(one memory per glossary term — the##sections AFTER a## Termsheading) plusdocs/wiki/ai/CONTRACTS.mdandCONSTRAINTS.md(one whole-document memory each). Knows the FORMAT (a data contract), never guildgate’s code. Missing files are skipped. - Resolved
Project - A resolved, already-normalized project name plus the source it was derived from.
- Scan
Summary - Result of a
conflicts scan: pairs judged, edges asserted, not-conflict verdicts, and judge errors (each swallowed — a failing pair never aborts).first_errorsamples the first judge error so a total misconfiguration (every pair errors) is distinguishable from “ran clean, found nothing”. - Search
Query - A search request: free text plus optional exact filters and match mode.
- Update
Patch - Fields to change on an existing memory.
None= leave unchanged. Note: unsettingtopic_keyis not supported in v1 —Some(x)sets it,Noneleaves the current value. An emptyanchors/tagsVecinsideSomereplaces the current value with empty.
Enums§
- CliError
- Project
Source - Where a resolved project name came from (precedence order, first match wins).
- Relation
Constants§
Traits§
- Ingest
Source - The extension point. One external system = one
impl IngestSource.
Functions§
- normalization_
notice - A notice when an explicitly-given project name is not already canonical, e.g.
Some("project 'My-Repo' normalized to 'my-repo'");Nonewhen it is unchanged. The surface (CLI stderr / MCP response) shows it — canonicalization itself never fails. - normalize_
project - Canonical form of a project name: trimmed, lowercased, with every maximal run of
separators (
-,_, or whitespace) collapsed into a single-, and no leading or trailing-. Idempotent:normalize_project(&normalize_project(s)) == normalize_project(s). - parse_
anchor - Parse a CLI anchor argument:
path:start:endorpath:start:end:symbol. - parse_
relation - Parse a relation label at a boundary. Rejects unknown values.
- parse_
scope - Parse a scope string at a boundary. Rejects unknown values (no silent fallback).
- resolve_
project - Resolve the project for
cwd. Precedence: an explicit name →.memnite/config.json(project_name, searched from cwd upward) → the gitoriginremote’s repo name → the git root directory name → the cwd directory name. The returnedprojectis always normalized; the function never returns an error. - sanitize_
fts - Turn arbitrary user text into a safe FTS5 query: split on whitespace AND
control characters (incl. NUL, which would otherwise truncate the bound C
string and produce an unterminated FTS5 literal), then wrap each token as an
FTS5 string literal (double-quoted, embedded
"doubled). This neutralizes FTS5 operators/columns/hyphens so plain text never errors.