mesh: un-rest idss-mesh-self-admit — the gateway joins its OWN plane with a key from the #973 issuer, so the wt0 takeover path exists (ADR 0214 d.5 as ruled; #996's missing half) #998

Closed
opened 2026-08-29 20:28:41 +00:00 by ben · 2 comments
Owner

Parent

ADR 0214 decision 5 (Ben ruled A) · the named residue of #973 ("#964's self-admit oneshot un-rests") that #964 shipped resting and #996 explicitly did not decide. Blocks #854: the member-device takeover SSHes to the device's wt0 address (ADR 0209/0210), and with no gateway peer that path is unreachable by construction — #996's preflight now makes it fail in seconds instead of 21 minutes, but nothing makes it succeed.

What to build

The gateway actually joins its own mesh plane at deploy. Everything it needs now exists on main:

  • the plane runs (#961), the front door routes it (#962),
  • the control plane is the plane's own issuer (#973: gateway-local JWKS, clan-var signing key, productionMeshMinter mints setup keys with a self-issued JWT),
  • the idss-mesh-self-admit oneshot structure ships but rests honestly waiting for a token source that has since landed.

Un-rest it: the oneshot obtains a setup key through the same issuer+management API the MeshMinter uses (gateway-local, no PAT), runs netbird up for the gateway's own client, and is idempotent/Restart=on-failure per #964's structure. No new decision is required — this is executing ADR 0214 d.5 as ruled.

Acceptance

  • On a fresh founding, after management + the identity provider are up, the gateway's netbird client is connected with a wt0 address (netbird status on the box); re-running the oneshot is a no-op.
  • The oneshot's token comes from the #973 issuer path (same audience/keys as the minter) — no second credential class, no PAT.
  • Rests loud (ADR 0100) only when the plane or issuer is genuinely absent; never a perpetually-failing unit.
  • Offline: render/eval-smoke assertions that the unit's script requests the key via the issuer and guards idempotently; adapter test with an httptest management for the mint call.
  • Live (rides the standing drive, may be named residue if the sandbox cannot): phase-5 deploy-takeover reaches the device over wt0 — #996's FailUnreachable stops firing.

Out of scope

  • A LAN/public fallback for the takeover path (the ADR 0210 "mesh-only vs fallback" question #996 flagged) — with the gateway peered, the ruled mesh path works and no fallback decision is needed for #854.
## Parent ADR 0214 decision 5 (Ben ruled A) · the named residue of #973 ("#964's self-admit oneshot un-rests") that #964 shipped resting and #996 explicitly did not decide. Blocks #854: the member-device takeover SSHes to the device's `wt0` address (ADR 0209/0210), and with no gateway peer that path is **unreachable by construction** — #996's preflight now makes it fail in seconds instead of 21 minutes, but nothing makes it succeed. ## What to build The gateway actually joins its own mesh plane at deploy. Everything it needs now exists on main: - the plane runs (#961), the front door routes it (#962), - the control plane is the plane's own issuer (#973: gateway-local JWKS, clan-var signing key, `productionMeshMinter` mints setup keys with a self-issued JWT), - the `idss-mesh-self-admit` oneshot structure ships but **rests honestly** waiting for a token source that has since landed. Un-rest it: the oneshot obtains a setup key through the same issuer+management API the `MeshMinter` uses (gateway-local, no PAT), runs `netbird up` for the gateway's own client, and is idempotent/`Restart=on-failure` per #964's structure. No new decision is required — this is executing ADR 0214 d.5 as ruled. ## Acceptance - [ ] On a fresh founding, after management + the identity provider are up, the gateway's netbird client is connected with a `wt0` address (`netbird status` on the box); re-running the oneshot is a no-op. - [ ] The oneshot's token comes from the #973 issuer path (same audience/keys as the minter) — no second credential class, no PAT. - [ ] Rests loud (ADR 0100) only when the plane or issuer is genuinely absent; never a perpetually-failing unit. - [ ] Offline: render/eval-smoke assertions that the unit's script requests the key via the issuer and guards idempotently; adapter test with an httptest management for the mint call. - [ ] Live (rides the standing drive, may be named residue if the sandbox cannot): phase-5 `deploy-takeover` reaches the device over `wt0` — #996's `FailUnreachable` stops firing. ## Out of scope - A LAN/public fallback for the takeover path (the ADR 0210 "mesh-only vs fallback" question #996 flagged) — with the gateway peered, the ruled mesh path works and no fallback decision is needed for #854.

swarm-claim host=elitebook-distributed-server-03 run=14061
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=14061 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #998 — status success

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

envelope
{
  "issue": 998,
  "status": "success",
  "commits": [
    "4257240"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/mesh_self_admit.go",
    "control-plane/cmd/control-plane/mesh_self_admit_test.go",
    "docs/adr/0159-mesh-bound-services-order-against-the-mesh.md",
    "internal/clan/netbird.go",
    "internal/clan/netbird_test.go",
    "internal/enroll/mesh_minter.go",
    "internal/enroll/mesh_minter_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/clan/ ./internal/enroll/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "pre-push gate: nix develop .#go-ci go seam stages (full suite + lint)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "On a fresh founding, after management + the identity provider are up, the gateway's netbird client is connected with a wt0 address; re-running the oneshot is a no-op": "Render (internal/clan/netbird.go meshSelfAdmitOneshot): oneshot ordered after netbird-management + the IdP + idss-control-plane, mints then `netbird up`; idempotency `netbird status` 'Management: Connected' skip retained (asserted by TestNetbird_SelfAdmitOneshotStructure). Live wt0 connection rides the standing phase-5 drive (named residue).",
    "The oneshot's token comes from the #973 issuer path (same audience/keys as the minter) — no second credential class, no PAT": "enroll.NetbirdMinter.MintSelf reuses the exact Mint path (self-minted RS256 service JWT signed with IDSS_MESH_SIGNING_KEY_FILE, the netbird-api-signing-key clan var); TestNetbirdMinter_MintSelfMintsGatewayKey asserts the JWKS-verifiable Bearer via validateServiceToken; the oneshot exports the same signing-key clan var path.",
    "Rests loud (ADR 0100) only when the plane or issuer is genuinely absent; never a perpetually-failing unit": "control-plane mesh-self-admit exits 1 (logged to stderr) when the signing key is absent or the mint fails; under `set -e` the oneshot's Restart=on-failure/startLimitIntervalSec=0 retries until the plane is ready. TestRunMeshSelfAdmit_NoKeyFailsLoud + TestNetbirdMinter_MintSelfMissingKeyFailsLoud.",
    "Offline: render/eval-smoke assertions that the unit's script requests the key via the issuer and guards idempotently; adapter test with an httptest management for the mint call": "TestNetbird_SelfAdmitMintsAndJoins asserts the IDSS_MESH_SIGNING_KEY_FILE export + control-plane mesh-self-admit mint + `netbird up`; TestNetbird_SelfAdmitOneshotStructure asserts the idempotency skip; TestNetbirdMinter_MintSelfMintsGatewayKey + TestRunMeshSelfAdmit_PrintsMintedKey drive an httptest management for the mint. internal/clan eval smoke evaluates the composed gateway (go test ./internal/clan/ green).",
    "Live (rides the standing drive, may be named residue if the sandbox cannot): phase-5 deploy-takeover reaches the device over wt0 — #996's FailUnreachable stops firing": "Named residue: the sandbox cannot drive live founding; the wt0 join proof rides the standing phase-5 drive. Documented in STATUS.md header and ADR 0159 note."
  },
  "summary": "Un-rested idss-mesh-self-admit so the gateway mints its own setup key through the #973 control-plane issuer and joins its own mesh plane at deploy, giving #854's wt0 takeover door a peer by construction.",
  "blockers": []
}
**close-report** for #998 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 998, "status": "success", "commits": [ "4257240" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/mesh_self_admit.go", "control-plane/cmd/control-plane/mesh_self_admit_test.go", "docs/adr/0159-mesh-bound-services-order-against-the-mesh.md", "internal/clan/netbird.go", "internal/clan/netbird_test.go", "internal/enroll/mesh_minter.go", "internal/enroll/mesh_minter_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/clan/ ./internal/enroll/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "pre-push gate: nix develop .#go-ci go seam stages (full suite + lint)", "exit_code": 0 } ], "criteria": { "On a fresh founding, after management + the identity provider are up, the gateway's netbird client is connected with a wt0 address; re-running the oneshot is a no-op": "Render (internal/clan/netbird.go meshSelfAdmitOneshot): oneshot ordered after netbird-management + the IdP + idss-control-plane, mints then `netbird up`; idempotency `netbird status` 'Management: Connected' skip retained (asserted by TestNetbird_SelfAdmitOneshotStructure). Live wt0 connection rides the standing phase-5 drive (named residue).", "The oneshot's token comes from the #973 issuer path (same audience/keys as the minter) — no second credential class, no PAT": "enroll.NetbirdMinter.MintSelf reuses the exact Mint path (self-minted RS256 service JWT signed with IDSS_MESH_SIGNING_KEY_FILE, the netbird-api-signing-key clan var); TestNetbirdMinter_MintSelfMintsGatewayKey asserts the JWKS-verifiable Bearer via validateServiceToken; the oneshot exports the same signing-key clan var path.", "Rests loud (ADR 0100) only when the plane or issuer is genuinely absent; never a perpetually-failing unit": "control-plane mesh-self-admit exits 1 (logged to stderr) when the signing key is absent or the mint fails; under `set -e` the oneshot's Restart=on-failure/startLimitIntervalSec=0 retries until the plane is ready. TestRunMeshSelfAdmit_NoKeyFailsLoud + TestNetbirdMinter_MintSelfMissingKeyFailsLoud.", "Offline: render/eval-smoke assertions that the unit's script requests the key via the issuer and guards idempotently; adapter test with an httptest management for the mint call": "TestNetbird_SelfAdmitMintsAndJoins asserts the IDSS_MESH_SIGNING_KEY_FILE export + control-plane mesh-self-admit mint + `netbird up`; TestNetbird_SelfAdmitOneshotStructure asserts the idempotency skip; TestNetbirdMinter_MintSelfMintsGatewayKey + TestRunMeshSelfAdmit_PrintsMintedKey drive an httptest management for the mint. internal/clan eval smoke evaluates the composed gateway (go test ./internal/clan/ green).", "Live (rides the standing drive, may be named residue if the sandbox cannot): phase-5 deploy-takeover reaches the device over wt0 — #996's FailUnreachable stops firing": "Named residue: the sandbox cannot drive live founding; the wt0 join proof rides the standing phase-5 drive. Documented in STATUS.md header and ADR 0159 note." }, "summary": "Un-rested idss-mesh-self-admit so the gateway mints its own setup key through the #973 control-plane issuer and joins its own mesh plane at deploy, giving #854's wt0 takeover door a peer by construction.", "blockers": [] } ``` </details>
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.

Reference
Matou/idss#998
No description provided.