Skip to content

Mission 05: Mainnet migration + Reality Tunnel (trust-circle modes)#48

Open
oriontsx wants to merge 10 commits into
intuition-box:devfrom
oriontsx:mission-05-mainnet-reality-tunnel
Open

Mission 05: Mainnet migration + Reality Tunnel (trust-circle modes)#48
oriontsx wants to merge 10 commits into
intuition-box:devfrom
oriontsx:mission-05-mainnet-reality-tunnel

Conversation

@oriontsx

Copy link
Copy Markdown

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

  • GraphQL endpoint testnet.intuition.shhttps://mainnet.intuition.sh/v1/graphql (src/api.js, src/api/Base.js)
  • Env badge relabeled "Intuition Mainnet"; homepage + CNAMEgraph.intuition.box
  • Verified mainnet returns the full triple shape the force-graph renders (subject/predicate/object).

2. Reality Tunnel (trust circle)

Trust circle = the Account-type atoms the connected wallet holds positions on (accounts they've staked on), weighted by vault shares. New src/trustCircle.jsfetchTrustCircle(address), query validated against mainnet:

account(id: $address) {
  positions(where: { vault: { term: { atom: { type: { _eq: "Account" } } } } }, order_by: { shares: desc }) {
    shares
    vault { term { atom { term_id label wallet_id } } }
  }
}

Modes (header control replaces the old single-address whitelist):

  • Global — full graph (default, unchanged behavior)
  • My circle — filtered to your trust circle (aggregate of trusted accounts' positions)
  • Single — view from one trusted account's perspective
  • All circle — aggregated graph across your whole trust circle (plus your own positions)

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 build pass (only pre-existing third-party source-map warnings).
  • Render-tested against mainnet: real data renders, the Reality Tunnel control + all 4 modes show, no console errors after load (pre-existing WalletConnect projectId 401 aside).
  • Wallet-gated modes' data path validated via direct mainnet queries; the gated UI flow needs a connected wallet to fully exercise.

Removed the now-orphaned realityTunnelConfig.js whitelist.

oriontsx added 3 commits May 30, 2026 08:38
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/GraphVisualization.js Outdated
Comment on lines +222 to +224
const where = {
term: { vaults: { positions: { account_id: { _in: addresses } } } },
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@oriontsx

Copy link
Copy Markdown
Author

Closing for now to polish the graph layout (declustering) and harden the trust-circle modes against known accounts. Will reopen a cleaner version.

@oriontsx oriontsx closed this May 30, 2026
oriontsx added 7 commits May 30, 2026 09:37
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).
@oriontsx oriontsx reopened this Jun 10, 2026
@oriontsx

Copy link
Copy Markdown
Author

Reopening with the cleaner version promised in my closing note. Since then:

  • Layout declustering — rebuilt the viz around a predicate-as-edge model with a 3-level radial layout (subject → predicate → object), semantic-zoom LOD and map-style labels; no more hairball on mainnet-scale data.
  • Trust modes hardened — redesigned the trust-graph query to stake-weighted claims about/by circle members (capped + deduped server- and client-side); verified against a 35k-position whale account (cap engages cleanly) and zero-position accounts (proper empty state). All 4 Reality Tunnel modes verified live on mainnet via the ?address= override.
  • UI revamp — unified control dock (view/mode/layout/search/legend), node-details sidebar with Portal links, per-stage loading states, stats strip, mobile layout, plus a new expand-on-demand Focus mode.
  • Chain config — Intuition L3 mainnet (1155) wired as the primary wagmi/RainbowKit chain.

npm run build passes clean. Screenshots and a walkthrough on request.

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.

1 participant