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§
- Knowledge
Candidate - One candidate record awaiting review: what a reader needs to decide whether to open it.
- Knowledge
Candidates - The candidates awaiting review, against the policy’s cap.
- Knowledge
Group - 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.
- Knowledge
Record - One knowledge record, with every reference it names resolved.
- Knowledge
Record Input - 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. - Knowledge
Status - Whether the deriver is still writing, and what it last wrote.
- Ledger
Mark - One ledger line that matters to the judgement: when, and which episode.
- Resolved
Reference - One
derived_fromreference of a record, with how it resolved and against what. - Resolved
Relation - One
relationsentry, resolved the same way.
Enums§
- AgeSource
- Where the age of a candidate in the review queue was read from. A candidate’s
dateis 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. - Reference
Resolution - How a typed reference resolved.
Constants§
- KNOWLEDGE_
CANDIDATES_ URI - The URI under which
knowledge_base.candidatesis read as an MCP resource. - KNOWLEDGE_
STATUS_ URI - The URI under which
knowledge_base.statusis 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.