Skip to content

Conversation

@karloti
Copy link

@karloti karloti commented Jan 5, 2026

Motivation and Context

Refactor the GOAP planner DSL to promote a more consistent builder pattern and simplify API usage. Previously, users relied on the goap extension function, often needing to explicitly pass typeOf(). This change enables direct usage of GOAPPlannerBuilder { ... }, which leverages reified type parameters to automatically infer the state type. The goap function has been deprecated with a ReplaceWith quick fix to facilitate migration. Additionally, KDoc documentation has been updated with complete examples, and new tests verify the type inference and direct builder usage.

Breaking Changes

No. The goap function is marked as @deprecated(level = DeprecationLevel.WARNING), so existing code will continue to compile and run, but users will see a warning suggesting the new usage.


Type of the changes

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tests improvement
  • Refactoring

Checklist

  • The pull request has a description of the proposed change
  • I read the Contributing Guidelines before opening the pull request
  • The pull request uses develop as the base branch
  • Tests for the changes have been added
  • All new and existing tests passed

Additional steps for pull requests adding a new feature

  • An issue describing the proposed change exists
  • The pull request includes a link to the issue
  • The change was discussed and approved in the issue
  • Docs have been added / updated

@karloti karloti closed this Jan 5, 2026
@karloti karloti marked this pull request as ready for review January 5, 2026 10:19
@karloti karloti reopened this Jan 5, 2026
Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

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

@karloti, looks great, thank you!
Would you mind changing some tests to use simplified syntax as well?

@kpavlov kpavlov added the enhancement New feature or request label Jan 5, 2026
@karloti karloti changed the title Refactor goap builder to automatically infer stateType from the reified type parameter, eliminating the need to pass it explicitly. Refactor GOAP planner instantiation to use GOAPPlannerBuilder directly with automatic type inference, deprecating the goap function and adding comprehensive tests. Jan 6, 2026
@kpavlov kpavlov self-requested a review January 7, 2026 14:37
Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

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

Hi, @karloti
Would you mind rebasing from JetBrains:develop, squashing your commits, and excluding unrelated changes?

@karloti karloti force-pushed the develop branch 5 times, most recently from bbcb94f to 453fa53 Compare January 7, 2026 21:27
@karloti karloti closed this Jan 8, 2026
•GOAPPlannerBuilder.kt: Changed goap function deprecation level to HIDDEN to enforce builder usage.
•GOAPPlannerAgentTest.kt: Refactored tests to use GOAPPlannerBuilder instead of the deprecated goap function.
•GrouperAgent.kt: Updated example agent to use the new builder syntax.
•planner-agents.md: Updated documentation and code examples to use GOAPPlannerBuilder, fixing knit generation errors.
@karloti karloti reopened this Jan 8, 2026
@karloti karloti requested a review from kpavlov January 8, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants