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

environment.explain

Where an environment value came from

What it is

The provenance of the snapshot: for each field, what decided it — a compile-time constant, a file, a command, or the cache — which resolver read it, and how far it can be trusted. Narrow it to one field, or to a prefix, by name.

Descriptor

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

Run

query
A query. It reads and changes nothing.

The field in dotted form (`services.url`, `capabilities.objects`); every field when absent.

GET /api/v1/environment/explain

Projections

InterfaceAsWhere
MCP toolmajordomus_environment_explain-
MCP resourcenot exposed-
HTTPGET /api/v1/environment/explainSwagger
Command linenot exposed-

Schemas

Input · ExplainInput
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "field": {
      "type": [
        "string",
        "null"
      ],
      "description": "The field in dotted form (`services.url`, `capabilities.objects`); every field when\nabsent."
    }
  },
  "description": "Which field's provenance to explain.",
  "title": "ExplainInput"
}
Output · EnvironmentProvenance
{
  "type": "object",
  "properties": {
    "resolution": {
      "$ref": "#/$defs/Resolution",
      "description": "How the snapshot behind these entries was resolved."
    },
    "fields": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FieldSource"
      },
      "description": "One entry per field, in the order the resolver produced them."
    }
  },
  "required": [
    "resolution",
    "fields"
  ],
  "description": "Where the values of one snapshot came from.",
  "title": "EnvironmentProvenance",
  "$defs": {
    "Resolution": {
      "oneOf": [
        {
          "type": "string",
          "const": "fast",
          "description": "Only what is cheap enough for a shell prompt; the rest from the cache."
        },
        {
          "type": "string",
          "const": "full",
          "description": "Everything, including the index. Writes the cache."
        }
      ],
      "description": "How completely a snapshot was resolved. Carried in the snapshot because a consumer must\nbe able to tell \"there is no server running\" from \"nobody looked\"."
    },
    "FieldSource": {
      "type": "object",
      "properties": {
        "field": {
          "type": "string",
          "description": "The field, in dotted form: `services.cockpit.url`, `vcs.branch`."
        },
        "value": {
          "type": [
            "string",
            "null"
          ],
          "description": "The value as it appears in the snapshot, rendered for a person; absent for a field\nthat resolved to nothing."
        },
        "source": {
          "type": "string",
          "description": "What decided it: a file, a command, a compile-time constant, the cache."
        },
        "resolver": {
          "type": "string",
          "description": "The part of this executable that read it."
        },
        "confidence": {
          "$ref": "#/$defs/Confidence",
          "description": "How certain the value is."
        }
      },
      "required": [
        "field",
        "source",
        "resolver",
        "confidence"
      ],
      "description": "Where one field of the snapshot came from. This is what makes an inferred system\ndebuggable: every fact can name the thing that decided it, so \"why does it say that\"\nis answered by the tool rather than by reading its source."
    },
    "Confidence": {
      "oneOf": [
        {
          "type": "string",
          "const": "exact",
          "description": "Read from its canonical source during this resolution."
        },
        {
          "type": "string",
          "const": "cached",
          "description": "Read from a cache whose fingerprint still matches its inputs."
        },
        {
          "type": "string",
          "const": "unknown",
          "description": "Not resolved."
        }
      ],
      "description": "How far a resolved value can be trusted."
    }
  }
}

Examples

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

all
{}
one-field
{
  "field": "project.version"
}