control panel: wire the four device-add CONNECT ops over control-plane HTTP — the deployed dialog connect stage is founding-stdio-only #1459

Closed
opened 2026-09-12 20:01:52 +00:00 by matou-build-agent · 3 comments

The gap

DDR 0240's connect-before-check stage works in the panel harness (#1415:
ConnectScreen.vue + DeviceAddSurface.vue + the four optional DeviceAddSource
ops connectDevice/offerDialIn/awaitDialIn/checkDevice, proven against
FakeDeviceAddSource). But it does not work on the deployed control panel,
because the four ops have no control-plane HTTP transport.

  • #1413 built the Go half only in the founding stdio bridge
    (internal/founding/stdio.go OpConnectDevice, internal/founding/connectcheck.go)
    — reachable by the packaged app's founding path over Electron IPC.
  • The deployed panel talks to the control plane over HTTP via the generated
    client. dashboard/src/lib/api/enrollClient.ts HttpDeviceAddClient implements
    only mintCode/revokeCode/watchCallIn + the broker ops
    placeOptions/serverOffer/rentServer (#1398). It has no
    connectDevice/offerDialIn/awaitDialIn/checkDevice.
  • internal/controlapi/enroll_rent.go serves /api/v1/enroll/places|server-offer|rent
    but no /enroll/connect|dial-in|check, and dashboard/src/lib/api/generated.ts
    carries no such methods.

Consequence: on the served dashboard DeviceAddSurface.hasConnect is false, so
own-vps / self-hosted skip the connect stage and fall through to mint-and-wait
(the intended graceful fallback — "a seam that cannot reach devices skips it").

What's needed

  1. Serve the four connect ops over control-plane HTTP (internal/controlapi/enroll_*.go),
    reusing the founding bridge's connectcheck.go logic where possible.
  2. Add them to the OpenAPI spec + generated.ts.
  3. Attach them on HttpDeviceAddClient, gated behind an /enroll/config capability
    flag mirroring has_broker (so an older gateway omits them and the dialog skips
    the stage — the existing path), with fake<->http parity.

Unblocks

  • #1452 — the standing device drive's live connect leg (journey.device.spec.ts).
    A sibling prerequisite for that live leg: the device-add live fixture
    app/tests/e2e/fixtures/deviceAdd.ts mintCliCode still drives the removed
    device-add-drill-in and must migrate to the new device-add-dialog flow
    (place -> form -> path-cli -> connect) before the connect leg can be driven live.

Filed by agent under ADR 0174 (follow-up from the #1452 session) — veto anytime.

## The gap DDR 0240's connect-before-check stage works in the **panel harness** (#1415: `ConnectScreen.vue` + `DeviceAddSurface.vue` + the four optional `DeviceAddSource` ops `connectDevice`/`offerDialIn`/`awaitDialIn`/`checkDevice`, proven against `FakeDeviceAddSource`). But it does **not** work on the **deployed control panel**, because the four ops have no control-plane HTTP transport. - #1413 built the Go half only in the **founding stdio bridge** (`internal/founding/stdio.go` `OpConnectDevice`, `internal/founding/connectcheck.go`) — reachable by the packaged app's *founding* path over Electron IPC. - The deployed panel talks to the control plane over **HTTP** via the generated client. `dashboard/src/lib/api/enrollClient.ts` `HttpDeviceAddClient` implements only `mintCode`/`revokeCode`/`watchCallIn` + the broker ops `placeOptions`/`serverOffer`/`rentServer` (#1398). It has **no** `connectDevice`/`offerDialIn`/`awaitDialIn`/`checkDevice`. - `internal/controlapi/enroll_rent.go` serves `/api/v1/enroll/places|server-offer|rent` but no `/enroll/connect|dial-in|check`, and `dashboard/src/lib/api/generated.ts` carries no such methods. Consequence: on the served dashboard `DeviceAddSurface.hasConnect` is `false`, so own-vps / self-hosted **skip the connect stage** and fall through to mint-and-wait (the intended graceful fallback — "a seam that cannot reach devices skips it"). ## What's needed 1. Serve the four connect ops over control-plane HTTP (`internal/controlapi/enroll_*.go`), reusing the founding bridge's `connectcheck.go` logic where possible. 2. Add them to the OpenAPI spec + `generated.ts`. 3. Attach them on `HttpDeviceAddClient`, gated behind an `/enroll/config` capability flag mirroring `has_broker` (so an older gateway omits them and the dialog skips the stage — the existing path), with fake<->http parity. ## Unblocks - **#1452** — the standing device drive's live connect leg (`journey.device.spec.ts`). A sibling prerequisite for that live leg: the device-add live fixture `app/tests/e2e/fixtures/deviceAdd.ts` `mintCliCode` still drives the **removed** `device-add-drill-in` and must migrate to the new `device-add-dialog` flow (place -> form -> path-cli -> connect) before the connect leg can be driven live. Filed by agent under ADR 0174 (follow-up from the #1452 session) — veto anytime.
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: ready-for-agent (category enhancement kept).

Triage checks.

  • Redundancy: the four connect ops have no control-plane HTTP transport today — HttpDeviceAddClient (dashboard/src/lib/api/enrollClient.ts) implements only mintCode/revokeCode/watchCallIn + the broker ops, and internal/controlapi/enroll_rent.go serves /enroll/places|server-offer|rent but no connect|dial-in|check. Confirmed the gap; not already implemented.
  • Design gate: the design contract is complete — wireframe docs/ux/wireframes/p2-device-add-cli/p2-s1c-connect-and-check.html exists, ConnectScreen.vue + DeviceAddSurface.vue + the four optional DeviceAddSource ops shipped in #1415, and internal/founding/connectcheck.go holds the reusable Go logic (#1413). Nothing to design → not needs-design.
  • Human gate: no needs_human_decision residue. Adding an HTTP transport that mirrors the founding-stdio bridge and gates behind an /enroll/config capability flag (like has_broker, #1398) is additive and does not widen the security posture — an older gateway omits the ops and the dialog keeps its existing skip-the-stage fallback.

Why a two-way door: a label change plus additive routes/client methods gated behind a capability flag, revertible by commit with zero product loss (fallback is the current shipped behaviour).

What proves it: fake↔http parity on the four ops, a controlapi integration test over the real routes, and openapi check:client in sync — the same proof shape #1398/#1431 used for the sibling enroll ops.

Note for the implementer: the live fixture migration named under Unblocks (app/tests/e2e/fixtures/deviceAdd.ts mintCliCode → the device-add-dialog flow) is a prerequisite for #1452's live leg, not for the transport work here.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** **Ruling:** `ready-for-agent` (category `enhancement` kept). **Triage checks.** - *Redundancy:* the four connect ops have no control-plane HTTP transport today — `HttpDeviceAddClient` (`dashboard/src/lib/api/enrollClient.ts`) implements only `mintCode`/`revokeCode`/`watchCallIn` + the broker ops, and `internal/controlapi/enroll_rent.go` serves `/enroll/places|server-offer|rent` but no `connect|dial-in|check`. Confirmed the gap; not already implemented. - *Design gate:* the design contract is complete — wireframe `docs/ux/wireframes/p2-device-add-cli/p2-s1c-connect-and-check.html` exists, `ConnectScreen.vue` + `DeviceAddSurface.vue` + the four optional `DeviceAddSource` ops shipped in #1415, and `internal/founding/connectcheck.go` holds the reusable Go logic (#1413). Nothing to design → not `needs-design`. - *Human gate:* no `needs_human_decision` residue. Adding an HTTP transport that mirrors the founding-stdio bridge and gates behind an `/enroll/config` capability flag (like `has_broker`, #1398) is additive and does not widen the security posture — an older gateway omits the ops and the dialog keeps its existing skip-the-stage fallback. **Why a two-way door:** a label change plus additive routes/client methods gated behind a capability flag, revertible by commit with zero product loss (fallback is the current shipped behaviour). **What proves it:** fake↔http parity on the four ops, a controlapi integration test over the real routes, and openapi `check:client` in sync — the same proof shape #1398/#1431 used for the sibling enroll ops. Note for the implementer: the live fixture migration named under *Unblocks* (`app/tests/e2e/fixtures/deviceAdd.ts` `mintCliCode` → the `device-add-dialog` flow) is a prerequisite for #1452's live leg, not for the transport work here.
Author
Member

swarm-claim host=matou-dev-server-01 run=22605
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=22605 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1459 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1459,
  "status": "success",
  "commits": [
    "7a7896ba"
  ],
  "changed_files": [
    "STATUS.md",
    "dashboard/src/lib/api/enrollClient.ts",
    "dashboard/src/lib/api/generated.ts",
    "dashboard/tests/unit/enrollLive.test.ts",
    "internal/controlapi/enroll.go",
    "internal/controlapi/enroll_connect.go",
    "internal/controlapi/enroll_connect_integration_test.go",
    "packages/openapi-spec/openapi.yaml"
  ],
  "tests": [
    {
      "command": "go test ./internal/controlapi/",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/controlapi/",
      "exit_code": 0
    },
    {
      "command": "npx vitest run tests/unit/enrollLive.test.ts (dashboard)",
      "exit_code": 0
    },
    {
      "command": "npx vue-tsc -p tsconfig.json --noEmit (dashboard)",
      "exit_code": 0
    },
    {
      "command": "npx eslint src/lib/api/enrollClient.ts (dashboard)",
      "exit_code": 0
    },
    {
      "command": "node packages/openapi-spec/scripts/generate-client.mjs --check",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Serve the four connect ops over control-plane HTTP (internal/controlapi/enroll_*.go)": "internal/controlapi/enroll_connect.go — WithEnrollDeviceConnect serves POST /enroll/connect, /enroll/dial-in, /enroll/dial-in/await, /enroll/check over the EnrollDeviceConnector seam; proven by enroll_connect_integration_test.go over the four real routes",
    "Add them to the OpenAPI spec + generated.ts": "packages/openapi-spec/openapi.yaml adds the four paths, request-body + response schemas, and has_connect; dashboard/src/lib/api/generated.ts regenerated with the four postEnroll* ops; check:client in sync (exit 0)",
    "Attach them on HttpDeviceAddClient gated behind an /enroll/config capability flag mirroring has_broker, with fake<->http parity": "dashboard/src/lib/api/enrollClient.ts — EnrollConfigView.hasConnect + attachConnectOps() attach connectDevice/offerDialIn/awaitDialIn/checkDevice in loadConfig only when has_connect; enrollLive.test.ts proves attach-when-true, skip-when-false/absent, snake-in/camel-out, and refused-dial-out resolves ok:false",
    "Refused dial-out carries a remedy and the dial-in door, not a thrown error (DDR 0240 decision 3)": "ConnectResult ok:false path in enroll_connect.go (200) proven by TestEnrollConnect_RefusedDialOutCarriesDialIn and the enrollLive.test.ts refused-dial-out case",
    "Graceful fallback preserved when no connector (has_connect false in production)": "EnrollConfig.has_connect defaults false; enrollConfigFrom unchanged; the surface's hasConnect gate reads false so the dialog skips the stage"
  },
  "summary": "The device-add dialog's four CONNECT ops (DDR 0240) get their control-plane HTTP transport — served over a new EnrollDeviceConnector seam, gated behind an /enroll/config has_connect flag, with fake<->http parity — so the deployed panel no longer skips the connect stage once a connector is composed.",
  "reason": "Adds the missing HTTP transport for the four connect ops; the production connector composes later (like the broker's #1400), so has_connect stays false and the current skip-the-stage fallback is preserved.",
  "blockers": []
}
**close-report** for #1459 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1459, "status": "success", "commits": [ "7a7896ba" ], "changed_files": [ "STATUS.md", "dashboard/src/lib/api/enrollClient.ts", "dashboard/src/lib/api/generated.ts", "dashboard/tests/unit/enrollLive.test.ts", "internal/controlapi/enroll.go", "internal/controlapi/enroll_connect.go", "internal/controlapi/enroll_connect_integration_test.go", "packages/openapi-spec/openapi.yaml" ], "tests": [ { "command": "go test ./internal/controlapi/", "exit_code": 0 }, { "command": "go vet ./internal/controlapi/", "exit_code": 0 }, { "command": "npx vitest run tests/unit/enrollLive.test.ts (dashboard)", "exit_code": 0 }, { "command": "npx vue-tsc -p tsconfig.json --noEmit (dashboard)", "exit_code": 0 }, { "command": "npx eslint src/lib/api/enrollClient.ts (dashboard)", "exit_code": 0 }, { "command": "node packages/openapi-spec/scripts/generate-client.mjs --check", "exit_code": 0 } ], "criteria": { "Serve the four connect ops over control-plane HTTP (internal/controlapi/enroll_*.go)": "internal/controlapi/enroll_connect.go — WithEnrollDeviceConnect serves POST /enroll/connect, /enroll/dial-in, /enroll/dial-in/await, /enroll/check over the EnrollDeviceConnector seam; proven by enroll_connect_integration_test.go over the four real routes", "Add them to the OpenAPI spec + generated.ts": "packages/openapi-spec/openapi.yaml adds the four paths, request-body + response schemas, and has_connect; dashboard/src/lib/api/generated.ts regenerated with the four postEnroll* ops; check:client in sync (exit 0)", "Attach them on HttpDeviceAddClient gated behind an /enroll/config capability flag mirroring has_broker, with fake<->http parity": "dashboard/src/lib/api/enrollClient.ts — EnrollConfigView.hasConnect + attachConnectOps() attach connectDevice/offerDialIn/awaitDialIn/checkDevice in loadConfig only when has_connect; enrollLive.test.ts proves attach-when-true, skip-when-false/absent, snake-in/camel-out, and refused-dial-out resolves ok:false", "Refused dial-out carries a remedy and the dial-in door, not a thrown error (DDR 0240 decision 3)": "ConnectResult ok:false path in enroll_connect.go (200) proven by TestEnrollConnect_RefusedDialOutCarriesDialIn and the enrollLive.test.ts refused-dial-out case", "Graceful fallback preserved when no connector (has_connect false in production)": "EnrollConfig.has_connect defaults false; enrollConfigFrom unchanged; the surface's hasConnect gate reads false so the dialog skips the stage" }, "summary": "The device-add dialog's four CONNECT ops (DDR 0240) get their control-plane HTTP transport — served over a new EnrollDeviceConnector seam, gated behind an /enroll/config has_connect flag, with fake<->http parity — so the deployed panel no longer skips the connect stage once a connector is composed.", "reason": "Adds the missing HTTP transport for the four connect ops; the production connector composes later (like the broker's #1400), so has_connect stays false and the current skip-the-stage fallback is preserved.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1459
No description provided.