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

commit.scopes

The scope vocabulary

What it is

Every scope this repository's commit history uses, how often, and the directories each one is written about — learned from the history rather than declared in a table, so that a subsystem committed today is in the vocabulary today and one nobody has touched falls to the bottom on its own.

Descriptor

Canonical id
commit.scopes
Module
commit
Kind
query
Stability
behaviorallyverified
Provenance
declared
Source
apps/majordomus-cli/src/capability/builtin/commit.rs
Cache
disabled
Benchmark
required
Tags
commitgitintrospection

Run

query
A query. It reads and changes nothing.

This capability takes no input.

GET /api/v1/commit/scopes

Projections

InterfaceAsWhere
MCP toolmajordomus_commit_scopes-
MCP resourcemajordomus://commit/scopes-
HTTPGET /api/v1/commit/scopesSwagger
Command linemajordomus commit scopes-

Schemas

Input · Empty
{
  "type": "object",
  "additionalProperties": false,
  "description": "No input.",
  "title": "Empty"
}
Output · ScopesReport
{
  "type": "object",
  "properties": {
    "vocabulary": {
      "$ref": "#/$defs/ScopeVocabulary",
      "description": "Every scope the history uses, most used first, with the directories it is used about."
    },
    "sample": {
      "type": "integer",
      "format": "uint",
      "minimum": 0,
      "description": "How many commits back the vocabulary is learned from."
    }
  },
  "required": [
    "vocabulary",
    "sample"
  ],
  "description": "The vocabulary, with the policy that reads it.\n```\nuse majordomus_cli::capability::builtin::commit::ScopesReport;\nuse majordomus_cli::commit::ScopeVocabulary;\nlet r = ScopesReport { vocabulary: ScopeVocabulary::default(), sample: 1500 };\nassert_eq!(r.sample, majordomus_cli::commit::scopes::SAMPLE);\n```",
  "title": "ScopesReport",
  "$defs": {
    "ScopeVocabulary": {
      "type": "object",
      "properties": {
        "scopes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ScopeUse"
          },
          "description": "Every scope, by how often it is used, then by name. The order is the answer to\n\"which scopes does this repository use\", so it is the order a person reads."
        },
        "sampled": {
          "type": "integer",
          "format": "uint",
          "minimum": 0,
          "description": "How many commits were read to learn it."
        },
        "unavailable": {
          "type": [
            "string",
            "null"
          ],
          "description": "Set when git could not be asked; the vocabulary is then empty rather than wrong."
        }
      },
      "required": [
        "scopes",
        "sampled"
      ],
      "description": "The vocabulary as observed, with what was observed.\n```\nuse majordomus_cli::commit::ScopeVocabulary;\n// an empty vocabulary knows nothing and says so, rather than guessing\nlet v = ScopeVocabulary::default();\nassert!(!v.knows(\"anything\"));\nassert!(v.words().is_empty());\n```"
    },
    "ScopeUse": {
      "type": "object",
      "properties": {
        "scope": {
          "type": "string",
          "description": "The scope word, as commits spell it."
        },
        "commits": {
          "type": "integer",
          "format": "uint",
          "minimum": 0,
          "description": "How many of the sampled commits used it."
        },
        "directories": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The directory prefixes those commits touched, most often first, at most five."
        }
      },
      "required": [
        "scope",
        "commits",
        "directories"
      ],
      "description": "One scope the history uses, and how much.\n```\nuse majordomus_cli::commit::scopes::ScopeUse;\nlet u = ScopeUse { scope: \"commit\".into(), commits: 40, directories: vec![\"src/commit\".into()] };\nassert_eq!(u.commits, 40);\n```"
    }
  }
}

Examples

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

default
{}