feat: goal-driven task generation system#115
Draft
kcjonson wants to merge 2 commits into
Draft
Conversation
Adds centralized GoalTaskRegistry for managing crafting, hauling, and harvesting goals with parent-child relationships and dependency tracking. New systems: - GoalTaskRegistry: Central goal storage with indices for fast lookup - CraftingGoalSystem: Creates Craft + Harvest + Haul goal hierarchies - StorageGoalSystem: Creates Haul goals for storage containers - BuildGoalSystem: Creates PlacePackaged goals for furniture placement Changes: - AIDecisionSystem: Evaluates goals from registry instead of ad-hoc scanning - ActionSystem: Updates goal progress on task completion - Task component: Added goal IDs for tracking reservations - GlobalTaskAdapter: Displays goal hierarchy in task list UI Known issue: Goals are being removed unexpectedly, causing infinite regeneration. Debug logging added to investigate.
Bug Fix: - StorageGoalSystem was removing Craft goals owned by CraftingGoalSystem - Root cause: getGoalsByType(Haul) returned ALL Haul goals, including child Haul goals from CraftingGoalSystem's material delivery - StorageGoalSystem would then call removeGoalByDestination() on entities it didn't recognize, inadvertently removing Craft goals Goal Ownership System: - Added GoalOwner enum (StorageGoalSystem, CraftingGoalSystem, BuildGoalSystem) - Added owner field to GoalTask struct - Added ownerToGoals index for efficient ownership-based queries - Systems now query getGoalsByOwner() instead of getGoalsOfType() - Each goal explicitly tracks which system created it Test Infrastructure: - Added CraftingGoalSystem.test.cpp with 7 tests - Tests reproduce the bug and verify the fix - Added registerTestRecipe() to RecipeRegistry for test support All 330 tests pass.
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.
Summary
Implements centralized goal-driven task generation as specified in
/docs/design/goal-driven-task-generation.md.New Components:
Key Changes:
Known Issues
Debug logging has been added to trace the removal path.
Test Plan