365 lines
22 KiB
Markdown
365 lines
22 KiB
Markdown
# Worker connections
|
||
|
||
Status: 2026-11-10. 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, the operator reported working telemetry
|
||
on independent LTE on 10 November; fresh telemetry was also verified after return to Wi-Fi.
|
||
The two LAB preparations reused local inputs and do not qualify an uncached Worker download.
|
||
A subsequent Wi-Fi test received 91,856,442 bytes through the live Worker result
|
||
gateway into empty scratch, verified independent Worker hashes and resumed a
|
||
deliberately interrupted HTTP response. This qualifies that data path and its
|
||
Range support, not automatic UI retry or full portable-LAB restoration.
|
||
WireGuard worker provisioning and clean-machine
|
||
enrollment are not accepted capabilities of this increment.
|
||
|
||
Current closeout and prioritized acceptance plan: [WORKER_NETWORK_NEXT_STEPS](WORKER_NETWORK_NEXT_STEPS.md).
|
||
|
||
## Operator LTE follow-up — 2026-11-10
|
||
|
||
The operator reported a real LTE-only test away from the Wi-Fi router, with
|
||
working Worker telemetry. The supplied 01:41 MSK screenshots show hardware values,
|
||
container metrics and network interfaces. Fresh CPU/RAM/GPU and network data were
|
||
also observed in Core after the operator returned to Wi-Fi. This accepts the
|
||
operator-observed telemetry run, not a measured handover time or an arbitrary-network SLA.
|
||
There is no retained time series covering the full transition.
|
||
|
||
The two apparently fast LAB downloads were local preparations:
|
||
|
||
| LAB | New assembled file, bytes | Completion, MSK |
|
||
| --- | ---: | --- |
|
||
| TRAVEL TGS | 424,391,097 | 10 November 01:42:13 |
|
||
| DDRNet-39 / GOOSE | 425,917,464 | 10 November 01:42:45 |
|
||
|
||
The Core HTTP log records successful removal of each presentation copy, then
|
||
session replay preparation and successful HEAD of the assembled replay. These
|
||
access-log lines do not include request timestamps or transferred-byte counts;
|
||
the completion times above come from filesystem metadata, not a bandwidth log.
|
||
Both output SHA-256 values match their sidecars. The common 299,056,182-byte base
|
||
recording was already local on 8 November; the camera proxy and relevant model
|
||
artifacts were local since August/September. `PortableReplayService.prepare`
|
||
combines these local inputs without Worker IO. Removing a presentation copy does
|
||
not remove shared source/dependency files. Thus the displayed size is the finished
|
||
recording's disk size; it is not evidence that approximately 850 MB crossed LTE.
|
||
|
||
The Worker evidence service log for 22:25–22:45 UTC contains startup messages but
|
||
no corresponding transfer entries. Log absence alone is not proof of zero network
|
||
traffic. The local input identities and packaging code establish the narrower
|
||
conclusion: this run did not qualify a wholly uncached Worker-result transfer.
|
||
That transfer, interruption/retry and sustained operation remain separate checks.
|
||
Preserve working/pinned LABs when arranging an isolated uncached test.
|
||
|
||
The duplicate shared-network inventory/import card was removed from the Network
|
||
page. Connection selection and WireGuard import remain in Worker settings.
|
||
Architecture test, typecheck, all 1,539 frontend tests and production build passed;
|
||
Network and settings/import were visually checked on the canonical Core.
|
||
Bounded local evidence: `outputs/lte-followup-20261110/`.
|
||
|
||
## Wi-Fi result transport acceptance — 2026-11-10
|
||
|
||
At the owner's request, the remaining bounded transport test ran on the current
|
||
Wi-Fi instead of waiting for LTE. Between 02:21:18 and 02:21:23 MSK, an independent
|
||
HTTP client requested four existing TGS playback tracks through Core :8000 → the
|
||
configured LAB gateway :19087 → authenticated SSH inside Tailscale → the Worker
|
||
evidence container. The destination was empty task scratch, outside application
|
||
storage. No browser cache or local CAS supplied these response bodies.
|
||
|
||
| Track | Received bytes | Verification |
|
||
| --- | ---: | --- |
|
||
| Cell centers | 18,080 | SHA-256 and numeric shape/dtype |
|
||
| States | 10,073,444 | SHA-256, shape/dtype and allowed state codes |
|
||
| Height bounds | 80,586,656 | SHA-256 and shape/dtype after interruption/resume |
|
||
| Frame metadata | 1,178,262 | SHA-256 and 4,489 decoded frame records |
|
||
|
||
All hashes matched the API manifest and separate read-only hashes calculated
|
||
inside the Worker container. The existing component is
|
||
`m49-tgs-full-shadow-ef98de7db7596d48e8c8c0549ce68e6704ee03e87c8c4bcf1e3e748b7ccb032e`,
|
||
from RAVNOVES00; this transport test does not readmit a historical LAB into the UI
|
||
or accept its algorithm quality.
|
||
|
||
The client closed the height-track response after 1,048,576 bytes and explicitly
|
||
requested the remainder with Range/If-Range. Core returned 206 with the exact
|
||
offset and unchanged ETag; the joined file matched the Worker SHA-256. A stale
|
||
If-Range correctly returned a complete-response 200 instead of appending a new
|
||
generation; an out-of-bounds Range returned 416. Cancellation was confined to the
|
||
test client's request: VPN, supervisors and other consumers stayed running.
|
||
|
||
Tailscale reported a direct peer address on the current LAN, with its received-byte
|
||
counter increasing by 101,087,264 bytes. That counter also includes read-ahead,
|
||
discarded probe bodies and unrelated traffic; it is not the exact application
|
||
payload count or an LTE speed measurement. Payload verification covers exactly
|
||
91,856,442 bytes. Do not infer DERP use from the populated Relay field when a
|
||
direct peer address is active.
|
||
|
||
The four temporary files were removed after verification. The local LAB index
|
||
digest and existing replay sizes/mtimes were unchanged; Core health remained 200.
|
||
No production code, models, Worker files, VPN configuration or power state changed.
|
||
|
||
Limits: this was an API data-plane test of existing visual tracks, **not** a fresh
|
||
end-to-end opening of one of the three portable LABs. Their current packaging still
|
||
uses local source/result dependencies. Automatic browser retry, restoration after
|
||
all those dependencies are absent, actual network loss during transfer, LTE/DERP
|
||
throughput and sustained operation remain unqualified. The explicit test-client
|
||
resume must not be described as a delivered automatic UI downloader.
|
||
|
||
Compact local evidence: `outputs/wifi-worker-transfer-20261110/REPORT.md`,
|
||
`result.json`, `manifest.json`, `worker-hashes.json` and `tools/check_transfer.py`.
|
||
Raw tracks are not retained or committed.
|
||
|
||
## 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` | Existing WireGuard import used inside Worker settings |
|
||
| `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](https://tailscale.com/docs/reference/tailscale-cli?tab=macos).
|
||
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:
|
||
|
||
```sh
|
||
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.
|
||
|
||
|
||
## Cold portable LAB UI acceptance — 2026-11-10
|
||
|
||
The canonical Core on port 8000 was tested with an isolated empty **viewing cache**
|
||
through the existing Chrome UI. The production cache, original recordings, model
|
||
artifacts and catalog were retained. No LTE handover or Wi-Fi setting was changed.
|
||
|
||
| Accepted LAB | Full Worker payload | UI checks |
|
||
| --- | ---: | --- |
|
||
| TRAVEL TGS | 424,391,097 bytes | Download button, eye, 3D playback, pause, seek to 405 s |
|
||
| DDRNet-39 / GOOSE | 425,917,464 bytes | Cold eye, camera/segmentation, playback, pause, seek to 700 s |
|
||
| Combined LAB | 488,555,813 bytes | Cold eye, synchronized camera/segmentation/boxes and 3D, pause, seek to 405/60 s |
|
||
|
||
All three payload SHA-256 values matched the accepted originals. Total full RRD
|
||
payload: 1,338,864,374 bytes; this is verified file content, not a measured network
|
||
traffic total or an LTE speed measurement. Warm reopening did not rewrite payloads.
|
||
The original three files/sidecars, index and pinned composition stayed byte-identical
|
||
with unchanged mtimes. Normal service configuration was restored, the three rows
|
||
and pin were checked in the UI, and only owned temporary test copies were removed.
|
||
|
||
The repair adds immutable complete RRD publication on Worker and an authenticated
|
||
Core restore reader, using the existing LAB gateway binding. Length, generation,
|
||
ETag and SHA-256 are validated before atomic cache registration. A bounded transient
|
||
read retry uses Range/If-Range. Wrong-generation/corrupt/unavailable published
|
||
products fail visibly; only an absent publication (404) retains legacy assembly.
|
||
Full-LAB deletion now inventories the publication, including composition ownership,
|
||
while retaining shared jobs and source recordings. No live LAB was deleted to test it.
|
||
|
||
The current three products were backfilled unchanged; no inference reran. Future
|
||
producer completion still needs to invoke the publication API. This acceptance
|
||
therefore does not establish a clean-machine install, automatic publication for
|
||
all future models, or a universal remote-only resolver. 41 selected Python tests
|
||
passed; new files passed Ruff. No frontend code changed.
|
||
|
||
Local evidence (not public Git payload):
|
||
`outputs/lab-cold-replay-20261110/REPORT.md`, `cold-start.json`, `cold-files.json`,
|
||
`preservation.json`, `local-closeout.json`, `deployment-closeout.json` and
|
||
`combined-playback.jpg`. Source modules:
|
||
`laboratory/replay_publication.py`, `laboratory/replay_restore.py`,
|
||
`web/worker_ready_replays.py` under `src/k1link`.
|