Skip to main content

Module web

Module web 

Source
Expand description

The repository’s web surfaces: one model, discovered once, read by everything that serves, publishes, validates or describes them.

A surface is anything this repository exposes over HTTP — the application’s site, the capability routes, the Swagger UI, the Cockpit, a generated test or benchmark report. Before this module each of those was known separately by the router, the publication script, the gate model and the documentation, and a new one cost a registration in each. Here it is discovered from its producer (discover), checked against the invariants a topology must satisfy (validate), composed into a publishable tree (compose) and written out for diagnostics (manifest) — all from the same model::Topology.

The decision and what it rejected are in .ai/repo/adrs/0013-*.md.

use majordomus_cli::web::{discover, model::Mount};
// the executable's own routes come from the constants that already declare them
let native = discover::native(discover::Runtime::full());
assert!(native.iter().any(|s| s.mount == Mount::parse("/swagger").unwrap()));

Re-exports§

pub use model::Availability;
pub use model::Category;
pub use model::Feature;
pub use model::Mount;
pub use model::Provenance;
pub use model::Surface;
pub use model::SurfaceKind;
pub use model::Topology;
pub use model::Visibility;

Modules§

discover
Discovery: how the repository’s web surfaces are found without anybody listing them.
files
Serving a static surface: a generated directory answered under its mount.
html
The one page style every generated report uses.
model
The typed model of a web surface: what it is, where it is mounted, what produced it, and where every value came from.
report
The reports this repository generates as web surfaces: the test run, the benchmark run, the UI conformance audit that is a section of the first, and the UI itself read once at a pinned commit, which a publication carries at the UI’s mount (snapshot, ADR 0141).
serve
Serving the static surfaces of a resolved topology.
validate
Validation: the invariants a topology must satisfy before anything serves or publishes it.

Structs§

ProjectionRoute
One route the projection answers for itself, as the OpenAPI document, the published site and the Cockpit all show it: where it answers, what it is, and whether a publication can carry it.

Functions§

projection_routes
The projection’s own routes, in the order their producers declare them: the home page first, then every native surface.