region-host: group-capacity alarm pages after 5 min short, not 1
Planned member launches leave the group one short for 1-2 minutes, and the 1-of-1 alarm fired on each: 76 ALARM/OK pairs on the dev IE and flagship US groups from 2026-11-04 to 11-11, none over 2 minutes. Now 5 of 5 x 60 s; same metric math, threshold, missing-data handling (breaching) and actions. A real shortfall pages after 5 minutes instead of 1; launch failures still page at once via EventBridge. Test: group_alarms.tftest.hcl asserts the 5/5 window. Census proposal included.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 files changed,
+43
−5
docs/superpowers/notes/census-proposal-group-capacity-damping.md+21 −0infra/modules/region-host/group_alarms.tf+11 −3infra/modules/region-host/tests/group_alarms.tftest.hcl+2 −2internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-group-capacity-damping.tsv+8 −0
CI passed — run details
diff --git a/docs/superpowers/notes/census-proposal-group-capacity-damping.md b/docs/superpowers/notes/census-proposal-group-capacity-damping.md| new file mode 100644 |
| index 000000000..3911149af |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-group-capacity-damping.md |
| @@ -0,0 +1,21 @@ |
| +# Census approval: group-capacity-damping |
| + |
| +Ruling `census-ruling-group-capacity-damping`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `infra/modules/region-host/group_alarms.tf` `external` | body | unchanged (1) | group_capacity alarm: evaluation_periods and datapoints_to_alarm 1 -> 5 (alarms after 5 of 5 one-minute periods short), description and comment updated; same metric math, threshold, missing-data handling and actions. tofu only, run on an operator machine; no read is added and nothing on a box reads the file. | |
| +| `infra/modules/region-host/tests/group_alarms.tftest.hcl` `external` | body | unchanged (1) | Assert the group capacity alarm window is 5 of 5 (was 1 of 1) and update its message. Mock-provider test only, no root runtime read. | |
| + |
| +Envelopes re-pinned: `infra/modules/region-host`, `infra/modules/region-host/tests`. |
| + |
| +Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `infra/modules/region-host/group_alarms.tf` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add default-off termination queue age alarm, using existing queue name and regional SNS topic; no IAM, queue, consumer or instance changes. Copy sweep 1: apply approved variable and alarm descriptions verbatim; no resource, threshold, action or read changes.;rev3=census-ruling-region-ha-p3b;basis=Add group capacity, memory, clock, missing-clock and launch-failure notifications; preserve account-owner SNS rights and scope CloudWatch/EventBridge publishers by source account/ARN. Operator-applied Terraform, no box file read; notifications grant no replacement authority.;rev3=census-ruling-region-ha-g2-t3;basis=T3b: add one group-mode SuspectHolderHosts Maximum alarm, 60 seconds, 1 of 1, threshold greater than zero, missing data notBreaching, existing regional SNS actions and ASG dimension. No replacement, scale, IAM, storage or root runtime authority.;rev3=census-ruling-region-ha-g3-fixes;basis=Send existing queue, group and launch-failure notifications to the selected regional SNS topic. Keep externally owned topic policy and subscriptions outside this module; no replacement or scale authority and no new root runtime read. |
| +- `infra/modules/region-host/tests/group_alarms.tftest.hcl` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add plan-only mock queue alarm defaults, thresholds, missing-data and regional notification assertions.;rev3=census-ruling-region-ha-p3b;basis=Mock group metric producers, alarm dimensions/windows/missing data and complete scoped SNS policy; retain fixed alarm expectations. Test-only Terraform input, no root runtime read.;rev3=census-ruling-region-ha-p3b1-fixes;basis=Supply the real-shape group queue URL in the group alarm mock so the launch URL equality guard is exercised. Mock plans only; no runtime reads.;rev3=census-ruling-region-ha-g2-t3;basis=T3b: pin fixed-mode zero count, group shape, regional SNS actions and non-breaching missing data for the new alarm; mock-provider test only, no root runtime read. |
| + |
| +Seal: `43260792034a1a20791d14c4e4476e762b40d7bcca64257ef2e9899da6af5df0` → `20c1d07970cec7fc99fa89a3171209e632119a58e79f2785a73a2eac70adb0f7`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-group-capacity-damping.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/infra/modules/region-host/group_alarms.tf b/infra/modules/region-host/group_alarms.tf| index f177b6863..dfc5128fb 100644 |
| --- a/infra/modules/region-host/group_alarms.tf |
| +++ b/infra/modules/region-host/group_alarms.tf |
| @@ -31,14 +31,22 @@ locals { |
| group_alarm_actions = local.alerts_actions |
| } |
| +# Five of five minutes, not one. A planned member launch (roll, Standby |
| +# return, replacement) leaves the group one short for one to two minutes: |
| +# 76 such ALARM/OK pairs on the dev IE and flagship US groups between |
| +# 2026-11-04 and 11-11, none longer than two minutes, which taught people |
| +# to ignore this alarm. A real shortfall now pages after five minutes |
| +# instead of one; a member that never comes back still pages, and so do |
| +# five minutes of missing data. Launch failures page on their own through |
| +# the EventBridge rule below. |
| resource "aws_cloudwatch_metric_alarm" "group_capacity" { |
| count = var.mode == "group" ? 1 : 0 |
| alarm_name = "${var.name}-group-capacity" |
| - alarm_description = "Fewer group members are in service than the current desired capacity. Check launch failures and member health." |
| + alarm_description = "Fewer group members have been in service than the current desired capacity for 5 minutes. Check launch failures and member health." |
| comparison_operator = "LessThanThreshold" |
| threshold = 0 |
| - evaluation_periods = 1 |
| - datapoints_to_alarm = 1 |
| + evaluation_periods = 5 |
| + datapoints_to_alarm = 5 |
| treat_missing_data = "breaching" |
| alarm_actions = local.group_alarm_actions |
| ok_actions = local.group_alarm_actions |
diff --git a/infra/modules/region-host/tests/group_alarms.tftest.hcl b/infra/modules/region-host/tests/group_alarms.tftest.hcl| index f2f3eb2a6..26ed6608f 100644 |
| --- a/infra/modules/region-host/tests/group_alarms.tftest.hcl |
| +++ b/infra/modules/region-host/tests/group_alarms.tftest.hcl |
| @@ -224,8 +224,8 @@ run "group_alarm_producers" { |
| error_message = "suspect-holder missing data or actions changed" |
| } |
| assert { |
| - condition = aws_cloudwatch_metric_alarm.group_capacity[0].threshold == 0 && aws_cloudwatch_metric_alarm.group_capacity[0].comparison_operator == "LessThanThreshold" && aws_cloudwatch_metric_alarm.group_capacity[0].evaluation_periods == 1 && aws_cloudwatch_metric_alarm.group_capacity[0].datapoints_to_alarm == 1 && one([for q in aws_cloudwatch_metric_alarm.group_capacity[0].metric_query : q.expression if q.id == "deficit"]) == "IF(FILL(desired, -1) < 0, -1, FILL(inservice, -1) - desired)" && alltrue([for q in aws_cloudwatch_metric_alarm.group_capacity[0].metric_query : length(q.metric) == 0 ? true : q.metric[0].period == 60 && q.metric[0].namespace == "AWS/AutoScaling" && q.metric[0].dimensions == tomap({ AutoScalingGroupName = aws_autoscaling_group.group[0].name })]) |
| - error_message = "capacity uses actual desired membership including approved Standby" |
| + condition = aws_cloudwatch_metric_alarm.group_capacity[0].threshold == 0 && aws_cloudwatch_metric_alarm.group_capacity[0].comparison_operator == "LessThanThreshold" && aws_cloudwatch_metric_alarm.group_capacity[0].evaluation_periods == 5 && aws_cloudwatch_metric_alarm.group_capacity[0].datapoints_to_alarm == 5 && one([for q in aws_cloudwatch_metric_alarm.group_capacity[0].metric_query : q.expression if q.id == "deficit"]) == "IF(FILL(desired, -1) < 0, -1, FILL(inservice, -1) - desired)" && alltrue([for q in aws_cloudwatch_metric_alarm.group_capacity[0].metric_query : length(q.metric) == 0 ? true : q.metric[0].period == 60 && q.metric[0].namespace == "AWS/AutoScaling" && q.metric[0].dimensions == tomap({ AutoScalingGroupName = aws_autoscaling_group.group[0].name })]) |
| + error_message = "capacity uses actual desired membership including approved Standby, and alarms only after 5 of 5 minutes short" |
| } |
| assert { |
| condition = aws_cloudwatch_metric_alarm.group_memory[0].metric_name == "MemAvailablePercent" && aws_cloudwatch_metric_alarm.group_memory[0].statistic == "Minimum" && aws_cloudwatch_metric_alarm.group_memory[0].period == 60 && aws_cloudwatch_metric_alarm.group_memory[0].threshold == 15 && aws_cloudwatch_metric_alarm.group_memory[0].evaluation_periods == 3 && aws_cloudwatch_metric_alarm.group_memory[0].datapoints_to_alarm == 3 && aws_cloudwatch_metric_alarm.group_memory[0].comparison_operator == "LessThanThreshold" |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index f9452e594..305139fbf 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -165,3 +165,4 @@ plan14-root-reads-demo-terms-links.tsv c8e2c7ed3850823a8e379d880738982772b870ad8 |
| plan14-root-reads-fix-silent-start-kill-861.tsv 733204d61bea49fe418d8ff0f1bfa20d77bdffb1f08a216d9de92923eea22557 |
| plan14-root-reads-group-bucket-region.tsv 733204d61bea49fe418d8ff0f1bfa20d77bdffb1f08a216d9de92923eea22557 |
| plan14-root-reads-w6-ingress-drain.tsv 43260792034a1a20791d14c4e4476e762b40d7bcca64257ef2e9899da6af5df0 |
| +plan14-root-reads-group-capacity-damping.tsv 20c1d07970cec7fc99fa89a3171209e632119a58e79f2785a73a2eac70adb0f7 |
diff --git a/internal/provision/testdata/plan14-root-reads-group-capacity-damping.tsv b/internal/provision/testdata/plan14-root-reads-group-capacity-damping.tsv| new file mode 100644 |
| index 000000000..8e94d4e51 |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-group-capacity-damping.tsv |
| @@ -0,0 +1,8 @@ |
| +# Census overlay group-capacity-damping, written by census-propose (#369). census-ruling-group-capacity-damping, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-group-capacity-damping.md. |
| +# 2 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +@legacy 07497d3f9f6d867ef276933446048ca8245ed269585142d395bf2546aa9b8f5d infra/modules/region-host/group_alarms.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add default-off termination queue age alarm, using existing queue name and regional SNS topic; no IAM, queue, consumer or instance changes. Copy sweep 1: apply approved variable and alarm descriptions verbatim; no resource, threshold, action or read changes.;rev3=census-ruling-region-ha-p3b;basis=Add group capacity, memory, clock, missing-clock and launch-failure notifications; preserve account-owner SNS rights and scope CloudWatch/EventBridge publishers by source account/ARN. Operator-applied Terraform, no box file read; notifications grant no replacement authority.;rev3=census-ruling-region-ha-g2-t3;basis=T3b: add one group-mode SuspectHolderHosts Maximum alarm, 60 seconds, 1 of 1, threshold greater than zero, missing data notBreaching, existing regional SNS actions and ASG dimension. No replacement, scale, IAM, storage or root runtime authority.;rev3=census-ruling-region-ha-g3-fixes;basis=Send existing queue, group and launch-failure notifications to the selected regional SNS topic. Keep externally owned topic policy and subscriptions outside this module; no replacement or scale authority and no new root runtime read.;rev3=census-ruling-group-capacity-damping;basis=group_capacity alarm: evaluation_periods and datapoints_to_alarm 1 -> 5 (alarms after 5 of 5 one-minute periods short), description and comment updated; same metric math, threshold, missing-data handling and actions. tofu only, run on an operator machine; no read is added and nothing on a box reads the file. file:external@0 4b760dbd47b6877ae42c4c9375118f6f0ea1ddb12f3bf9b04a216187823ac43e |
| +@legacy 674f4270a71ac724298658e6ae347810c6b3102b47255ce15a552f5bdfcd5baf infra/modules/region-host/tests/group_alarms.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add plan-only mock queue alarm defaults, thresholds, missing-data and regional notification assertions.;rev3=census-ruling-region-ha-p3b;basis=Mock group metric producers, alarm dimensions/windows/missing data and complete scoped SNS policy; retain fixed alarm expectations. Test-only Terraform input, no root runtime read.;rev3=census-ruling-region-ha-p3b1-fixes;basis=Supply the real-shape group queue URL in the group alarm mock so the launch URL equality guard is exercised. Mock plans only; no runtime reads.;rev3=census-ruling-region-ha-g2-t3;basis=T3b: pin fixed-mode zero count, group shape, regional SNS actions and non-breaching missing data for the new alarm; mock-provider test only, no root runtime read.;rev3=census-ruling-group-capacity-damping;basis=Assert the group capacity alarm window is 5 of 5 (was 1 of 1) and update its message. Mock-provider test only, no root runtime read. file:external@0 1180c329fff3d82e5f03e7792cb4c2435b6f3e03762b9b62762f615daeff5787 |
| +infra/modules/region-host/group_alarms.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add default-off termination queue age alarm, using existing queue name and regional SNS topic; no IAM, queue, consumer or instance changes. Copy sweep 1: apply approved variable and alarm descriptions verbatim; no resource, threshold, action or read changes.;rev3=census-ruling-region-ha-p3b;basis=Add group capacity, memory, clock, missing-clock and launch-failure notifications; preserve account-owner SNS rights and scope CloudWatch/EventBridge publishers by source account/ARN. Operator-applied Terraform, no box file read; notifications grant no replacement authority.;rev3=census-ruling-region-ha-g2-t3;basis=T3b: add one group-mode SuspectHolderHosts Maximum alarm, 60 seconds, 1 of 1, threshold greater than zero, missing data notBreaching, existing regional SNS actions and ASG dimension. No replacement, scale, IAM, storage or root runtime authority.;rev3=census-ruling-region-ha-g3-fixes;basis=Send existing queue, group and launch-failure notifications to the selected regional SNS topic. Keep externally owned topic policy and subscriptions outside this module; no replacement or scale authority and no new root runtime read.;rev3=census-ruling-group-capacity-damping;basis=group_capacity alarm: evaluation_periods and datapoints_to_alarm 1 -> 5 (alarms after 5 of 5 one-minute periods short), description and comment updated; same metric math, threshold, missing-data handling and actions. tofu only, run on an operator machine; no read is added and nothing on a box reads the file. file:external@0 4b760dbd47b6877ae42c4c9375118f6f0ea1ddb12f3bf9b04a216187823ac43e |
| +infra/modules/region-host/tests/group_alarms.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add plan-only mock queue alarm defaults, thresholds, missing-data and regional notification assertions.;rev3=census-ruling-region-ha-p3b;basis=Mock group metric producers, alarm dimensions/windows/missing data and complete scoped SNS policy; retain fixed alarm expectations. Test-only Terraform input, no root runtime read.;rev3=census-ruling-region-ha-p3b1-fixes;basis=Supply the real-shape group queue URL in the group alarm mock so the launch URL equality guard is exercised. Mock plans only; no runtime reads.;rev3=census-ruling-region-ha-g2-t3;basis=T3b: pin fixed-mode zero count, group shape, regional SNS actions and non-breaching missing data for the new alarm; mock-provider test only, no root runtime read.;rev3=census-ruling-group-capacity-damping;basis=Assert the group capacity alarm window is 5 of 5 (was 1 of 1) and update its message. Mock-provider test only, no root runtime read. file:external@0 1180c329fff3d82e5f03e7792cb4c2435b6f3e03762b9b62762f615daeff5787 |
| +@coverage infra/modules/region-host a7447fbc687f106943efec620ab3449a064f94e3898df6c4171f8dea41aefdf5 |
| +@coverage infra/modules/region-host/tests da426764959112acb9eba280a61938710e551c1aef02ef0cb7e4f04c217598ec |