front-door: gateway-attach — the provision-time step that wires front-door.nix into the gateway machine config #251

Closed
opened 2026-08-01 00:47:48 +00:00 by ben · 1 comment
Owner

Parent

Front-door epic #219 — the attach leg its landed code slice (27e08c0) exported but deliberately did not wire (#219 comment, 2026-07-31). Lineage: founding spec #11 (gateway role, ADR 0013) + members spec #19 (the gated door, ADRs 0074/0076), via #219.

What's true today

  • clan.RenderFrontDoor (internal/clan/frontdoor.go, landed 27e08c0) is a pure exported render: given the route set (slug → ruled host → mesh target → exempt paths) it emits the gateway's front-door.nix in the ADR 0102 templating layer, deterministic and seam-tested. Nothing calls it.
  • It was kept out of enrollment on purpose: routes come from the live service set and placement, not fresh-host facts (#219 comment, 2026-07-31).
  • The inputs all exist separately — the slug→URL authority (#218, ADR 0113), live placement in the control plane, each port's declared client-protocol exempt paths — but no provision-time step joins them into the render's route set or writes the result into a gateway machine dir.

What to build

The provision-time attach step: when the live service set or placement changes, assemble the route set (slug → ruled host from the #218 authority → mesh target from live placement → the port's exempt paths), call clan.RenderFrontDoor, and write front-door.nix into the gateway machine's config under the clan single-writer (ADR 0102). The module lands only in a gateway machine dir, preserving #219 AC-4 (a non-gateway node imports none of it).

Acceptance criteria

  • Given a provisioned service with a ruled hostname, When the attach step runs, Then the gateway machine config carries its host-matched route — reverse-proxied over the mesh (wt0) to its placed node, behind forward_auth naming its slug, exempt paths honoured
  • Given a service is unprovisioned or re-placed, When the attach step re-runs, Then the rendered routes follow the live set — no orphan route survives
  • Given a non-gateway machine, When the attach step runs, Then that machine's config gains nothing
  • Given the same live state twice, Then the attach is idempotent (byte-identical front-door.nix, no spurious single-writer churn)

Task manifest

task: front-door:gateway-attach
implements_seam: "the provision-time caller of clan.RenderFrontDoor — routes from the #218 slug→URL authority + live placement, written under the clan single-writer (ADR 0102)"
interface: "provisioning a service makes its front-door route real on the gateway"
seam: "attach-step tests over a fake live set + rendered-config assertions (the render itself is already seam-tested)"
acceptance:
  - given: a provisioned service and live placement; when: the attach step runs; then: the gateway machine config carries the host-matched forward_auth route and non-gateway machines gain nothing
depends_on: []
out_of_scope: [live wildcard cert issuance (sibling acme-dns-registration ticket), the live lab smoke (#183 leg B·3 arena), gateway re-homing flows]
needs_human_decision: []

Blocks

The live wildcard smoke proving #219 AC-1/AC-3 needs this and the sibling front-door: acme-dns-registration ticket; that smoke lives in the #183 leg B·3 arena — left unlinked from #183 for Ben to judge, per #219's own precedent.

## Parent Front-door epic #219 — the attach leg its landed code slice (`27e08c0`) exported but deliberately did not wire (#219 comment, 2026-07-31). Lineage: founding spec #11 (gateway role, ADR 0013) + members spec #19 (the gated door, ADRs 0074/0076), via #219. ## What's true today - `clan.RenderFrontDoor` (`internal/clan/frontdoor.go`, landed `27e08c0`) is a **pure exported render**: given the route set (slug → ruled host → mesh target → exempt paths) it emits the gateway's `front-door.nix` in the ADR 0102 templating layer, deterministic and seam-tested. **Nothing calls it.** - It was kept out of enrollment on purpose: routes come from the **live service set and placement**, not fresh-host facts (#219 comment, 2026-07-31). - The inputs all exist separately — the slug→URL authority (#218, ADR 0113), live placement in the control plane, each port's declared client-protocol exempt paths — but no provision-time step joins them into the render's route set or writes the result into a gateway machine dir. ## What to build The provision-time **attach step**: when the live service set or placement changes, assemble the route set (slug → ruled host from the #218 authority → mesh target from live placement → the port's exempt paths), call `clan.RenderFrontDoor`, and write `front-door.nix` into the **gateway machine's** config under the clan single-writer (ADR 0102). The module lands only in a gateway machine dir, preserving #219 AC-4 (a non-gateway node imports none of it). ## Acceptance criteria - [ ] Given a provisioned service with a ruled hostname, When the attach step runs, Then the gateway machine config carries its host-matched route — reverse-proxied over the mesh (`wt0`) to its placed node, behind `forward_auth` naming its slug, exempt paths honoured - [ ] Given a service is unprovisioned or re-placed, When the attach step re-runs, Then the rendered routes follow the live set — no orphan route survives - [ ] Given a non-gateway machine, When the attach step runs, Then that machine's config gains nothing - [ ] Given the same live state twice, Then the attach is idempotent (byte-identical `front-door.nix`, no spurious single-writer churn) ## Task manifest ```yaml task: front-door:gateway-attach implements_seam: "the provision-time caller of clan.RenderFrontDoor — routes from the #218 slug→URL authority + live placement, written under the clan single-writer (ADR 0102)" interface: "provisioning a service makes its front-door route real on the gateway" seam: "attach-step tests over a fake live set + rendered-config assertions (the render itself is already seam-tested)" acceptance: - given: a provisioned service and live placement; when: the attach step runs; then: the gateway machine config carries the host-matched forward_auth route and non-gateway machines gain nothing depends_on: [] out_of_scope: [live wildcard cert issuance (sibling acme-dns-registration ticket), the live lab smoke (#183 leg B·3 arena), gateway re-homing flows] needs_human_decision: [] ``` ## Blocks The live wildcard smoke proving #219 AC-1/AC-3 needs this **and** the sibling `front-door: acme-dns-registration` ticket; that smoke lives in the #183 leg B·3 arena — left unlinked from #183 for Ben to judge, per #219's own precedent.
Author
Owner

Landed in 14dd1c0 on main.

(*clan.Adapter).AttachFrontDoor (internal/clan/frontdoor_attach.go) is now the provision-time caller of clan.RenderFrontDoor (which #219 landed but nothing wired). It takes a fake-able FrontDoorLiveSet (gateway node + apex + gateway-level facts + each provisioned service's live placement) and JOINS it into the render's route set:

  • each ruled host is DERIVED from its slug + apex through the one #218 authority (internal/hostnames, ADR 0113) — never carried; a no-hostname slug (front-door/backup-copy) or reserved label gets no route rather than a fabricated one (AC-1 host-matched forward_auth route over the mesh, exempt paths honoured);
  • it renders the whole front-door.nix and writes it into machines/<gateway>/ ONLY, under the clan single-writer (ADR 0102) — a non-gateway machine gains nothing (AC-3 / #219 AC-4);
  • rewritten whole from the live set every run, so a service that left the set leaves no orphan route (AC-2);
  • deterministic render + no-op single writer → byte-identical, no churn on re-run (AC-4).

Evidence: 5 attach seam tests over a real single-writer repo + a fake live set in internal/clan/frontdoor_attach_test.go (the render itself stays seam-tested in frontdoor_test.go); full Go gate (build/vet/test/lint + broker) green. STATUS.md updated (header lead + milestone-log). Next: the live wildcard clan-lab smoke (#183 leg B·3) needs this + #252.

Landed in `14dd1c0` on `main`. `(*clan.Adapter).AttachFrontDoor` (`internal/clan/frontdoor_attach.go`) is now the provision-time caller of `clan.RenderFrontDoor` (which #219 landed but nothing wired). It takes a fake-able `FrontDoorLiveSet` (gateway node + apex + gateway-level facts + each provisioned service's live placement) and JOINS it into the render's route set: - each ruled host is DERIVED from its slug + apex through the one #218 authority (`internal/hostnames`, ADR 0113) — never carried; a no-hostname slug (front-door/backup-copy) or reserved label gets no route rather than a fabricated one (AC-1 host-matched forward_auth route over the mesh, exempt paths honoured); - it renders the whole `front-door.nix` and writes it into `machines/<gateway>/` ONLY, under the clan single-writer (ADR 0102) — a non-gateway machine gains nothing (AC-3 / #219 AC-4); - rewritten whole from the live set every run, so a service that left the set leaves no orphan route (AC-2); - deterministic render + no-op single writer → byte-identical, no churn on re-run (AC-4). Evidence: 5 attach seam tests over a real single-writer repo + a fake live set in `internal/clan/frontdoor_attach_test.go` (the render itself stays seam-tested in `frontdoor_test.go`); full Go gate (build/vet/test/lint + broker) green. STATUS.md updated (header lead + milestone-log). Next: the live wildcard clan-lab smoke (#183 leg B·3) needs this + #252.
ben closed this issue 2026-08-01 01:38:33 +00:00
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.

Dependencies

No dependencies set.

Reference
Matou/idss#251
No description provided.