pub struct EconomicsContextRun {
pub schema: String,
pub suite: String,
pub suite_version: u32,
pub methodology: u32,
pub repository: EconomicsRevision,
pub majordomus_version: String,
pub tokenizer: EconomicsTokenizer,
pub inputs_digest: String,
pub budget_tokens: u64,
pub measured_at: String,
pub seeds: Vec<EconomicsContextSeed>,
pub refused: Vec<String>,
}Expand description
One recorded measurement of the context suite: every seed the compiler compiled, counted, and every seed it refused, named with its reason rather than dropped.
use majordomus_cli::economics::model::EconomicsContextRun;
let run: EconomicsContextRun = serde_json::from_value(serde_json::json!({
"schema": "economics-context-run/v1", "suite": "context", "suite_version": 1,
"methodology": 1, "repository": { "commit": "8d37d011ef", "dirty": false },
"majordomus_version": "0.7.0",
"tokenizer": { "encoding": "o200k_base", "implementation": "tiktoken-rs 0.12.0" },
"inputs_digest": "i0", "budget_tokens": 8000, "measured_at": "2026-09-24T10:00:00Z",
"seeds": []
}))
.unwrap();
assert_eq!(run.tokenizer.encoding, "o200k_base");
assert!(run.seeds.is_empty());
assert!(run.refused.is_empty(), "a record from before refusals were kept reads as none");
let json = serde_json::to_value(&run).unwrap();
assert_eq!(json["refused"], serde_json::json!([]), "a new record says none explicitly");Fields§
§schema: Stringeconomics-context-run/v1.
suite: StringThe suite.
suite_version: u32The suite’s version.
methodology: u32The methodology version.
repository: EconomicsRevisionThe repository revision measured.
majordomus_version: StringThe Majordomus version that compiled the contexts.
tokenizer: EconomicsTokenizerThe tokenizer.
inputs_digest: StringDigest of the suite’s freshness inputs when measured.
budget_tokens: u64The compiler’s budget, in its own units.
measured_at: StringWhen measured, UTC.
seeds: Vec<EconomicsContextSeed>One entry per seed, sorted by seed.
refused: Vec<String>The seeds the compiler refused, each with the reason it gave (I0042: no such issue). They were not measured, so they are in no count above; they are kept here
so that a ratio over the seeds that compiled is never read as one over every seed.
A record written before this field existed reads as an empty list.
Trait Implementations§
Source§impl Clone for EconomicsContextRun
impl Clone for EconomicsContextRun
Source§fn clone(&self) -> EconomicsContextRun
fn clone(&self) -> EconomicsContextRun
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EconomicsContextRun
impl Debug for EconomicsContextRun
Source§impl<'de> Deserialize<'de> for EconomicsContextRun
impl<'de> Deserialize<'de> for EconomicsContextRun
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for EconomicsContextRun
impl JsonSchema for EconomicsContextRun
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ordered for EconomicsContextRun
A context measurement orders by when it was taken, then by the commit it measured, never
by its file name, so the last one is the latest. measured_at is a UTC RFC 3339 timestamp
at whole seconds, whose digit runs have fixed widths, so the natural order reads it
chronologically.
impl Ordered for EconomicsContextRun
A context measurement orders by when it was taken, then by the commit it measured, never
by its file name, so the last one is the latest. measured_at is a UTC RFC 3339 timestamp
at whole seconds, whose digit runs have fixed widths, so the natural order reads it
chronologically.
Source§impl PartialEq for EconomicsContextRun
impl PartialEq for EconomicsContextRun
Source§fn eq(&self, other: &EconomicsContextRun) -> bool
fn eq(&self, other: &EconomicsContextRun) -> bool
self and other values to be equal, and is used by ==.