Mission 05: Mainnet migration + Reality Tunnel (trust-circle modes)#48
Mission 05: Mainnet migration + Reality Tunnel (trust-circle modes)#48oriontsx wants to merge 10 commits into
Conversation
…ge, homepage, CNAME)
Replace the single-address whitelist scaffold with a trust-circle filter
driven by the connected wallet's on-chain positions on Account-type atoms
(weighted by vault shares).
- src/trustCircle.js: fetchTrustCircle(address, endpoint) queries
account(id).positions on Account-type atoms and returns trusted accounts
[{address(wallet_id), atomId, label, weight(shares)}].
- RealityTunnel: segmented mode switcher (Global / My circle / Single /
All circle) + trusted-account picker for Single mode. Handles
not-connected, empty-circle, and loading states.
- GraphVisualization: aggregate trust-circle filter (account_id _in circle),
enhanced single-perspective filter, and trust weighting wired into node
size/opacity/glow and link color/width in 2D and 3D.
- App: tunnel selection state replacing userFilterAddress whitelist; Global
remains the default view.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b44f64735e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const where = { | ||
| term: { vaults: { positions: { account_id: { _in: addresses } } } }, | ||
| }; |
There was a problem hiding this comment.
Include counter-term-only positions in circle mode
In the trust-circle aggregate modes, this where clause only selects triples whose positive term has a position from one of the circle addresses. The rest of this effect still sums circleShares(t.counter_term), and the single-address path above explicitly queries both term and counter_term, so any trusted account that only holds the counter-position on a triple is omitted from “My circle”/“All circle” entirely instead of being shown and weighted.
Useful? React with 👍 / 👎.
|
Closing for now to polish the graph layout (declustering) and harden the trust-circle modes against known accounts. Will reopen a cleaner version. |
Declutter (Task 1): - Cap Global view fetch at 250 triples so it stays legible. - Configure d3 forces (stronger charge repulsion scaled by node count, longer link distance, collision force keyed to node size) so nodes spread out instead of piling into a blob. - 2D: draw compact node dots; only render text labels on hover/selection, when zoomed in (>1.6x), or for notably-trusted nodes; truncate labels. - 3D: smaller spheres, only label notably-trusted nodes (rest keep hover tooltip), truncated sprite text. Both view modes preserved. Test-address override (Task 2): - App reads ?address=0x... from the URL; precedence is connected wallet first, then the URL override. The effective address un-gates the Reality Tunnel trust modes and feeds the trust-circle queries. - Empty ?address falls back to documented test account 0x34E3f9567aee97397Ac7A002dF2ef4f30193F1A6 (7 positions / 6 unique trusted accounts on mainnet). - account(id:) lookups pass the address AS-IS (checksum-cased); mainnet returns null for the lowercased id. Verified the circle loads non-empty.
Mission 05 interactive overhaul of the knowledge-graph visualization: - Cluster by (None/Predicate/Subject) segmented control. Custom d3 cluster force pulls member nodes toward per-cluster anchor centroids laid out on a ring; predicate/subject atoms are the anchors and get persistent prominent labels at every zoom level. - Semantic zoom (universe -> galaxy -> solar system): nodeCanvasObject reveals detail by globalScale. Low zoom shows only cluster anchors, members fade in mid zoom, member labels appear at high zoom. Starts zoomed out via zoomToFit + pull-back on first engine stop. - Contextual hover tooltip varies by node role: subject shows the subject; predicate shows subject -> predicate; object shows the full subject -> predicate -> object (across all triples it participates in). - Full interactivity: wheel zoom, background pan, node drag (pins on drop), hover highlight, click-anchor to center/zoom into a cluster. graphData now annotates nodes with triple membership + cluster keys. 3D mode, Reality Tunnel trust modes, ?address= override, endpoint selector, 2D/3D/VR toggle and search are all preserved.
New 'Radial' layout mode places subject atoms on a center ring (R1), their predicates as branches at a mid radius (R2), and objects as leaves at the outer radius (R3), grouped angularly by subject so each subject's triples form a coherent radial branch. Positions are pinned (fx/fy) for legibility; dragging a node re-pins it. Made the default view. - clustering.js: computeRadialLayout (role-level + per-subject angular sectors; radii scale with subject count) + applyRadialPositions (pin). - GraphVisualization.js: wire radial mode into the layout effect, extend the Layout control to Radial/None/Predicate/Subject, 3-tier semantic-zoom reveal (subject hubs -> predicate branches -> object leaves), and frame zoomed-out (universe) on entry. LOD, contextual hover, drag/zoom/pan, trust modes, endpoint selector, 2D/3D toggle all preserved.
Predicates were drawn as shared middle NODES, which sucked many subjects into one fan on the convergent mainnet graph (~236 subjects, ~12 distinct predicates). Rebuild so a predicate is a relationship CATEGORY rendered as the colored, labeled EDGE between subject and object. - graphData: nodes are only distinct subject/object atoms; one predicate- colored edge per triple (subject -> object) carrying predicate label/id/ color. Shared objects stay single nodes. Primary level: ever-subject -> hub, else object -> leaf. Keeps triples/roles for hover. - nodeColors: 16-color predicate palette + deterministic getPredicateColor. - clustering: 2-level radial layout — subject hubs on an inner ring grouped by sector, each subject's objects on short outward spokes within its wedge; the predicate-colored edge is the branch. - GraphVisualization: predicate filter (toggle chips colored by branch color, shift-click to isolate, All to reset); edges colored by predicate; map-like edge-labels on branches at high zoom. Map-zoom LOD expressed as a ratio to the settled universe zoom so it feels consistent at any graph size: universe = clean subject dots (objects hidden, only biggest hubs labeled), zoom in reveals object leaves, then hub labels, then object + edge labels. Explicit hub-ring framing on engine stop so the universe is never an empty void. Layout control now Radial/Free/Subject (no predicate-node mode). - Hover tooltip shows full subject -> predicate -> object triple; legend gains a Predicate (edge) entry. Trust modes, ?address= override, 2D/3D toggle, drag re-pin, wheel zoom/pan, and search all preserved (all paths flow through transformToGraphData).
|
Reopening with the cleaner version promised in my closing note. Since then:
|
Addresses #45.
Summary
Migrates the graph to Intuition mainnet and adds the Reality Tunnel — a trust-circle-driven view of the knowledge graph.
1. Mainnet migration
testnet.intuition.sh→https://mainnet.intuition.sh/v1/graphql(src/api.js,src/api/Base.js)homepage+CNAME→graph.intuition.box2. Reality Tunnel (trust circle)
Trust circle = the
Account-type atoms the connected wallet holds positions on (accounts they've staked on), weighted by vaultshares. Newsrc/trustCircle.js—fetchTrustCircle(address), query validated against mainnet:Modes (header control replaces the old single-address whitelist):
Trust weighting — node size/opacity/glow and link width/color scale by aggregated stake (shares). UI handles not-connected / loading / empty-circle states.
Testing
npm install+npm run buildpass (only pre-existing third-party source-map warnings).Removed the now-orphaned
realityTunnelConfig.jswhitelist.