Skip to main content

Module knowledge_base

Module knowledge_base 

Source
Expand description

The knowledge_base module: what the knowledge deriver left for review and whether it is still writing — the candidate records awaiting promotion, one record by id with every reference it names resolved, and the derivation status of this checkout judged against session.freshness.

It is read, never written. The writer is the shell tool’s lib/knowledge.sh, which derives a candidate from the ledger and git at every episode boundary (ADR 0091), and a person promotes or rejects one. This process reads three things and restates none of them: the candidates from the index, where they are tracked files discovered by the candidates source class like every other object of the layer; the ledger through crate::session::Ledger, which is the one reader of that file; and the thresholds and switches from the policy, through the reading super::continuity already does.

The module id is not knowledge. The registry refuses a builtin module named like a declarative kind, and knowledge is the kind these records are. The command line still reads majordomus knowledge <verb>, because the words a person types are a projection and the module id is not.

Absence is an answer. A fresh clone has no ledger and no candidates, a repository whose policy predates the keys declares no thresholds, and a record can name an episode this checkout never saw. Each is reported as itself, never as a failure, and the stopped-writer judgement is withheld — and says so — until a derivation has run here at least once, so that the day the deriver arrives no checkout turns red for what it could not yet have done.

use majordomus_cli::capability::builtin::knowledge_base::{module, KNOWLEDGE_STATUS_URI};
let m = module();
assert_eq!(m.id.as_str(), "knowledge_base");
assert!(m.capabilities.iter().any(|e| {
    e.capability.exposure.mcp.as_ref().and_then(|x| x.resource.as_ref())
        .is_some_and(|r| r.uri == KNOWLEDGE_STATUS_URI)
}));

Structs§

KnowledgeCandidate
One candidate record awaiting review: what a reader needs to decide whether to open it.
KnowledgeCandidates
The candidates awaiting review, against the policy’s cap.
KnowledgeGroup
The records under one subject: every candidate awaiting review and every rejected one, with the episodes behind them (ADR 0118). Recurrence is read here, never written: each record stays one episode’s own file, and a group is how several of them read as one thing.
KnowledgeRecord
One knowledge record, with every reference it names resolved.
KnowledgeRecordInput
Which knowledge record: the input of knowledge_base.record. The id is the file name and the identity the index keys the record by, so one string names it on every surface.
KnowledgeStatus
Whether the deriver is still writing, and what it last wrote.
LedgerMark
One ledger line that matters to the judgement: when, and which episode.
ResolvedReference
One derived_from reference of a record, with how it resolved and against what.
ResolvedRelation
One relations entry, resolved the same way.

Enums§

AgeSource
Where the age of a candidate in the review queue was read from. A candidate’s date is the day of the evidence it came from, deliberately, so that the same evidence yields the same bytes; the day it entered the queue is a different fact and is read from the ledger first, then from git, and only then from the record.
ReferenceResolution
How a typed reference resolved.

Constants§

KNOWLEDGE_CANDIDATES_URI
The URI under which knowledge_base.candidates is read as an MCP resource.
KNOWLEDGE_STATUS_URI
The URI under which knowledge_base.status is read as an MCP resource.

Functions§

module
The module: three queries, declared once, from which every projection — the MCP tools and resources, the HTTP routes, the command line, the OpenAPI operations, the cockpit’s catalogue entry and the benchmark targets — is derived.