Skip to main content

Module reasoning

Module reasoning 

Source
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§

AdvisorCapacity
One advisory capability and who can provide it now: a row of the capacity table reasoning.advisors reports. An empty available is answered by the local review.
AdvisorsReport
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. operational is true whatever the counts.
PlanPreviewInput
The input of reasoning.plan: a stated uncertainty, in transport-friendly scalars. Nothing is recorded; reasoning.record with a plan records one.
ReasoningCheck
The answer of reasoning.check: whether it is clean, the checks performed in order, and every finding. ok is true exactly when findings is empty.
ReasoningExplainInput
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.
ReasoningRecordInput
The input of reasoning.record: one record, as authored, tagged by its kind. The writer computes everything else (id, task, stamp, a plan’s selection) itself.
ReasoningRecorded
The answer of reasoning.record: the record as stored, where it was written, and the timeline step it adds.
ReasoningStatus
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.
ReasoningStatusInput
The input of reasoning.status: which task’s records to derive the state from. Absent is the open task; all is 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 reasoning module: 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).