Task · TSO-0122

Keep alert policy counts and recommended-profile prose truthful

Description

CodeRabbit review during Wave 10 found two related documentation claims that drift when the generated alert catalogue changes. The policy table still reported 67 optional rules although the generator declared 72, making its rows sum to 100 while 105 alert manifests existed. The recommended-profile prose also said the shipped starter set was unchanged and byte-identical to what had always shipped, which becomes false whenever a new enabled rule is added even though the intended contract is only that the profile preserves each rule’s authored paused state.

Acceptance Criteria

Definition of Done

Implementation Plan

  1. Add failing generator tests that compare the documented policy table with POLICY_BY_UID and reject historical-immutability wording for the recommended profile.
  2. Update the generator-owned profile rationale and decision text to state that recommended preserves authored paused values and equals the default output for the current catalogue.
  3. Correct the optional-policy count in the alert README and regenerate docs/alert-profiles.md.
  4. Run focused generator tests and alert generation checks; fold this small covered repair into the Wave 10 alert commit and finalize it separately.

Implementation Notes

Negative tests first proved both defects: the policy-count test reported optional 72 versus documented 67, and the profile-contract test found no authored wording plus the stale always shipped claim. Fixed the generator-owned rationale/decision/help text, corrected the optional policy count to 72, regenerated docs/alert-profiles.md, and added durable tests. Targeted red-to-green passed; the full generator suite now reports 132 tests passed, and just rules-check validates 127 rules plus all fixtures.

just rules-check covers 127 Prometheus-compatible rules. The 128th catalogue resource is the Loki-backed AuditConfigChangeWARN, which is intentionally absent because promtool cannot parse LogQL; the real Grafana push and just verify-deploy m7kni cover all 128.

Integrated with the alert work as 74a8c924. The cumulative full gate passed at 0e212ab5; integrated generation left no diff and formatting passed. Exact-head CI run 33844779329 attempt 1 succeeded for 630b1d75 before the later fallback fix. The final count audit distinguishes 127 Prometheus-compatible rules from the Loki-backed AuditConfigChangeWARN, while live Grafana verification covers all 128 deployed rules.

Final Summary

Corrected optional policy count 67 to 72, added a regression proving policy rows sum to the 105-alert catalogue, and replaced false catalogue-immutability prose with the real contract that recommended preserves authored paused state. Generator and drift checks pass.

View the source file on GitHub