Commit 53e312b
test(admin): registry-drift guard for adminAllowedTiers vs plans.yaml (rule 18) (#233)
adminAllowedTiers (the closed set of tiers an admin may set on a team) is
hand-maintained. The capabilities-contract regression — a hardcoded slice
that silently dropped hobby_plus for 3h — is exactly the bug class this
guards. Per rule 18 the test iterates the LIVE plans registry
(plans.Default().All()), not a hand-typed list: every tier in plans.yaml
must be consciously filed as either admin-settable OR in a documented
exclude set (anonymous, growth, and the upsell/yearly variants). Adding a
new tier to plans.yaml now reds CI until someone makes that decision.
Also guards both directions: a stale entry left in adminAllowedTiers (or in
the test's exclude set) that no longer exists in plans.yaml fails too.
Pure test addition; passes against the embedded plans registry (no DB).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 893bed9 commit 53e312b
1 file changed
Lines changed: 67 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
0 commit comments