Skip to main content

Module stack

Module stack 

Source
Expand description

Phase 38 — stack integrations as data (ADR-0144).

The homelab stack is where secrets and config already meet: Prometheus scrape jobs with basic_auth, Grafana datasources with secureJsonData, Homepage widgets with one API key per service. Eleven hand-written exporters were already “eleven treadmills” (review-01 section 1); five more would be sixteen. So an integration is not code here, it is a descriptor in data/stack-adapters.json: the chunk types it adds (with their fields, defaults and which are secret), the shape of the file it produces, and the rules a generated file has to satisfy. This module interprets descriptors; src/ts/stack.ts interprets the same file for the app, and a golden fixture asserted from both sides keeps the two interpreters honest.

If an integration cannot be expressed in the descriptor grammar, that is information about the grammar, not a reason to hand-write another exporter.

§Rendering

The caller supplies how a stored field value becomes text (resolve): it decides whether ${Provider/field} becomes the real value (a deploy), a fingerprint (a terminal), or stays literal. The interpreter only knows which fields the descriptor marks secret, and passes that flag along so a redacting caller can mask a literal secret as well as a reference.

Structs§

Adapter
ChunkSpec
FieldSpec
Rule
Starter

Functions§

adapter
adapters
check
Checks a project of this adapter’s type against the descriptor’s rules, plus the one rule every adapter shares: a ${…} that names no vault entry.
chunk_types
Every chunk type any adapter adds, in descriptor order.
new_chunk
A new, empty chunk of this type, with its defaults filled in.
render
Renders a project of this adapter’s type to the file it produces.
starter_chunks
The chunks a new project of this type starts with.

Type Aliases§

Resolve
How a stored field value becomes text: (raw, is_secret) -> text.