Demote anchored edges to substandard confidence

Anchored edges are geographically inferred (resolve a hop to the region-unique
repeater near a known endpoint), not observed consecutive hops, so they are less
trustworthy than any path-uniq edge. Re-rank confidence to:
direct 1.0 > path-uniq-3b 0.8 > path-uniq-2b 0.6 > anchor 0.45 > path-uniq-1b 0.4.

Anchors now fall below the 0.5 "Standard" default (hidden by default, just above
the noisy 1-byte tier). Add an "Include anchored (lower confidence)" UI tier at
0.45 so they can be opted into without the 1-byte noise.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Vanderpot
2026-06-19 21:05:38 -04:00
parent f8abe219e7
commit 9191bcaab0
2 changed files with 14 additions and 5 deletions
@@ -165,7 +165,10 @@ WITH
),
all_edges AS (
SELECT region, source_node, target_node, method, obs,
multiIf(method = 'direct', 0, method LIKE 'anchor-%', 1, method = 'path-uniq-3b', 1, method = 'path-uniq-2b', 2, 3) AS rank
-- rank orders confidence (lower=better). Anchors are demoted BELOW the path-uniq tiers
-- (substandard, just above the noisy 1-byte tier): an anchor bind is inferred geographically,
-- not an observed consecutive hop, so it's less trustworthy than any path-uniq edge.
multiIf(method = 'direct', 0, method = 'path-uniq-3b', 1, method = 'path-uniq-2b', 2, method LIKE 'anchor-%', 3, 4) AS rank
FROM (
SELECT region, source_node, target_node, method, obs FROM edges_path_uniq
UNION ALL SELECT region, source_node, target_node, method, obs FROM edges_anchor_gw
@@ -193,8 +196,11 @@ SELECT
-- are single-hop but inferred, so they group with 'path'. Fine-grained tier is in `method`.
if(ec.method = 'direct', 'direct', 'path') AS connection_type,
ec.method AS method,
-- tier base (direct 1.0 .. path-uniq-1b 0.4) plus a small capped consensus bonus
least(1.0, greatest(0.0, (1.0 - 0.2 * ec.best_rank) + least(0.08, 0.04 * log10(ec.observation_count + 1)))) AS confidence,
-- tier base: direct 1.0, path-uniq-3b 0.8, path-uniq-2b 0.6, anchor 0.45 (substandard), 1b 0.4,
-- plus a small capped consensus bonus (<0.05 so anchors stay below the 0.5 default and above 1b).
least(1.0, greatest(0.0,
multiIf(ec.best_rank = 0, 1.0, ec.best_rank = 1, 0.8, ec.best_rank = 2, 0.6, ec.best_rank = 3, 0.45, 0.4)
+ least(0.04, 0.02 * log10(ec.observation_count + 1)))) AS confidence,
ec.observation_count AS observation_count,
ec.observation_count AS packet_count,
sd.node_name AS source_name,
@@ -48,10 +48,13 @@ export const NODE_TYPE_OPTIONS = [
];
// Neighbor confidence tiers, mapped to the minimum edge confidence emitted by
// meshcore_all_neighbor_edges (direct=1.0, anchored/3-byte≈0.8, 2-byte≈0.6, 1-byte≈0.4).
// meshcore_all_neighbor_edges (direct=1.0, 3-byte≈0.8, 2-byte≈0.6, anchored≈0.45, 1-byte≈0.4).
// Anchored edges are geographically inferred (not observed hops) so they rank just above the noisy
// 1-byte tier and are hidden at the default "Standard" threshold.
export const NEIGHBOR_CONFIDENCE_OPTIONS = [
{ value: 1.0, label: "MQTT direct only" },
{ value: 0.7, label: "High (anchored + extended hash)" },
{ value: 0.7, label: "High (extended hash)" },
{ value: 0.5, label: "Standard" },
{ value: 0.45, label: "Include anchored (lower confidence)" },
{ value: 0, label: "All (include weak 1-byte)" },
];