feat: configurable radius for !path hash-collision disambiguation - #30
Merged
Conversation
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.
What changed
[bot] path_collision_radius_miles(miles, default 150,0= off) used only to disambiguate!pathhop-hash collisions.0disables the bound (collisions then resolve only when ≥2 candidates are located — the previous conservative behavior).Why
The prior fix (#29) dropped a colliding hop whenever fewer than two candidates had a location — which also discarded a correctly located local repeater when its colliding neighbour was geoless (a regression for that case). A bounded distance check restores it without re-admitting the far impostor.
Anchors
The bound is measured to any trusted anchor: the bot's own location, the message sender, or any unambiguously-located neighbouring hop in the path. So the bot's own location helps but is not required — a single cleanly-resolved hop is enough to disambiguate its colliding neighbours. With no anchor at all, collisions stay unlocated.
Notes
!adm/web surface.tests/test_path_resolve.py: lone local hop within radius kept; radius gates accept/reject (150 vs 50 vs 0); radius 0 still disambiguates ≥2 located; neighbour-hop anchors a collision with no bot/sender location.Breaking changes
None. Default 150 mi; output format unchanged.