catalogue: files-port — Nextcloud's full three-part port: module, reconciler, themed for real #220

Closed
opened 2026-07-31 02:38:47 +00:00 by ben · 1 comment
Owner

Parent

Provisioning spec #17 (the catalogue's first real service) + ADR 0062 (a catalogue port ships three parts). Contract-gap sweep 2026-07-30, filed on Ben's request.

What's true today

  • files/Nextcloud is the closest-to-real catalogue service and still ships only two fragments of its contract: a health check (/status.php, #204) and the member-orbit reconciler port over a hand-set URL (OURCLOUD_NEXTCLOUD_URL, #213). There is no NixOS module that deploys Nextcloud — AttachService records the instance in the config repo, and the clan render layer renders inventory and takeover network/disk config, never a service module.
  • The brand artifact nextcloud-theming.conf is compiled and committed on every brand apply and consumed by nothing (grep hits only internal/brandkit/surface.go) — matching the theming seam's accepted strain: "coverage says 'applied', not 'the service demonstrably shows it'". DDR 0007 promises Nextcloud strong fidelity.

What to build

The full ADR 0062 contract for files:

  1. Part 1 — the declarative module: the Nextcloud module (daemon + secrets via clan vars) the adapter attaches when files is assigned, rendered through the clan adapter's templating layer (ADR 0102).
  2. Part 2 — the reconciler: post-start imperative provisioning per the Garage/S13 pattern where the module can't declare it; the existing member-orbit reconciler keeps owning people (ADR 0105's pattern — runtime people are never reprovisioned).
  3. Theming consumed: the compiled nextcloud-theming.conf reaches the running instance so the login and skin carry the community's kit — coverage's "applied" becomes demonstrably true.
  4. OURCLOUD_NEXTCLOUD_URL stops being hand-set: derived from the one hostname authority once a node holds files.

Part 3 (the health check) already exists — it becomes the gate this deploy actually passes.

Acceptance criteria

  • Given a device assigned files in the whole composition, When the deploy completes, Then Nextcloud serves, its real health check passes, and only then does it activate and publish
  • Given the community's brand kit, When the login renders, Then it demonstrably carries the kit (DDR 0007 strong fidelity) — and a brand re-apply re-themes it without restart-the-world
  • Given the member orbit, When members are provisioned/offboarded, Then the reconciler drives the same instance the module deployed — one URL, derived, not hand-set

Task manifest

task: catalogue:files-port
implements_seam: "the files port's remaining parts (ADR 0062): module + reconciler home + consumed theming (DDR 0007)"
interface: "the fleet's first fully real catalogue service"
seam: "a clan-lab smoke: assign files, deploy, health-pass, branded login (the smoke-* precedent)"
acceptance:
  - given: files assigned; when: deploy completes; then: a running, branded, health-gated Nextcloud the reconciler drives
depends_on: [front-door:ingress-and-tls]
out_of_scope: [the other catalogue services (the arc seed ticket), datasets/backup contract changes (ADR 0080 already declares them)]
needs_human_decision: []

Blocks

Likely the real evidence for #183 leg B·3 (branded Nextcloud login) — left unlinked for Ben to judge on his closeout.

## Parent Provisioning spec #17 (the catalogue's first real service) + ADR 0062 (a catalogue port ships three parts). Contract-gap sweep 2026-07-30, filed on Ben's request. ## What's true today - `files`/Nextcloud is the closest-to-real catalogue service and still ships only two fragments of its contract: a health check (`/status.php`, #204) and the member-orbit reconciler port over a hand-set URL (`OURCLOUD_NEXTCLOUD_URL`, #213). There is **no NixOS module that deploys Nextcloud** — `AttachService` records the instance in the config repo, and the clan render layer renders inventory and takeover network/disk config, never a service module. - The brand artifact `nextcloud-theming.conf` is compiled and committed on every brand apply and **consumed by nothing** (grep hits only `internal/brandkit/surface.go`) — matching the theming seam's accepted strain: "coverage says 'applied', not 'the service demonstrably shows it'". DDR 0007 promises Nextcloud strong fidelity. ## What to build The full ADR 0062 contract for `files`: 1. **Part 1 — the declarative module**: the Nextcloud module (daemon + secrets via clan vars) the adapter attaches when `files` is assigned, rendered through the clan adapter's templating layer (ADR 0102). 2. **Part 2 — the reconciler**: post-start imperative provisioning per the Garage/S13 pattern where the module can't declare it; the existing member-orbit reconciler keeps owning people (ADR 0105's pattern — runtime people are never reprovisioned). 3. **Theming consumed**: the compiled `nextcloud-theming.conf` reaches the running instance so the login and skin carry the community's kit — coverage's "applied" becomes demonstrably true. 4. `OURCLOUD_NEXTCLOUD_URL` stops being hand-set: derived from the one hostname authority once a node holds `files`. Part 3 (the health check) already exists — it becomes the gate this deploy actually passes. ## Acceptance criteria - [ ] Given a device assigned `files` in the whole composition, When the deploy completes, Then Nextcloud serves, its real health check passes, and only then does it activate and publish - [ ] Given the community's brand kit, When the login renders, Then it demonstrably carries the kit (DDR 0007 strong fidelity) — and a brand re-apply re-themes it without restart-the-world - [ ] Given the member orbit, When members are provisioned/offboarded, Then the reconciler drives the same instance the module deployed — one URL, derived, not hand-set ## Task manifest ```yaml task: catalogue:files-port implements_seam: "the files port's remaining parts (ADR 0062): module + reconciler home + consumed theming (DDR 0007)" interface: "the fleet's first fully real catalogue service" seam: "a clan-lab smoke: assign files, deploy, health-pass, branded login (the smoke-* precedent)" acceptance: - given: files assigned; when: deploy completes; then: a running, branded, health-gated Nextcloud the reconciler drives depends_on: [front-door:ingress-and-tls] out_of_scope: [the other catalogue services (the arc seed ticket), datasets/backup contract changes (ADR 0080 already declares them)] needs_human_decision: [] ``` ## Blocks Likely the real evidence for #183 leg B·3 (branded Nextcloud login) — left unlinked for Ben to judge on his closeout.
Author
Owner

Landed in b879e08 on origin/main.

The files port's remaining ADR 0062 parts are built, mirroring the front-door port's render/attach shape (#219 render + #251 attach):

  • Part 1 — the declarative module (internal/clan/files.go, RenderFiles(FilesConfig)): the files node's files.nix through the clan adapter's templating layer (ADR 0102 §4) — services.nextcloud on its ruled host behind https, admin identity + DB password on clan-var paths (the secret never lands in the store), and the declarative Postgres backing store. This node opens no public port; the front door fronts it over the mesh (ADR 0074).
  • Theming consumed (DDR 0007 strong fidelity — the standing "applied ≠ shown" strain closed): the compiled nextcloud-theming.conf, until now committed on every brand apply and read by nothing, now reaches the running instance through a nextcloud-brand oneshot that applies each theming key via occ theming:config. The conf is a Nix path literal + restartTrigger, so a brand re-apply rewrites its bytes → its store hash changes → the oneshot re-runs and re-themes the live login/skin without restarting Nextcloud (occ is a live change). lib.mkIf (builtins.pathExists …) omits it honestly with no applied kit.
  • Part 2's home declared, runtime people never: the module deploys the store; the member-orbit reconciler (internal/nextcloud) keeps owning runtime people over the OCS API and never reprovisions them (ADR 0105).
  • The provision-time caller (internal/clan/files_attach.go, (*Adapter).AttachFiles): derives the ruled host from the one hostname authority (hostnames.Service(apex,"files") → files.<apex>, ADR 0113) and writes the module into machines/<node>/ under the single writer — node-only, deterministic, idempotent (byte-identical re-render → no churn); a missing apex is refused, never fabricated.
  • Part 4 — the URL is DERIVED, not hand-set (OURCLOUD_NEXTCLOUD_URL retired): the whole composition derives https://files.<apex> once through the authority and shares it across the deploy-time /status.php health check and the reconciler port, so all three parts drive the same instance through one URL. Absent an apex the files service rests (ADR 0100).

Part 3 (the health check, #204) is unchanged — it becomes the gate this deploy passes.

Evidence: seam tests at the clan seam over a real single-writer repo + a fake live set — internal/clan/files_test.go (6 render checks: daemon on ruled host, secrets via clan vars, backing store w/o runtime people, theming consumed onto the running instance + re-theme trigger, determinism, package default/override) and internal/clan/files_attach_test.go (4 attach checks: derived host, missing-apex refused, node-only write, idempotency); plus the composition derivation seam in control-plane/cmd/control-plane/offboard_catalogue_test.go. go build/vet/test + golangci-lint run ./... green under nix develop .#go-ci. STATUS.md updated.

Acceptance mapping:

  • AC1 (deploy → serves → health passes → then activates/publishes): Part 1 gives the module that lets Nextcloud serve; the existing per-service health gate (#204/#217/ADR 0112) still gates activation/publication on the real /status.php pass.
  • AC2 (login carries the kit; re-apply re-themes without restart-the-world): the occ theming:config consumption + path-literal restart trigger.
  • AC3 (reconciler drives the same instance the module deployed — one URL, derived): the derived files.<apex> shared by module hostName, health check, and reconciler base.

Follow-up (deferred, not this slice): the manifest's live clan-lab smoke ("assign files → deploy → health-pass → branded login" on a real 3-node lab) needs this landed module wired into provisioning's deploy path plus a smoke-* harness — deferred exactly as #251 deferred the front-door wildcard smoke (a separate smoke slice, per the engine-adapters "smokes are slices, not CI" ruling). This render/attach/wiring slice is the offline seam-tested substrate that smoke would then prove on hardware. Left unlinked from #183 leg B·3 for Ben's closeout, as the ticket asked.

Landed in `b879e08` on `origin/main`. The files port's remaining ADR 0062 parts are built, mirroring the front-door port's render/attach shape (#219 render + #251 attach): - **Part 1 — the declarative module** (`internal/clan/files.go`, `RenderFiles(FilesConfig)`): the files node's `files.nix` through the clan adapter's templating layer (ADR 0102 §4) — `services.nextcloud` on its ruled host behind https, admin identity + DB password on clan-var paths (the secret never lands in the store), and the declarative Postgres backing store. This node opens no public port; the front door fronts it over the mesh (ADR 0074). - **Theming consumed** (DDR 0007 strong fidelity — the standing "applied ≠ shown" strain closed): the compiled `nextcloud-theming.conf`, until now committed on every brand apply and read by nothing, now reaches the **running** instance through a `nextcloud-brand` oneshot that applies each theming key via `occ theming:config`. The conf is a Nix **path literal** + `restartTrigger`, so a brand re-apply rewrites its bytes → its store hash changes → the oneshot re-runs and re-themes the live login/skin **without restarting Nextcloud** (occ is a live change). `lib.mkIf (builtins.pathExists …)` omits it honestly with no applied kit. - **Part 2's home declared, runtime people never**: the module deploys the store; the member-orbit reconciler (`internal/nextcloud`) keeps owning runtime people over the OCS API and never reprovisions them (ADR 0105). - **The provision-time caller** (`internal/clan/files_attach.go`, `(*Adapter).AttachFiles`): derives the ruled host from the **one** hostname authority (`hostnames.Service(apex,"files")` → `files.<apex>`, ADR 0113) and writes the module into `machines/<node>/` under the single writer — node-only, deterministic, idempotent (byte-identical re-render → no churn); a missing apex is refused, never fabricated. - **Part 4 — the URL is DERIVED, not hand-set** (`OURCLOUD_NEXTCLOUD_URL` retired): the whole composition derives `https://files.<apex>` once through the authority and shares it across the deploy-time `/status.php` health check **and** the reconciler port, so all three parts drive the **same** instance through one URL. Absent an apex the files service rests (ADR 0100). Part 3 (the health check, #204) is unchanged — it becomes the gate this deploy passes. **Evidence:** seam tests at the clan seam over a real single-writer repo + a fake live set — `internal/clan/files_test.go` (6 render checks: daemon on ruled host, secrets via clan vars, backing store w/o runtime people, theming consumed onto the running instance + re-theme trigger, determinism, package default/override) and `internal/clan/files_attach_test.go` (4 attach checks: derived host, missing-apex refused, node-only write, idempotency); plus the composition derivation seam in `control-plane/cmd/control-plane/offboard_catalogue_test.go`. `go build`/`vet`/`test` + `golangci-lint run ./...` green under `nix develop .#go-ci`. STATUS.md updated. **Acceptance mapping:** - AC1 (deploy → serves → health passes → then activates/publishes): Part 1 gives the module that lets Nextcloud serve; the existing per-service health gate (#204/#217/ADR 0112) still gates activation/publication on the real `/status.php` pass. - AC2 (login carries the kit; re-apply re-themes without restart-the-world): the `occ theming:config` consumption + path-literal restart trigger. - AC3 (reconciler drives the same instance the module deployed — one URL, derived): the derived `files.<apex>` shared by module hostName, health check, and reconciler base. **Follow-up (deferred, not this slice):** the manifest's live clan-lab smoke ("assign files → deploy → health-pass → branded login" on a real 3-node lab) needs this landed module wired into provisioning's deploy path **plus** a `smoke-*` harness — deferred exactly as #251 deferred the front-door wildcard smoke (a separate smoke slice, per the engine-adapters "smokes are slices, not CI" ruling). This render/attach/wiring slice is the offline seam-tested substrate that smoke would then prove on hardware. Left unlinked from #183 leg B·3 for Ben's closeout, as the ticket asked.
ben closed this issue 2026-08-01 03:51: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.

Reference
Matou/idss#220
No description provided.