Files
NODEDC_MISSION_CORE/docs/WORKER_CONNECTIONS.md
T

14 KiB
Raw Blame History

Worker connections

Status: 2026-11-09. The existing Worker 006 uses the installed Tailscale connection registry and four supervised channels. The first operator LTE check showed incomplete telemetry; returning to Wi-Fi restored it. After the transport repair below, repeat LTE acceptance is pending. WireGuard worker provisioning and clean-machine enrollment are not accepted capabilities of this increment.

Ownership and boundaries

  • A network profile describes a VPN network, not a physical computer.
  • A worker has an immutable contour identity and a pinned SSH host public key. A prepared transport binding additionally fixes its hostname, OS, authentication alias and permitted channels. VPN peer identity and physical host identity are both checked; selecting an address does not grant trust.
  • A worker may have several connections. Adding one does not activate it. The operator selects an already verified connection for that worker alone.
  • Tailscale remains primary for the current worker. Its endpoint is the peer's stable VPN DNS name, not the operator's Wi-Fi address. HTTP and MQTT currently travel through authenticated SSH forwarding inside the VPN; SSH has not been eliminated or replaced by a newly deployed worker control service.
  • There is no automatic switching between VPN providers. Existing Tailscale routing/reconnection and the channel supervisors handle temporary interruption.
  • Board profiles and board power control are not changed by worker selection.

Components

Component Authority
src/k1link/compute_connections/store.py Atomic registry, revisions, enrollment and selection
src/k1link/compute_connections/transport.py Private prepared bindings, VPN validation, strict host-key checks
src/k1link/compute_connections/service.py Discovery, verification, admission and manual activation
src/k1link/compute_connections/link.py One supervised authenticated forwarding channel
src/k1link/web/compute_connection_api.py Loopback operator API and short-lived power confirmation
scripts/install_compute_connection_links.py Versioned adoption of enumerated existing LaunchAgents and rollback
apps/control-station/src/components/system/WorkerConnectionSettings.tsx Connection selection and prepared-worker enrollment
apps/control-station/src/components/system/SharedNetworkProfiles.tsx Shared profile inventory; reuses existing WireGuard import
apps/control-station/src/components/system/useWorkerPower.tsx Confirmed worker shutdown

The existing compute-contour catalog projects admitted identity/address from the connection registry, retaining display-name and polling preferences. New LAB agent code accepts an explicit contour identity throughout claims and heartbeats; this does not itself deploy per-worker API credentials or additional agents.

Runtime state and channel contract

Private state lives under .runtime/system:

  • device-connections.json: profile references, worker identities, connections, active selection and revisions; no credentials.
  • worker-bindings/<binding>.json and .known_hosts: installer-owned private transport configuration and pinned public keys; never browser-editable.
  • connection-status/<contour>/<channel>.json: bounded latest status, replaced atomically, stale after six seconds. It is not historical telemetry.
  • connection-migrations/<binding>/: exact prior LaunchAgent files for rollback.

The adopted channels preserve existing loopback-only endpoints:

Channel Direction Endpoints
LAB jobs Worker → Core Worker 127.0.0.1:18080 → Core 127.0.0.1:8000
Telemetry Worker → Core Worker 127.0.0.1:1883 → Core 127.0.0.1:1883
Gaussian Pipeline Core → Worker Core 127.0.0.1:18090 → Worker 127.0.0.1:18090
LAB results Core → Worker Core 127.0.0.1:19087 → Worker 127.0.0.1:19087

Supervisors reread active selection and pinned identity, keep one child process, and reconnect forwarding only. A running indicator requires authenticated SSH master setup, not simply an open local port. It does not establish model/runtime readiness or successful transfer of a whole result. Applications retain their own readiness and retry semantics. Activation waits for all configured channels; on failure it restores the previous desired connection. Recovery of that previous connection remains independently observable.

The old telemetry installer refuses to overwrite an adopted connection. Its normal receiver reconciliation remains available. Other legacy planners are not the authority for migrated channels; use the connection installer. The LAB operator-link installer already refuses replacement of a different installed file.

Power control

The local operator API verifies the worker before offering confirmation. The 30-second nonce is bound to the worker, connection revision, selected connection and pinned key, and consumed before execution. A fresh check precedes one fixed Windows shutdown command. No durable queue or automatic resend exists. A missing reply is reported as uncertain, not as a proven failure to execute. Linux worker power control is not admitted by this implementation. Physical shutdown has not been performed as part of connection testing; the UI confirmation was cancelled.

Installation and acceptance

Use the adoption script's --plan <private-plan.json> first, then --apply. The plan enumerates existing owned labels and exact channel specifications. It does not install VPN clients, distribute credentials, provision models or alter the board. --rollback with the same plan restores prior LaunchAgent files; registry records remain and must not be mistaken for live supervisor acceptance. Keep the original plan/backups private. Do not create a second Core service.

WireGuard profiles reuse the existing fleet profile inventory, but current VPS provisioning only prepares core/board roles. A worker needs an explicit worker peer and routing policy plus a client before that path can pass verification. The UI displays the provider registry and explicitly distinguishes it from a network scan; it does not accept a board profile as an equivalent worker. Tailscale network selection occurs in its installed client; this UI does not log into multiple tailnets on the operator's behalf.

Acceptance before declaring field readiness:

  1. Check identity and four channels in Worker settings; observe fresh telemetry.
  2. Move the Mac to an independent LTE connection, retaining Tailscale and Worker power. Wait for recovery; check again without editing IPs or restarting Core.
  3. Retrieve a result that is not already cached; local playback alone cannot prove Worker reachability. Confirm byte integrity through the existing result path.
  4. Return to the original network and repeat the connectivity check.
  5. Separately qualify interrupted transfer/retry and sustained operation before promising arbitrary-network or field-workload reliability.

Local evidence: outputs/worker-connections-20261109/REPORT.md.

Telemetry batching and truthful status — 2026-11-09 follow-up

A settings check verifies pinned host identity and authenticated forwarding. It cannot establish fresh CPU/memory data or readiness of every model. The UI now labels these results as established connections and directs telemetry inspection to Modules. If the host responds only with pipeline data, the Core reports telemetry-host-incomplete; Modules/Network show a warning, not green online with empty hardware. Missing network interfaces produce unknown values, not invented zero traffic. Source timestamps and the 30-second query freshness limit remain.

The installed Telegraf 1.38.4 MQTT non-batch output waits for QoS 1 confirmation for each metric. With dozens of metrics this scales with round-trip latency. Host and pipeline outputs now use layout="batch", grouping metrics per topic. The normalizer accepts both single messages and {"metrics":[...]} envelopes, validates the entire message before admission, and retains each sample's own series identity and timestamp. Bounds: 1 MiB/message, 1–512 metrics/batch; malformed or nested batches are rejected. Existing TTL, agent ACLs and memory limits remain.

Update the normalizer before enabling batching on an existing agent. New agent configurations use the Windows/Linux templates. For the managed Windows host, deploy/telemetry-plane/telegraf/Enable-NdcMissionCoreTelemetryBatch.ps1 validates the expected node, current service/configuration and candidate Telegraf config, keeps a hash-addressed backup, and rolls back on failed service restart. It changes neither credentials nor the endpoint. Current Worker 006 receipt and backup path: outputs/worker-connections-20261109/telemetry-batch-install.json. For manual rollback restore that exact configuration backup and restart only Telegraf; the normalizer remains compatible with single messages.

On Worker 006 an isolated benchmark used the installed Telegraf binary, 128 synthetic metrics and a loopback MQTT receiver delaying each PUBACK by 150 ms: 20.106 s with 128 messages versus 0.169 s with one batch. This proves the transport latency defect, not the exact cause of every symptom during the earlier LTE test. A controlled 38-second loss of the telemetry SSH channel expired stale readings; resuming its supervisor restored fresh readings in 26.29 seconds. Both are bounded controlled tests, not a successful Wi-Fi/LTE handover or a recovery-time guarantee.

Operator connection workflow and remaining gap

The add window follows VPN type → network → device. It lists actual provider peers, marks enrolled/offline devices, and explains when a visible device lacks a Mission Core binding. It no longer requires selection from an unexplained empty “prepared worker” list or displays Worker 006's identity for a new worker. Name matching selects a unique prepared binding only; server-side pinned key, physical host and VPN peer verification remain mandatory admission gates.

WireGuard imports use the existing NODE.DC server connection JSON, not an exported WireGuard .conf tunnel. The UI states this and explains that profile IPs identify VPN servers. Full enrollment of an unprepared computer is still unavailable: it needs agent installation, scoped credentials and trusted binding provisioning. Do not represent clearer selection UI as an accepted clean-host installer.

System navigation contains Workers and VPS catalogs. A selected worker opens Modules and Network. The static Integrations and Audit placeholder pages were removed; operational APIs and actual logs were preserved.

Native VPN client handoff — 2026-11-09

Core detects the installed Tailscale client and reads status --json. On macOS it prefers the official application bundle's own CLI, so an independently installed newer client does not require replacing it with a bundled old version. CLI subprocesses set TAILSCALE_BE_CLI=1, as documented in the official CLI reference. Without this flag the bundle can select GUI mode in a non-interactive service; changing the executable's letter case alone does not resolve that condition. An unknown response/state remains unavailable; there is no version-number guess that declares an untested version compatible. Version is diagnostic metadata.

The connection window distinguishes missing client, login required, stopped, starting, pending administrator approval and connected. Missing client links to the official download. Login/open launches the installed native application; when that client has already issued an official login URL, the same action opens it. Core never receives passwords, switches accounts, forces logout or executes tailscale up/login/switch. Account management stays in the official app. The loopback-only open API accepts no executable, command or URL from the browser.

While settings are visible, discovery refreshes every five seconds and when focus returns from the VPN app. Only one request runs at a time. Hidden/closed windows stop polling, closing aborts the request, and checks/mutations suspend automatic refresh. Still-available selections survive refresh; stale peer/network selections are cleared after an external account change. This does not rebind an existing worker to a newly visible network automatically.

Where the WireGuard import comes from

The NODE.DC VPS installer produces /var/lib/ndc-wireguard-vps/mission-core-wireguard.json on the VPN server. From the directory containing the deployed installer package, its administrator can issue a fresh invitation with:

sudo python3 mission-core-wireguard-vps-0.1.1.pyz connection

Transfer that private JSON to the operator and use the existing import action. The invitation expires after 24 hours; this is not an expiry of an already admitted connection. Keep invitation contents out of logs and normal Git. Source authority is the separate NODEDC_MISSION_CORE_ARNAVI-VPS repository: wireguard_vps/state.py:State.export, wireguard_vps/installer.py:main and docs/WIREGUARD_FLEET_OPERATIONS.md. A .conf exported from the native WireGuard app has a different purpose and is not this server-management invitation.

Current VPS enrollment accepts core and node (board), not worker; its firewall policy is also board-oriented. Therefore importing a server profile does not prepare Worker 006 on WireGuard. Worker peer admission and routing need a separate communications change, independent of the deferred LAB/Docker setup. No VPS profile, board tunnel or active Worker connection was changed here.