calendar-remove red on the rented-services drive: a PLACED Calendar & contacts is forgotten by the change picker — deployedModuleFiles has no calendar entry, so machineServices never derives it and P4-S2 opens with it unticked (the operator c… #1823

Closed
opened 2026-09-24 14:57:18 +00:00 by ben · 1 comment
Owner

Seen: rented-services drive 20260924T142850Z (hand-fired from matou-workstation, payload + gateway image at 63a62ec1): 29 legs green through calendar-install, then calendar-remove red in unselectServiceOnGateway (fixtures/brandreach.ts:525):

the running Calendar & contacts is not ticked on re-entry — the picker forgot a deployed service — [data-action="toggle-calendar"] expected data-status="selected", got "unselected" (30 s)

The install DID land (checked on the kept box before release):

  • nextcloud-occ app:list → calendar: 6.6.1 in the Enabled section;
  • /srv/idss/config/machines/gateway/files.nix:345 systemd.services.nextcloud-calendar = { … :357 $occ app:install calendar || $occ app:enable calendar;
  • /var/lib/idss/provision-deploy-runs.json last run: {"service":"calendar","label":"Calendar & contacts","healthy":true,"url":"https://files.rehearsal-g.idss.nz/apps/calendar"}, completed_at 2026-09-24T14:44:06Z;
  • the leg's own frame (legs/calendar-remove-w2.png): Change gateway picker with Files ticked, Calendar & contacts unticked.

Why the picker forgets it — the chain, file:line:

  1. internal/provision/change.go:88-105 — Assessment.Preselected is built from d.Services, nothing else; the P4-S2 screen in change mode seeds its ticks from preselect ALONE (SelectRoleServicesScreen.vue initialSelection: seed = props.change ? [] : …).
  2. d.Services comes from the fleet projection, whose ONE reader is clan.ReadPlacement (internal/clan/inventory.go:196-215), which calls machineServices(machines/<id>) (internal/clan/deployedservices.go:55): a slug is placed on a machine iff its <slug>.nix module exists in the machine dir (deployedModuleFiles).
  3. deployedModuleFiles (deployedservices.go:11-25) has entries for files, docs-editing, code, mail, chat, static-sites, meetings, surveys, video, whakapapa, newsletters, paperless, archive, data-collections — and none for calendar. Calendar is not a module of its own by design (internal/clan/files.go:52-62 "Calendar & contacts is NOT a service of its own — it is Nextcloud's built-in app", rendered as a oneshot INSIDE files.nix when cfg.Calendar is set). Nothing else records the placement: inventory.json, .idss/inventory.json, gateway-render.json, enroll.json carry no calendar after the apply (grepped on the box). So the projection can never see a placed calendar.

Consequence beyond the drive: an operator who adds Calendar & contacts gets it (Nextcloud enables it, the deploy run says healthy, the Services tab's health read shows it), but the Change gateway picker opens with it unticked and there is no way in the panel to REMOVE it — #1589's "removing calendar leaves the box" is unreachable from the UI. Review impact's LOSES / the size-band sums are also blind to it. docs-editing, the other Files add-on, is NOT affected — it has its own docs-editing.nix marker.

Fix shape (two-way door): make the placement derivable — either machineServices also detects the calendar oneshot in files.nix (the systemd.services.nextcloud-calendar marker files.go writes), or attachFilesPlacement lands a tiny calendar.nix marker module beside files.nix (and removes it on removal) so deployedModuleFiles maps it like every other slug. Either way, pin it: a unit test that every catalogue slug with a placement path (catalogue.Services() minus the non-placeable) is derivable by machineServices from what the render writes — that is the gap this slipped through.

Side observation from the same frame (separate question, not this ticket's): on the rented 77 GB box every other card reads "needs N GB of disk — -23 GB free beside the front door and Files & documents" (internal/provision/assess.go:651) and is greyed — the Files floor (60 GB) plus the front door's footprint exceeds the box's disk, so nothing else can ever be added to the default rented gateway. Worth a ruling on what the rented default should size to.

Related: #1599 (the leg), #1589 (removal leaves the box), #1719 (add-ons live inside their host). Found by the Portal follow-ups' rented-carrier drive (whāriki arc, ADR 0271).

**Seen:** rented-services drive `20260924T142850Z` (hand-fired from `matou-workstation`, payload + gateway image at `63a62ec1`): 29 legs green through `calendar-install`, then `calendar-remove` red in `unselectServiceOnGateway` (`fixtures/brandreach.ts:525`): > the running Calendar & contacts is not ticked on re-entry — the picker forgot a deployed service — `[data-action="toggle-calendar"]` expected `data-status="selected"`, got `"unselected"` (30 s) **The install DID land** (checked on the kept box before release): - `nextcloud-occ app:list` → `calendar: 6.6.1` in the Enabled section; - `/srv/idss/config/machines/gateway/files.nix:345` `systemd.services.nextcloud-calendar = {` … `:357 $occ app:install calendar || $occ app:enable calendar`; - `/var/lib/idss/provision-deploy-runs.json` last run: `{"service":"calendar","label":"Calendar & contacts","healthy":true,"url":"https://files.rehearsal-g.idss.nz/apps/calendar"}`, `completed_at 2026-09-24T14:44:06Z`; - the leg's own frame (`legs/calendar-remove-w2.png`): Change gateway picker with **Files ticked, Calendar & contacts unticked**. **Why the picker forgets it — the chain, file:line:** 1. `internal/provision/change.go:88-105` — `Assessment.Preselected` is built from `d.Services`, nothing else; the P4-S2 screen in change mode seeds its ticks from `preselect` ALONE (`SelectRoleServicesScreen.vue` `initialSelection`: `seed = props.change ? [] : …`). 2. `d.Services` comes from the fleet projection, whose ONE reader is `clan.ReadPlacement` (`internal/clan/inventory.go:196-215`), which calls `machineServices(machines/<id>)` (`internal/clan/deployedservices.go:55`): a slug is placed on a machine **iff its `<slug>.nix` module exists in the machine dir** (`deployedModuleFiles`). 3. `deployedModuleFiles` (`deployedservices.go:11-25`) has entries for files, docs-editing, code, mail, chat, static-sites, meetings, surveys, video, whakapapa, newsletters, paperless, archive, data-collections — **and none for `calendar`**. Calendar is not a module of its own by design (`internal/clan/files.go:52-62` "Calendar & contacts is NOT a service of its own — it is Nextcloud's built-in app", rendered as a oneshot INSIDE `files.nix` when `cfg.Calendar` is set). Nothing else records the placement: `inventory.json`, `.idss/inventory.json`, `gateway-render.json`, `enroll.json` carry no `calendar` after the apply (grepped on the box). So the projection can never see a placed calendar. **Consequence beyond the drive:** an operator who adds Calendar & contacts gets it (Nextcloud enables it, the deploy run says healthy, the Services tab's health read shows it), but the Change gateway picker opens with it unticked and there is no way in the panel to REMOVE it — #1589's "removing calendar leaves the box" is unreachable from the UI. Review impact's LOSES / the size-band sums are also blind to it. `docs-editing`, the other Files add-on, is NOT affected — it has its own `docs-editing.nix` marker. **Fix shape (two-way door):** make the placement derivable — either `machineServices` also detects the calendar oneshot in `files.nix` (the `systemd.services.nextcloud-calendar` marker `files.go` writes), or `attachFilesPlacement` lands a tiny `calendar.nix` marker module beside `files.nix` (and removes it on removal) so `deployedModuleFiles` maps it like every other slug. Either way, pin it: a unit test that every catalogue slug with a placement path (`catalogue.Services()` minus the non-placeable) is derivable by `machineServices` from what the render writes — that is the gap this slipped through. **Side observation from the same frame** (separate question, not this ticket's): on the rented 77 GB box every other card reads "needs N GB of disk — **-23 GB** free beside the front door and Files & documents" (`internal/provision/assess.go:651`) and is greyed — the Files floor (60 GB) plus the front door's footprint exceeds the box's disk, so nothing else can ever be added to the default rented gateway. Worth a ruling on what the rented default should size to. Related: #1599 (the leg), #1589 (removal leaves the box), #1719 (add-ons live inside their host). Found by the Portal follow-ups' rented-carrier drive (whāriki arc, ADR 0271).

This was generated by AI during triage.

Triage: bug — already implemented (wontfix, closing)

Ruled by agent under ADR 0174 — veto anytime. Two-way door: closing an already-fixed bug is reversible (reopen + relabel), and the fix is provable by existing passing tests. Not on the one-way-door list.

The reported symptom is already fixed on main. It landed in commit c2e17818 ("rehearsal healer: the placement read-back forgot the calendar rider, so P4-S2 re-entry opened with a running Calendar & contacts unticked", committed 2026-09-24 14:54:28Z) — 3 minutes before this issue was filed (14:57:18Z). The drive that saw the red (20260924T142850Z, 14:28:50Z) predates the fix, so the report was written against a pre-fix tree.

The fix is exactly the shape this ticket proposed — "make machineServices also detect the calendar oneshot in files.nix":

  • internal/clan/deployedservices.go:47-101 introduces riderModuleMarkers — a rider slug (calendar today) whose deployed signal is a marker inside the host module rather than a <slug>.nix file. Calendar maps to files.nix + the marker systemd.services.nextcloud-calendar = {.
  • machineServices (:112-133) and ReadDeployedServices (:150-186) now union machineRiders onto the module-file read — the two readers are one signal at two scopes. So the fleet projection → clan.ReadPlacement → d.Services → change.go Preselected chain now carries a placed calendar, and P4-S2 re-entry opens with it ticked.
  • ADR 0103 §3 is preserved: no second durable record — the rendered marker is the signal. A files node re-rendered with Calendar:false grows no oneshot and reports no rider, so #1589's removal path still takes it back out.

Pinned by tests (all pass locally, go test ./internal/clan/):

  • TestMachineServices_CalendarRiderReadsBackOffTheFilesRender
  • TestMachineServices_FilesWithoutCalendarReportsNoRider
  • TestReadDeployedServices_CarriesThePlacedCalendarRider

Two loose ends noted for follow-up (not reopened here):

  1. This ticket also asked for a generalized pin — "every catalogue slug with a placement path is derivable by machineServices from what the render writes." The calendar rider is now pinned specifically by the three tests above, but no completeness test over the whole catalogue exists yet. Worth a small hardening ticket if the next rider should be caught structurally.
  2. The side observation (rented 77 GB box shows -23 GB free so nothing beyond Files can be added — a ruling on the rented default's size) is a separate concern the reporter flagged as out of scope for this ticket, and is untouched here.

Closing as wontfix (already implemented). Reopen if a fresh drive still shows calendar-remove red.

> *This was generated by AI during triage.* ## Triage: bug — already implemented (wontfix, closing) **Ruled by agent under ADR 0174 — veto anytime.** Two-way door: closing an already-fixed bug is reversible (reopen + relabel), and the fix is provable by existing passing tests. Not on the one-way-door list. **The reported symptom is already fixed on `main`.** It landed in commit `c2e17818` (*"rehearsal healer: the placement read-back forgot the calendar rider, so P4-S2 re-entry opened with a running Calendar & contacts unticked"*, committed `2026-09-24 14:54:28Z`) — **3 minutes before this issue was filed** (`14:57:18Z`). The drive that saw the red (`20260924T142850Z`, `14:28:50Z`) predates the fix, so the report was written against a pre-fix tree. **The fix is exactly the shape this ticket proposed** — "make `machineServices` also detect the calendar oneshot in `files.nix`": - `internal/clan/deployedservices.go:47-101` introduces `riderModuleMarkers` — a rider slug (calendar today) whose deployed signal is a **marker inside the host module** rather than a `<slug>.nix` file. Calendar maps to `files.nix` + the marker `systemd.services.nextcloud-calendar = {`. - `machineServices` (`:112-133`) and `ReadDeployedServices` (`:150-186`) now **union `machineRiders`** onto the module-file read — the two readers are one signal at two scopes. So the fleet projection → `clan.ReadPlacement` → `d.Services` → `change.go` `Preselected` chain now carries a placed calendar, and P4-S2 re-entry opens with it ticked. - ADR 0103 §3 is preserved: no second durable record — the rendered marker *is* the signal. A files node re-rendered with `Calendar:false` grows no oneshot and reports no rider, so #1589's removal path still takes it back out. **Pinned by tests (all pass locally, `go test ./internal/clan/`):** - `TestMachineServices_CalendarRiderReadsBackOffTheFilesRender` - `TestMachineServices_FilesWithoutCalendarReportsNoRider` - `TestReadDeployedServices_CarriesThePlacedCalendarRider` **Two loose ends noted for follow-up (not reopened here):** 1. This ticket also asked for a *generalized* pin — "every catalogue slug with a placement path is derivable by `machineServices` from what the render writes." The calendar rider is now pinned specifically by the three tests above, but no completeness test over the whole catalogue exists yet. Worth a small hardening ticket if the next rider should be caught structurally. 2. The **side observation** (rented 77 GB box shows `-23 GB` free so nothing beyond Files can be added — a ruling on the rented default's size) is a separate concern the reporter flagged as out of scope for this ticket, and is untouched here. Closing as `wontfix` (already implemented). Reopen if a fresh drive still shows `calendar-remove` red.
matou-build-agent 2026-09-24 15:01:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#1823
No description provided.