Skip to content
Cockpit0.29.0
A snapshot: read at commit 707a04c7ce8 on 2026-10-18T00:06:01Z by majordomus 0.29.0. Nothing on this page is read again. See it live

economics.runs

Recorded benchmark runs

What it is

The raw facts every economics metric is computed from: each recorded run with its task, variant, repetition, model, revision, success-gate verdicts and the totals derived from its provider usage, and the path of its record.

Descriptor

Canonical id
economics.runs
Module
economics
Kind
query
Stability
behaviorallyverified
Provenance
declaredcached
Source
apps/majordomus-cli/src/capability/builtin/economics.rs
Cache
process, 16 entries, 5s
Benchmark
required
Tags
economicsevidence

Run

query
A query. It reads and changes nothing.

Only this suite.

Only this task.

Only this variant.

GET /api/v1/economics/runs

Projections

InterfaceAsWhere
MCP toolmajordomus_economics_runs-
MCP resourcenot exposed-
HTTPGET /api/v1/economics/runsSwagger
Command linemajordomus economics runs-

Schemas

Input · EconomicsRunsQuery
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "suite": {
      "type": [
        "string",
        "null"
      ],
      "description": "Only this suite."
    },
    "task": {
      "type": [
        "string",
        "null"
      ],
      "description": "Only this task."
    },
    "variant": {
      "type": [
        "string",
        "null"
      ],
      "description": "Only this variant."
    }
  },
  "description": "The input of `economics.runs`: optional filters on suite, task and variant, all of which\nmust match. An empty query lists every recorded run, and an unknown field is refused.\n\n```\nuse majordomus_cli::economics::model::EconomicsRunsQuery;\nlet wire = serde_json::json!({ \"suite\": \"pilot\", \"variant\": \"baseline\" });\nlet q: EconomicsRunsQuery = serde_json::from_value(wire.clone()).unwrap();\nassert!(q.task.is_none(), \"an absent filter matches every task\");\nassert_eq!(serde_json::to_value(&q).unwrap(), wire, \"absent filters are not written back\");\nlet by_model = serde_json::json!({ \"model\": \"claude-sonnet-5\" });\nassert!(serde_json::from_value::<EconomicsRunsQuery>(by_model).is_err());\n```",
  "title": "EconomicsRunsQuery"
}
Output · EconomicsRunList
{
  "type": "object",
  "properties": {
    "count": {
      "type": "integer",
      "format": "uint",
      "minimum": 0,
      "description": "How many."
    },
    "runs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EconomicsRunView"
      },
      "description": "The runs, sorted by id."
    },
    "diagnostics": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Records that could not be read.",
      "default": []
    }
  },
  "required": [
    "count",
    "runs"
  ],
  "description": "The answer of `economics.runs`: the raw facts every metric is computed from.\n\n```\nuse majordomus_cli::economics::model::EconomicsRunList;\nlet l: EconomicsRunList =\n    serde_json::from_value(serde_json::json!({ \"count\": 0, \"runs\": [] })).unwrap();\nassert_eq!(l.count, l.runs.len());\nassert!(l.diagnostics.is_empty(), \"no diagnostics listed means none\");\n```",
  "title": "EconomicsRunList",
  "$defs": {
    "EconomicsRunView": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The run's id."
        },
        "suite": {
          "type": "string",
          "description": "The suite."
        },
        "task": {
          "type": "string",
          "description": "The task."
        },
        "variant": {
          "type": "string",
          "description": "The variant."
        },
        "repetition": {
          "type": "integer",
          "format": "uint32",
          "minimum": 0,
          "description": "The repetition."
        },
        "model": {
          "type": "string",
          "description": "The model requested."
        },
        "revision": {
          "type": "string",
          "description": "The revision."
        },
        "completed": {
          "type": "boolean",
          "description": "Whether every success gate passed."
        },
        "checks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EconomicsCheck"
          },
          "description": "Each gate's verdict."
        },
        "sessions": {
          "type": "integer",
          "format": "uint",
          "minimum": 0,
          "description": "Sessions."
        },
        "usage": {
          "anyOf": [
            {
              "$ref": "#/$defs/EconomicsUsage"
            },
            {
              "type": "null"
            }
          ],
          "description": "Totals, when the provider reported usage."
        },
        "path": {
          "type": "string",
          "description": "Where the raw record is."
        }
      },
      "required": [
        "id",
        "suite",
        "task",
        "variant",
        "repetition",
        "model",
        "revision",
        "completed",
        "checks",
        "sessions",
        "path"
      ],
      "description": "One run in brief, with its derived totals.\n\n```\nuse majordomus_cli::economics::model::EconomicsRunView;\nlet v: EconomicsRunView = serde_json::from_value(serde_json::json!({\n    \"id\": \"vat-rounding--majordomus--r1\", \"suite\": \"pilot\", \"task\": \"vat-rounding\",\n    \"variant\": \"majordomus\", \"repetition\": 1, \"model\": \"claude-sonnet-5\",\n    \"revision\": \"8d37d011ef\", \"completed\": false, \"checks\": [], \"sessions\": 1,\n    \"path\": \".ai/repo/benchmarks/economics/runs/pilot/vat-rounding--majordomus--r1.json\"\n}))\n.unwrap();\nassert!(v.usage.is_none(), \"a run whose provider reported no usage has no totals\");\nassert!(v.path.ends_with(&format!(\"{}.json\", v.id)));\n```"
    },
    "EconomicsCheck": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The gate's id."
        },
        "passed": {
          "type": "boolean",
          "description": "Whether it passed."
        },
        "detail": {
          "type": "string",
          "description": "What was found."
        }
      },
      "required": [
        "id",
        "passed",
        "detail"
      ],
      "description": "One success gate's verdict on a run.\n\n```\nuse majordomus_cli::economics::model::EconomicsCheck;\nlet c = EconomicsCheck { id: \"tests_kept\".into(), passed: true, detail: \"0 deleted\".into() };\nlet back: EconomicsCheck = serde_json::from_value(serde_json::to_value(&c).unwrap()).unwrap();\nassert_eq!(back, c);\n```"
    },
    "EconomicsUsage": {
      "type": "object",
      "properties": {
        "input_uncached": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0,
          "description": "Input neither read from nor written to the cache."
        },
        "cache_write": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0,
          "description": "Input written to the cache."
        },
        "cache_read": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0,
          "description": "Input read from the cache."
        },
        "output": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0,
          "description": "Output, reasoning included."
        },
        "reasoning": {
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0,
          "description": "Reasoning tokens, when every request reported them."
        },
        "total_input": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0,
          "description": "All input."
        },
        "total": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0,
          "description": "All input and output."
        },
        "requests": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0,
          "description": "Provider requests."
        },
        "tool_calls": {
          "type": "integer",
          "format": "uint64",
          "minimum": 0,
          "description": "Tool calls."
        },
        "cost_microusd": {
          "type": [
            "integer",
            "null"
          ],
          "format": "uint64",
          "minimum": 0,
          "description": "The harness's cost projection, in millionths of a dollar, when every session had one."
        }
      },
      "required": [
        "input_uncached",
        "cache_write",
        "cache_read",
        "output",
        "total_input",
        "total",
        "requests",
        "tool_calls"
      ],
      "description": "A run's totals, derived from its raw usage.\n\n```\nuse majordomus_cli::economics::model::EconomicsUsage;\nlet u = EconomicsUsage {\n    input_uncached: 10, cache_write: 90, cache_read: 900, output: 50,\n    total_input: 1000, total: 1050, requests: 3, ..EconomicsUsage::default()\n};\nassert_eq!(u.total_input, u.input_uncached + u.cache_write + u.cache_read);\nlet json = serde_json::to_value(&u).unwrap();\nassert!(json.get(\"reasoning\").is_none() && json.get(\"cost_microusd\").is_none());\n```"
    }
  }
}

Examples

These are the capability's own benchmark cases: the same inputs the benchmark runs and the OpenAPI document shows.

all
{}
narrowed
{
  "suite": "pilot",
  "task": "vat-rounding",
  "variant": "baseline"
}