Expand description
Claim governance for token economics: no number about tokens, context or cost reaches a reader unless the evidence produced it.
Three checks, all deterministic and all run by majordomus economics check:
- Bound claims. The methodology binds claims of
docs/CLAIMS.yamlto metrics. A bound claim may beguaranteedonly while its metric stands where the binding says —verifiedfor sampled live evidence meeting the publication rule,measuredfor deterministic evidence — and while every suite behind that metric is current. Evidence that goes stale takes the guarantee with it. - Unbound claims. A
guaranteedclaim whose sentence says that tokens, context or cost go down has to be bound to a metric, or nothing would ever check it. A claim id that appears twice is refused too: a binding, a page and a gate would each read whichever copy they found first. - Unsupported quantities in prose. Every hand-written document, page and claim sentence is scanned for a quantity (a percentage, “N times fewer”, “half the tokens”) in the same sentence as a word of the economics vocabulary. Repository prose is hard-wrapped, so the scan reads paragraphs, not lines: a sentence wrapped over two lines is one sentence. Numbers about tokens are generated from evidence into generated artifacts; typed by hand, they are refused.
The check fails closed. Declarations it cannot read, a claims matrix it cannot parse and a repository git cannot list are findings, never an empty and therefore clean result.
use majordomus_cli::economics::claims::unsupported_quantity;
assert!(unsupported_quantity("Majordomus saves 50% of tokens.").is_some());
assert!(unsupported_quantity("Majordomus cuts cost by 3x.").is_some());
assert!(unsupported_quantity("The suite takes 50% longer on Linux.").is_none(), "no economics word");
assert!(unsupported_quantity("The context budget is 300 lines.").is_none(), "no quantity");Structs§
- Economics
Check Input - The input of
economics.check: nothing to narrow; the check is over the repository. Unknown fields are refused rather than ignored, so a caller who tries to scope the check to a path learns that it cannot be scoped instead of reading a partial verdict as whole. - Economics
Check Report - The answer of
economics.check, the same over the CLI, HTTP and MCP: how much was read and every refusal.okis true exactly whenfindingsis empty.scannedcounts the hand-written files read,docs/CLAIMS.yamlincluded and generated files excluded;claims_checkedcounts the methodology’s claim bindings, whatever their status. - Economics
Finding - One thing the check refuses.
detailnames the remedy, so a finding can be acted on without reading the methodology. A finding about a claim or a file rather than a line carries noline, and its JSON omits the key. The kinds: - Prose
Quantity - A quantity
prose_quantitiesfound: the 1-based line the quantity starts on, the quantity as written, and whether it stands in a fenced code block. A quantity in a code block is still a finding — a pasted benchmark output is a number about tokens a person typed into the document — and the flag lets the finding say where it is.
Functions§
- check
- Run every check over the repository at
root: the prose scan ofscan_prose, and the claims ofcheck_claimsagainst a summary computed afresh bycrate::economics::summarize, never a cached one. It never fails as a call: what cannot be read is a finding, and the report isokexactly when no check found anything. - check_
claims - Check the claims matrix against the methodology’s bindings and
summary, and return how many bindings the methodology declares with every finding. - prose_
quantities - Every unsupported quantity in the text of the file at
path, read paragraph by paragraph so that a sentence hard-wrapped over several lines is read whole, with the line each quantity starts on. How lines group is decided by the file’s kind: Markdown and templates join consecutive non-blank lines, with each fenced code block, table row and heading a paragraph of its own and each list item starting a new one; TOML starts a paragraph at every key; YAML reads only theclaim:andnote:values, with their continuation lines.unsupported_quantityis the sentence-level test applied. - scan_
prose - Scan the repository’s hand-written prose for unsupported quantities, and return how many files were read with every finding.
- unsupported_
quantity - The quantity in
linethat states something about token economics, if there is one: a number followed by%,%,percent,per cent,percentage pointsorpp, or a multiplier (3x,3 × cheaper,2 times fewer), in a sentence that also uses a plain word of the economics vocabulary; or a multiplier or fraction word (half,twice,a third) in a sentence that also says something went down. This reads one line as it stands;prose_quantitiesreads a whole file, with wrapped sentences joined.