Skip to content
screen · composed of the kit

Architecture

One repository.Many interfaces.

Majordomus discovers a repository once, reads it into typed models, and derives its interfaces from them: the HTTP API and its OpenAPI description, Swagger UI, MCP, the Cockpit's generic pages and this site. The command line is declared a second time, in clap, and checked against the registry.

“Discover and model a fact once, and derive every interface from it.”
docs/SURFACES.md · the invariant

Repository

The tracked tree is the source of truth

prismatic-majordomus/

  • .ai/the layer: policy, rules, ADRs, skills
  • apps/the Rust executable and its capabilities
  • bin/the entry points
  • lib/the shell tool
  • share/kinds, schemas, the design
  • docs/manuals and generated documents
  • test/the cases
  • site/this website and the data derived for it
  • justfilethe workflows

RepositoryEnvironment

one typed value, built by one resolver

  1. projectthe crate manifest
  2. repository.ai/manifest.yaml
  3. vcsone git status
  4. toolchainsthe manifests that declare them
  5. layerthe index, counted per kind
  6. workflowsjust --dump
  7. providersthe policy's projections
  8. servicesroute constants and the lease

Key principles

  • One declarationMCP, HTTP and OpenAPI are built from it; the CLI is checked against it
  • Discoveredenumerated through sources.yaml, never registered by hand
  • Typedan object that does not validate is a diagnostic
  • Deterministicthe OpenAPI document: maps sorted, no timestamp
  • Provenanceevery field names where it came from
  • Checkeda hand edit of a derived file is refused or reported
1

Discovery

Enumeration governed by a declaration

  • The rootthe executable finds the repository
  • The manifest.ai/manifest.yaml names the layer
  • Kinds and schemasshare/kinds.yaml and share/schemas/
  • Sourcessources.yaml classes, read from the git index
  • Diagnosticsa file that does not validate is excluded and named
2

Canonical model

Typed, with provenance

environment/mod.rs
RepositoryEnvironment {
  schema, generated_at,
  resolution,
  project, repository,
  vcs,
  toolchains: [ .. ],
  layer, workflows,
  providers: [ .. ],
  services: [ .. ],
  reasoning?,
  diagnostics: [ .. ],
  provenance: [ .. ],
}

Resolved in full or fast; both produce the same type, and a value nothing resolved is absent, never zero.

3

Derived interfaces

Same registry, every surface

SurfaceWhere
CLImajordomus
HTTP/api/v1/
OpenAPI/openapi.json
Swagger/swagger
MCPmajordomus mcp
Cockpit/cockpit
DocsGitHub Pages

197 operations in 58 modules, described by one OpenAPI document.

4

Feedback loop

Detect, regenerate, check

  1. The tree moves
  2. Index rebuilt
  3. majordomus generate
  4. derive-check
the model

Searches the titles and descriptions of every page this site publishes.