Skip to content

Fix ConfigLoader convenience getters to support sectioned lookups#268

Merged
niyazmft merged 2 commits into
mainfrom
fix/config-loader-section-support-6826570002351841991
Jun 9, 2026
Merged

Fix ConfigLoader convenience getters to support sectioned lookups#268
niyazmft merged 2 commits into
mainfrom
fix/config-loader-section-support-6826570002351841991

Conversation

@niyazmft

@niyazmft niyazmft commented Jun 9, 2026

Copy link
Copy Markdown
Owner

The ConfigLoader convenience getters (getInt, getFloat, getString) were previously limited to a flat lookup, ignoring the sectioned structure of the JSON configuration. This caused many config reads to silently fall back to hard-coded defaults even when values were present in the JSON sections.

This change:

  1. Enhances ConfigLoader getters to support both (key, fallback) and (section, key, fallback) signatures.
  2. Updates AutoloadHelper to support these signatures.
  3. Fixes call sites across the codebase to use the appropriate sections (ap_economy, combat, entity, run_manager, elemental), ensuring tunable values in game_config.json are correctly respected.
  4. Maintains backward compatibility and early-initialization safety via type-checking and heuristic-based disambiguation.

Fixes #245


PR created automatically by Jules for task 6826570002351841991 started by @niyazmft

- Updated ConfigLoader.getInt(), getFloat(), and getString() to support overloaded
  (section, key, fallback) and (key, fallback) signatures.
- Implemented robust argument disambiguation and heuristic-based section detection
  for getString to maintain safety during early initialization.
- Updated AutoloadHelper static methods to expose the new multi-signature API.
- Updated multiple call sites (combat_formula, entity_lifecycle, elemental_resolver,
  burden_manager, run_manager) to use explicit sectioned lookups.
- Verified fix with dedicated API tests and full project test suite.

Co-authored-by: niyazmft <9331133+niyazmft@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Updated ConfigLoader.getInt(), getFloat(), and getString() to support overloaded
  (section, key, fallback) and (key, fallback) signatures.
- Implemented robust argument disambiguation and heuristic-based section detection
  for getString to maintain safety during early initialization.
- Updated AutoloadHelper static methods to expose the new multi-signature API.
- Updated multiple call sites (combat_formula, entity_lifecycle, elemental_resolver,
  burden_manager, run_manager) to use explicit sectioned lookups.
- Removed redundant local config helpers in entity_lifecycle.gd and
  elemental_resolver.gd.
- Cleaned up orphaned .uid files and reformatted code to pass CI.
- Verified fix with dedicated API tests and full project test suite.

Co-authored-by: niyazmft <9331133+niyazmft@users.noreply.github.com>
@niyazmft niyazmft merged commit 4681464 into main Jun 9, 2026
4 checks passed
@niyazmft niyazmft deleted the fix/config-loader-section-support-6826570002351841991 branch June 9, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(ConfigLoader): convenience getters ignore JSON section structure, causing silent fallbacks

1 participant