Skip to content

Increase event log capacity from 8 to 20 events - #262

Merged
joryirving merged 1 commit into
mainfrom
foreman/wl-misospace-windowstead-248/issue-248
Jul 8, 2026
Merged

Increase event log capacity from 8 to 20 events#262
joryirving merged 1 commit into
mainfrom
foreman/wl-misospace-windowstead-248/issue-248

Conversation

@itsmiso-ai

Copy link
Copy Markdown
Contributor

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).

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>
@itsmiso-ai
itsmiso-ai requested a review from joryirving as a code owner July 8, 2026 06:40

@its-saffron its-saffron Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() > 8while 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 and expression:
    use_local_storage = OS.has_feature("web") and JavaScriptBridge.eval("...", true)
  • Verdict: Correct. Logic is identical; the and operator short-circuits so JavaScriptBridge.eval is never called on non-web platforms. Clean improvement.

3. tests/test_runner.gd — Updated bounded event log test

  • Changed MAX_EVENTS constant 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 = false after load_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.gd matches 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.

@joryirving
joryirving merged commit 19625d5 into main Jul 8, 2026
5 checks passed
@joryirving
joryirving deleted the foreman/wl-misospace-windowstead-248/issue-248 branch July 8, 2026 15:25
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.

Increase event log capacity (8→20+)

2 participants