feat(node): expose fresh network interface and hardware status

This commit is contained in:
DCCONSTRUCTIONS
2026-11-04 00:42:26 +03:00
parent 2c0a10b687
commit 669ada973f
13 changed files with 861 additions and 7 deletions
+136
View File
@@ -0,0 +1,136 @@
# Read-only onboard network status
Operator job: open the existing onboard-computer settings in Core and identify
which physical network the selected board is connected to. The owner selected
a **Network** section in that window. It is domain content in the admitted
FeatureSettingsWindow composition, not a new workspace. The alternative of
mixing Wi-Fi into **Connection to Core** was rejected because physical network
association and the chosen private-network transport are different facts.
The section uses shared FeatureSettingsWindow, SettingsCard, StatusBadge,
Description and the registered network icon, plus existing fleet fact layout.
It shows Wi-Fi SSID, signal percentage, Ethernet state, interface and addresses.
Virtual interfaces are excluded. It has no network mutation or save action.
Missing, unreadable and stale observations remain explicit and never imply a
successful current connection. Stale evidence is labelled and timestamped.
Node adds typed physical interface metadata to its existing authenticated host
inventory. Linux sysfs identifies Wi-Fi/Ethernet without interface-name guesses.
NetworkManager provides association state and only the associated SSID/signal.
`nmcli device show` reads its existing cache; no scan, connection change,
credential read, new network listener, root helper or permission change is used.
NetworkManager was already a mandatory Debian dependency. Everything ships in
Node 0.8.52-97; nothing is manually configured on the qualification host.
An asynchronous single-reader cache refreshes at most every five seconds. The
command has a 1.5-second deadline and 64 KiB output limit. Failed observations
replace previous data; observations older than 15 seconds are not returned as
current by Node. UI freshness also requires current host inventory, a live
Core channel and a recent observation; a one-second local expiry check works
even when no new fleet events arrive. No history database is added.
Connection state reports the last observed OS network association, not Internet
reachability. The current presentation contract below separates it from board
transport liveness.
The read-only pipeline does not change NetBird/Tailscale selection, Worker,
Synology isolation, physical network configuration or vehicle control.
Acceptance (2026-11-01): frontend architecture checks, typecheck, all 1445
unit tests and production build passed. The bounded Ubuntu build completed all
24 jobs, including Go race tests, onboard UI and installer/environment tests.
The qualified Node 0.8.52-97 owner installer upgraded the prepared board with
one package update, no new packages and no removals. The live Core settings
window displayed the associated USB Wi-Fi SSID/signal/addresses, disconnected
internal Wi-Fi and unavailable Ethernet; repeated opening and Escape worked.
Metadata was collected by the installed unprivileged Node service without any
extra OS permission or configuration. The NetBird profile revision and active
X4 preview were preserved. No motor-control command was issued.
Private build/install evidence and the screenshot remain outside Git under the
session's runtime records. A prepared N006 does not establish clean-image
installation or physical Wi-Fi handover acceptance.
Adapter identification (Node 0.8.53-98): the existing NetworkManager read also
returns the OS vendor/product description; sysfs device/subsystem identifies
USB, PCI, SDIO, platform or virtio. Names are bounded and validated. No hardware
catalog, interface-name heuristic, device ID allowlist or new command is added.
The UI titles cards by network type and reported bus and shows model/vendor
alongside the system interface. It deliberately does not infer physical
internal/external placement from a bus (internal USB devices also exist).
If a group contains several adapters, deterministic initial ordering assigns
its numbers. The stable-presentation revision below preserves the known group
and its order across refreshes and missing reports. Numbers describe the open
window’s known group, not permanent hardware identities. Missing metadata stays
explicit. The section remains read-only and no OS change is
required outside the shipped Node update.
Node98 acceptance (2026-11-01): architecture and focused identification tests,
frontend typecheck, 1447 unit tests and the production build passed; all 24
bounded Ubuntu build jobs passed. The owner installer completed with one Node
upgrade and no new packages/removals. Live Core displayed independently
reported USB and PCI Wi-Fi models plus the PCI Ethernet model. The installed
unprivileged Node service supplied all hardware metadata. NetBird profile and
X4 version/preview were preserved; no motor command or network change was made.
Stable Core presentation (2026-11-01): settings retain the latest known adapter
cards for the lifetime of the open board window. Initial order is deterministic;
new interfaces append. Poll order, stale data, connection state and temporary
missing/unreadable inventory never reorder or remove known cards. A readable,
recent report omitting an adapter shows "not detected"; failed observation and
expired observation remain distinct from an explicit disconnected response.
Latest association facts retain their original timestamp after a negative
response, and the UI labels them as last known network/signal/IP. All fact rows
stay mounted, including vendor, signal and timestamp; no status-dependent
paragraph or row changes card height. The 20-second freshness check is preserved.
State resets on board identity change or window close; at most 64 absent rows
are remembered, with no limit on the current physical interface list. Older
inventory packets cannot overwrite accepted observations. This is a Core-only
presentation fix; no onboard package or OS configuration changes are required.
Stability acceptance (2026-11-01): architecture and 12 focused network tests,
frontend typecheck, all 1452 unit tests and production build passed. In the
canonical live UI, three cards retained identical order, field sets, heights
and positions across 21.242 seconds with new signal/timestamp observations.
Escape and reopening passed; no browser errors were recorded. Missing/error,
expiry, negative-state, recovery, board-switch and out-of-order cases were
checked synthetically without interrupting the physical network. The board
remained online. No onboard deployment, OS change or motor command was made.
Packet-driven state revision (2026-11-01, supersedes the UI expiry behavior
above): adapter cards show the last reported OS state. Clock age, board
liveness, inventory freshness and missing/unknown connection metadata never
rewrite that state. Explicit connected/disconnected/failed/etc. observations
change the state; a complete readable inventory can confirm an absent adapter.
An unreadable inventory cannot confirm removal. A reappearing adapter without
connection metadata has unknown state until a new observation confirms it.
Whole-snapshot and per-adapter observation timestamps reject older data.
The network section separately shows whether Core currently has a board link
and the source timestamp of the latest host snapshot. It does not run an expiry
timer. Card facts omit changing sample timestamps; equal semantic packets reuse
the fact data and memoized card props. Actual SSID, signal, address, hardware or
state changes still appear. Last association facts remain labeled as last known
after disconnect. The existing bounded window-owned memory and ordering remain.
No control/lease liveness rules, transport settings or Node installer change.
Read-only diagnosis: 31 local fleet samples over one minute all reported an
online board and identical physical adapter states. Association age ranged
11.02–24.17 seconds, crossing the old 20-second UI threshold in seven samples;
local API reads took 7–24 ms. The Node collects host metadata before the full
sensor inventory and then sends the full heartbeat; sensor driver inventory
reads are sequential with individual timeouts. Network metadata itself comes
from a separate bounded asynchronous cache. These timestamps establish an
inventory publication delay, not Wi-Fi disconnection; they do not attribute
all latency to a single driver or establish transport performance. Raw bounded
timing evidence stays in .runtime/board-network-state-20261101.
Packet-state acceptance: 15 network tests plus four architecture tests pass;
typecheck and production build pass. The full frontend run passed 1454/1455,
with one unrelated K1 manual-control label mismatch in separately modified
code; no K1 source/test was changed for this fix. Live UI snapshots 24.108
seconds apart retained identical adapter headers, order, heights and positions
while the host timestamp and signal updated. Escape/reopen passed with no
browser errors. The canonical 8000 service remained running. This qualifies
the read-only display, not reduced inventory transport latency. An already
open page needs a reload to receive the rebuilt frontend.