catalogue/provisioning: may the gateway co-host catalogue services? — the headroom decision no layer owns (Nextcloud-on-gateway) #352

Closed
opened 2026-08-09 05:01:23 +00:00 by ben · 3 comments
Owner

RULED — DDR 0146 (commit 42d15c6), grilled 2026-08-09

The gateway co-hosts by headroom. Six rulings:

  1. The one-machine community is a supported shape — the gateway may co-host catalogue services.
  2. The gate moves to provisioning; the catalogue is untouched. Roles stays ADR 0055's hint. assess.go replaces the gateway node's role gate ("runs under the helper role") with the headroom gate — the seam catalogue.go:14-17 reserved.
  3. Every helper service is eligible except backup-copy, refused with the honest reason: a backup copy must live in a different failure domain than the data it copies.
  4. The formula (hard gate): admission = the device meets the largest single floor among live + candidate (floors never summed — that double-counts OS overhead); fit = steady-memory sum (front door + live + candidate) ≤ 80% of device RAM; disk floors are summed. A breach greys the row with the reason in the device's own numbers, deviceReason style. No soft-warning tier — "allowed but tight" lives in S3's LOAD line.
  5. S2's gateway case gains a STEADY LOAD budget line (S3's LOAD vocabulary) so a greyed row is never the first sign the budget exists — ✎ frame added to p4-s2-select-role-and-services.html, plus the blast-radius line ("everything here shares the front door's machine").
  6. Colocation stands when a capable helper later enrols (DDR 0142 posture: named, not torn down). No auto-move, no nudge; removing a data-homing service is an honest refusal. The move-off journey is #353 (no-triage until the backups tier makes it real).

ADR 0020 stands (services still chosen at provisioning, never founding). 03-fleet-topology.md amended in the same commit (ADR 0042).

Implementation scope (this ticket, now ready-for-agent)

  • internal/provision/assess.go: for the gateway node, replace the role gate with the headroom gate (formula above); new reason strings — numbers for breaches, the failure-domain line for backup-copy.
  • GatewayLiveSet (internal/clan/gateway_attach.go): add the Files slot (further slots ride each service's render landing).
  • Dashboard P4-S2: the gateway case per the ✎ frame — data-field="headroom" STEADY LOAD line, gated rows, blast-radius line.
  • Review-impact/deploy compose through the live-set orchestrator.

Blocked by #351 (native dependency): un-greying S2 before the live-set orchestrator lands would let a gateway files-deploy write the phantom clan-core inventory module and report success while nothing runs.


The original question (for the record)

May the gateway co-host catalogue services — concretely, Nextcloud (files) on the gateway machine? Ben's practical goal: once the private-path VM's control panel is reachable, provision Nextcloud without needing a second machine. The three blockers were: files helper-only + one role per node (catalogue.go:75-81, assess.go:259-260); no Files slot in GatewayLiveSet; and the "headroom decision" punt (catalogue.go:14-17) that no layer implemented. The tension: ADR 0020 / 03-fleet-topology / the founding-to-nextcloud prototype all placed services on other nodes, while gateway_attach.go's own comment and the health-check wiring half-expected the one-machine community.

Sibling: #351 wires provisioning's deploy to the real Attach* renders.

## RULED — DDR 0146 (commit `42d15c6`), grilled 2026-08-09 **The gateway co-hosts by headroom.** Six rulings: 1. **The one-machine community is a supported shape** — the gateway may co-host catalogue services. 2. **The gate moves to provisioning; the catalogue is untouched.** `Roles` stays ADR 0055's hint. `assess.go` replaces the gateway node's role gate ("runs under the helper role") with the headroom gate — the seam `catalogue.go:14-17` reserved. 3. **Every helper service is eligible except `backup-copy`**, refused with the honest reason: a backup copy must live in a different failure domain than the data it copies. 4. **The formula (hard gate):** admission = the device meets the largest *single* floor among live + candidate (floors never summed — that double-counts OS overhead); fit = steady-memory sum (front door + live + candidate) ≤ **80% of device RAM**; disk floors *are* summed. A breach greys the row with the reason in the device's own numbers, `deviceReason` style. No soft-warning tier — "allowed but tight" lives in S3's LOAD line. 5. **S2's gateway case gains a STEADY LOAD budget line** (S3's LOAD vocabulary) so a greyed row is never the first sign the budget exists — ✎ frame added to `p4-s2-select-role-and-services.html`, plus the blast-radius line ("everything here shares the front door's machine"). 6. **Colocation stands when a capable helper later enrols** (DDR 0142 posture: named, not torn down). No auto-move, no nudge; removing a data-homing service is an honest refusal. The move-off journey is **#353** (`no-triage` until the backups tier makes it real). ADR 0020 stands (services still chosen at provisioning, never founding). `03-fleet-topology.md` amended in the same commit (ADR 0042). ## Implementation scope (this ticket, now `ready-for-agent`) - `internal/provision/assess.go`: for the gateway node, replace the role gate with the headroom gate (formula above); new reason strings — numbers for breaches, the failure-domain line for `backup-copy`. - `GatewayLiveSet` (`internal/clan/gateway_attach.go`): add the Files slot (further slots ride each service's render landing). - Dashboard P4-S2: the gateway case per the ✎ frame — `data-field="headroom"` STEADY LOAD line, gated rows, blast-radius line. - Review-impact/deploy compose through the live-set orchestrator. **Blocked by #351** (native dependency): un-greying S2 before the live-set orchestrator lands would let a gateway files-deploy write the phantom `clan-core` inventory module and report success while nothing runs. --- ## The original question (for the record) May the gateway co-host catalogue services — concretely, Nextcloud (`files`) on the gateway machine? Ben's practical goal: once the private-path VM's control panel is reachable, provision Nextcloud without needing a second machine. The three blockers were: `files` helper-only + one role per node (`catalogue.go:75-81`, `assess.go:259-260`); no Files slot in `GatewayLiveSet`; and the "headroom decision" punt (`catalogue.go:14-17`) that no layer implemented. The tension: ADR 0020 / `03-fleet-topology` / the founding-to-nextcloud prototype all placed services on other nodes, while `gateway_attach.go`'s own comment and the health-check wiring half-expected the one-machine community. Sibling: #351 wires provisioning's deploy to the real `Attach*` renders.
Author
Owner

Grilled and ruled 2026-08-09 — DDR 0146 docs/adr/0146-design-the-gateway-cohosts-by-headroom.md, landed+pushed in 42d15c6 with the P4-S2 ✎ gateway frame and the 03-fleet-topology amendment. Body rewritten with the six rulings and implementation scope; flipped needs-design → ready-for-agent, blocked by #351. (Renumbered from 0145 at commit time — the kanidm-brand session minted 0145 concurrently; 0140-collision precedent applied, next free is 0147.)

Grilled and ruled 2026-08-09 — DDR 0146 `docs/adr/0146-design-the-gateway-cohosts-by-headroom.md`, landed+pushed in `42d15c6` with the P4-S2 ✎ gateway frame and the `03-fleet-topology` amendment. Body rewritten with the six rulings and implementation scope; flipped `needs-design` → `ready-for-agent`, blocked by #351. (Renumbered from 0145 at commit time — the kanidm-brand session minted 0145 concurrently; 0140-collision precedent applied, next free is 0147.)
Author
Owner

Restored ready-for-agent (the 06:34 automation had knocked it back to needs-design; the design is done — DDR 0146). Dependency re-pointed: now blocked by #354 (gateway live-set assembly, #351's AC2 split per Ben's option-A ruling) instead of the closed #351 — same honesty rule: no un-greyed checkbox before the gateway assembly can actually land what it promises.

Restored `ready-for-agent` (the 06:34 automation had knocked it back to `needs-design`; the design is done — DDR 0146). Dependency re-pointed: now blocked by **#354** (gateway live-set assembly, #351's AC2 split per Ben's option-A ruling) instead of the closed #351 — same honesty rule: no un-greyed checkbox before the gateway assembly can actually land what it promises.
Author
Owner

Landed in a8a3ab5 (pushed to origin/main, full pre-push gate green: Go + 985 dashboard tests).

DDR 0146 implemented across the three surfaces it names, plus the honest deploy composition:

  • assess (the seam): ForRole (internal/provision/assess.go) replaces the role gate with the headroom gate for a node holding the gateway role — admission by the largest single floor, steady-memory sum ≤ 80% of RAM, disk floors summed; backup-copy is the one principled failure-domain refusal. The Selection carries a Headroom STEADY LOAD line + per-row SteadyBytes; the catalogue is untouched. Tests: headroom gating, already-colocated sum, and the hypothetical-role guard (assess_test.go).
  • composition: GatewayLiveSet grows a Files slot, and a new ComposeGatewayCohost (internal/clan/gateway_attach.go) re-imports every present gateway module into configuration.nix (additive, idempotent, no founding-facts needed). On the clan.Clan interface + fake + resting composition. Tests: the Files-slot compose + the preserve/idempotency recompose (gateway_attach_test.go).
  • deploy: attachCatalogueService (deploy.go) renders files.nix then ComposeGatewayCohost for the gateway node — so a gateway files co-host is imported beside the front door, never a deploy that succeeds over dead text (the honesty rule the #351/#354 block protected). Test: deploy_test.go.
  • dashboard: P4-S2 ✎ gateway case ships (SelectRoleServicesScreen.vue) — fixed role, the STEADY LOAD line that moves as services are ticked, headroom-gated rows, blast-radius line; MATAI_SELECTION_GATEWAY fixture + Headroom/steadyBytes types. Test: provisionGatewayCohost.test.ts.

Move-off stays #353. STATUS.md updated in the same commit.

Landed in `a8a3ab5` (pushed to `origin/main`, full pre-push gate green: Go + 985 dashboard tests). DDR 0146 implemented across the three surfaces it names, plus the honest deploy composition: - **assess (the seam):** `ForRole` (`internal/provision/assess.go`) replaces the role gate with the headroom gate for a node holding the gateway role — admission by the largest single floor, steady-memory sum ≤ 80% of RAM, disk floors summed; `backup-copy` is the one principled failure-domain refusal. The `Selection` carries a `Headroom` STEADY LOAD line + per-row `SteadyBytes`; the catalogue is untouched. Tests: headroom gating, already-colocated sum, and the hypothetical-role guard (`assess_test.go`). - **composition:** `GatewayLiveSet` grows a `Files` slot, and a new `ComposeGatewayCohost` (`internal/clan/gateway_attach.go`) re-imports every present gateway module into `configuration.nix` (additive, idempotent, no founding-facts needed). On the `clan.Clan` interface + fake + resting composition. Tests: the Files-slot compose + the preserve/idempotency recompose (`gateway_attach_test.go`). - **deploy:** `attachCatalogueService` (`deploy.go`) renders files.nix then `ComposeGatewayCohost` for the gateway node — so a gateway files co-host is imported beside the front door, never a deploy that succeeds over dead text (the honesty rule the #351/#354 block protected). Test: `deploy_test.go`. - **dashboard:** P4-S2 ✎ gateway case ships (`SelectRoleServicesScreen.vue`) — fixed role, the STEADY LOAD line that moves as services are ticked, headroom-gated rows, blast-radius line; `MATAI_SELECTION_GATEWAY` fixture + `Headroom`/`steadyBytes` types. Test: `provisionGatewayCohost.test.ts`. Move-off stays #353. `STATUS.md` updated in the same commit.
ben closed this issue 2026-08-09 14:20:58 +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#352
No description provided.