calendar-remove: the placement read-back forgets the calendar rider, so P4-S2 re-entry opens with a running Calendar & contacts unticked #1822

Closed
opened 2026-09-24 14:54:33 +00:00 by matou-build-agent · 1 comment

The failure

Drive 20260924T142850Z (artifacts/verdict.json: 29 green, 1 red, firstRedLeg: calendar-remove) went red at the FIRST assertion of the calendar-remove leg — the re-entry tick, before the untick ever ran:

Locator:  locator('[data-action="toggle-calendar"]')
Expected: "selected"
Received: "unselected"
63 × locator resolved to <button … data-status="unselected" data-action="toggle-calendar" class="oc-card oc-card--gated">

That is unselectServiceOnGateway's guard at app/tests/e2e/fixtures/brandreach.ts:520-523 ("the running ${svc.name} is not ticked on re-entry — the picker forgot a deployed service"). calendar-install was green immediately before it (134 s), and its own on-the-box proof expectCalendarAppsGoneFromGuest's sibling expectCalendarAppsEnabledOnGuest (app/tests/e2e/fixtures/calendarRemoval.ts:154) had already confirmed occ app:list showed calendar + contacts ENABLED on the guest. So the service WAS deployed and the picker did not know it.

The evidence

The picker's ticks seed from props.preselect alone in change mode (dashboard/src/components/provisioning/SelectRoleServicesScreen.vue:372-380, initialSelection). preselect is the seam's Assessment.Preselected, built in internal/provision/change.go:88-105 by iterating d.Services — the fleet projection's per-node assignments, which come from control-plane/cmd/control-plane/whole_composition.go:1089 (configRepoInventory.Placement) → clan.ReadPlacement (internal/clan/inventory.go:196-212) → machineServices (internal/clan/deployedservices.go:55-68).

machineServices keys on <slug>.nix file PRESENCE via deployedModuleFiles (internal/clan/deployedservices.go:18-33). calendar is not in that map, and cannot be: Calendar & contacts ships no module of its own by design — its whole substance is the app-enable oneshot the FILES render grows when FilesConfig.Calendar is set (internal/clan/files.go:454-483, renderNextcloudCalendar), and a phantom clan-core calendar inventory instance is deliberately never written (internal/provision/deploy_test.go:1279, TestDeploy_CalendarDrivesTheFilesRenderNotAPhantomInventory). So Preselected could never carry calendar.

The kept box (168.144.171.185, artifacts/live-box.json, kept_on_red: true) said so verbatim. ls /srv/idss/config/machines/gateway/:

acme-dns.nix  configuration.nix  files.nix  front-door.nix
gateway-guest.nix  gateway-render.json  ledger.nix

No calendar.nix. And grep -n -i calendar …/files.nix:

files.nix:338:  # Calendar & contacts (#1174): Nextcloud's OWN built-in Calendar and Contacts
files.nix:345:  systemd.services.nextcloud-calendar = {
files.nix:357:      $occ app:install calendar 2>/dev/null || $occ app:enable calendar

The placement's only durable record of a placed calendar is that oneshot, inside the host module — and no reader looked at it. /srv/idss/config/.idss/inventory.json on the box carries the gateway's role and vars and no services key at all, confirming the sidecar is not a second source either.

This is worse than a missing tick: because the deploy re-renders the files node from the operator's selection (internal/provision/deploy.go:1069, nodeSvcs[clan.CalendarSlug]), the NEXT unrelated change — panel-apply, redeploy-services — would have deployed with Calendar:false and silently disabled Calendar and Contacts on the community's Nextcloud without ever naming a removal.

The suspected layer

internal/clan/deployedservices.go — the per-machine and fleet-wide deployed-service read. Fixed there: a riderModuleMarkers registry reads a RIDER slug off the marker its render already wrote into the HOST module (files.nix ← systemd.services.nextcloud-calendar = {), unioned into both machineServices and ReadDeployedServices so the two readers cannot disagree about one node. A files node with no calendar placed renders no oneshot and reports no rider, so #1589's Calendar:false re-render still takes it back out of the placement.

Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime)

Two-way door. (1) Revertible: the whole change is +76 non-test lines in one file, purely additive — git revert df134cc2 restores the previous read byte-for-byte. It touches no schema, no secrets shape, no route, no default, no message, no security posture, and nothing outside this checkout. (2) Proven by a test written here first and watched fail: TestMachineServices_CalendarRiderReadsBackOffTheFilesRender (internal/clan/deployedservices_test.go) went red with calendar must be in the gateway's Services, got [files] before the fix and green after, plus its mirror TestMachineServices_FilesWithoutCalendarReportsNoRider (a files node with no calendar placed must NOT report the rider, so the removal path still works) and TestReadDeployedServices_CarriesThePlacedCalendarRider (the two readers stay one signal). The fixture renders through RenderFiles itself, so the marker this reader keys on cannot drift from the oneshot the render emits. (3) Mechanical, not a design decision: the product ALREADY means P4-S2 to open pre-ticked with the node's current setup — internal/provision/change.go:13-14 states it as the contract and internal/provision/change_test.go:94 pins it for module-backed slugs. The read simply could not see a service the render had already recorded; this makes it see what is there. Nothing about what a community is offered, what a deploy renders, or what any screen says changes — only that a deployed calendar stops being forgotten. Blast radius on the fleet-wide reader is inert: memberorbit.Catalogue.isDeployed narrows only REGISTERED ports (internal/memberorbit/memberorbit.go:248-259) and calendar has none, and calendar is not in catalogue.liveDatasetServices (internal/catalogue/catalogue.go:972-981) so it contributes no dataset to DatasetsFromPlacement and cannot alter any LOSES verdict. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.

drive 20260924T142850Z red at calendar-remove (sig f8fe3dcef764) — self-fixed on the fast lane, commit c2e1781891745f612225c84f8656eb4fa7fbc7a1; checks: GOWORK had to be pinned to this checkout (the inherited GOWORK points at the drive's payload tree /home/dev/drives/idss-portal). Targeted: GOWORK=/home/dev/rehearsal-heal/idss/go.work go test git.matou.nz/Matou/idss/internal/clan -run 'TestMachineServices_|TestReadDeployedServices_|TestReadPlacement_' -v → RED FIRST on the two new pins (calendar must be in the gateway's Services, got [files]; got map[files:true]), GREEN after the fix (12 passed, 0 failed). Package: go test git.matou.nz/Matou/idss/internal/clan → 2 failures, both PRE-EXISTING on clean main and unrelated (verified by git stash + re-run at 7018fb3f): TestGoldenRenderLint_NoSecretInTheConfigRepo and TestGoldenRenderLint_CatchesPlantedSecretsAndShapes, tripping on the matou-cache public signing key jryaAm0uulUbamaQ5/9Shb9SkpMW3rVv49FkzRNOf7E= that commit 7018fb3f (#1801) landed in gateway-guest.nix/vmguest configuration.nix with no goldenRenderAllowList entry — a separate ticket, not touched here. Downstream consumers: go test git.matou.nz/Matou/idss/internal/provision git.matou.nz/Matou/idss/internal/fleetstate git.matou.nz/Matou/idss/internal/memberorbit git.matou.nz/Matou/idss/internal/catalogue git.matou.nz/Matou/idss/control-plane/... → all ok. gofmt -l internal/clan/ → clean; go vet git.matou.nz/Matou/idss/internal/clan → clean.. evidence: /home/dev/drives/idss-portal/test-results/drive-rented-services/20260924T142850Z on matou-workstation.

## The failure Drive `20260924T142850Z` (`artifacts/verdict.json`: 29 green, 1 red, `firstRedLeg: calendar-remove`) went red at the FIRST assertion of the `calendar-remove` leg — the re-entry tick, before the untick ever ran: ``` Locator: locator('[data-action="toggle-calendar"]') Expected: "selected" Received: "unselected" 63 × locator resolved to <button … data-status="unselected" data-action="toggle-calendar" class="oc-card oc-card--gated"> ``` That is `unselectServiceOnGateway`'s guard at `app/tests/e2e/fixtures/brandreach.ts:520-523` ("the running ${svc.name} is not ticked on re-entry — the picker forgot a deployed service"). `calendar-install` was green immediately before it (134 s), and its own on-the-box proof `expectCalendarAppsGoneFromGuest`'s sibling `expectCalendarAppsEnabledOnGuest` (`app/tests/e2e/fixtures/calendarRemoval.ts:154`) had already confirmed `occ app:list` showed calendar + contacts ENABLED on the guest. So the service WAS deployed and the picker did not know it. ## The evidence The picker's ticks seed from `props.preselect` alone in change mode (`dashboard/src/components/provisioning/SelectRoleServicesScreen.vue:372-380`, `initialSelection`). `preselect` is the seam's `Assessment.Preselected`, built in `internal/provision/change.go:88-105` by iterating `d.Services` — the fleet projection's per-node assignments, which come from `control-plane/cmd/control-plane/whole_composition.go:1089` (`configRepoInventory.Placement`) → `clan.ReadPlacement` (`internal/clan/inventory.go:196-212`) → `machineServices` (`internal/clan/deployedservices.go:55-68`). `machineServices` keys on `<slug>.nix` file PRESENCE via `deployedModuleFiles` (`internal/clan/deployedservices.go:18-33`). **`calendar` is not in that map, and cannot be**: Calendar & contacts ships no module of its own by design — its whole substance is the app-enable oneshot the FILES render grows when `FilesConfig.Calendar` is set (`internal/clan/files.go:454-483`, `renderNextcloudCalendar`), and a phantom clan-core `calendar` inventory instance is deliberately never written (`internal/provision/deploy_test.go:1279`, `TestDeploy_CalendarDrivesTheFilesRenderNotAPhantomInventory`). So `Preselected` could never carry `calendar`. **The kept box (168.144.171.185, `artifacts/live-box.json`, `kept_on_red: true`) said so verbatim.** `ls /srv/idss/config/machines/gateway/`: ``` acme-dns.nix configuration.nix files.nix front-door.nix gateway-guest.nix gateway-render.json ledger.nix ``` No `calendar.nix`. And `grep -n -i calendar …/files.nix`: ``` files.nix:338: # Calendar & contacts (#1174): Nextcloud's OWN built-in Calendar and Contacts files.nix:345: systemd.services.nextcloud-calendar = { files.nix:357: $occ app:install calendar 2>/dev/null || $occ app:enable calendar ``` The placement's only durable record of a placed calendar is that oneshot, inside the host module — and no reader looked at it. `/srv/idss/config/.idss/inventory.json` on the box carries the gateway's role and vars and no `services` key at all, confirming the sidecar is not a second source either. This is worse than a missing tick: because the deploy re-renders the files node from the operator's selection (`internal/provision/deploy.go:1069`, `nodeSvcs[clan.CalendarSlug]`), the NEXT unrelated change — `panel-apply`, `redeploy-services` — would have deployed with `Calendar:false` and silently disabled Calendar and Contacts on the community's Nextcloud without ever naming a removal. ## The suspected layer `internal/clan/deployedservices.go` — the per-machine and fleet-wide deployed-service read. Fixed there: a `riderModuleMarkers` registry reads a RIDER slug off the marker its render already wrote into the HOST module (`files.nix` ← `systemd.services.nextcloud-calendar = {`), unioned into both `machineServices` and `ReadDeployedServices` so the two readers cannot disagree about one node. A files node with no calendar placed renders no oneshot and reports no rider, so #1589's `Calendar:false` re-render still takes it back out of the placement. ## Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime) Two-way door. (1) Revertible: the whole change is +76 non-test lines in one file, purely additive — `git revert df134cc2` restores the previous read byte-for-byte. It touches no schema, no secrets shape, no route, no default, no message, no security posture, and nothing outside this checkout. (2) Proven by a test written here first and watched fail: `TestMachineServices_CalendarRiderReadsBackOffTheFilesRender` (internal/clan/deployedservices_test.go) went red with `calendar must be in the gateway's Services, got [files]` before the fix and green after, plus its mirror `TestMachineServices_FilesWithoutCalendarReportsNoRider` (a files node with no calendar placed must NOT report the rider, so the removal path still works) and `TestReadDeployedServices_CarriesThePlacedCalendarRider` (the two readers stay one signal). The fixture renders through `RenderFiles` itself, so the marker this reader keys on cannot drift from the oneshot the render emits. (3) Mechanical, not a design decision: the product ALREADY means P4-S2 to open pre-ticked with the node's current setup — `internal/provision/change.go:13-14` states it as the contract and `internal/provision/change_test.go:94` pins it for module-backed slugs. The read simply could not see a service the render had already recorded; this makes it see what is there. Nothing about what a community is offered, what a deploy renders, or what any screen says changes — only that a deployed calendar stops being forgotten. Blast radius on the fleet-wide reader is inert: `memberorbit.Catalogue.isDeployed` narrows only REGISTERED ports (internal/memberorbit/memberorbit.go:248-259) and calendar has none, and calendar is not in `catalogue.liveDatasetServices` (internal/catalogue/catalogue.go:972-981) so it contributes no dataset to `DatasetsFromPlacement` and cannot alter any LOSES verdict. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes. drive `20260924T142850Z` red at `calendar-remove` (sig f8fe3dcef764) — self-fixed on the fast lane, commit `c2e1781891745f612225c84f8656eb4fa7fbc7a1`; checks: GOWORK had to be pinned to this checkout (the inherited GOWORK points at the drive's payload tree /home/dev/drives/idss-portal). Targeted: `GOWORK=/home/dev/rehearsal-heal/idss/go.work go test git.matou.nz/Matou/idss/internal/clan -run 'TestMachineServices_|TestReadDeployedServices_|TestReadPlacement_' -v` → RED FIRST on the two new pins (`calendar must be in the gateway's Services, got [files]`; `got map[files:true]`), GREEN after the fix (12 passed, 0 failed). Package: `go test git.matou.nz/Matou/idss/internal/clan` → 2 failures, both PRE-EXISTING on clean main and unrelated (verified by `git stash` + re-run at 7018fb3f): `TestGoldenRenderLint_NoSecretInTheConfigRepo` and `TestGoldenRenderLint_CatchesPlantedSecretsAndShapes`, tripping on the matou-cache public signing key `jryaAm0uulUbamaQ5/9Shb9SkpMW3rVv49FkzRNOf7E=` that commit 7018fb3f (#1801) landed in gateway-guest.nix/vmguest configuration.nix with no `goldenRenderAllowList` entry — a separate ticket, not touched here. Downstream consumers: `go test git.matou.nz/Matou/idss/internal/provision git.matou.nz/Matou/idss/internal/fleetstate git.matou.nz/Matou/idss/internal/memberorbit git.matou.nz/Matou/idss/internal/catalogue git.matou.nz/Matou/idss/control-plane/...` → all ok. `gofmt -l internal/clan/` → clean; `go vet git.matou.nz/Matou/idss/internal/clan` → clean.. evidence: `/home/dev/drives/idss-portal/test-results/drive-rented-services/20260924T142850Z` on matou-workstation. <!-- rehearsal-sig: f8fe3dcef764 -->
Author
Member

close-report for #1822 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1822,
  "status": "success",
  "commits": [
    "c2e1781891745f612225c84f8656eb4fa7fbc7a1"
  ],
  "changed_files": [
    "internal/clan/deployedservices.go",
    "internal/clan/deployedservices_test.go"
  ],
  "tests": [
    {
      "command": "GOWORK had to be pinned to this checkout (the inherited GOWORK points at the drive's payload tree /home/dev/drives/idss-portal). Targeted: `GOWORK=/home/dev/rehearsal-heal/idss/go.work go test git.matou.nz/Matou/idss/internal/clan -run 'TestMachineServices_|TestReadDeployedServices_|TestReadPlacement_' -v` → RED FIRST on the two new pins (`calendar must be in the gateway's Services, got [files]`; `got map[files:true]`), GREEN after the fix (12 passed, 0 failed). Package: `go test git.matou.nz/Matou/idss/internal/clan` → 2 failures, both PRE-EXISTING on clean main and unrelated (verified by `git stash` + re-run at 7018fb3f): `TestGoldenRenderLint_NoSecretInTheConfigRepo` and `TestGoldenRenderLint_CatchesPlantedSecretsAndShapes`, tripping on the matou-cache public signing key `jryaAm0uulUbamaQ5/9Shb9SkpMW3rVv49FkzRNOf7E=` that commit 7018fb3f (#1801) landed in gateway-guest.nix/vmguest configuration.nix with no `goldenRenderAllowList` entry — a separate ticket, not touched here. Downstream consumers: `go test git.matou.nz/Matou/idss/internal/provision git.matou.nz/Matou/idss/internal/fleetstate git.matou.nz/Matou/idss/internal/memberorbit git.matou.nz/Matou/idss/internal/catalogue git.matou.nz/Matou/idss/control-plane/...` → all ok. `gofmt -l internal/clan/` → clean; `go vet git.matou.nz/Matou/idss/internal/clan` → clean.",
      "exit_code": 0
    }
  ],
  "criteria": {
    "the red leg is now green": "healed on the fast lane, commit c2e1781891745f612225c84f8656eb4fa7fbc7a1"
  },
  "summary": "The placement read-back keyed only on `<slug>.nix` presence, so the calendar rider — whose only record is the app-enable oneshot inside files.nix — was invisible to `Preselected` and the change picker opened with a deployed Calendar & contacts unticked; `machineServices`/`ReadDeployedServices` now read a rider off its marker in the host module.",
  "blockers": []
}
**close-report** for #1822 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1822, "status": "success", "commits": [ "c2e1781891745f612225c84f8656eb4fa7fbc7a1" ], "changed_files": [ "internal/clan/deployedservices.go", "internal/clan/deployedservices_test.go" ], "tests": [ { "command": "GOWORK had to be pinned to this checkout (the inherited GOWORK points at the drive's payload tree /home/dev/drives/idss-portal). Targeted: `GOWORK=/home/dev/rehearsal-heal/idss/go.work go test git.matou.nz/Matou/idss/internal/clan -run 'TestMachineServices_|TestReadDeployedServices_|TestReadPlacement_' -v` → RED FIRST on the two new pins (`calendar must be in the gateway's Services, got [files]`; `got map[files:true]`), GREEN after the fix (12 passed, 0 failed). Package: `go test git.matou.nz/Matou/idss/internal/clan` → 2 failures, both PRE-EXISTING on clean main and unrelated (verified by `git stash` + re-run at 7018fb3f): `TestGoldenRenderLint_NoSecretInTheConfigRepo` and `TestGoldenRenderLint_CatchesPlantedSecretsAndShapes`, tripping on the matou-cache public signing key `jryaAm0uulUbamaQ5/9Shb9SkpMW3rVv49FkzRNOf7E=` that commit 7018fb3f (#1801) landed in gateway-guest.nix/vmguest configuration.nix with no `goldenRenderAllowList` entry — a separate ticket, not touched here. Downstream consumers: `go test git.matou.nz/Matou/idss/internal/provision git.matou.nz/Matou/idss/internal/fleetstate git.matou.nz/Matou/idss/internal/memberorbit git.matou.nz/Matou/idss/internal/catalogue git.matou.nz/Matou/idss/control-plane/...` → all ok. `gofmt -l internal/clan/` → clean; `go vet git.matou.nz/Matou/idss/internal/clan` → clean.", "exit_code": 0 } ], "criteria": { "the red leg is now green": "healed on the fast lane, commit c2e1781891745f612225c84f8656eb4fa7fbc7a1" }, "summary": "The placement read-back keyed only on `<slug>.nix` presence, so the calendar rider — whose only record is the app-enable oneshot inside files.nix — was invisible to `Preselected` and the change picker opened with a deployed Calendar & contacts unticked; `machineServices`/`ReadDeployedServices` now read a rider off its marker in the host module.", "blockers": [] } ``` </details>
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#1822
No description provided.