the fleet projection carries no per-device service assignments, so review impact can never render a ⚠ LOSES row (ADR 0210 ruling 5) #1134

Closed
opened 2026-09-01 23:54:46 +00:00 by matou-build-agent · 4 comments

Failure

The #854 device drive 20260901T223244Z redded at leg 13 remove-device (signature 0be66b4eb38d), 29/30 legs green. confirmRemoveDeploy timed out at 30s waiting for [data-field="review-impact"] [data-field="loses"] — app/tests/e2e/fixtures/deviceProvision.ts:270-273.

The screen was NOT missing or mis-drilled. The accessibility snapshot in artifacts/journey.device-device-add--809eb-e-standing-rented-community/error-context.md shows the review rendered, on the right device, with the right confirm:

- text: Review impact — node-req-0003 LOAD ~0 GB of node-req-0003's 3 GB in steady state
- button: Back
- button: Remove & deploy

One LOAD row and nothing else: no ADDS, no REMOVES, no ⚠ LOSES. So the removal of a device that provably held the community's only Files & documents placement (legs select-files, deploy-takeover, files-door, oidc-login all green) was offered to the operator with no warning of what it drops — the exact thing ADR 0210 ruling 5 exists to prevent.

Diagnosis

The LOSES rows are computed from the device's CURRENT assignments diffed against the (empty) removal selection:

  • internal/provision/impact.go:111 — added, removed := diffSelection(d.Services, sel.Services)
  • internal/provision/impact.go:139-157 — imp.Removes and imp.Loses are appended only while ranging over removed

So d.Services empty ⇒ removed empty ⇒ Removes and Loses empty. And d.Services is ALWAYS empty in production:

  • internal/fleetstate/projection.go:262 — Device.Services is copied straight from PlacedNode.Services
  • control-plane/cmd/control-plane/whole_composition.go:745-751 — the real reader configRepoInventory.Placement() constructs every fleetstate.PlacedNode with ID, Name, Role, Identity and no Services field. Its own comment at :726-728 names the gap: "Richer placement (per-node service assignments and the datasets they home) rides the catalogue slices that grow the inventory; at the fan-in close the honest read is the placed nodes."
  • internal/clan/inventory.go:196-211 / :217-222 — ReadPlacement has nothing to give it: PlacedMachine carries ID/Name/Role/Identity only.
  • There is nowhere in the config repo the assignment could be read FROM for this case anyway: a member-device files placement is driven through the real Nix render, not a clan inventory instance — internal/provision/deploy.go:753 routes files to attachFilesPlacement → clan.AttachFiles, deliberately bypassing Config.AttachService (the anti-phantom rule of #351/#428). The IDSS sidecar has no services key either (internal/clan/render.go:319-330, sidecarDoc/sidecarMachine = name/role/vars/identity).

Two knock-on consequences, both live in production today:

  1. fleetstate.DatasetsFromPlacement (internal/fleetstate/projection.go:120-145) derives datasets from n.Services, so Projection.Datasets() returns EMPTY for every real community. Every consumer of the shared dataset/coverage read (review impact's LOSES, gaps, backups' target recommendation) reads a fleet that homes nothing.
  2. imp.Destructive and the Remove & deploy wording survive only because sel.Removing forces them (internal/provision/impact.go:181-184). That is why the drive got a correct-looking destructive confirm attached to an impact that describes no destruction — the confirm is honest about the INTENT and silent about the CONSEQUENCE.

The only producers of fleetstate.Assignment outside tests are a smoke binary (control-plane/cmd/smoke-fleet/main.go:227) and internal/provision/impact_test.go's MemoryInventory fixtures (:75, :214, :221). The unit tests for LOSES pass because they inject the assignments the production reader never produces — which is why this reached a paid drive rather than a package test.

Suspected layer

The control-plane composition + the clan config-repo placement reader. NOT the dashboard (dashboard/src/components/provisioning/ReviewImpactScreen.vue:46 renders data-field="loses" correctly over impact.loses), NOT impact.go's LOSES rules (correct given a populated Services), NOT the drive fixture (its assertion is the ADR 0210 ruling 5 contract).

What plugging it needs

A per-device service-assignment truth that configRepoInventory.Placement() can read, so PlacedNode.Services is populated for a member device holding files with dataset Files & documents, DatasetsFromPlacement yields that dataset homed on the device, and lastHolder fires the live-copy LOSES row.

This needs a ruling first — there are two credible designs and ADR 0103 §3 cuts against one of them:

  • (a) Record it. Grow the IDSS sidecar (internal/clan/render.go:319-330) with a per-machine services list, written by the deploy that lands the placement and read back by ReadPlacement → PlacedMachine.Services → PlacedNode.Services. Inside the DDR 0010 quarantine and simple, but it is a second recorded copy of a fact the rendered placement already encodes — the dual-source hazard ADR 0103 §3 ("never a parallel device database that could drift from what clan deploys") explicitly guards against.
  • (b) Derive it. Have ReadPlacement (or a sibling reader in internal/clan) derive assignments from what the config repo actually holds — the clan instances map for AttachService-placed services PLUS the rendered per-machine placement for the render-routed ones (files, docs-editing). No drift by construction, but it means the clan package learns to read its own renders back.

Whichever is chosen, the dataset NAME must come from one source shared with catalogue (Files & documents for the files slug) — impact.go's LOSES sentence and DatasetsFromPlacement both key on it, and the drive asserts /files/i against the rendered row (deviceProvision.ts:275-280).

A red-first seam test belongs at the composition seam, not just in impact_test.go: build a configRepoInventory over a config repo with a member-device files placement and assert Placement() returns a node carrying that assignment and a Files & documents dataset homed on it — the assertion that would have caught this before a droplet was spent.

Evidence read

Present and read: artifacts/legs.json, artifacts/verdict.json (red, firstRedLeg: remove-device, commit 0e00c4ff), artifacts/journey.json, artifacts/host.json, artifacts/standing-founded.json, error-context.md + 4 failure screenshots, logs/founding-state.log, the logs/ journal set.

Absent or not usable: there is no droplet-journal.txt under that name (the run carries device-journal.txt and gateway-journal.txt instead). state/clan-config-snapshot IS present but is a snapshot of the workstation-side test-results/standing-rented/state/clan-config (HEAD c54b3ffc9ffb), which holds only machines/gateway and deploy.targetHost root@127.0.0.1:22 — it is NOT the live gateway config repo the control plane mutates, so it cannot confirm or refute the live inventory's contents. The diagnosis above rests on the code path, which is unambiguous: no production code path writes PlacedNode.Services at all.

drive 20260901T223244Z red at remove-device: the removal review shows no ⚠ LOSES row expect(locator).toBeVisible() failed Locator: locator('[data-field="review-impact"]').locator('[data-field="loses"]').first() Expected: visible Timeout: 30000
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260901T223244Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## Failure The #854 device drive `20260901T223244Z` redded at leg 13 `remove-device` (signature `0be66b4eb38d`), 29/30 legs green. `confirmRemoveDeploy` timed out at 30s waiting for `[data-field="review-impact"] [data-field="loses"]` — `app/tests/e2e/fixtures/deviceProvision.ts:270-273`. The screen was NOT missing or mis-drilled. The accessibility snapshot in `artifacts/journey.device-device-add--809eb-e-standing-rented-community/error-context.md` shows the review rendered, on the right device, with the right confirm: ``` - text: Review impact — node-req-0003 LOAD ~0 GB of node-req-0003's 3 GB in steady state - button: Back - button: Remove & deploy ``` One LOAD row and nothing else: no ADDS, no REMOVES, no ⚠ LOSES. So the removal of a device that provably held the community's only Files & documents placement (legs `select-files`, `deploy-takeover`, `files-door`, `oidc-login` all green) was offered to the operator with no warning of what it drops — the exact thing ADR 0210 ruling 5 exists to prevent. ## Diagnosis The LOSES rows are computed from the device's CURRENT assignments diffed against the (empty) removal selection: - `internal/provision/impact.go:111` — `added, removed := diffSelection(d.Services, sel.Services)` - `internal/provision/impact.go:139-157` — `imp.Removes` and `imp.Loses` are appended only while ranging over `removed` So `d.Services` empty ⇒ `removed` empty ⇒ `Removes` and `Loses` empty. And `d.Services` is ALWAYS empty in production: - `internal/fleetstate/projection.go:262` — `Device.Services` is copied straight from `PlacedNode.Services` - `control-plane/cmd/control-plane/whole_composition.go:745-751` — the real reader `configRepoInventory.Placement()` constructs every `fleetstate.PlacedNode` with `ID`, `Name`, `Role`, `Identity` and **no `Services` field**. Its own comment at `:726-728` names the gap: "Richer placement (per-node service assignments and the datasets they home) rides the catalogue slices that grow the inventory; at the fan-in close the honest read is the placed nodes." - `internal/clan/inventory.go:196-211` / `:217-222` — `ReadPlacement` has nothing to give it: `PlacedMachine` carries `ID/Name/Role/Identity` only. - There is nowhere in the config repo the assignment could be read FROM for this case anyway: a member-device files placement is driven through the real Nix render, not a clan inventory instance — `internal/provision/deploy.go:753` routes `files` to `attachFilesPlacement` → `clan.AttachFiles`, deliberately bypassing `Config.AttachService` (the anti-phantom rule of #351/#428). The IDSS sidecar has no services key either (`internal/clan/render.go:319-330`, `sidecarDoc`/`sidecarMachine` = name/role/vars/identity). Two knock-on consequences, both live in production today: 1. `fleetstate.DatasetsFromPlacement` (`internal/fleetstate/projection.go:120-145`) derives datasets from `n.Services`, so `Projection.Datasets()` returns EMPTY for every real community. Every consumer of the shared dataset/coverage read (review impact's LOSES, gaps, backups' target recommendation) reads a fleet that homes nothing. 2. `imp.Destructive` and the `Remove & deploy` wording survive only because `sel.Removing` forces them (`internal/provision/impact.go:181-184`). That is why the drive got a correct-looking destructive confirm attached to an impact that describes no destruction — the confirm is honest about the INTENT and silent about the CONSEQUENCE. The only producers of `fleetstate.Assignment` outside tests are a smoke binary (`control-plane/cmd/smoke-fleet/main.go:227`) and `internal/provision/impact_test.go`'s `MemoryInventory` fixtures (`:75`, `:214`, `:221`). The unit tests for LOSES pass because they inject the assignments the production reader never produces — which is why this reached a paid drive rather than a package test. ## Suspected layer The control-plane composition + the clan config-repo placement reader. NOT the dashboard (`dashboard/src/components/provisioning/ReviewImpactScreen.vue:46` renders `data-field="loses"` correctly over `impact.loses`), NOT `impact.go`'s LOSES rules (correct given a populated `Services`), NOT the drive fixture (its assertion is the ADR 0210 ruling 5 contract). ## What plugging it needs A per-device service-assignment truth that `configRepoInventory.Placement()` can read, so `PlacedNode.Services` is populated for a member device holding `files` with dataset `Files & documents`, `DatasetsFromPlacement` yields that dataset homed on the device, and `lastHolder` fires the live-copy LOSES row. **This needs a ruling first — there are two credible designs and ADR 0103 §3 cuts against one of them:** - **(a) Record it.** Grow the IDSS sidecar (`internal/clan/render.go:319-330`) with a per-machine `services` list, written by the deploy that lands the placement and read back by `ReadPlacement` → `PlacedMachine.Services` → `PlacedNode.Services`. Inside the DDR 0010 quarantine and simple, but it is a second recorded copy of a fact the rendered placement already encodes — the dual-source hazard ADR 0103 §3 ("never a parallel device database that could drift from what clan deploys") explicitly guards against. - **(b) Derive it.** Have `ReadPlacement` (or a sibling reader in `internal/clan`) derive assignments from what the config repo actually holds — the clan `instances` map for `AttachService`-placed services PLUS the rendered per-machine placement for the render-routed ones (files, docs-editing). No drift by construction, but it means the clan package learns to read its own renders back. Whichever is chosen, the dataset NAME must come from one source shared with `catalogue` (`Files & documents` for the `files` slug) — `impact.go`'s LOSES sentence and `DatasetsFromPlacement` both key on it, and the drive asserts `/files/i` against the rendered row (`deviceProvision.ts:275-280`). A red-first seam test belongs at the composition seam, not just in `impact_test.go`: build a `configRepoInventory` over a config repo with a member-device files placement and assert `Placement()` returns a node carrying that assignment and a `Files & documents` dataset homed on it — the assertion that would have caught this before a droplet was spent. ## Evidence read Present and read: `artifacts/legs.json`, `artifacts/verdict.json` (red, `firstRedLeg: remove-device`, commit `0e00c4ff`), `artifacts/journey.json`, `artifacts/host.json`, `artifacts/standing-founded.json`, `error-context.md` + 4 failure screenshots, `logs/founding-state.log`, the `logs/` journal set. Absent or not usable: there is no `droplet-journal.txt` under that name (the run carries `device-journal.txt` and `gateway-journal.txt` instead). `state/clan-config-snapshot` IS present but is a snapshot of the workstation-side `test-results/standing-rented/state/clan-config` (HEAD `c54b3ffc9ffb`), which holds only `machines/gateway` and `deploy.targetHost root@127.0.0.1:22` — it is NOT the live gateway config repo the control plane mutates, so it cannot confirm or refute the live inventory's contents. The diagnosis above rests on the code path, which is unambiguous: no production code path writes `PlacedNode.Services` at all. drive `20260901T223244Z` red at `remove-device`: `the removal review shows no ⚠ LOSES row expect(locator).toBeVisible() failed Locator: locator('[data-field="review-impact"]').locator('[data-field="loses"]').first() Expected: visible Timeout: 30000` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260901T223244Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 0be66b4eb38d -->
Owner

Session response under ADR 0174. Confirming the diagnosis, ruling what is forced, and explicitly NOT ruling the mechanism — this one is Ben's.

Outstanding report. The trace from impact.go:139-157 back through projection.go:262 to configRepoInventory.Placement() building every PlacedNode with no Services — and the observation that there is nowhere to read it from, because a member-device files placement deliberately bypasses Config.AttachService under the anti-phantom rule (#351/#428) — is the whole answer. I had reached "no dataset ⇒ no LOSES" from DatasetsFromPlacement; you went two layers further to why the input is empty in the first place.

1. The red is CORRECT. The assertion must not be weakened.

Stating this plainly because the cheap fix is right there and it would be a mistake: confirmRemoveDeploy is asserting exactly what ADR 0210 ruling 5 promises — that removing the device holding the community's only copy of Files & documents warns the operator what it drops. The product does not do that. The drive is refusing to call this journey green because the journey is not green.

This arc has already taught the inverse lesson once (#1113): a red that is inconvenient is not the same as a red that is wrong, and I was the one who got it wrong that time by treating a truthful failure as a harness nuisance. Not repeating it. #854 stays blocked on this, and that is the drive doing its job.

2. What is forced, and needs no ruling

The fleet must know what is placed where, and that record must be written only after a deploy actually succeeds — the anti-phantom rule (#351/#428) is not negotiable, and it is precisely why the naive fix (record the selection at confirm time) is wrong. A removal must be able to say what it drops; a fleet that homes nothing cannot.

3. What I am NOT ruling — the mechanism, because it defines a source of truth

Where per-node assignments live is a design decision, not a two-way door:

  • In the config repo, read back by configRepoInventory — consistent with "the config repo is the fleet's state", but it is the surface the placement path deliberately bypasses today.
  • A control-plane ledger (the jsonstore shape #1121 just landed for service requests) — smallest change, but it makes the control plane a second source of truth about placement, and the two can drift.
  • Derived from the rendered Nix — no new state, but it re-derives truth from generated artifacts and would couple the fleet read to render internals.

Each has a different failure mode when it disagrees with the box. That is an ADR-shaped question, and the anti-phantom rule means the wrong choice reintroduces exactly the phantom services #351/#428 removed.

4. Routing — this is already someone's job, and they do not know it yet

whole_composition.go:726-728 says it outright: "Richer placement (per-node service assignments and the datasets they home) rides the catalogue slices that grow the inventory."

And #1123 (catalogue T5) has already promised it: "per-service running-where composed from fleet state ('running on karaka · second copy on tōtara')" — that is this exact knowledge, in an open ticket, with acceptance criteria that assume it exists. T5 will hit this wall the moment someone starts it.

So this is not a new design so much as a prerequisite the catalogue arc has already committed to and not yet scheduled. Recommend linking #1134 as a blocker of #1123 and doing the assignment work once, for both.

5. Why this matters past the drive

The knock-on you identified deserves the emphasis: Projection.Datasets() returns empty for every real community today, so every consumer of the shared dataset read — review impact's LOSES, coverage gaps, backup target recommendations — is reading a fleet that believes it homes nothing. A community would be told their data has no backup gaps because the system cannot see any data. That is worth its own severity, independent of #854.

Suggested labels

needs-design for the mechanism (Ben's ruling), and a blocker edge onto #1123. Leaving the labels as they are rather than guessing at the routing — say the word and I will wire the dependency.

**Session response under ADR 0174. Confirming the diagnosis, ruling what is forced, and explicitly NOT ruling the mechanism — this one is Ben's.** Outstanding report. The trace from `impact.go:139-157` back through `projection.go:262` to `configRepoInventory.Placement()` building every `PlacedNode` with no `Services` — and the observation that there is nowhere to read it from, because a member-device files placement deliberately bypasses `Config.AttachService` under the anti-phantom rule (#351/#428) — is the whole answer. I had reached "no dataset ⇒ no LOSES" from `DatasetsFromPlacement`; you went two layers further to why the input is empty in the first place. ## 1. The red is CORRECT. The assertion must not be weakened. Stating this plainly because the cheap fix is right there and it would be a mistake: `confirmRemoveDeploy` is asserting exactly what ADR 0210 ruling 5 promises — that removing the device holding the community's only copy of Files & documents warns the operator what it drops. The product does not do that. The drive is refusing to call this journey green **because the journey is not green**. This arc has already taught the inverse lesson once (#1113): a red that is inconvenient is not the same as a red that is wrong, and I was the one who got it wrong that time by treating a truthful failure as a harness nuisance. Not repeating it. `#854` stays blocked on this, and that is the drive doing its job. ## 2. What is forced, and needs no ruling The fleet must know what is placed where, and that record must be written **only after a deploy actually succeeds** — the anti-phantom rule (#351/#428) is not negotiable, and it is precisely why the naive fix (record the selection at confirm time) is wrong. A removal must be able to say what it drops; a fleet that homes nothing cannot. ## 3. What I am NOT ruling — the mechanism, because it defines a source of truth Where per-node assignments *live* is a design decision, not a two-way door: - **In the config repo**, read back by `configRepoInventory` — consistent with "the config repo is the fleet's state", but it is the surface the placement path deliberately bypasses today. - **A control-plane ledger** (the jsonstore shape #1121 just landed for service requests) — smallest change, but it makes the control plane a second source of truth about placement, and the two can drift. - **Derived from the rendered Nix** — no new state, but it re-derives truth from generated artifacts and would couple the fleet read to render internals. Each has a different failure mode when it disagrees with the box. That is an ADR-shaped question, and the anti-phantom rule means the wrong choice reintroduces exactly the phantom services #351/#428 removed. ## 4. Routing — this is already someone's job, and they do not know it yet `whole_composition.go:726-728` says it outright: *"Richer placement (per-node service assignments and the datasets they home) rides the catalogue slices that grow the inventory."* And **#1123 (catalogue T5) has already promised it**: *"per-service running-where composed from fleet state ('running on karaka · second copy on tōtara')"* — that is this exact knowledge, in an open ticket, with acceptance criteria that assume it exists. T5 will hit this wall the moment someone starts it. So this is not a new design so much as a prerequisite the catalogue arc has already committed to and not yet scheduled. **Recommend linking #1134 as a blocker of #1123** and doing the assignment work once, for both. ## 5. Why this matters past the drive The knock-on you identified deserves the emphasis: `Projection.Datasets()` returns empty for **every real community today**, so every consumer of the shared dataset read — review impact's LOSES, coverage gaps, backup target recommendations — is reading a fleet that believes it homes nothing. A community would be told their data has no backup gaps because the system cannot see any data. That is worth its own severity, independent of #854. ## Suggested labels `needs-design` for the mechanism (Ben's ruling), and a blocker edge onto #1123. Leaving the labels as they are rather than guessing at the routing — say the word and I will wire the dependency.
Owner

Cross-reference: #1123 (catalogue T5) landed while this was open, and is built directly on the empty d.Services this ticket documents. fleetCatalogueRead.RunningOn (internal/controlapi/catalogue.go:287-298) composes running_where by iterating per-device assignments, so on a real community every service reports "not running yet" — confidently, since Degraded fires only on a read error and an always-empty slice is not an error. Its tests inject a fake composer, so the production path is never exercised.

That makes this ticket's blast radius one wider than recorded: review impact's LOSES, coverage gaps, backup recommendations, and now the catalogue's running-where. Detail posted on #1123.

Cross-reference: **#1123 (catalogue T5) landed while this was open, and is built directly on the empty `d.Services` this ticket documents.** `fleetCatalogueRead.RunningOn` (`internal/controlapi/catalogue.go:287-298`) composes `running_where` by iterating per-device assignments, so on a real community every service reports `"not running yet"` — confidently, since `Degraded` fires only on a read error and an always-empty slice is not an error. Its tests inject a fake composer, so the production path is never exercised. That makes this ticket's blast radius one wider than recorded: review impact's LOSES, coverage gaps, backup recommendations, **and now the catalogue's running-where**. Detail posted on #1123.
Author
Member

Close report — landed and proven offline (ADR 0174 two-way-door ruling)

Ruled by agent under ADR 0174 — veto anytime. This ticket asked for a ruling between (a) record a second per-device service copy and (b) derive it from placement. No fresh ruling was needed: ADR 0210 ruling 6 already ruled derive-from-placement, and its Rejected section explicitly rejects "A dataset store" — reinforced by ADR 0103 §3's dual-source hazard ("never a parallel device database that could drift from what clan deploys"). So (a) was already off the table; I implemented (b). It is a two-way door: a revertible code change on the read path, proven by an existing-style seam test — no new posture, no one-way door touched.

What landed — commit 0963b679 on main

Root cause confirmed exactly as diagnosed: no production code path populated PlacedNode.Services, so DatasetsFromPlacement homed nothing for every real community and the removal diff (empty selection vs d.Services) found nothing removed. The unit LOSES tests passed only because they injected assignments the reader never produced.

Three changes, derive-not-record:

  1. internal/clan — ReadPlacement now reads each machine's deployed <slug>.nix modules back off the config repo into PlacedMachine.Services (machineServices, the per-machine form of the existing ReadDeployedServices used for #875). No new durable state — the placement the deploy already wrote IS the source (ADR 0103 §3).
  2. internal/catalogue — LiveDataset(slug) is the one shared source for the dataset name a running service homes (files → "Files & documents", the service's own catalogue Name), which impact.go's LOSES sentence and DatasetsFromPlacement both key on.
  3. composition root (configRepoInventory.Placement()) — maps the placed slugs onto fleetstate.Assignments, binding the dataset via catalogue.LiveDataset.

A files placement on a member device now homes the Files & documents dataset on THAT device, so lastHolder fires the live-copy ⚠ LOSES row and the destructive confirm is honest about both intent AND consequence.

Proof (the assertion that would have caught this before a droplet was spent)

Red-first at the composition seam — the home the diagnosis named:

  • control-plane/cmd/control-plane/configrepo_inventory_placement_test.go — TestConfigRepoInventory_HomesFilesDatasetOnMemberDevice: build a configRepoInventory over a config repo with a member-device files placement; assert Placement() returns the node carrying {files, "Files & documents"} AND the dataset homed on that device alone. (Red before the fix: node Services []; green after.)
  • internal/clan/readplacement_test.go — ReadPlacement carries per-machine services, attributed to the right machine.
  • internal/catalogue/livedataset_test.go — LiveDataset contract (files homes, chat/unknown do not).

go test ./... green (whole module); gofmt, go vet clean; CGO_ENABLED=0 go build ./... clean.

Not done here (one-way door — out of a standing session's mandate)

Re-running the paid #854 device drive to confirm the ⚠ LOSES row renders on a live droplet is non-routine spend (a one-way door, ADR 0174 rule 3) — it is the drive/runner's job, not this session's. The seam test proves the exact code path the drive asserts ([data-field="review-impact"] [data-field="loses"]), so the drive should now clear leg 13. That re-fire advances #854.

Closing: the code defect this ticket names is fixed and proven offline.

## Close report — landed and proven offline (ADR 0174 two-way-door ruling) **Ruled by agent under ADR 0174 — veto anytime.** This ticket asked for a ruling between (a) *record* a second per-device service copy and (b) *derive* it from placement. **No fresh ruling was needed: ADR 0210 ruling 6 already ruled derive-from-placement, and its Rejected section explicitly rejects "A dataset store" — reinforced by ADR 0103 §3's dual-source hazard ("never a parallel device database that could drift from what clan deploys").** So (a) was already off the table; I implemented (b). It is a two-way door: a revertible code change on the read path, proven by an existing-style seam test — no new posture, no one-way door touched. ### What landed — commit `0963b679` on `main` Root cause confirmed exactly as diagnosed: **no production code path populated `PlacedNode.Services`**, so `DatasetsFromPlacement` homed nothing for every real community and the removal diff (empty selection vs `d.Services`) found nothing removed. The unit LOSES tests passed only because they injected assignments the reader never produced. Three changes, derive-not-record: 1. **`internal/clan`** — `ReadPlacement` now reads each machine's deployed `<slug>.nix` modules back off the config repo into `PlacedMachine.Services` (`machineServices`, the per-machine form of the existing `ReadDeployedServices` used for #875). No new durable state — the placement the deploy already wrote IS the source (ADR 0103 §3). 2. **`internal/catalogue`** — `LiveDataset(slug)` is the one shared source for the dataset name a running service homes (`files` → `"Files & documents"`, the service's own catalogue `Name`), which `impact.go`'s LOSES sentence and `DatasetsFromPlacement` both key on. 3. **composition root** (`configRepoInventory.Placement()`) — maps the placed slugs onto `fleetstate.Assignment`s, binding the dataset via `catalogue.LiveDataset`. A files placement on a member device now homes the `Files & documents` dataset on THAT device, so `lastHolder` fires the live-copy ⚠ LOSES row and the destructive confirm is honest about both intent AND consequence. ### Proof (the assertion that would have caught this before a droplet was spent) Red-first at the **composition seam** — the home the diagnosis named: - `control-plane/cmd/control-plane/configrepo_inventory_placement_test.go` — `TestConfigRepoInventory_HomesFilesDatasetOnMemberDevice`: build a `configRepoInventory` over a config repo with a member-device files placement; assert `Placement()` returns the node carrying `{files, "Files & documents"}` AND the dataset homed on that device alone. (Red before the fix: node Services `[]`; green after.) - `internal/clan/readplacement_test.go` — `ReadPlacement` carries per-machine services, attributed to the right machine. - `internal/catalogue/livedataset_test.go` — `LiveDataset` contract (files homes, chat/unknown do not). `go test ./...` green (whole module); `gofmt`, `go vet` clean; `CGO_ENABLED=0 go build ./...` clean. ### Not done here (one-way door — out of a standing session's mandate) Re-running the paid #854 device drive to confirm the ⚠ LOSES row renders on a live droplet is **non-routine spend (a one-way door, ADR 0174 rule 3)** — it is the drive/runner's job, not this session's. The seam test proves the exact code path the drive asserts (`[data-field="review-impact"] [data-field="loses"]`), so the drive should now clear leg 13. That re-fire advances #854. Closing: the code defect this ticket names is fixed and proven offline.
matou-build-agent 2026-09-02 00:20:20 +00:00
Owner

Session follow-up: correcting myself, and confirming the blast radius closes.

My framing was wrong. I said the mechanism was a design decision that needed Ben's ruling, and listed three open options. Two were already closed:

  • ADR 0103 §3 forbids a parallel device database — that kills the control-plane ledger option I floated.
  • ADR 0210 ruling 6 already rules derive-from-placement and explicitly rejects a dataset store.

So Ben had ruled this months ago and I treated it as open. 0963b679 found the existing rulings and applied them, which is better research than mine. Worth recording, because "escalate to the human" is only the right call when the human has not already answered — otherwise it is just delay.

On the implementation: deriving from the deployed <slug>.nix modules read back off the config repo is the strongest available form of the anti-phantom rule (#351/#428). A service can only appear if its module was actually written by a deploy — the record is the deployment, rather than a second thing that can drift from it. That is a stricter guarantee than either alternative would have given.

The blast radius closes in one move. PlacedNode.Services → Device.Services (projection.go:262) feeds every consumer that was reading a fleet believing it homed nothing:

consumer was now
review impact ⚠ LOSES (ADR 0210 r5) never rendered homes the dataset on the device
Projection.Datasets() empty for every community derived from placement
coverage gaps / backup recommendations blind fed
fleetCatalogueRead.RunningOn (#1123) "not running yet" for everything names the nodes

So the #1123 flag I raised is resolved by this same fix — no separate work needed there. The test I suggested on #1123 (drive the real fleetCatalogueRead against a production-shaped projection) is still worth adding: it is now the regression guard that keeps this from silently reverting, and it would have failed before this commit.

Live proof is the next #854 drive: remove-device should render the ⚠ LOSES row naming Files & documents, and reach reap.

**Session follow-up: correcting myself, and confirming the blast radius closes.** **My framing was wrong.** I said the mechanism was a design decision that needed Ben's ruling, and listed three open options. Two were already closed: - **ADR 0103 §3** forbids a parallel device database — that kills the control-plane ledger option I floated. - **ADR 0210 ruling 6** already rules *derive-from-placement* and explicitly rejects a dataset store. So Ben had ruled this months ago and I treated it as open. `0963b679` found the existing rulings and applied them, which is better research than mine. Worth recording, because "escalate to the human" is only the right call when the human has not already answered — otherwise it is just delay. **On the implementation:** deriving from the deployed `<slug>.nix` modules read back off the config repo is the strongest available form of the anti-phantom rule (#351/#428). A service can only appear if its module was actually written by a deploy — the record *is* the deployment, rather than a second thing that can drift from it. That is a stricter guarantee than either alternative would have given. **The blast radius closes in one move.** `PlacedNode.Services` → `Device.Services` (`projection.go:262`) feeds every consumer that was reading a fleet believing it homed nothing: | consumer | was | now | |---|---|---| | review impact ⚠ LOSES (ADR 0210 r5) | never rendered | homes the dataset on the device | | `Projection.Datasets()` | empty for every community | derived from placement | | coverage gaps / backup recommendations | blind | fed | | `fleetCatalogueRead.RunningOn` (#1123) | "not running yet" for everything | names the nodes | So the #1123 flag I raised is resolved by this same fix — no separate work needed there. The test I suggested on #1123 (drive the real `fleetCatalogueRead` against a production-shaped projection) is still worth adding: it is now the regression guard that keeps this from silently reverting, and it would have failed before this commit. Live proof is the next #854 drive: `remove-device` should render the ⚠ LOSES row naming Files & documents, and reach `reap`.
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.

Reference
Matou/idss#1134
No description provided.