connect-before-check: a service device (helper) is held to the GATEWAY's "Visitors can reach it" check — a fail blocks a machine nobody on the internet ever dials (DDR 0240 decision 4) #1586

Closed
opened 2026-09-18 15:56:41 +00:00 by ben · 2 comments
Owner

What is wrong

CheckDevice (internal/founding/connectcheck.go:266) runs the same four pre-checks on every device, and "Visitors can reach it" is one a fail on which blocks. But inbound 80/443 from the internet is the gateway's job — it is the front door. A service device (helper role) is reached over the mesh, by the gateway; nobody on the internet ever dials it. A perfectly good helper on a home network is therefore blocked from carrying services for a requirement it does not have — or, when it reported no address, waved through on a "couldn't check" warn that means nothing for its role.

The check set never looks at the role: deviceFloor(device) picks the helper floor for memory/disk, but the visitors probe runs unconditionally.

This is a design-level drift, not just code: DDR 0240 decision 4 lists one check set, decision 7 rules "one step wherever a device is chosen", and the wireframe docs/ux/wireframes/p2-device-add-cli/p2-s1c-connect-and-check.html:50 draws data-check="visitors" for an added machine. The same set is mirrored in the control panel's device-add dialog (internal/controlapi/enroll_connect.go, dashboard/src/components/device-add/ConnectScreen.vue), where every device added is a helper or member device, never the gateway.

What a helper actually needs

That the gateway can reach it over the mesh and that it can reach the gateway — which the connect leg itself already demonstrates on a dial-in (the machine called in), and which enrollment proves for real when the mesh comes up.

Proposed default ruling (two-way door, ADR 0174)

Amend DDR 0240 decision 4: the visitors check belongs to the gateway only. For an added machine the check set is: the machine answers / enough memory / enough disk. "One step, one form" (decision 7) stands — it is the same step with the role's own checks, exactly as the floors are already the role's own.

Acceptance criteria

  1. DDR 0240 amended (decision 4 + consequences) recording the ruling; p2-s1c-connect-and-check.html and founding's Add-a-device wireframe drop the visitors row for an added machine.
  2. CheckDevice with a non-empty device runs no outside-in probe and returns no visitors check; the gateway's set is unchanged.
  3. The control-panel connect seam and ConnectScreen.vue match; the dashboard fake and deviceAddConnect.test.ts follow.
  4. Test: a helper with a private/CGNAT address passes its pre-checks; the reachability fake records no probe for it.

Why session, not swarm

A DDR amendment and wireframe edits are design-tier work (ready-for-session).

## What is wrong `CheckDevice` (`internal/founding/connectcheck.go:266`) runs the same four pre-checks on every device, and "Visitors can reach it" is one a **fail** on which blocks. But inbound 80/443 from the internet is the **gateway's** job — it is the front door. A service device (helper role) is reached over the mesh, by the gateway; nobody on the internet ever dials it. A perfectly good helper on a home network is therefore blocked from carrying services for a requirement it does not have — or, when it reported no address, waved through on a "couldn't check" warn that means nothing for its role. The check set never looks at the role: `deviceFloor(device)` picks the helper floor for memory/disk, but the visitors probe runs unconditionally. This is a **design-level** drift, not just code: DDR 0240 decision 4 lists one check set, decision 7 rules "one step wherever a device is chosen", and the wireframe `docs/ux/wireframes/p2-device-add-cli/p2-s1c-connect-and-check.html:50` draws `data-check="visitors"` for an added machine. The same set is mirrored in the control panel's device-add dialog (`internal/controlapi/enroll_connect.go`, `dashboard/src/components/device-add/ConnectScreen.vue`), where **every** device added is a helper or member device, never the gateway. ## What a helper actually needs That the gateway can reach it over the mesh and that it can reach the gateway — which the connect leg itself already demonstrates on a dial-in (the machine called in), and which enrollment proves for real when the mesh comes up. ## Proposed default ruling (two-way door, ADR 0174) Amend DDR 0240 decision 4: **the visitors check belongs to the gateway only.** For an added machine the check set is: the machine answers / enough memory / enough disk. "One step, one form" (decision 7) stands — it is the same step with the role's own checks, exactly as the floors are already the role's own. ## Acceptance criteria 1. DDR 0240 amended (decision 4 + consequences) recording the ruling; `p2-s1c-connect-and-check.html` and founding's Add-a-device wireframe drop the visitors row for an added machine. 2. `CheckDevice` with a non-empty `device` runs no outside-in probe and returns no `visitors` check; the gateway's set is unchanged. 3. The control-panel connect seam and `ConnectScreen.vue` match; the dashboard fake and `deviceAddConnect.test.ts` follow. 4. Test: a helper with a private/CGNAT address passes its pre-checks; the reachability fake records **no** probe for it. ## Why session, not swarm A DDR amendment and wireframe edits are design-tier work (`ready-for-session`).
Author
Owner

Siblings from the same review (2026-09-18): #1585 (the check probes the private NIC address) and #1587 (the probe's vantage is the operator's own computer).

Siblings from the same review (2026-09-18): #1585 (the check probes the private NIC address) and #1587 (the probe's vantage is the operator's own computer).

Close-report — landed, seam-proven (Ruled by agent under ADR 0174 — veto anytime).

The visitors check now belongs to the gateway only. Inbound 80/443 from the internet is the gateway's job (the front door); a service device (helper role) is reached over the mesh, by the gateway — nobody on the internet ever dials it — so holding a helper to a CGNAT/reachability requirement was the defect.

What landed (commit 065fe5e6):

  • AC1 — DDR + wireframes. DDR 0240 decision 4 amended (+ a consequences bullet, + a status-header amendment note): the check set is the role's own, exactly as deviceFloor already picks the helper floor. p2-s1c-connect-and-check.html drops the visitors row — this is the shared added-machine step founding's Add-a-device dialog uses (DDR 0240 decision 7, "one step, one form"), so the drop covers both surfaces; the gateway's own step p1-s4d-connect-the-gateway.html keeps the row.
  • AC2 — founding.CheckDevice. With a non-empty device it runs no outside-in probe and returns no visitors check (set = answers · memory · disk). The gateway's set (device == "") is byte-for-byte unchanged (answers · visitors · memory · disk).
  • AC3 — seam + UI. The control-panel projection (internal/controlapi/enroll_connect.go) and both renderers (ConnectScreen.vue, FoundingConnectDevice.vue) already draw whatever set the connector returns — they follow with no code change. The dashboard fake (tests/fakes/deviceAdd.ts) + deviceAddConnect.test.ts mirror the role-aware set, and the checkDevice seam doc (src/lib/deviceAdd.ts) records it.
  • AC4 — test. New TestHandle_CheckDevice_HelperSkipsVisitorsProbe: a helper dials in from a private/CGNAT address (192.168.1.50/24), passes its pre-checks, carries no visitors check, and the reachability fake records zero probes for it. The gateway's TestHandle_CheckDevice_MeasuresConnectedDevice (probe runs, CGNAT blocks) is held unchanged. New dashboard test proves a named helper carries no visitors row even with cgnat set.

Proof: go build ./..., go vet ./internal/founding, gofmt clean; full go test ./internal/founding ./internal/controlapi (uncached) green; full dashboard vitest 1706 passed; vue-tsc + eslint green (the push pre-hook ran eslint . and passed).

Two-way door: revertible code + a DDR amendment, proven by tests — no one-way residue. advances #1586.

**Close-report — landed, seam-proven (Ruled by agent under ADR 0174 — veto anytime).** The visitors check now belongs to the **gateway only**. Inbound 80/443 from the internet is the gateway's job (the front door); a service device (helper role) is reached over the mesh, by the gateway — nobody on the internet ever dials it — so holding a helper to a CGNAT/reachability requirement was the defect. **What landed** (commit `065fe5e6`): - **AC1 — DDR + wireframes.** DDR 0240 decision 4 amended (+ a consequences bullet, + a status-header amendment note): the check set is the *role's* own, exactly as `deviceFloor` already picks the helper floor. `p2-s1c-connect-and-check.html` drops the `visitors` row — this is the **shared** added-machine step founding's Add-a-device dialog uses (DDR 0240 decision 7, "one step, one form"), so the drop covers both surfaces; the gateway's own step `p1-s4d-connect-the-gateway.html` **keeps** the row. - **AC2 — `founding.CheckDevice`.** With a non-empty `device` it runs **no** outside-in probe and returns **no** `visitors` check (set = *answers · memory · disk*). The gateway's set (`device == ""`) is byte-for-byte unchanged (*answers · visitors · memory · disk*). - **AC3 — seam + UI.** The control-panel projection (`internal/controlapi/enroll_connect.go`) and both renderers (`ConnectScreen.vue`, `FoundingConnectDevice.vue`) already draw whatever set the connector returns — they follow with **no code change**. The dashboard fake (`tests/fakes/deviceAdd.ts`) + `deviceAddConnect.test.ts` mirror the role-aware set, and the `checkDevice` seam doc (`src/lib/deviceAdd.ts`) records it. - **AC4 — test.** New `TestHandle_CheckDevice_HelperSkipsVisitorsProbe`: a helper dials in from a private/CGNAT address (`192.168.1.50/24`), **passes** its pre-checks, carries **no** `visitors` check, and the reachability fake records **zero** probes for it. The gateway's `TestHandle_CheckDevice_MeasuresConnectedDevice` (probe runs, CGNAT blocks) is held unchanged. New dashboard test proves a named helper carries no `visitors` row even with `cgnat` set. **Proof:** `go build ./...`, `go vet ./internal/founding`, gofmt clean; full `go test ./internal/founding ./internal/controlapi` (uncached) green; full dashboard vitest **1706 passed**; `vue-tsc` + `eslint` green (the push pre-hook ran `eslint .` and passed). **Two-way door:** revertible code + a DDR amendment, proven by tests — no one-way residue. advances #1586.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1586
No description provided.