Skip to main content

The DFE control-plane layer

The control-plane layer is the small set of repos that own the DFE control plane: configuration, RBAC, schema, the operator UI and the deploy target. A doc that says "the control-plane layer" means these repos. The data-plane repos (receiver, loader, transforms, fetcher, archiver, hunt runner) are services the control plane configures, outside the layer.

The API is the dfe-engine API, never "the dfe-api". The daemon is dfe-engine (dfe-engine run), the human CLI is dfe, and the engine's API settings read as DFE_ENGINE_API_*.

dfe-ui calls the engine, which reads dfe-schemas and commits to the deploy repo that Argo CD syncs with dfe-infra's ApplicationSets.

Figure 1. L4 Detail -- Control-plane repos. Up: L2 Services -- dfe-engine.

RepoRole in the layer
dfe-engineThe config control plane and the sole authorisation decision point. Hosts the FastAPI API and the generated dfe CLI. Everything else in the layer keys off its API.
dfe-schemasThe schema source of truth: the common event header, the hunt-results DDL, the profiles. The engine reads the version-pinned dfe-schemas wheel and creates the ClickHouse objects from it.
dfe-uiThe operator console, a window over the engine API that decides nothing. It holds the engine-minted JWT and reads its expiry, and the engine verifies it.
dfe-infraThe charts, ApplicationSets and bootstrap that deploy the suite through Argo CD. Never a config authority.
dfe-deployThe per-deployment read-write gitops repo the running engine commits to. dfe-deploy ships its starting content, and each deployment owns its copy.

Each source of truth has one writer​

Each holds one kind of authoritative state, every other component reads it or an artefact generated from it, and each has exactly one write path, so a change is auditable and consumers cannot diverge.

Source of truthLives inConsumed byWritten by
API surface, openapi.jsondfe-engine openapi/dfe-ui types, the Prism contract mock, the route mapscripts/generate_openapi.py from the FastAPI routes, never by hand
Schema: event header, hunt-results DDL, profilesdfe-schemas, the dfe-schemas wheel pinned in uv.lockthe engine, which creates the ClickHouse objects at startup, and dfe schemadfe-schemas commits
Deployment definition: Helm charts and valueseach app's thin chart, built from its deployment contract, plus dfe-infra values and the deploy-repo overlaysArgo CDeach app's release for its chart, dfe-infra for its values, the engine for the overlays (one values/<service>-<instance>-values.yaml per app instance, each write a gitops commit). Where no chart runs (Compose), src/dfe_engine/appmgmt/appconfig.py merges an overlay's config: over the base config into the app's config file
Deployed state, the gitops YAMLdfe-deploy, one per deploymentArgo CD, and the engine for current statethe engine API, every mutation a git commit, and dfe local break-glass when the daemon is down
AuthZ: RBAC roles and scopesroles in rbac/roles.yaml under DFE_CONFIG_DIR, seeded from src/dfe_engine/auth/resources/roles.yaml. Scopes in src/dfe_engine/auth/rbac_scopes/scope_constants.pythe API (require_action), the CLIthe engine's role API for roles, a code change for scopes

The engine reads dfe-schemas and the RBAC roles, and Argo CD syncs the deploy repo with the charts and dfe-infra values.

Figure 2. L4 Detail -- Control-plane sources of truth. Up: L2 Services -- dfe-engine.

To change one, go through its writer: edit the routes and regenerate the spec, commit to dfe-schemas, turn the engine's dials, or edit roles through the API. Never hand-edit a generated artefact such as openapi.json or a compiled overlay.

openapi/openapi.json, the API source of truth, is generated from the FastAPI app (uv run python scripts/generate_openapi.py) and committed. The routes feed it, and every consumer keys off the routes or the file, never off a hand-kept copy.

The dfe CLI and Swagger UI read the live routes, and dfe-ui and the Prism mock read the committed openapi.json.

Figure 3. L4 Detail -- openapi.json and its consumers. Up: L2 Services -- dfe-engine.

  • The dfe CLI builds its whole command tree at runtime from the installed engine's app factory, so an endpoint becomes a command with no CLI code. An endpoint opts out with x-scalo.cli.hidden.
  • dfe-ui copies both specs into its @repo/dfe-engine-types package through a PR the sync workflow opens, and generates its types from them.
  • docker-compose.dev.yaml mounts ./openapi into Prism. Swagger UI is served at /docs when DFE_ENGINE_API_DOCS_ENABLED allows it.

When the API changes, change the routes, regenerate openapi.json, and every consumer follows.

The pages in this area:

DocCovers
governed-ops-design.mdGitCrud, the governance layer and curated actions
gitops-commit-standard.mdmachine-commit conventions for gitops repos
oidc-rbac-architecture.mdOIDC and RBAC: the auth model, the two RBAC planes, the provider registry and adapters, the management API, infra requirements
rbac.mdauth paths, the RBAC model, multi-tenant ClickHouse, stores
rbac-sign-in.mdidentity resolution, the sign-in allowlist, first login and password changes
rbac-groups.mdIdP group sync, linking a group to an IdP group, the checks on a link
rbac-engine-reads.mdthe engine's ClickHouse reads and how they bind to a caller's orgs
idp-setup/: google.md, entra.md, okta.mdone-time setup for a customer's IdP admin: sign-in client, groups, the values to send the operator
rbac-vocabulary.mdrole and group names and terms across engine, ui, infra, deploy, schemas and test envs
synthetic-data.mdsynthetic data: reference packs, lookalike scrub, standing demo streams
ui-api-guide.mdfrontend integration guide and endpoint reference
type-safety-sync.mdOpenAPI and RBAC-scope type sync to dfe-ui
dfe-cli-design.mdhow the dfe client CLI is built and resolves profiles

The system map is ../architecture.md.