BUILDING Parts of this page describe what is not built yet, and each says so.
SpendCap
A SpendCap as RunningLake's configuration repository declares it, at spend/cap.yaml. Generated from the Go types the control plane decodes this file into, so it checks the shape the gate reads — field names and types, and which fields may exist. The gate also applies rules no schema can express — required fields inside spec among them — so a file this schema accepts can still be refused by `rl diff`. Take #/properties/spec for the spec alone.
Recorded only. A spend cap limits no query yet, and no run is held by one: nothing reads it to
refuse anything. What is built is a check on who may weaken it. A push that raises the amount, relaxes
hold to alert, changes the currency or the period, or removes the file is not applied. The
control plane keeps the value it had and lists the change as held until an owner or an admin confirms it with a
fresh sign-in. A lowering and an environment’s first cap apply at the next sync, unless one would sit below the
metered work already counted this month plus what is in flight: that is held the same way.
What that check does not do: it cannot tell who pushed a change; it holds this kind and no other, so a pushed change to any other governance file still takes effect; it does not stop a push or a token from lowering the cap to any amount, and a cap lowered below the month’s metered work is not held yet; an environment created after a raise was pushed takes the repository’s cap as its first cap; during a release roll, a cap pushed while an older replica is running is looked at on the next commit; and it is a check in the control plane’s code, so a change made to the database by hand is not held. Branch protection on the repository is the only preventive control for everything else.
File: spend/cap.yaml
Fields
| Field | Type | Required | Meaning |
|---|---|---|---|
apiVersion |
string | Yes |
The config schema's version, which is independent of the HTTP API's (rule unsupported-api-version). Values: |
kind |
string | Yes |
The kind this file declares. A kind that disagrees with the file's path is refused (rule kind-mismatch). Values: |
metadata |
object | Yes |
No description
|
metadata. |
string | Yes |
The resource's name, which is also its path segment. It must be the name this file's path gives it (rule name-mismatch). |
metadata. |
map of string | No |
No description
|
metadata. |
map of string | No |
No description
|
spec |
object | No |
SpendCapSpec is a limit on the metered work an environment may do in one month, in the currency its cloud bills in. It is recorded; nothing enforces it yet, so it limits no query and no run today. A cap bounds metered work, not your cloud bill. Raising it, relaxing it or removing it is held until an owner or admin confirms it; lowering it takes effect at the next sync. |
spec. |
string | No |
Amount is the cap, as a quoted decimal in whole units of currency: "250. |
spec. |
string | No |
Currency is the currency the amount is in: three capital letters, such as USD. Required, with no default, because a default would state an amount wrong by the exchange rate. Changing it is held until an owner or admin confirms it. Not patchable per environment. |
spec. |
string | No |
OnExceed is what happens at the cap: alert or hold. Required. Recorded; nothing enforces it yet. hold will mean a query is refused and a run is held; alert will mean someone is told and work goes on. Changing hold to alert is held until an owner or admin confirms it. An environment's overlay may set its own. |
spec. |
string | No |
Period is the window the cap counts over. Optional; month, the UTC calendar month, is the only value and the default. Not patchable per environment. |
A nested field is written with its parents, spec.a.b; an item of a list is
[] and a value of a map is *. Required means the
parent object must carry the field; the rules a schema cannot express, such as a field that
is required only inside spec, are checked by rl diff.
The schema
This page is read from the kind’s published schema, at
https://runninglake.com/schema/v1alpha1/spendcap.json. An editor that follows it checks a file of this kind as you
type. To see the fields of a kind’s spec from the command line, run rl schema
with the kind’s name: it works offline and prints what the gate accepts. The
command reference has the rest.