Repository navigation
fix(open_nodes): direction 'any' returns in-edges, each edge once - #256
Open
Levalicious wants to merge 1 commit into
Open
Levalicious wants to merge 1 commit into
Levalicious wants to merge 1 commit into
Conversation
The 'any' branch kept an in-edge only when its source was also in the opened set: the inverse of the intended filter. 'any' therefore returned out-edges only (in-edges from outside the opened set were dropped), and an edge between two opened nodes was listed twice, once as the source's out-edge and once as the target's in-edge. Skip an in-edge under 'any' exactly when its source is opened (it was already emitted as that source's out-edge). That keeps every other in-edge and lists shared edges and self-loops once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B7UQfn7Vue83jAPFaWfmAZ
Contributor
Per-op benchmark — p50 cycles (base vs head)base runs: 5, head runs: 5 (median of mins) · freq-correction ×0.9987 · threshold head−base > max(40 cyc, 5%)
* head frequency-corrected to base via the No regressions beyond threshold. |
This branch has not been deployed
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.
Problem
openNodeskept an in-edge underdirection: 'any'only when its source was also in the opened set — the inverse of the intended filter. So:anyreturned out-edges only; in-edges from outside the opened set vanished (e.g. a node with 50 out / 96 in reported 50 underany).Fix
One condition: under
any, skip an in-edge exactly when its source is opened (already emitted as that source's out-edge). Every other in-edge is kept; shared edges and self-loops appear once.Tests
tests/open-nodes-direction.test.ts(3): single node any = forward ∪ backward with self-loop once; in-edges from outside the set; shared edge listed once. 3/3 fail on develop, pass here. Full suite 199/199.🤖 Generated with Claude Code
https://claude.ai/code/session_01B7UQfn7Vue83jAPFaWfmAZ