mesh.build_cache.key
Every lockfile the repository tracks — Cargo.lock, mix.lock, package-lock.json — as the thing it makes cacheable (a cargo build directory, mix dependencies, npm node_modules), each with its key: a schema version, the platform (the toolchain's own host triple, or `any` for platform-independent source), the toolchain as its executables state it, and the digest of every input and environment variable that changes what the install leaves. Where the entry is restored to is a separate field, so two checkouts with one lockfile share one entry. A kind whose toolchain is absent says why and has no key (ADR 0157, I3950).
Every lockfile the repository tracks — Cargo.lock, mix.lock, package-lock.json — as the thing it makes cacheable (a cargo build directory, mix dependencies, npm node_modules), each with its key: a schema version, the platform (the toolchain's own host triple, or `any` for platform-independent source), the toolchain as its executables state it, and the digest of every input and environment variable that changes what the install leaves. Where the entry is restored to is a separate field, so two checkouts with one lockfile share one entry. A kind whose toolchain is absent says why and has no key (ADR 0157, I3950).
- query
- experimental
- module mesh
- #mesh
- #build
- #cache
Exposure
Where this one definition is reachable. Absence is explicit: a surface not listed does not carry it.
| surface | as |
|---|---|
| MCP | tool majordomus_mesh_build_cache_key |
| HTTP | GET /api/v1/mesh/build-cache/key operationId mesh.build_cache.key |
| command line | majordomus mesh build-cache key |
Schemas
The canonical input and output, from the Rust types; the MCP tool schema and the OpenAPI parameters and responses are derived from these.
input · BuildCacheKeyInput
mesh.build_cache.key.| property | type | required | description |
|---|---|---|---|
| kind | one of 2 | no | Only this kind; every kind the repository has when absent. |
JSON Schema
{
"$defs": {
"Kind": {
"description": "What is cached: the thing a lockfile makes reusable, named by the directory an install or\na build fills. The word is part of every key, so two kinds never share an entry.\n\n```\nuse majordomus_cli::mesh::build_cache::key::Kind;\nassert_eq!(Kind::NpmModules.as_str(), \"npm-modules\");\nassert_eq!(Kind::parse(\"mix-deps\"), Some(Kind::MixDeps));\n```",
"oneOf": [
{
"const": "cargo-build-dir",
"description": "The cargo build directory of a workspace: the dependencies compiled on the way, without\nincremental state. Restored only into a directory that is cold.",
"type": "string"
},
{
"const": "mix-deps",
"description": "The `deps/` directory `mix deps.get` fills.",
"type": "string"
},
{
"const": "npm-modules",
"description": "The `node_modules/` directory `npm ci` fills.",
"type": "string"
}
]
}
},
"additionalProperties": false,
"description": "The input of `mesh.build_cache.key`.",
"properties": {
"kind": {
"anyOf": [
{
"$ref": "#/$defs/Kind"
},
{
"type": "null"
}
],
"description": "Only this kind; every kind the repository has when absent."
}
},
"title": "BuildCacheKeyInput",
"type": "object"
}output · BuildCacheKeyReport
cache.key answers it.
use majordomus_cli::mesh::build_cache::key::KeyReport;
let r = KeyReport { platform: "x86_64-unknown-linux-gnu".into(), kinds: vec![] };
assert!(r.kinds.is_empty());| property | type | required | description |
|---|---|---|---|
| kinds | array | yes | One entry per lockfile the repository tracks, by kind then directory. |
| platform | string | yes | This machine's platform triple. |
JSON Schema
{
"$defs": {
"BuildCacheKindKey": {
"description": "One cached thing of a repository, with its key or the reason it has none.\n\n```\nuse majordomus_cli::mesh::build_cache::key::{Kind, KindKey};\nlet k = KindKey {\n kind: Kind::NpmModules,\n dir: \"site\".into(),\n location: \"site/node_modules\".into(),\n platform: \"aarch64-apple-darwin\".into(),\n toolchain: Some(\"node-24.8.0-npm-11\".into()),\n inputs: vec![\"site/package-lock.json\".into()],\n digest: \"0\".repeat(32),\n key: Some(format!(\"v1/npm-modules/aarch64-apple-darwin/node-24.8.0-npm-11/{}\", \"0\".repeat(32))),\n unavailable: None,\n};\nassert!(k.key.unwrap().starts_with(\"v1/npm-modules/\"));\n```",
"properties": {
"digest": {
"description": "The first 32 hex digits of the SHA-256 over the inputs and the declared environment.",
"type": "string"
},
"dir": {
"description": "The directory holding the lockfile, relative to the repository root (`.` for the root).",
"type": "string"
},
"inputs": {
"description": "The files hashed into the digest, relative to the repository root.",
"items": {
"type": "string"
},
"type": "array"
},
"key": {
"description": "`v1/<kind>/<platform>/<toolchain>/<digest>`; absent when the toolchain is.",
"type": [
"string",
"null"
]
},
"kind": {
"$ref": "#/$defs/Kind",
"description": "What is cached."
},
"location": {
"description": "Where the entry is restored to: relative to the repository, or `~/`-relative when it\nlies under the home directory (a shared cargo build directory).",
"type": "string"
},
"platform": {
"description": "The platform triple the entry is built for.",
"type": "string"
},
"toolchain": {
"description": "The toolchain as its executables state it; absent when they could not be asked.",
"type": [
"string",
"null"
]
},
"unavailable": {
"description": "Why there is no key, when there is none.",
"type": [
"string",
"null"
]
}
},
"required": [
"kind",
"dir",
"location",
"platform",
"inputs",
"digest"
],
"type": "object"
},
"Kind": {
"description": "What is cached: the thing a lockfile makes reusable, named by the directory an install or\na build fills. The word is part of every key, so two kinds never share an entry.\n\n```\nuse majordomus_cli::mesh::build_cache::key::Kind;\nassert_eq!(Kind::NpmModules.as_str(), \"npm-modules\");\nassert_eq!(Kind::parse(\"mix-deps\"), Some(Kind::MixDeps));\n```",
"oneOf": [
{
"const": "cargo-build-dir",
"description": "The cargo build directory of a workspace: the dependencies compiled on the way, without\nincremental state. Restored only into a directory that is cold.",
"type": "string"
},
{
"const": "mix-deps",
"description": "The `deps/` directory `mix deps.get` fills.",
"type": "string"
},
{
"const": "npm-modules",
"description": "The `node_modules/` directory `npm ci` fills.",
"type": "string"
}
]
}
},
"description": "Every cached thing a repository has, as `cache.key` answers it.\n\n```\nuse majordomus_cli::mesh::build_cache::key::KeyReport;\nlet r = KeyReport { platform: \"x86_64-unknown-linux-gnu\".into(), kinds: vec![] };\nassert!(r.kinds.is_empty());\n```",
"properties": {
"kinds": {
"description": "One entry per lockfile the repository tracks, by kind then directory.",
"items": {
"$ref": "#/$defs/BuildCacheKindKey"
},
"type": "array"
},
"platform": {
"description": "This machine's platform triple.",
"type": "string"
}
},
"required": [
"platform",
"kinds"
],
"title": "BuildCacheKeyReport",
"type": "object"
}Policies
- benchmark
- waived — waived: external_dependency
- cache
- disabled — every call runs the handler
Benchmark targets
Derived from the registry for this repository: one requirement per transport, and the cases the input type provides. The whole matrix is on the benchmarks page.
| transport | state | cases | targets |
|---|---|---|---|
| direct | waived (external_dependency) | 0 | |
| mcp | waived (external_dependency) | 0 | |
| http | waived (external_dependency) | 0 |