Fix #349 - #354
Merged
Merged
Conversation
compute_build_progress counted any build whose kind matched the target,
so the build_hut/build_workshop/build_garden rotating goals completed
the moment a foundation was queued (build created with complete: false),
granting the reward before the structure was finished. This disagreed
with MilestoneManager.evaluate_milestone, which guards MILESTONE_TYPE_BUILD
on bool(build.get("complete")).
Add the same complete guard to compute_build_progress so the goal and
the milestone agree on when "Build a hut" is achieved.
Update tests/test_goal_progression.gd to include an incomplete build
that does not count and a completed one that does, and fix the
existing build-progress test in tests/test_rotating_goal.gd that
codified the placement-based behavior.
Fixes #349
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)
Recommendation: Approve
This PR correctly fixes the misalignment between RotatingGoal.compute_build_progress and MilestoneManager.evaluate_milestone by adding a bool(build.get("complete")) guard to the build counting logic.
Change-by-Change Findings
scripts/rotating_goal.gd
- The
compute_build_progressfunction now requiresbool(build.get("complete"))as an additional condition alongside the kind matching check. - Comment updated to explicitly reference MilestoneManager's
MILESTONE_TYPE_BUILDguard, making the behavioral alignment self-documenting. bool()handles the case wherecompleteis absent (null) or explicitly false — in both cases the build is not counted.
tests/test_goal_progression.gd
_test_compute_build_progressupdated: game_state now containscomplete: falseandcomplete: truevariants; assertion expects 1 (not 2), confirming incomplete builds don't count.- New
_test_compute_build_progress_incomplete_onlytest explicitly validates the regression case: a single incomplete build yields progress of 0. - Both tests include the required
nameargument inassert_eqcalls.
tests/test_rotating_goal.gd
test_compute_build_progressupdated to includecompletefields in all test builds; expected count adjusted from 2 to 1.- Covers both the positive case (completed hut counts) and negative case (incomplete hut does not).
Standards Compliance
- No regressions introduced: The
completefield is optional in saved builds;bool(build.get("complete"))correctly returnsfalsewhen the field is absent, preserving backward compatibility with existing saves. - Behavioral alignment: The fix makes
RotatingGoal.compute_build_progressconsistent withMilestoneManager.evaluate_milestoneforMILESTONE_TYPE_BUILD, eliminating the discrepancy described in the issue. - Test quality: Per AGENTS.md testing traps, all
assert_eqcalls include the requirednameargument — no parse errors possible. - CI validation gates passed: All 7 CI checks succeeded (Linux/macOS/Windows/Web export validation, macOS validation, headless smoke test, script test suite).
Linked Issue Fit
All three acceptance criteria from PR 349 are satisfied:
- ✅ After placing a foundation (build not yet complete), the
build_hutrotating goal does not complete —_test_compute_build_progress_incomplete_onlyverifies this. - ✅ The
build_hutgoal completes only when a matching structure hascomplete: true—_test_compute_build_progressasserts progress = 1 only when a completed hut is present. - ✅
tests/test_goal_progression.gdupdated with both an incomplete build that does not count and a completed one that does —_test_compute_build_progressuses both;_test_compute_build_progress_incomplete_onlycovers the incomplete-only case.
Tool Harness Findings
Not applicable — tool harness reached stop reason (tool-call-budget-exhausted) before any errors were encountered.
Unknowns or Needs Verification
None. The diff is self-contained, the fix is minimal and well-scoped, and CI confirms the changes are correct.
Open
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.
Fix compute_build_progress to only count completed builds, aligning with MilestoneManager's complete guard — resolves issue #349 with targeted code change and test updates.
Fixes #349
Opened by foreman on review GO (workload wl-misospace-windowstead-349).