Skip to content

Fix logical NOT for string-backed boolean values - #1191

Draft
fallenmi wants to merge 1 commit into
BehaviorTree:masterfrom
fallenmi:agent/fix-subtree-literal-booleans
Draft

Fix logical NOT for string-backed boolean values#1191
fallenmi wants to merge 1 commit into
BehaviorTree:masterfrom
fallenmi:agent/fix-subtree-literal-booleans

Conversation

@fallenmi

Copy link
Copy Markdown

Fixes #1122.

Literal values passed to a SubTree remain strings in its blackboard. Script unary logical NOT rejected every string, including values that use the standard boolean spellings accepted by convertFromString<bool>.

Allow ! to interpret only true/True/TRUE/1 and false/False/FALSE/0. Other strings still raise the existing Invalid operator for std::string error, and the blackboard values remain unchanged for string consumers.

Regression coverage includes:

  • the reported _skipIf="!enabled" path;
  • lowercase, capitalized, uppercase, and remapped 1/0 values;
  • preservation of the original string values;
  • rejection of a numeric-prefix string that is not a boolean.

Validation

  • cmake --build build --target behaviortree_cpp_test --parallel 8
  • ./build/tests/behaviortree_cpp_test --gtest_filter='SubTree.*:Preconditions.*:ParserTest.*:PortTest.*:PortTypeRules.*' — 110 passed
  • uvx pre-commit run -a
  • git diff --check

AI assistance disclosure

OpenAI Codex reproduced the issue, drafted the code and tests, checked the visible upstream overlap surface, and ran the validation listed above. The account owner remains responsible for the contribution.

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.

Script error with boolean operator on subtree input

1 participant