Skip to content

feat(support): recommendation graph — ref-code edges, edge-cap fix & lazy 1-hop expansion#3948

Open
TaprootFreak wants to merge 10 commits into
developfrom
feat/support-recommendation-graph-lazy-neighbors
Open

feat(support): recommendation graph — ref-code edges, edge-cap fix & lazy 1-hop expansion#3948
TaprootFreak wants to merge 10 commits into
developfrom
feat/support-recommendation-graph-lazy-neighbors

Conversation

@TaprootFreak

@TaprootFreak TaprootFreak commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Consolidated PR — the complete referral-network work for the support recommendation graph, in one unit against develop.

Includes

  1. Ref-code edges: classic user.usedRef → user.ref relationships as UsedRef edges in the recommendation graph (deduplicated against recommendations), refUserDataId in the support user info, and an index on user.usedRef.
  2. Edge-cap fix: recommendation edges are filtered to nodes within the result set (no edges dangling to unloaded nodes at the node cap).
  3. Lazy 1-hop endpoint: GET support/recommendation-graph/:id/neighbors?skip&take (paginated hasMore, cheap per-node expandable) for progressive expansion — avoids the 500-node hairball for hub accounts.

Shared helpers (collectHop, buildGraphPayload) keep the full-graph and neighbors endpoints consistent. Verified end-to-end on real production data (userData 321067, hub 2085) on a local stack. Build/eslint green.

Supersedes the separate PRs #3897 and #3917.

Blume1977 and others added 3 commits June 16, 2026 14:21
…on network graph

The compliance recommendation network graph and panel only read the
Recommendation table, so classic ref-code relationships (user.usedRef ->
user.ref) were invisible even though they drive AML (InvalidKycStatusRefUser)
and ref rewards. Traverse usedRef in both directions during the graph BFS,
emit deduplicated ref-code edges (recommendation wins for shared pairs),
expose the referrer userData id on user support info, and index user.usedRef
for the reverse lookup.
@TaprootFreak TaprootFreak changed the title feat(support): add lazy 1-hop neighbors endpoint for the recommendation graph feat(support): recommendation graph — ref-code edges, edge-cap fix & lazy 1-hop expansion Jun 20, 2026
@TaprootFreak TaprootFreak changed the base branch from fix/support-recommendation-graph-dangling-edges to develop June 20, 2026 18:57
@TaprootFreak TaprootFreak marked this pull request as draft June 20, 2026 19:37
…counts); always include upward referrers in neighbors
@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown

⚠️ Unverified Commits (1)

The following commits are not signed/verified:

  • 3d21621 feat(support): include classic ref-code relationships in recommendation network graph (Blume1977)
How to sign commits
# SSH signing (recommended)
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign true

# Re-sign last commit
git commit --amend -S --no-edit
git push --force-with-lease

…t external-degree expandability, RefEdge type, enum edge fields, controller presence checks
…point, page-size const, self-pair/NaN guards, test hardening
…n, drop dead neighborIds, filter self-loop edges
…der side-effect, real migration timestamp, centralize ref predicate
…p take with Max, fix stale edge-id comment, cover getUsersByUsedRefs
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.

2 participants