docs(provisioner): retire stale "-1 = unlimited (team/growth)" comment examples (P4-1)#49
Merged
mastermanas805 merged 2 commits intoJun 6, 2026
Conversation
…t examples
Bug-hunt iter4 P4-1. The strict-80 margin redesign (merged to common+api
master 2026-06-05) made every tier's postgres_connections and redis_memory_mb
finite (team=100 conns/1536 MB, growth=20 conns/1024 MB, pro=20 conns/512 MB).
No tier passes the -1 "no limit" wire sentinel anymore. The comments still gave
the misleading example "-1 = unlimited (team/growth)" / "team: unlimited (-1)".
Comments-only for production code: the -1/<=0 sentinel branches stay (still the
wire contract; the pool prewarm path still passes -1 deliberately), and the two
dedicated-pod sizing literals (redis k8s maxmemoryMB, postgres k8s connLimit)
are byte-identical — only their surrounding comments are corrected to note the
runtime cap is reconciled to the finite registry value via Regrade.
Also fixes one pre-existing FAILING test left behind by the strict-80 common
bump: TestRegradeResource_Redis_ProTier_AppliesCap/team asserted maxmemory=0
(old team=-1) while the registry now returns 1536. Reworked to derive expected
values from the live plans registry (rule 18) so a future registry change can
never silently drift it again. No production behavior change — the server
already applied the registry value; only the test expectation was stale.
Coverage:
Symptom: comment example "-1 = unlimited (team/growth)" + test want 0
Enumeration: rg -n 'unlimited|connLimit.*-1|-1.*unlimited' internal/
Sites found: stale tier-attributed examples across 6 source files + 2 tests
Sites touched: all stale tier attributions corrected; pure-sentinel mech docs
kept (accurate) with a post-strict-80 note on entry-point docs
Coverage test: TestRegradeResource_Redis_ProTier_AppliesCap now registry-driven
Live verified: doc-only/test-only — make gate green (build+vet+test ./...)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-patch gate)
The comment-only edit in this PR re-touched the diff hunk around regradeRedis's
`if memLimitMB < 0 { targetMaxmemoryMB = 0 }` block, pulling that executable
branch into the diff. diff-cover's 100%-patch gate (coverage.yml "Patch coverage
gate") correctly flagged it uncovered — no production tier resolves a negative
redis_memory_mb post the strict-80 margin redesign, so the branch had no test.
Add a registry-seam test (SwapRegradeConnLimits + a fixture plans.yaml with
redis_memory_mb: -1) that drives the sentinel and asserts maxmemory=0 is targeted
(rule 18: registry-derived, not a hand-faked constant). The seam lives in a new
export_test.go so the external server_test package can swap the unexported
package-level registry.
diff-cover now reports internal/server/server.go (100%), Missing: 0 lines.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why (Bug-hunt iter4 finding P4-1)
The strict-80 margin redesign (merged to common+api master 2026-06-05) retired the
-1"no limit" sentinel from every tier's resource limits.postgres_connectionsandredis_memory_mbare now finite for every tier (team=100 conns / 1536 MB, growth=20 conns / 1024 MB, pro=20 conns / 512 MB). The provisioner's code is correct (it applies whatever the plans registry passes), but several comments still gave the now-misleading example-1 = unlimited (team/growth)/team: unlimited (-1).This corrects every stale tier-attributed example to be accurate:
-1/<= 0sentinel branches stay — they remain the wire contract, and the pool-prewarm path (internal/pool/manager.go) still passes-1deliberately, so the branch is live.Backend.Provision,Regrader.Regrade,LocalBackend.Provision/Regrade).redis/k8s.gomaxmemoryMB: -1,postgres/k8s.goconnLimit: -1) are byte-identical — only their surrounding comments changed, now noting the runtime cap is reconciled to the finite registry value viaRegrade.No production behavior change.
Also: fixes a pre-existing FAILING test
make gatewas already red on origin/master:TestRegradeResource_Redis_ProTier_AppliesCap/teamassertedmaxmemory=0(old teamredis_memory_mb=-1) while the registry now returns1536— a test expectation strict-80's common bump left behind. Reworked to derive expected values from the live plans registry (rule 18) so the same drift can never recur silently. The production code already applied the registry value; only the stale test expectation changed.Coverage block
Latent issue surfaced (NOT fixed here — out of scope)
sizingForTierin both dedicated-pod backends still hardcodes-1(redis/k8s.gomaxmemoryMB,postgres/k8s.goconnLimit) for team. At provision time the k8s postgres backend usessz.connLimit(Provisionignores its registry-passedconnLimitparam — see the existing doc atK8sBackend.Provision), so a team dedicated postgres role is briefly created uncapped until the reconciler's firstRegradeapplies the finite registry value (100). The redis pod similarly starts with no--maxmemoryflag and gets capped to 1536 on the nextRegrade. This is functionally reconciled but not provision-time-correct; flagged in the comments and worth a follow-up to pass the registry value at provision time. Left out of this comment-only PR.🤖 Generated with Claude Code