Ask: Evaluate the stockpile_food milestone against current stockpiled food instead of lifetime harvested food.
Expected files: scripts/milestone_manager.gd, tests/test_milestone_goals.gd
Problem: The stockpile_food milestone — name "Stockpile 10 food", description "The larder is filling up. Rations secured." — is evaluated by the MILESTONE_TYPE_STOCKPILE branch reading game_state.harvested, i.e. lifetime food gathered, which never decreases. A colony that harvested 10 food and then ate it all completes the milestone while holding 0 food; the "larder" is never actually filled as the name and description promise. The neighboring build_* milestones and the rotating gather_* goals correctly use their own semantics, so this reads as an implementation/description mismatch rather than a deliberate design (the field name harvested vs. milestone type STOCKPILE is the tell). The current tests encode the harvested behavior, so the fix must update both implementation and tests.
Evidence:
scripts/milestone_manager.gd evaluate_milestone() MILESTONE_TYPE_STOCKPILE branch — var harvested: Dictionary = game_state.get("harvested", {}); progress from harvested.get(resource, 0)
scripts/milestone_manager.gd MILESTONE_CATALOG stockpile_food — name/description promise a stockpile ("larder filling up")
scripts/game_state.gd / scripts/colony_sim.gd — current stock is state.resources.food (see apply_food_upkeep()), never consulted by this milestone
tests/test_milestone_goals.gd test_evaluate_stockpile_milestone — asserts progress from harvested (no spend scenario)
Acceptance:
- Progress derives from current
resources.food (clamped to target), so spending food regresses progress
test_evaluate_stockpile_milestone updated to use resources; add a harvested-then-spent scenario proving progress < total
- Other milestone types unchanged; suites stay green
Ask: Evaluate the stockpile_food milestone against current stockpiled food instead of lifetime harvested food.
Expected files: scripts/milestone_manager.gd, tests/test_milestone_goals.gd
Problem: The
stockpile_foodmilestone — name "Stockpile 10 food", description "The larder is filling up. Rations secured." — is evaluated by theMILESTONE_TYPE_STOCKPILEbranch readinggame_state.harvested, i.e. lifetime food gathered, which never decreases. A colony that harvested 10 food and then ate it all completes the milestone while holding 0 food; the "larder" is never actually filled as the name and description promise. The neighboringbuild_*milestones and the rotatinggather_*goals correctly use their own semantics, so this reads as an implementation/description mismatch rather than a deliberate design (the field nameharvestedvs. milestone typeSTOCKPILEis the tell). The current tests encode the harvested behavior, so the fix must update both implementation and tests.Evidence:
scripts/milestone_manager.gdevaluate_milestone()MILESTONE_TYPE_STOCKPILE branch —var harvested: Dictionary = game_state.get("harvested", {}); progress fromharvested.get(resource, 0)scripts/milestone_manager.gdMILESTONE_CATALOGstockpile_food— name/description promise a stockpile ("larder filling up")scripts/game_state.gd/scripts/colony_sim.gd— current stock isstate.resources.food(seeapply_food_upkeep()), never consulted by this milestonetests/test_milestone_goals.gdtest_evaluate_stockpile_milestone— asserts progress fromharvested(no spend scenario)Acceptance:
resources.food(clamped to target), so spending food regresses progresstest_evaluate_stockpile_milestoneupdated to useresources; add a harvested-then-spent scenario proving progress < total