pack.verify
Read a pack directory inside the repository against its pack.json: every file it names is present with its digest and nothing else is, every carried file's content has the digest its marker records, no carried path is a binary, an artifact, a link or a gitlink under the profile the manifest names, no file is over the profile's token budget or holds a NUL byte or a leak, and there are no more files than the profile allows. An unreadable manifest is unmeasured, never a pass.
Read a pack directory inside the repository against its pack.json: every file it names is present with its digest and nothing else is, every carried file's content has the digest its marker records, no carried path is a binary, an artifact, a link or a gitlink under the profile the manifest names, no file is over the profile's token budget or holds a NUL byte or a leak, and there are no more files than the profile allows. An unreadable manifest is unmeasured, never a pass.
- query
- behaviorally_verified
- module pack
- #pack
- #archive
- #privacy
- #evidence
Exposure
Where this one definition is reachable. Absence is explicit: a surface not listed does not carry it.
| surface | as |
|---|---|
| MCP | tool majordomus_pack_verify |
| HTTP | GET /api/v1/pack/verify operationId pack.verify |
| command line | majordomus pack verify |
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 · PackVerifyInput
pack.verify: the directory of a pack that was written, which must lie
inside the repository it was built from.
use majordomus_cli::capability::builtin::pack::PackVerifyInput;
let input = PackVerifyInput { dir: "tmp/packs/x".into() };
assert_eq!(input.dir, "tmp/packs/x");| property | type | required | description |
|---|---|---|---|
| dir | string | yes | The pack's directory, inside the repository: relative to its root, or absolute under it. |
JSON Schema
{
"additionalProperties": false,
"description": "The input of `pack.verify`: the directory of a pack that was written, which must lie\ninside the repository it was built from.\n\n```\nuse majordomus_cli::capability::builtin::pack::PackVerifyInput;\nlet input = PackVerifyInput { dir: \"tmp/packs/x\".into() };\nassert_eq!(input.dir, \"tmp/packs/x\");\n```",
"properties": {
"dir": {
"description": "The pack's directory, inside the repository: relative to its root, or absolute\nunder it.",
"type": "string"
}
},
"required": [
"dir"
],
"title": "PackVerifyInput",
"type": "object"
}output · PackVerdict
The examples below build a pack of a repository holding main.rs.
use majordomus_cli::pack::{build, plan, verify, PackVerdict, Profiles};
#### use std::process::Command;
#### let dir = tempfile::tempdir().unwrap();
#### let (root, share) = (dir.path().join("repo"), dir.path().join("share"));
#### std::fs::create_dir_all(&root).unwrap();
#### std::fs::create_dir_all(&share).unwrap();
#### std::fs::write(share.join("archive.yaml"), "default: chat\nprofiles:\n - id: chat\n binary: drop\n artifacts: drop\n shards:\n max_count: 5\n max_tokens: 4000\n").unwrap();
#### let git = |a: &[&str]| assert!(Command::new("git").arg("-C").arg(&root)
#### .args(["-c", "user.email=t@example.com", "-c", "user.name=t"]).args(a)
#### .status().unwrap().success());
#### git(&["init", "-q"]);
#### std::fs::write(root.join("main.rs"), "fn main() {}\n").unwrap();
#### git(&["add", "-A"]);
#### git(&["commit", "-q", "-m", "one"]);
let profiles = Profiles::load(&share, &root).unwrap();
let out = dir.path().join("pack");
let v: PackVerdict = build(&plan(&root, &share, None), &root, &out).unwrap();
assert_eq!((v.files, v.sources), (2, 1), "the index and one shard, carrying one file");
assert_eq!(v.profile.as_deref(), Some("chat"));
// a directory with no manifest is not measured, which is not a pass
let v: PackVerdict = verify(dir.path(), &profiles, &root);
assert!(!v.measured && !v.passes);| property | type | required | description |
|---|---|---|---|
| commit | string | null | no | The commit its manifest names. |
| dir | string | yes | The directory read. |
| files | integer | yes | How many files it holds, the index included. |
| findings | array | yes | Every finding. Empty is the passing answer. |
| largest_tokens | integer | yes | The tokens of its largest file. |
| measured | boolean | yes | Whether the pack could be read at all. false is not a pass. |
| passes | boolean | yes | true when the pack was read and nothing was found. |
| profile | string | null | no | The profile its manifest names. |
| reason | string | null | no | Why it could not, when it could not. |
| sources | integer | yes | How many source files its shards carry. |
JSON Schema
{
"$defs": {
"PackFinding": {
"description": "A reason the pack cannot be built as planned, or a written pack is not what its\nmanifest says: a stable code, the path when there is one, and the remedy.\n\nThe examples below plan a repository holding `main.rs` and a `logo.png` whose content is\nbinary, with a distribution whose `chat` profile has limits and whose `bare` one has none.\n\n```\nuse majordomus_cli::pack::{plan, PackFinding};\n# use std::process::Command;\n# let dir = tempfile::tempdir().unwrap();\n# let (root, share) = (dir.path().join(\"repo\"), dir.path().join(\"share\"));\n# std::fs::create_dir_all(&root).unwrap();\n# std::fs::create_dir_all(&share).unwrap();\n# std::fs::write(share.join(\"archive.yaml\"), \"default: chat\\nprofiles:\\n - id: chat\\n binary: drop\\n artifacts: drop\\n shards:\\n max_count: 5\\n max_tokens: 4000\\n - id: bare\\n binary: drop\\n\").unwrap();\n# let git = |a: &[&str]| assert!(Command::new(\"git\").arg(\"-C\").arg(&root)\n# .args([\"-c\", \"user.email=t@example.com\", \"-c\", \"user.name=t\"]).args(a)\n# .status().unwrap().success());\n# git(&[\"init\", \"-q\"]);\n# std::fs::write(root.join(\"main.rs\"), \"fn main() {}\\n\").unwrap();\n# std::fs::write(root.join(\"logo.png\"), b\"\\x89PNG\\0\\x01\").unwrap();\n# git(&[\"add\", \"-A\"]);\n# git(&[\"commit\", \"-q\", \"-m\", \"one\"]);\nlet findings: Vec<PackFinding> = plan(&root, &share, Some(\"bare\")).plan.findings;\nassert_eq!(findings[0].code, \"pack.no_limits\");\nassert!(findings[0].path.is_none() && !findings[0].remedy.is_empty());\n```",
"properties": {
"code": {
"description": "A stable code: `pack.file_too_large`, `pack.too_many_shards`, `pack.index_too_large`, `pack.leak`,\n`pack.empty`, `pack.no_limits`, and from verification `pack.tampered`,\n`pack.not_text`, `pack.forbidden_path`, `pack.missing`, `pack.stray`,\n`pack.over_budget`, `pack.manifest`.",
"type": "string"
},
"message": {
"description": "What is wrong.",
"type": "string"
},
"path": {
"description": "The path the finding is about, when it is about one.",
"type": [
"string",
"null"
]
},
"remedy": {
"description": "What settles it.",
"type": "string"
}
},
"required": [
"code",
"message",
"remedy"
],
"type": "object"
}
},
"description": "The verdict on a written pack: whether it could be read, what its manifest names, how\nmany files and sources it holds, and every finding against it.\n\nThe examples below build a pack of a repository holding `main.rs`.\n\n```\nuse majordomus_cli::pack::{build, plan, verify, PackVerdict, Profiles};\n# use std::process::Command;\n# let dir = tempfile::tempdir().unwrap();\n# let (root, share) = (dir.path().join(\"repo\"), dir.path().join(\"share\"));\n# std::fs::create_dir_all(&root).unwrap();\n# std::fs::create_dir_all(&share).unwrap();\n# std::fs::write(share.join(\"archive.yaml\"), \"default: chat\\nprofiles:\\n - id: chat\\n binary: drop\\n artifacts: drop\\n shards:\\n max_count: 5\\n max_tokens: 4000\\n\").unwrap();\n# let git = |a: &[&str]| assert!(Command::new(\"git\").arg(\"-C\").arg(&root)\n# .args([\"-c\", \"user.email=t@example.com\", \"-c\", \"user.name=t\"]).args(a)\n# .status().unwrap().success());\n# git(&[\"init\", \"-q\"]);\n# std::fs::write(root.join(\"main.rs\"), \"fn main() {}\\n\").unwrap();\n# git(&[\"add\", \"-A\"]);\n# git(&[\"commit\", \"-q\", \"-m\", \"one\"]);\nlet profiles = Profiles::load(&share, &root).unwrap();\nlet out = dir.path().join(\"pack\");\nlet v: PackVerdict = build(&plan(&root, &share, None), &root, &out).unwrap();\nassert_eq!((v.files, v.sources), (2, 1), \"the index and one shard, carrying one file\");\nassert_eq!(v.profile.as_deref(), Some(\"chat\"));\n// a directory with no manifest is not measured, which is not a pass\nlet v: PackVerdict = verify(dir.path(), &profiles, &root);\nassert!(!v.measured && !v.passes);\n```",
"properties": {
"commit": {
"description": "The commit its manifest names.",
"type": [
"string",
"null"
]
},
"dir": {
"description": "The directory read.",
"type": "string"
},
"files": {
"description": "How many files it holds, the index included.",
"format": "uint",
"minimum": 0,
"type": "integer"
},
"findings": {
"description": "Every finding. Empty is the passing answer.",
"items": {
"$ref": "#/$defs/PackFinding"
},
"type": "array"
},
"largest_tokens": {
"description": "The tokens of its largest file.",
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"measured": {
"description": "Whether the pack could be read at all. `false` is not a pass.",
"type": "boolean"
},
"passes": {
"description": "`true` when the pack was read and nothing was found.",
"type": "boolean"
},
"profile": {
"description": "The profile its manifest names.",
"type": [
"string",
"null"
]
},
"reason": {
"description": "Why it could not, when it could not.",
"type": [
"string",
"null"
]
},
"sources": {
"description": "How many source files its shards carry.",
"format": "uint",
"minimum": 0,
"type": "integer"
}
},
"required": [
"measured",
"dir",
"files",
"sources",
"largest_tokens",
"findings",
"passes"
],
"title": "PackVerdict",
"type": "object"
}Policies
- benchmark
- required — a target on every transport the exposure declares; the cases are the input type's
- 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.