Skip to main content

Module served

Module served 

Source
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.observe reaches 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.forge asks the forge which deployments and releases it recorded, through the forge’s own tool, and keeps the answer for deploy.observed to read. It reaches the network and spends the caller’s credential, so it too is a command line and nothing else.
  • served.show is 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 (see crate::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§

DeploymentStanding
One deployment’s newest record and what it proves about the commit asked. Both are carried: the recorded judgement is what was seen, now is what it still proves.
ForgeObserved
What served.forge came to: whether the forge answered, and what its answer held. The answer itself is read through deploy.observed; this is the receipt of having asked.
ObserveInput
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, its build.json and HEAD.
Observed
What served.observe did: the observation, where it was recorded, and the exit status the command line reports the verdict with.
ServedStanding
Every deployment’s standing against one commit: the answer served.show gives on the command line, over HTTP and to an MCP client, from one derivation.
ShowInput
The input of served.show: the commit every record is re-judged against, and optionally a single deployment. HEAD and 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.observe and served.forge (commands of the trusted command line) and served.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.