GuardrailConfig holds the thresholds a cost estimate is judged against. All fields are optional pointers: a nil pointer means "this check is disabled". When every field is nil the guardrail is purely informational and always passes.
| 10 | // When every field is nil the guardrail is purely informational and always |
| 11 | // passes. |
| 12 | type GuardrailConfig struct { |
| 13 | // Budget is the absolute monthly ceiling in USD. The estimate breaches when |
| 14 | // its monthly total exceeds this value. |
| 15 | Budget *float64 |
| 16 | // Baseline is the monthly total (USD) of the comparison point — typically the |
| 17 | // base branch's estimate. Setting it enables the relative-increase checks. |
| 18 | Baseline *float64 |
| 19 | // MaxIncrease is the largest allowed absolute increase in USD over Baseline. |
| 20 | MaxIncrease *float64 |
| 21 | // MaxIncreasePct is the largest allowed percentage increase over Baseline. |
| 22 | MaxIncreasePct *float64 |
| 23 | } |
| 24 | |
| 25 | // Enabled reports whether any threshold is configured. When false the guardrail |
| 26 | // only reports numbers and never fails. |
nothing calls this directly
no outgoing calls
no test coverage detected