Expand description
reasoning.check: the executable half of the rules project.advisors-are-optional
and project.review-is-recorded-not-claimed. Each check reads files and says what it
found; none of them asks an advisor anything.
catalogue— the advisor catalogue resolves against the provider table and the model catalogue (one inventory, referenced, never restated);adapters— every adapter the catalogue names has its transport module, so the Node layer is derived from the catalogue rather than keeping a list of its own;coupling— the provider-independent code (this module, its capability, its CLI rendering, its Cockpit page, the transport driver) names no advisor, adapter, executable, provider, vendor or model of the catalogue as a string literal;ci— no CI workflow or gate names a model vendor’s credential variable, so no required gate can depend on a live model;claims— no document asserts a claim the catalogue forbids (“consensus guarantees …”) or that an advisor is required;records— every stored record is readable, every consultation names an advisor its plan selected and one this repository knows, every conclusion’s computed review matches the consultations it cites.
The lifecycle: load the catalogue, its references and the store, then run every
check over a repository root; an empty list is a clean repository.
use majordomus_cli::reasoning::catalogue::{AdvisorCatalogue, References};
use majordomus_cli::reasoning::check::run;
use majordomus_cli::reasoning::store::Store;
let root = tempfile::tempdir().unwrap();
let catalogue = AdvisorCatalogue {
forbidden_claims: vec!["consensus guarantees correctness".into()],
..Default::default()
};
let loaded = Store::at(root.path()).load();
assert!(run(root.path(), &catalogue, &References::default(), &loaded).is_empty());
std::fs::write(root.path().join("README.md"), "Consensus guarantees correctness.\n").unwrap();
let findings = run(root.path(), &catalogue, &References::default(), &loaded);
assert_eq!(findings.len(), 1);
assert_eq!((findings[0].check.as_str(), findings[0].subject.as_str()), ("claims", "README.md"));Structs§
- Reasoning
Finding - One finding of a reasoning check: which check, where, and what is wrong.
Constants§
- ADAPTER_
DIR - Where the transport adapters live, relative to the root.
- CHECKS
- The checks, by name, in the order
runperforms them. - INDEPENDENT_
SOURCES - The source files that must stay provider-independent, relative to the root.
- REPOSITORY_
CHECKS - The checks that judge a repository’s own workflows and documents rather than the
reasoning layer it adopted; they apply only where
REPOSITORY_RULEis declared. - REPOSITORY_
RULE - The rule whose executable half
ciandclaimsare: what Majordomus’s own CI and documents may say about advisors. A repository that does not declare it is an adopter, and an adopter’s workflows and documents are its product, not its use of the reasoning layer (I1996).
Functions§
- applicable
- The checks a repository declaring the rules
rule_idsis held to, inCHECKSorder: every check whereREPOSITORY_RULEis among them, and only what an adopter adopted (its catalogue, adapters, coupling and records) where it is not. - catalogue_
names - The names the independent code must not spell.
- literals_
naming - String literals of a source naming any of
names:"name"or'name', exactly. - run
- Run every check over the repository at
root, in the order ofCHECKS. - run_
checks - Run the named
checksover the repository atroot, in the order ofCHECKS; a name that is not one of them is ignored.runis this with every check, andapplicablesays which a repository is held to.