Expand description
The served module: whether a deployment serves the commit it was meant to, observed
from outside and recorded as evidence a later reader can re-judge.
Three operations, deliberately unequal:
served.observereaches the network and appends a record, so it is a command of the trusted command line only. A browser or an MCP client that could make this process probe an arbitrary URL would have been handed a request forger.served.forgeasks the forge which deployments and releases it recorded, through the forge’s own tool, and keeps the answer fordeploy.observedto read. It reaches the network and spends the caller’s credential, so it too is a command line and nothing else.served.showis a read: it asks no network, writes nothing and re-judges what was recorded against the commit asked about, which is what makes an old observation go stale without anyone deciding it has (seecrate::served).
use majordomus_cli::capability::builtin::served;
use majordomus_cli::capability::model::CapabilityKind;
let m = served::module();
let observe = m.capabilities.iter().find(|c| c.capability.id.as_str() == "served.observe").unwrap();
// the operation that reaches the network is on no surface a client can call
assert_eq!(observe.capability.kind, CapabilityKind::Command);
assert!(observe.capability.exposure.http.is_none());
assert!(observe.capability.exposure.mcp.is_none());
let show = m.capabilities.iter().find(|c| c.capability.id.as_str() == "served.show").unwrap();
assert_eq!(show.capability.exposure.http.as_ref().unwrap().path, "/api/v1/served");Structs§
- Deployment
Standing - One deployment’s newest record and what it proves about the commit asked. Both are
carried: the recorded judgement is what was seen,
nowis what it still proves. - Forge
Observed - What
served.forgecame to: whether the forge answered, and what its answer held. The answer itself is read throughdeploy.observed; this is the receipt of having asked. - Observe
Input - The input of
served.observe: which deployment, where it is, which commit is expected and how long the probe may take. Everything is optional — the defaults are this repository’s own site, itsbuild.jsonandHEAD. - Observed
- What
served.observedid: the observation, where it was recorded, and the exit status the command line reports the verdict with. - Served
Standing - Every deployment’s standing against one commit: the answer
served.showgives on the command line, over HTTP and to an MCP client, from one derivation. - Show
Input - The input of
served.show: the commit every record is re-judged against, and optionally a single deployment.HEADand every deployment when absent.
Constants§
- DEFAULT_
DEPLOYMENT - The deployment name an observation carries when the caller names none: the public site.
- SERVED_
URI - The URI under which the recorded standing of every deployment is read as a resource.
Functions§
- module
- The module:
served.observeandserved.forge(commands of the trusted command line) andserved.show(a read on every surface). - standing
- The standing of every recorded deployment against
expected. Public so that a consumer that judges an intent’s deployment criterion reads the same derivation as this read.