Expand description
The reasoning module: provider-independent reasoning, projected (ADR 0098).
Six capabilities over one model (crate::reasoning): which advisors can be asked and
what they can do (reasoning.advisors), what a stated uncertainty calls for
(reasoning.plan), the one writer of the session’s reasoning records
(reasoning.record), the state those records derive (reasoning.status), one
record’s provenance (reasoning.explain), and the checks that keep the design honest
(reasoning.check). None of them talks to an advisor: the transport is the Node layer
(scripts/lib/advisors/), which records what it did through reasoning.record.
§Example
use majordomus_cli::capability::builtin::reasoning::module;
use majordomus_cli::capability::model::Effect;
// The declaration is the only place these names exist; every surface derives from it.
let m = module();
assert_eq!(m.id.as_str(), "reasoning");
let plan = m.capabilities.iter().find(|e| e.capability.id.as_str() == "reasoning.plan").unwrap();
let exposure = &plan.capability.exposure;
assert_eq!(exposure.mcp.as_ref().and_then(|m| m.tool.as_deref()), Some("majordomus_reasoning_plan"));
assert_eq!(exposure.http.as_ref().map(|h| h.path.as_str()), Some("/api/v1/reasoning/plan"));
// one writer: only `reasoning.record` changes the repository
let writers: Vec<&str> = m
.capabilities
.iter()
.filter(|e| e.capability.execution.effect == Effect::RepositoryMutation)
.map(|e| e.capability.id.as_str())
.collect();
assert_eq!(writers, ["reasoning.record"]);Structs§
- Advisor
Capacity - One advisory capability and who can provide it now: a row of the capacity table
reasoning.advisorsreports. An emptyavailableis answered by the local review. - Advisors
Report - The answer of
reasoning.advisors: the mode in force, how many advisors may and may not be asked, every advisor’s state, the capacity per advisory capability, and the catalogue’s own findings.operationalistruewhatever the counts. - Plan
Preview Input - The input of
reasoning.plan: a stated uncertainty, in transport-friendly scalars. Nothing is recorded;reasoning.recordwith aplanrecords one. - Reasoning
Check - The answer of
reasoning.check: whether it is clean, the checks performed in order, and every finding.okistrueexactly whenfindingsis empty. - Reasoning
Explain Input - The input of
reasoning.explain: the id of the record whose assessment chain is explained. An id no record carries is a not-found answer. - Reasoning
Record Input - The input of
reasoning.record: one record, as authored, tagged by itskind. The writer computes everything else (id, task, stamp, a plan’s selection) itself. - Reasoning
Recorded - The answer of
reasoning.record: the record as stored, where it was written, and the timeline step it adds. - Reasoning
Status - The answer of
reasoning.status: the mode in force, the advisor counts, the state the records derive, and that state rendered as the Markdown a handover carries. - Reasoning
Status Input - The input of
reasoning.status: which task’s records to derive the state from. Absent is the open task;allis every task the store holds.
Constants§
- ADVISORS_
URI - The MCP resource of
reasoning.advisors. - REASONING_
URI - The MCP resource of
reasoning.status.
Functions§
- module
- The canonical declaration of the
reasoningmodule: its six capabilities with every projection each is exposed through. The MCP tools and resources, HTTP routes, CLI paths and the generated OpenAPI are read from here and nowhere else (ADR 0004).