Repository navigation
Keep ids of entities still placed elsewhere when a location is removed - #76
Merged
dmccoystephenson merged 3 commits intoNov 6, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (head
Findings folded in from the diff:
Gaps: Merge-gate check: no changed path matches the do-not-auto-merge list. No workflow file or This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
dmccoystephenson
deleted the
feature/remove-location-keeps-placed-entities
branch
November 6, 2026 11:31
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
Grid::removeLocationpreviously reset the ids of every entity in the removed location, even one also stored in another location. Such an entity stayed present with"N/S"and-1ids, and a directional move on it threw. It now keeps its grid id, and if its location id named the removed location, that id now names a location still holding it. An entity left in no location is detached as before.Grid::getLocationandGrid::getLocationByCoordinateserrors now name the id or coordinates requested and the grid's id, matchingEnvironment::getEntity. The exception type is unchanged.Design choice
The new check compares addresses, unlike the library's usual id matching. With id matching, a same-id twin elsewhere in the grid would have kept a genuinely detached entity's ids alive, which would have been a regression. Test 74 pins this. When an entity remains in several locations, its location id is set to the first of them in grid order.
Test plan
a723e09, aborting on the Test 72 assertionentity.getGridId() == 5(exit 134)removeLocationcommit6ec604f, with Tests 72-75 passing and Test 76 aborting on its first assertion (exit 134)e14728c, with 76 of 76 registered tests reporting success, and the CMakecteststep passedassertaborted at Test 72 first. On the old code it would fail on the same grid id reset.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 copies a vector of pointers and 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 #73
Closes #74
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