Repository navigation
Stop addEntityToLocation claiming an entity it did not place - #79
Merged
Merged
Conversation
Test 77 fails until addEntityToLocation stops inferring placement from the entity's grid id. Test 78 pins the deleted copy operations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Environment::addEntityToLocation inferred placement from the entity's grid id, which an entity already carrying that id passes without being placed, so its environment id was overwritten. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric, anchored on CI run 42370300793 at
Findings:
This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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
Environment::addEntityToLocationinferred placement by comparing the entity's grid id with the grid's after the call. An entity already carrying that grid id passed the check without being placed, so its environment id was overwritten, contrary to the README "Errors" section.Grid::addEntityToLocationnow returns whether it placed the entity, and the environment uses that result.voidtoboolchange is source compatible for existing callers. The Strata frontend does not call the grid method directly, and its CI build with warnings as errors passed.static_assertthatEnvironmentcannot be copied or assigned, which guards the double delete behind Environment is copyable but owns a raw Grid*, so copying it double-deletes the grid #44.Test plan
1f57797, aborting on the Test 77 assertionentity.getEnvironmentId() == -1after Test 76 passed (exit 134)83356c6, with 79 of 79 registered tests reporting success, and the CMakecteststep passed83356c6environment.h,makefailed on bothstatic_asserts, and the header was then restoredvoidreturn. It exercises the new return value only.run_tests_asan.shwas not run: CI has no AddressSanitizer job (tracked in CI does not run run_tests_asan.sh, so AddressSanitizer failures are not caught on PRs #75), and local execution is denied. The change alters no allocation or entity lifetime.Local execution of
tests_executableis denied in this session, so CI is the test anchor.Skipped
#75 was left for a later cycle. Its fix edits
.github/workflows/ci.yml, which is on the do-not-auto-merge list, so it needs human review and is independent of this change.Closes #77
Closes #78
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson