Increase event log capacity from 8 to 20 events - #262
Merged
Conversation
Update push_event() in scripts/main.gd to retain up to 20 events instead of 8, and update the bounded_event_log test accordingly. Fixes #248 Signed-off-by: Saffron <263493777+itsmiso-ai@users.noreply.github.com>
There was a problem hiding this comment.
AI Automated Review
Full PR review.
Analysis engine: MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic) — escalated (fast_low_confidence)
PR Review: Increase event log capacity from 8 to 20 events
Recommendation: APPROVE
This PR is a straightforward, well-scoped change that cleanly addresses issue PR 248. All CI checks pass (headless smoke test, script test suite, macOS validation, export validation).
Change-by-Change Findings
1. scripts/main.gd — Core capacity change (line 2435)
- Change:
while state.events.size() > 8→while state.events.size() > 20 - Verdict: Correct. This is the primary implementation of issue PR 248. The bounded log uses LIFO eviction (push_front + pop_back), which is preserved. No behavioral issues.
2. scripts/game_state.gd — Refactored initialization (line 17)
- Change: Condensed two-line conditional into single
andexpression:use_local_storage = OS.has_feature("web") and JavaScriptBridge.eval("...", true)
- Verdict: Correct. Logic is identical; the
andoperator short-circuits soJavaScriptBridge.evalis never called on non-web platforms. Clean improvement.
3. tests/test_runner.gd — Updated bounded event log test
- Changed
MAX_EVENTSconstant from 8 to 20 - Updated iteration from 12 to 25 events
- Adjusted assertions: first event tick 24, last kept tick 5, evicted count 5
- Verdict: Correct. All assertions match the new 20-event capacity.
4. Test files (test_dirty_state_tracking.gd, test_e2e.gd, test_reservations.gd, test_save_backup.gd)
- Added
gs.use_local_storage = falseafterload_game_state()in all test functions - Verdict: Appropriate. These are defensive workarounds ensuring tests don't interact with actual localStorage. This is unrelated to the main issue but is a reasonable test hygiene improvement.
Standards Compliance
- Repository conventions: No conflicts found with AGENTS.md or CONTRIBUTING.md.
- Save/version migration: N/A — capacity change doesn't affect save format.
- Code style: GDScript idioms preserved; no style regressions.
Linked Issue Fit
- Issue PR 248: "Increase event log capacity (8→20+)"
- ✅ Primary requirement met: capacity increased from 8 to 20
- ✅ Tests updated to match new capacity
- ✅ Minor refactor mentioned in PR body is included
Evidence Provider Findings
None configured.
Tool Harness Findings
- git_log: PR head commit confirmed as
1f66b43 - read_file:
game_state.gdmatches expected final state (refactor applied)
CI Check Results
All CI checks passed for commit 1f66b43b8b0cef60dc5174e6462f1bc718cd79d6:
- Headless smoke test: ✅ success
- Script test suite: ✅ success
- macOS validation: ✅ success
- Export validation (Linux): ✅ success
Unknowns / Needs Verification
None. The corpus provides complete coverage of the PR's scope.
Summary
This PR is ready to merge. It implements the requested feature completely, updates tests correctly, includes a minor but valid refactor, and passes all validation gates.
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.
Increases event log capacity from 8 to 20 in main.gd, updates tests accordingly, and includes a minor refactor of use_local_storage initialization.
Fixes #248
Opened by foreman on review GO (workload wl-misospace-windowstead-248).