Přeskočit na obsah

Tato stránka byla automaticky přeložena z angličtiny, jediného jazyka, ve kterém se tento web píše. Číst originál.

HTTP API: layout

The boundary between the layer's tracked and local halves, checked against the layouts their contracts declare: what lives where, and what must never appear there (I1102).

Vykresleno z docs/generated/openapi.json, který spustitelný soubor generuje ze svého registru schopností a CI jej odmítne, je-li zastaralý. Surový dokument je na /openapi.json; běžící server servíruje stejný dokument na vlastní /openapi.json a Swagger UI na /swagger.

rozvržení

The boundary between the layer's tracked and local halves, checked against the layouts their contracts declare: what lives where, and what must never appear there (I1102).

GET /api/v1/layout/check layout.check

Refuse a misplaced artifact

Every path a declared layout excludes, named with the contract it violates: a tracked file under the tracked half that git's ignore rules match (state that does not travel, under a contract that excludes cache or runtime), and a file under the local half that is a byte copy of a tracked canonical file or declares the schema of a kind share/kinds.yaml calls canonical (under the manifest's `local.excludes: [canonical]`). Only what a contract declares is judged. Reads git and the local half's files; no build and no network.

  • query
  • behaviorally_verified
  • vyžaduje se měření výkonu
  • cache vypnuta
  • MCP tool majordomus_layout_check
  • $ layout check

Žádné parametry.

Vyzkoušejte

Port je ten, který server zalogoval; 8741 je ten, o který žádá jako první. Hodnoty jsou první příklad operace.

curl -s "http://127.0.0.1:8741/api/v1/layout/check"

Testováno v apps/majordomus-cli/tests/http_serve.rs, který přehrává routu s těmito hodnotami proti serveru na skutečném socketu.

Odpovědi

statustělovýznam
200 LayoutReport
Refuse a misplaced artifact: the result.
400 ErrorBody
invalid_input: Vstup neodpovídá schématu: parametr špatného typu, neznámý parametr nebo hodnota, kterou schopnost odmítne.
404 ErrorBody
not_found: Vstup pojmenovává něco, co repozitář nemá.
500 ErrorBody
internal: Schopnost selhala z vlastního důvodu; zpráva ho pojmenovává.
výchozí ErrorBody
Jakékoli jiné selhání, které transport hlásí: 405 method_not_allowed pro jinou metodu na této cestě, 400 invalid_input pro tělo, které není objektem JSON.

Schémata

Komponenty, které používají jen operace tohoto tagu. Každý řádek je pole daného typu, jeho doc komentář je popis; typ vlastněný jinou stránkou na ni odkazuje.

LayoutFinding

object
One misplaced artifact: a path found in a half whose declared layout excludes it, with the contract that excludes it and why, so a refusal names what to move and where it belongs.

It travels as the JSON of the layout.check capability, so its member names are the wire contract every projection reads:

use majordomus_cli::layout::LayoutFinding;
let finding = LayoutFinding {
    path: ".ai/local/notes/rule.md".into(),
    contract: "manifest local".into(),
    excludes: "canonical".into(),
    reason: "a copy of .ai/repo/rules/rule.md".into(),
};
let json = serde_json::to_value(&finding).unwrap();
assert_eq!(json["contract"], "manifest local");
assert_eq!(json["excludes"], "canonical");
let back: LayoutFinding = serde_json::from_value(json).unwrap();
assert_eq!(back, finding);
vlastnosttyppovinnépopis
path string ano
The path, repository-relative.
kontrakt string ano
The contract it violates: a context document's id, or manifest local.
vylučuje string ano
What the contract excludes that this path is.
důvod string ano
What the path was found to be, and how.

Used by LayoutReport

LayoutReport

object
The answer of the layout check: whether the halves were read, how many paths were judged, and every path a contract excludes. A report that could not read the halves never passes, so silence about a tree nobody measured cannot read as a clean tree.

use majordomus_cli::layout::LayoutReport;
let clean = LayoutReport::of(true, None, 12, Vec::new());
assert!(clean.passes);
assert_eq!(clean.checked, 12);
let unread = LayoutReport::of(false, Some("git could not start".into()), 0, Vec::new());
assert!(!unread.passes, "nothing found because nothing was read");
assert_eq!(unread.reason.as_deref(), Some("git could not start"));
vlastnosttyppovinnépopis
naměřeno boolean ano
Whether the halves could be read at all. false is not a pass.
důvod string | null ne
Why they could not, when they could not.
checked integer (uint) ano
How many paths were judged.
zjištění array of LayoutFinding → LayoutFinding ano
Every path a contract excludes, in canonical order. Empty is the passing answer.
průchody boolean ano
true when the halves were read and nothing was found.

Used by layout.check

Prohledává názvy a popisy všech stránek, které tento web publikuje.