Skip to content

Fix #349 - #354

Merged
joryirving merged 1 commit into
mainfrom
foreman/wl-misospace-windowstead-349/issue-349
Aug 22, 2026
Merged

Fix #349#354
joryirving merged 1 commit into
mainfrom
foreman/wl-misospace-windowstead-349/issue-349

Conversation

@itsmiso-ai

Copy link
Copy Markdown
Contributor

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

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>
@itsmiso-ai
itsmiso-ai requested a review from joryirving as a code owner August 22, 2026 01:28

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

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_progress function now requires bool(build.get("complete")) as an additional condition alongside the kind matching check.
  • Comment updated to explicitly reference MilestoneManager's MILESTONE_TYPE_BUILD guard, making the behavioral alignment self-documenting.
  • bool() handles the case where complete is absent (null) or explicitly false — in both cases the build is not counted.

tests/test_goal_progression.gd

  • _test_compute_build_progress updated: game_state now contains complete: false and complete: true variants; assertion expects 1 (not 2), confirming incomplete builds don't count.
  • New _test_compute_build_progress_incomplete_only test explicitly validates the regression case: a single incomplete build yields progress of 0.
  • Both tests include the required name argument in assert_eq calls.

tests/test_rotating_goal.gd

  • test_compute_build_progress updated to include complete fields 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 complete field is optional in saved builds; bool(build.get("complete")) correctly returns false when the field is absent, preserving backward compatibility with existing saves.
  • Behavioral alignment: The fix makes RotatingGoal.compute_build_progress consistent with MilestoneManager.evaluate_milestone for MILESTONE_TYPE_BUILD, eliminating the discrepancy described in the issue.
  • Test quality: Per AGENTS.md testing traps, all assert_eq calls include the required name argument — 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:

  1. ✅ After placing a foundation (build not yet complete), the build_hut rotating goal does not complete — _test_compute_build_progress_incomplete_only verifies this.
  2. ✅ The build_hut goal completes only when a matching structure has complete: true_test_compute_build_progress asserts progress = 1 only when a completed hut is present.
  3. tests/test_goal_progression.gd updated with both an incomplete build that does not count and a completed one that does — _test_compute_build_progress uses both; _test_compute_build_progress_incomplete_only covers 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.

@joryirving
joryirving merged commit 4183164 into main Aug 22, 2026
8 checks passed
@joryirving
joryirving deleted the foreman/wl-misospace-windowstead-349/issue-349 branch August 22, 2026 02:17
@its-miso its-miso Bot mentioned this pull request Aug 21, 2026
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.

[P3] Rotating "build X" goals complete on foundation placement, not structure completion

2 participants