refactor: remove max-chunks setting, derive limit from protection range - #48
Merged
Conversation
The max-chunks config setting was redundant — the protection range already prevents claims outside it via maxRingRadius. The effective chunk cap is now derived solely from the island's protection range: maxChunks = (2 * floor((range - 8) / 16) + 1)^2 With the default range of 168 that gives 441 chunks (21x21), exactly what max-chunks was set to. Admins who want more or fewer chunks adjust the protection range instead of juggling two settings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QWvvUY9ZZJHxUYm1UyjdwK
|
Merged
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.



Summary
max-chunksconfig setting was redundant — the protection range already prevents claims outside it viamaxRingRadius, so the two settings were doing overlapping work and causing confusion (e.g., an admin setting range to 240 but max-chunks to 441 would silently cap at 441 even though 841 chunks fit).maxChunks = (2 * floor((range - 8) / 16) + 1)². With range 168 that gives 441 (21x21), exactly what the old default was.Changes
maxChunksfield, config annotations, getter and settergetMaxChunks(island)now returns the range-derived cap directly;checkGeometryno longer checks the removed config settingmax-reachedcelebration message (no artificial cap to hit)max-chunksentry, updated protection-range commentstestClaimBeyondMaxChunksDenied, updatedtestMaxChunksDerivedFromProtectionRangemax-reachedkeys left in place across 17 locale files (harmless dead text, not worth the churn)Test plan
ChunkBlockTest.testOnLoadpasses (Settings field validation)🤖 Generated with Claude Code
https://claude.ai/code/session_01QWvvUY9ZZJHxUYm1UyjdwK