Skip to main content

Module gates

Module gates 

Source
Expand description

The gates module: completion as a state the repository decides.

Two capabilities, and the split is the same one super::obligations makes for the same reason.

The model is declared. .ai/repo/ci/gates.yaml is this repository’s CI model: every validation gate, the job that runs it, the command it runs, and the path classes that decide which change selects which gate. gates.model reads it and answers in any checkout that has one, whether or not the lifecycle has ever run.

The completion is local. Whether this task may be called finished depends on the task record and the ledger under .ai/local/state/, which is one checkout’s own state and is never tracked or published. gates.completion answers about the checkout the process was started in and about no other.

It is read, never written. majordomus evidence --gate records a run; this judges the record. A second writer for the same ledger would be a second account of events, which is what ADR 0030 refuses.

One judgement, and every surface reads it. The shell tool’s check and finish call this executable rather than re-deriving the answer, the HTTP route serves the same execution, MCP exposes the same tool, and the Cockpit renders the same document. That is the property the module exists for: a worker cannot get a different verdict by asking a different surface, and no surface can be persuaded that “done” is true because an agent said so.

use majordomus_cli::capability::builtin::gates::module;

// the whole module, as every projection reads it: two capabilities, and neither has a
// command-line arm of its own because `check` and `finish` are the command line's answer
let m = module();
let ids: Vec<&str> = m.capabilities.iter().map(|c| c.capability.id.as_str()).collect();
assert_eq!(ids, ["gates.model", "gates.completion"]);
for entry in &m.capabilities {
    assert!(entry.capability.exposure.cli.is_none());
    assert!(entry.capability.exposure.http.is_some());
}

Structs§

CompletionInput
GateModelEntry
GateModelReport
The CI model this repository declares: what may refuse a change, and what selects each.

Constants§

COMPLETION_URI
The URI under which this checkout’s completion state is read as an MCP resource.
GATES_URI
The URI under which the CI model is read as an MCP resource.

Functions§

module
The gates module: the CI model every clone shares, and the completion state only this checkout can answer.