lifecycle.runtime
Commit, na kterém byl postaven servírovaný index, proti commitu, na kterém repozitář je, čteno při tomto volání. Server, který zmrazil index při startu, odpovídá na každou otázku o commitu před hodinami tak, že odpověď nic neříká; toto je čtení, které to dokáže rozeznat.
Commit, na kterém byl postaven servírovaný index, proti commitu, na kterém repozitář je, čteno při tomto volání. Server, který zmrazil index při startu, odpovídá na každou otázku o commitu před hodinami tak, že odpověď nic neříká; toto je čtení, které to dokáže rozeznat.
- query
- behaviorally_verified
- module lifecycle
- #continuity
- #session
- #server
Zpřístupnění
Kde je tato jedna definice dosažitelná. Absence je explicitní: povrch, který není uveden, ji nenese.
| povrch | jako |
|---|---|
| MCP | nástroj majordomus_lifecycle_runtime |
| HTTP | GET /api/v1/lifecycle/runtime operationId lifecycle.runtime |
| příkazová řádka | — |
Schémata
Kanonický vstup a výstup z typů Rustu; schéma nástroje MCP a parametry a odpovědi OpenAPI se odvozují z nich.
vstup · Prázdné
Žádné vlastnosti: schopnost nebere žádný vstup.
JSON Schema
{
"additionalProperties": false,
"description": "No input.",
"title": "Empty",
"type": "object"
}výstup · RuntimeView
Obě poloviny se zde čtou a žádná se nepředpokládá. served je to, z čeho byl sestaven index, který tento proces drží; repository je to, co git říká nyní, při tomto volání. Server, který následuje repozitář, hlásí obojí shodně a za důkaz platí jedno vyvolání git; server, který zmrazil svůj index při startu, hlásí rozdílné, což je jediný způsob, jak to čtenář mohl zjistit.
agree je pole s provozním významem a to, co říká, není „repozitář je v pořádku“, ale „odpovědi, které čtete, se týkají stromu, na který se díváte“. Když je false, každá další schopnost, kterou tento proces obsluhuje, odpovídá o commitu, který už není vyčekovaný, a nic jiného v API by vám to neřeklo.
use majordomus_cli::capability::builtin::lifecycle::RuntimeView;
use serde_json::json;
let view = |served: &str, repo: &str, agree: bool| -> RuntimeView {
serde_json::from_value(json!({
"root": "example/repo",
"served_head": served, "served_branch": "master", "served_working_tree": "clean",
"repository_head": repo, "repository_branch": "master",
"repository_working_tree": "clean",
"agree": agree, "objects": 1319, "index_state": "ok",
"note": "as measured on this call",
})).unwrap()
};
// a server following the repository: one `git` invocation buys the proof
let current = view("a1b2c3d", "a1b2c3d", true);
assert!(current.agree);
assert_eq!(current.served_head, current.repository_head);
assert_eq!(current.index_state, "ok");
// and one that froze its index at start-up: every answer it serves is about the old commit
let frozen = view("a1b2c3d", "9f8e7d6", false);
assert!(!frozen.agree);
assert_ne!(frozen.served_head, frozen.repository_head);| vlastnost | typ | povinné | popis |
|---|---|---|---|
| souhlasí | boolean | ano | Zda se obě shodují na commitu a větvi. |
| index_state | string | ano | ok nebo degraded. |
| poznámka | string | ano | Co porovnání znamená a co dělat, když nesouhlasí. |
| objekty | integer | ano | Kolik objektů obsahuje obsluhovaný index a zda byl degradován. |
| repository_branch | string | ne | Její větev nyní. |
| repository_head | string | ne | Commit, na kterém repozitář je, čtený při tomto volání. |
| repository_working_tree | string | ne | Pracovní strom nyní. |
| root | string | ano | Kořen repozitáře, který tento proces obsluhuje. |
| served_branch | string | ne | Její větev, nebo DETACHED. |
| served_head | string | ne | Commit, na kterém byl servírovaný index sestaven. |
| served_working_tree | string | ne | Zda byl pracovní strom čistý, když se index budoval. |
JSON Schema
{
"description": "The commit this process answers about, against the commit the repository is on.\n\nBoth halves are read here and neither is assumed. `served` is what the index this\nprocess is holding was built from; `repository` is what `git` says now, on this call. A\nserver that follows the repository reports them equal and pays one `git` invocation for\nthe proof; a server that froze its index at start-up reports them different, which is\nthe only way a reader could ever have found that out.\n\n`agree` is the field with the operational meaning, and what it says is *not* \"the\nrepository is fine\" but \"the answers you are reading are about the tree you are looking\nat\". When it is false every other capability this process serves is answering about a\ncommit that is no longer checked out, and nothing else in the API would tell you.\n\n```\nuse majordomus_cli::capability::builtin::lifecycle::RuntimeView;\nuse serde_json::json;\n\nlet view = |served: &str, repo: &str, agree: bool| -> RuntimeView {\n serde_json::from_value(json!({\n \"root\": \"example/repo\",\n \"served_head\": served, \"served_branch\": \"master\", \"served_working_tree\": \"clean\",\n \"repository_head\": repo, \"repository_branch\": \"master\",\n \"repository_working_tree\": \"clean\",\n \"agree\": agree, \"objects\": 1319, \"index_state\": \"ok\",\n \"note\": \"as measured on this call\",\n })).unwrap()\n};\n\n// a server following the repository: one `git` invocation buys the proof\nlet current = view(\"a1b2c3d\", \"a1b2c3d\", true);\nassert!(current.agree);\nassert_eq!(current.served_head, current.repository_head);\nassert_eq!(current.index_state, \"ok\");\n\n// and one that froze its index at start-up: every answer it serves is about the old commit\nlet frozen = view(\"a1b2c3d\", \"9f8e7d6\", false);\nassert!(!frozen.agree);\nassert_ne!(frozen.served_head, frozen.repository_head);\n```",
"properties": {
"agree": {
"description": "Whether the two agree on the commit and the branch.",
"type": "boolean"
},
"index_state": {
"description": "`ok` or `degraded`.",
"type": "string"
},
"note": {
"description": "What the comparison means, and what to do when it disagrees.",
"type": "string"
},
"objects": {
"description": "How many objects the served index holds, and whether it was degraded.",
"format": "uint",
"minimum": 0,
"type": "integer"
},
"repository_branch": {
"description": "Its branch now.",
"type": "string"
},
"repository_head": {
"description": "The commit the repository is on, read on this call.",
"type": "string"
},
"repository_working_tree": {
"description": "The working tree now.",
"type": "string"
},
"root": {
"description": "The repository root this process is serving.",
"type": "string"
},
"served_branch": {
"description": "Its branch, or `DETACHED`.",
"type": "string"
},
"served_head": {
"description": "The commit the served index was built at.",
"type": "string"
},
"served_working_tree": {
"description": "Whether the working tree was clean when the index was built.",
"type": "string"
}
},
"required": [
"root",
"agree",
"objects",
"index_state",
"note"
],
"title": "RuntimeView",
"type": "object"
}Politiky
- benchmark
- povinné — cíl na každém transportu, který expozice deklaruje; případy jsou ty ze vstupního typu
- cache
- process — až 2 záznamy v procesu, po 2 s každý, vymezené otiskem registru
Cíle benchmarku
Odvozeno z registru pro tento repozitář: jeden požadavek na transport a případy, které poskytuje typ vstupu. Celá matice je na stránce měření výkonu.
| transport | state | případy | targets |
|---|---|---|---|
| direct | pokryto | 1 | výchozí studený+teplý |
| mcp | pokryto | 1 | výchozí studený+teplý |
| http | pokryto | 1 | výchozí studený+teplý |
Tvrzení implementovaná vedle ní
Připojeno souborem, který každé tvrzení implementuje; každé odkazuje na svou stránku s implementací a testem, který je dokazuje.