You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quantitative thresholds that map raw values (RSSI dBm, data rate Mbps, packet-loss %, CPU %, latency/jitter, uptime) into graded states (excellent / good / fair / poor / critical, scores, colors, animations) are defined independently in many places across the 2.x codebase. There is no single source of truth. The same concept ("weak signal", "high CPU", "poor link") is re-decided with different numbers in different files, and none of these numbers has a documented spec backing — they were set ad-hoc during implementation.
This causes:
Conflicting thresholds for the same quantity (e.g. RSSI warning at −75 vs central −78/−71; CPU high at 80 vs scoring line 85).
Multiple normalization coordinate systems that disagree (level judged on −65−78 but progress bar on −100−30 → a bar can show "2/3" yet be labeled Excellent).
≥5 color-semantic systems and inconsistent animations for the same state.
Silent mis-mapping risk (enum declared in non-monotonic order, resolved by 3 - index arithmetic).
Full inventory below (scanned against dev-2.7.0, ~/dev/PrivacyGUI-2x, 2026-07-27). Line numbers are snapshot-based; re-verify before editing.
Goal
Establish a single source of truth for every quantitative threshold, and make all subsystems reference it. Add a lint/guard to prevent downstream code from redefining thresholds again (mechanism over reminder).
Ratification note
Items marked dedup-only are genuine duplicates of the same value → safe to consolidate with no behavior change.
Items marked needs-ratify have conflicting values with no spec backing → consolidating them forces picking a winner, which is a real domain decision. A candidate value is proposed, but must be confirmed by the owner (🌐 network expert for quantitative thresholds; 🎨 design system for state→color/animation) before the value is changed. Do not silently rubber-stamp an ad-hoc number as authoritative.
Owner legend: 🌐 network expert (are the numbers correct) · 🎨 design system (state → color / animation) · 🔧 engineering (pure structural dedup, no external decision needed)
Define one authoritative state→color mapping; all subsystems reference it (🎨)
8. Animation mapping
Dimension
Rule
Location
Status
Link type → line
wired solid pulse / wireless dashed flow
link_renderer.dart:184-190
dedup-only (has branching)
Signal level → node rings
0.9/0.65/0.4/0.1
usp_topology_builder.dart
needs-ratify (ignores wired/wireless, asymmetric with lines)
poor downgrade
grey unknown (reversed)
builder:268
needs-ratify
Define state→animation mapping consistent with the color mapping (🎨)
9. Enum ordering decoupled from semantics (pure risk)
Item
Current
Risk
Location
Status
NodeSignalLevel declaration order
poor, good, fair, excellent (non-monotonic), resolved via 3 - index
reordering silently mis-maps
wifi.dart:52-58
dedup-only (add guard test)
Decouple ordering from arithmetic; add a guard test (🔧)
10. Dead / half-wired code
Mascot walk action: defined but no trigger fires it (mascot_trigger_provider.dart)
cpuHigh / memoryHigh triggers: factory defined, no caller (trigger_definitions.dart:45,57) → System dimension computes CPU/mem score but never pops the mascot
9 triggers defined, only 5 have a fire site
Wire or remove dead triggers / walk action (🔧)
Suggested execution order
Structural dedup (behavior-preserving, 🔧) — extract one threshold registry; consolidate only dedup-only rows; leave needs-ratify rows at their current values as placeholders. Zero behavior change.
Ratification — owners confirm the needs-ratify values (🌐 quantitative thresholds; 🎨 color/animation). Confirmed values fill the registry.
Mechanism — add a lint/guard forbidding downstream redefinition of thresholds.
Problem
Quantitative thresholds that map raw values (RSSI dBm, data rate Mbps, packet-loss %, CPU %, latency/jitter, uptime) into graded states (excellent / good / fair / poor / critical, scores, colors, animations) are defined independently in many places across the 2.x codebase. There is no single source of truth. The same concept ("weak signal", "high CPU", "poor link") is re-decided with different numbers in different files, and none of these numbers has a documented spec backing — they were set ad-hoc during implementation.
This causes:
−78 but progress bar on −100−30 → a bar can show "2/3" yet be labeled Excellent).3 - indexarithmetic).Full inventory below (scanned against
dev-2.7.0,~/dev/PrivacyGUI-2x, 2026-07-27). Line numbers are snapshot-based; re-verify before editing.Goal
Establish a single source of truth for every quantitative threshold, and make all subsystems reference it. Add a lint/guard to prevent downstream code from redefining thresholds again (mechanism over reminder).
Ratification note
dedup-onlyare genuine duplicates of the same value → safe to consolidate with no behavior change.needs-ratifyhave conflicting values with no spec backing → consolidating them forces picking a winner, which is a real domain decision. A candidate value is proposed, but must be confirmed by the owner (🌐 network expert for quantitative thresholds; 🎨 design system for state→color/animation) before the value is changed. Do not silently rubber-stamp an ad-hoc number as authoritative.Owner legend: 🌐 network expert (are the numbers correct) · 🎨 design system (state → color / animation) · 🔧 engineering (pure structural dedup, no external decision needed)
1. RSSI signal grading — ≥4 enums + 5 numeric variants
wifi.dart:10-12unified_diagnostics notifier:1255service.dart:705-735device_score.dart:64-68Duplicated grading enums (same semantics, separate declarations):
NodeSignalLevel(wifi.dart:52),SignalTier(wifi.dart:102),DeviceSignalLevel(device_filter_state.dart:8),HealthTier(network_health_helpers.dart:14) — at least 4.2. RSSI normalization (0~1) — coordinates disagree with grading
(rssi+100)/70performance_card.dart:156snr/50wifi.dart:117?? -100performance_card.dart:583. Data rate (Mbps) grading — ≥3 sets
device_score.dart:72-79device_score.dart:95-99device_score.dart:60unified_diagnostics_service.dart:717-7274. Health-score models — ≥3 unrelated
device_score.dart:50,53+step_result_tile:455network_health_helpers.dart:32-39health_dimension.dart:123-1265. Diagnostic thresholds — scattered, no central definition
unified_diagnostics_service.dart:554_staleThresholdMinutes(noted "no TR-181 standard")6. CPU / memory — scoring vs copy disagree
mascot_config.dart:23-29(excellent=50, ≥95→20)mascot_config.dart:34-36mascot_message_templates.dart:1447. Color semantics — ≥5 coexisting systems
NodeSignalLevelExtwifi_ui.dart:57-68SignalTierExtwifi_ui.dart:84-89HealthTier tierColornetwork_health_helpers.dart:51-57builder:268linksys_mascot_renderer.dart:96-1018. Animation mapping
link_renderer.dart:184-190usp_topology_builder.dartbuilder:2689. Enum ordering decoupled from semantics (pure risk)
NodeSignalLeveldeclaration order3 - indexwifi.dart:52-5810. Dead / half-wired code
Mascot
walkaction: defined but no trigger fires it (mascot_trigger_provider.dart)cpuHigh/memoryHightriggers: factory defined, no caller (trigger_definitions.dart:45,57) → System dimension computes CPU/mem score but never pops the mascot9 triggers defined, only 5 have a fire site
Wire or remove dead triggers /
walkaction (🔧)Suggested execution order
dedup-onlyrows; leaveneeds-ratifyrows at their current values as placeholders. Zero behavior change.needs-ratifyvalues (🌐 quantitative thresholds; 🎨 color/animation). Confirmed values fill the registry.Statistics