device-add: the gateway peers its own mesh plane at first deploy, and every wt0-binding unit orders on the mesh (ADR 0214 d.5, makes ADR 0159 true) #964
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Depends on
Reference
Matou/idss#964
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Spec #960 (child of device-add spec #13) · ADR 0214 · surfaced by #956 (Ben ruled BUILD). Glossary: mesh plane, setup key (CONTEXT.md).
What to build
A fresh gateway joins its own mesh: the render declares the Netbird client (
wt0, 51820) pointed at its plane, and a oneshot runs after management and the identity provider are up, mints one setup key through the same API and token as Approve, and brings the peer up — idempotent when already connected, retrying on failure with no start limit. In the same change every unit that bindswt0(code, docs-editing, files, the control plane) declaresafter/wantson the mesh client through one shared render helper, so a reboot never races the mesh.Acceptance criteria
wt0/51820 with management URL = the gateway's own plane, gated onMesh.idss-mesh-self-admitoneshot ordered after management + the carrier's identity provider (kanidm or idss-idp); skips whennetbird statusreports connected;Restart=on-failure,startLimitIntervalSec = 0.meshBound()render helper exists and is applied to every unit bindingwt0; the eval smoke / render tests assert theafter/wantson each.rehearsal-d: after a deploy the gateway has awt0address innetbird status; after a reboot the mesh-bound units come up without a start-limit hit (journal shows nostart-limit-hit).go build/vet/lint/tests green; STATUS updated; ADR 0159 marked satisfied in its consequences.Blocked by
Task manifest
netbird uprejectsmesh.internaland no device can land #956Blocked — needs a human scoping/sequencing decision (asked on Mattermost, no reply in 20 min)
The self-admit oneshot (ADR 0214 decision 5) must "mint one setup key through the same API and token as Approve". Approve's token source is decision 4 — the
MeshMinterpresenting a Netbird service-user PAT toPOST http://localhost:8011/api/setup-keys(the V1 fallback #961 recorded, since neither carrier issues a non-interactive client-credentials token — a deterministic property of kanidm + the idss-idp bridge).That token infrastructure is #963 (
mesh-minter-at-approve), which is OPEN / not landed:MeshMinterport, noErrNoMeshPlane, noPOST /api/setup-keyswiring anywhere in the tree.enroll.MeshAdmissionForstill hands placeholder material (randBytes(32),mesh.internal); the gateway role gets the zero value (#907 — "founds the mesh at its own deploy", which is this ticket).services.netbird.tunnels.*+services.netbird.server) has no declarative account/setup-key bootstrap — minting strictly requires an authenticated API call with a token only #963 provides.So the gateway cannot self-peer (no
wt0address) until #963 lands → AC2 (the oneshot minting + bringing the peer up) and AC4 (livewt0address on rehearsal-d) are unmeetable this iteration.But the DAG (
docs/slices/device-add.yaml) listsmesh-gateway-self-peer-orderingdepends_on: [mesh-plane-render]ONLY — it omits the #963 edge. Since that ordering looks deliberate, I did not want to unilaterally override it.The decision needed (pick one, then re-arm
ready-for-agent):wt0/51820 pointed at the gateway's own plane (AC1) — pure render, no token;meshBound()ordering helper (after/wantsnetbird-mesh— reallynetbird-wt0.serviceon this pin) on the 4 wt0-binding units (code / docs-editing / files / control plane) with eval-smoke assertions (AC3 — the ADR 0159 render-level rule, which needs no token);idss-mesh-self-admitoneshot structure (ordering after management + IdP,netbird statusidempotency skip,Restart=on-failure,startLimitIntervalSec=0) written to rest honestly (ADR 0100) until #963's token exists, so no perpetually-failing unit lands on the fleet.nix evalsmoke. Reversible. Does not prove: AC2/AC4 live (gated on #963).depends_on: mesh-minter-at-approveedge, and land the self-peer whole once the token source exists. Cleaner (no half across the #963 seam), but the ordering contract (AC3) waits on the minter.There is also an unresolved token-bootstrap question #963 must answer regardless: how the first Netbird PAT is obtained non-interactively on a fresh single-account plane when neither carrier issues a service token (the spike's "named impedance"). That is #963's to solve, not this ticket's — flagging it so it isn't lost.
Why human
A deliberate DAG-ordering choice (#964 decoupled from #963) collides with a hard token dependency; whether to ship the reversible render-only half now or re-sequence #964 behind #963 is a scoping call I should not make unilaterally. No revertible test can prove AC2/AC4 this iteration, so it is not an ADR-0174 two-way door I can rule.
netbird uprejectsmesh.internaland no device can land #956Ruled (A) — ship the render-only half now (session, ADR 0174 two-way door: pure render, revertible, eval-smoke-provable). Since you asked, #963 has landed (
353ec1c6), but the token it needs is still unprovisioned — that bootstrap hole is now #973 (ready-for-human, recommendation A: the control plane is the plane's own issuer). So:wt0/51820 at the gateway's own plane), AC3 (meshBound()on the fourwt0units + eval-smoke assertions — the ADR 0159 rule), and theidss-mesh-self-admitoneshot structure resting honestly (ADR 0100) untilIDSS_MESH_TOKEN_FILEexists — never a perpetually-failing unit on the fleet.wt0address on rehearsal-d) move to #973's acceptance; name them as residue in your close comment.mesh-gateway-self-peer-orderingnow alsodepends_on: mesh-minter-at-approve(yaml fixed on main).Re-armed
ready-for-agent.swarm-claim host=matou-dev-server-01 run=13650
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #964 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
enroll-activate, before founding has supplied it — every fresh own-VPS founding reds (drive20260831T042600Z, sig073c79de3e67) #1056