control-plane: service-hostnames — one slug→URL authority under the wildcard, ruled and real #218

Closed
opened 2026-07-31 02:38:41 +00:00 by ben · 4 comments
Owner

Parent

Founding spec #11 (ADR 0014 one-registrar-visit) + provisioning spec #17 (portal publication). Contract-gap sweep 2026-07-30, filed on Ben's request.

What's true today

  • ADR 0014 promises the scheme — "every new service (cloud., chat., git.) is covered by the wildcard record and wildcard cert automatically" — and founding writes the wildcard A record (internal/founding/access.go gatewayDNSRecords). But no function anywhere maps a catalogue slug to a hostname: catalogue.Service and clan.ServiceInstance carry no address field, and the per-service names have never been ruled.
  • The dashboard's admin.<apex> is a wireframe convention only — 30+ occurrences in docs/ux/wireframes/** browser chrome and in test fixtures, fixed in no ADR, architecture doc, or code. Meanwhile the portal is placed at the apex by CONTEXT.md and ADR 0007. The apex-vs-admin. split is undocumented-but-assumed.
  • PortalLinks.ServiceUp(service string) (internal/provision/health.go) — the port that publishes a passed service to the portal — has no production implementation, only the test fake. (The portal page itself is also unbuilt; publication should land somewhere durable the portal will later read.)

What to build

A ruling first, then one authority:

  1. The ruling (an ADR): the canonical hostname map — each catalogue slug's subdomain under the apex, the dashboard's home (admin.<apex> or otherwise), the portal at the apex, and the reserved names (get, acme, acme-dns, invite paths).
  2. One derivation authority (the brandkit pattern — a single small package, nothing else re-derives): slug + apex → URL. Consumers read it; none invents a name.
  3. A real PortalLinks that records a passed service's published URL durably (state-directory ledger per ADR 0103, or config-repo doc — follow the ruling), so the portal has a truth to render when it arrives.

Acceptance criteria

  • Given the ruled map, When any consumer needs a service URL, Then it reads the one derivation authority — no hostname string is invented anywhere else
  • Given a service passes its health check in the whole composition, When it activates, Then its published URL lands durably where the portal will read it
  • Given the resting composition, Then honest resting — nothing published, nothing fabricated (ADR 0100)

Task manifest

task: control-plane:service-hostnames
implements_seam: "ADR 0014's wildcard scheme made real — one slug→URL authority + portal-link publication (spec #17)"
interface: "every service has exactly one ruled, derivable public URL"
seam: "unit tests over the derivation; composition seam test over publication"
acceptance:
  - given: the ruled hostname map; when: a service activates; then: its URL derives from one authority and is durably published
depends_on: []
out_of_scope: [the portal page itself (unbuilt, its own future slice), Caddy route generation (the ingress ticket), DNS record changes (the wildcard already covers every name)]
needs_human_decision: ["the canonical hostname map — per-service subdomains, the dashboard's admin.<apex>, the portal at the apex, reserved names (an ADR)"]

Blocks

The ingress-and-tls ticket (routes need ruled names). Filed as a native dependency.

## Parent Founding spec #11 (ADR 0014 one-registrar-visit) + provisioning spec #17 (portal publication). Contract-gap sweep 2026-07-30, filed on Ben's request. ## What's true today - ADR 0014 promises the scheme — "every new service (`cloud.`, `chat.`, `git.`) is covered by the wildcard record and wildcard cert automatically" — and founding writes the wildcard A record (`internal/founding/access.go` `gatewayDNSRecords`). But **no function anywhere maps a catalogue slug to a hostname**: `catalogue.Service` and `clan.ServiceInstance` carry no address field, and the per-service names have never been ruled. - The dashboard's `admin.<apex>` is a wireframe convention only — 30+ occurrences in `docs/ux/wireframes/**` browser chrome and in test fixtures, fixed in no ADR, architecture doc, or code. Meanwhile the portal is placed at the apex by CONTEXT.md and ADR 0007. The apex-vs-`admin.` split is undocumented-but-assumed. - `PortalLinks.ServiceUp(service string)` (`internal/provision/health.go`) — the port that publishes a passed service to the portal — has **no production implementation**, only the test fake. (The portal page itself is also unbuilt; publication should land somewhere durable the portal will later read.) ## What to build A ruling first, then one authority: 1. **The ruling (an ADR):** the canonical hostname map — each catalogue slug's subdomain under the apex, the dashboard's home (`admin.<apex>` or otherwise), the portal at the apex, and the reserved names (`get`, `acme`, `acme-dns`, invite paths). 2. **One derivation authority** (the brandkit pattern — a single small package, nothing else re-derives): slug + apex → URL. Consumers read it; none invents a name. 3. **A real `PortalLinks`** that records a passed service's published URL durably (state-directory ledger per ADR 0103, or config-repo doc — follow the ruling), so the portal has a truth to render when it arrives. ## Acceptance criteria - [ ] Given the ruled map, When any consumer needs a service URL, Then it reads the one derivation authority — no hostname string is invented anywhere else - [ ] Given a service passes its health check in the whole composition, When it activates, Then its published URL lands durably where the portal will read it - [ ] Given the resting composition, Then honest resting — nothing published, nothing fabricated (ADR 0100) ## Task manifest ```yaml task: control-plane:service-hostnames implements_seam: "ADR 0014's wildcard scheme made real — one slug→URL authority + portal-link publication (spec #17)" interface: "every service has exactly one ruled, derivable public URL" seam: "unit tests over the derivation; composition seam test over publication" acceptance: - given: the ruled hostname map; when: a service activates; then: its URL derives from one authority and is durably published depends_on: [] out_of_scope: [the portal page itself (unbuilt, its own future slice), Caddy route generation (the ingress ticket), DNS record changes (the wildcard already covers every name)] needs_human_decision: ["the canonical hostname map — per-service subdomains, the dashboard's admin.<apex>, the portal at the apex, reserved names (an ADR)"] ``` ## Blocks The ingress-and-tls ticket (routes need ruled names). Filed as a native dependency.
Author
Owner

Ruled by Ben, 2026-07-30 — slug-as-subdomain. <slug>.<apex> for every hostable service; portal at the apex; dashboard ratified at admin.<apex>; /get stays on the apex per ADR 0054 (the p2-s2 wireframe chrome is flagged as an erratum, not silently redrawn); reserved names admin, acme, acme-dns, www; front-door/backup-copy get no hostname. Recorded as ADR 0113 (docs/adr/0113-service-hostnames-slug-as-subdomain.md) — this IS the ADR the ticket asked for, so what remains is the derivation authority + real PortalLinks. The needs_human_decision is resolved.

**Ruled by Ben, 2026-07-30 — slug-as-subdomain.** `<slug>.<apex>` for every hostable service; portal at the apex; dashboard ratified at `admin.<apex>`; `/get` stays on the apex per ADR 0054 (the p2-s2 wireframe chrome is flagged as an erratum, not silently redrawn); reserved names `admin`, `acme`, `acme-dns`, `www`; `front-door`/`backup-copy` get no hostname. Recorded as **ADR 0113** (`docs/adr/0113-service-hostnames-slug-as-subdomain.md`) — this IS the ADR the ticket asked for, so what remains is the derivation authority + real PortalLinks. The `needs_human_decision` is resolved.
Author
Owner

Blocked on the needs_human_decision: the canonical hostname map (an ADR). The ticket's first deliverable is a ruling — mapping each catalogue slug to a subdomain, placing the dashboard and portal, and fixing the reserved names — and no prior ruling exists in the comments. This is a genuine judgement call: the catalogue slugs (files, code, docs-editing, meetings, static-sites, mail, chat, front-door, backup-copy) do not map obviously onto ADR 0014's cloud./chat./git. examples, and the admin.<apex> dashboard home is a wireframe convention that has never been fixed in an ADR.

Asked Ben via Mattermost (2026-07-31) with a concrete proposal; no reply within the wait window. Re-arming as ready-for-human.

Proposed map to rule (confirm or adjust):

Fixed points (already implied by docs):

  • Portal (branded landing page) → apex (example.nz) — CONTEXT.md + ADR 0007
  • Dashboard (operator control plane) → admin. — the wireframe convention made real
  • acme-dns delegation → acme. — ADR 0014 (unchanged)

Catalogue slug → subdomain (the real decision):

  • files (Nextcloud) → cloud.
  • chat (Mattermost) → chat.
  • code (Forgejo) → git.
  • docs-editing → docs.
  • meetings → meet.
  • mail → mail. (webmail UI)
  • static-sites → sites.
  • front-door → no own service page (it is the apex/ingress)
  • backup-copy → no public URL (internal helper job, never published)

Reserved names:

  • get.<apex> → agent/app install download
  • acme.<apex> / acme-dns → ACME delegation (ADR 0014)
  • invites → an apex path (example.nz/invite/...) rather than a subdomain?

Open questions for the human: (1) the four non-obvious slugs — docs-editing→docs., meetings→meet., static-sites→sites.; (2) invites as an apex path vs an invite. subdomain. Once ruled, the rest of the ticket (the single derivation authority + a real PortalLinks publishing durably per ADR 0103) is straightforward implementation with no further decisions.

**Blocked on the `needs_human_decision`: the canonical hostname map (an ADR).** The ticket's first deliverable is a ruling — mapping each catalogue slug to a subdomain, placing the dashboard and portal, and fixing the reserved names — and no prior ruling exists in the comments. This is a genuine judgement call: the catalogue slugs (`files`, `code`, `docs-editing`, `meetings`, `static-sites`, `mail`, `chat`, `front-door`, `backup-copy`) do not map obviously onto ADR 0014's `cloud.`/`chat.`/`git.` examples, and the `admin.<apex>` dashboard home is a wireframe convention that has never been fixed in an ADR. Asked Ben via Mattermost (2026-07-31) with a concrete proposal; no reply within the wait window. Re-arming as `ready-for-human`. **Proposed map to rule (confirm or adjust):** Fixed points (already implied by docs): - Portal (branded landing page) → **apex** (`example.nz`) — CONTEXT.md + ADR 0007 - Dashboard (operator control plane) → **admin.<apex>** — the wireframe convention made real - acme-dns delegation → **acme.<apex>** — ADR 0014 (unchanged) Catalogue slug → subdomain (the real decision): - files (Nextcloud) → `cloud.` - chat (Mattermost) → `chat.` - code (Forgejo) → `git.` - docs-editing → `docs.` - meetings → `meet.` - mail → `mail.` (webmail UI) - static-sites → `sites.` - front-door → no own service page (it *is* the apex/ingress) - backup-copy → **no public URL** (internal helper job, never published) Reserved names: - `get.<apex>` → agent/app install download - `acme.<apex>` / `acme-dns` → ACME delegation (ADR 0014) - invites → an **apex path** (`example.nz/invite/...`) rather than a subdomain? Open questions for the human: (1) the four non-obvious slugs — `docs-editing`→`docs.`, `meetings`→`meet.`, `static-sites`→`sites.`; (2) invites as an apex path vs an `invite.` subdomain. Once ruled, the rest of the ticket (the single derivation authority + a real `PortalLinks` publishing durably per ADR 0103) is straightforward implementation with no further decisions.
Author
Owner

Correction — the needs_human_decision is already ruled; re-arming ready-for-agent. My earlier block on this issue this iteration was based on a stale view: the rulings commit 2f9b93c had already landed ADR 0113 (docs/adr/0113-service-hostnames-slug-as-subdomain.md), which rules the canonical hostname map. My Mattermost ask crossed with that already-committed ruling.

Ben's ruling (ADR 0113) supersedes the proposal I posted above:

  • Services: <slug>.<apex> — mechanical, no mapping table (files.<apex>, chat.<apex>, code.<apex>, docs-editing.<apex>, meetings.<apex>, mail.<apex>, static-sites.<apex>). front-door and backup-copy have no hostname.
  • Portal: the apex (ratifies ADR 0007 / CONTEXT.md).
  • Dashboard: admin.<apex> (the wireframe convention is now the contract).
  • Install path: https://<apex>/get (ADR 0054 stands; the p2-s2 admin.<apex>/get chrome is an erratum flagged for design-verify).
  • Reserved: admin, acme, acme-dns, www.

No human decision remains: this is now pure implementation — one derivation authority (the brandkit pattern) mapping slug + apex → URL per ADR 0113, and a real PortalLinks that publishes a passed service's URL durably (ADR 0103). Removing ready-for-human, restoring ready-for-agent so the next iteration implements it against ADR 0113.

**Correction — the `needs_human_decision` is already ruled; re-arming `ready-for-agent`.** My earlier block on this issue this iteration was based on a stale view: the rulings commit `2f9b93c` had already landed **ADR 0113** (`docs/adr/0113-service-hostnames-slug-as-subdomain.md`), which rules the canonical hostname map. My Mattermost ask crossed with that already-committed ruling. Ben's ruling (ADR 0113) supersedes the proposal I posted above: - **Services**: `<slug>.<apex>` — mechanical, no mapping table (`files.<apex>`, `chat.<apex>`, `code.<apex>`, `docs-editing.<apex>`, `meetings.<apex>`, `mail.<apex>`, `static-sites.<apex>`). `front-door` and `backup-copy` have no hostname. - **Portal**: the apex (ratifies ADR 0007 / CONTEXT.md). - **Dashboard**: `admin.<apex>` (the wireframe convention is now the contract). - **Install path**: `https://<apex>/get` (ADR 0054 stands; the p2-s2 `admin.<apex>/get` chrome is an erratum flagged for design-verify). - **Reserved**: `admin`, `acme`, `acme-dns`, `www`. No human decision remains: this is now pure implementation — one derivation authority (the brandkit pattern) mapping slug + apex → URL per ADR 0113, and a real `PortalLinks` that publishes a passed service's URL durably (ADR 0103). Removing `ready-for-human`, restoring `ready-for-agent` so the next iteration implements it against ADR 0113.
Author
Owner

Done in 2922cc3 (on origin/main).

ADR 0113's slug-as-subdomain map is now real, per the ruling already recorded (needs_human_decision resolved):

  1. The one derivation authority — internal/hostnames (the brandkit pattern): Service(apex, slug) → https://<slug>.<apex> mechanical, Portal → apex, Dashboard → admin.<apex>, Install → <apex>/get, Reserved for admin/acme/acme-dns/www; front-door/backup-copy and reserved labels derive no URL (ok=false). The sole place slug + apex → URL — no consumer invents a hostname (AC1).
  2. A real PortalLinks — provision.FilePortalLedger derives a health-passed service's URL from that authority under the community apex and records it durably as a jsonstore.File document (portal-links.json, ADR 0103 §1) where the portal will read it via Links() (AC2). A no-hostname service publishes nothing; a write fault is logged, never fabricated (ADR 0100).

Wiring: composeWhole wires WithPortalLinks over the File ledger when the community apex is present (OURCLOUD_COMMUNITY_APEX); no apex or the resting composition publishes nothing — honest resting (AC3).

Seams: internal/hostnames/hostnames_test.go (the derivation), internal/provision/portal_test.go (durable publication), control-plane/cmd/control-plane/portal_publication_test.go (the composition seam — a passed service's URL lands durably, a withheld service and the resting composition publish nothing).

Out of scope as filed: the portal page itself, Caddy route generation (#219), DNS record changes. No Go toolchain in the sandbox (#198) — verified by review.

Unblocks #219 (the ingress ticket — routes now have ruled, derivable names).

Done in `2922cc3` (on origin/main). ADR 0113's slug-as-subdomain map is now real, per the ruling already recorded (needs_human_decision resolved): 1. **The one derivation authority** — `internal/hostnames` (the brandkit pattern): `Service(apex, slug)` → `https://<slug>.<apex>` mechanical, `Portal` → apex, `Dashboard` → `admin.<apex>`, `Install` → `<apex>/get`, `Reserved` for `admin`/`acme`/`acme-dns`/`www`; `front-door`/`backup-copy` and reserved labels derive no URL (`ok=false`). The sole place slug + apex → URL — no consumer invents a hostname (AC1). 2. **A real `PortalLinks`** — `provision.FilePortalLedger` derives a health-passed service's URL from that authority under the community apex and records it durably as a `jsonstore.File` document (`portal-links.json`, ADR 0103 §1) where the portal will read it via `Links()` (AC2). A no-hostname service publishes nothing; a write fault is logged, never fabricated (ADR 0100). **Wiring:** `composeWhole` wires `WithPortalLinks` over the File ledger when the community apex is present (`OURCLOUD_COMMUNITY_APEX`); no apex or the resting composition publishes nothing — honest resting (AC3). **Seams:** `internal/hostnames/hostnames_test.go` (the derivation), `internal/provision/portal_test.go` (durable publication), `control-plane/cmd/control-plane/portal_publication_test.go` (the composition seam — a passed service's URL lands durably, a withheld service and the resting composition publish nothing). Out of scope as filed: the portal page itself, Caddy route generation (#219), DNS record changes. No Go toolchain in the sandbox (#198) — verified by review. Unblocks #219 (the ingress ticket — routes now have ruled, derivable names).
ben closed this issue 2026-07-31 04:06:13 +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.

Reference
Matou/idss#218
No description provided.