the fleet projection carries no per-device service assignments, so review impact can never render a ⚠ LOSES row (ADR 0210 ruling 5) #1134
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#1134
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Failure
The #854 device drive
20260901T223244Zredded at leg 13remove-device(signature0be66b4eb38d), 29/30 legs green.confirmRemoveDeploytimed 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.mdshows the review rendered, on the right device, with the right confirm: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-loginall 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.Removesandimp.Losesare appended only while ranging overremovedSo
d.Servicesempty ⇒removedempty ⇒RemovesandLosesempty. Andd.Servicesis ALWAYS empty in production:internal/fleetstate/projection.go:262—Device.Servicesis copied straight fromPlacedNode.Servicescontrol-plane/cmd/control-plane/whole_composition.go:745-751— the real readerconfigRepoInventory.Placement()constructs everyfleetstate.PlacedNodewithID,Name,Role,Identityand noServicesfield. Its own comment at:726-728names 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—ReadPlacementhas nothing to give it:PlacedMachinecarriesID/Name/Role/Identityonly.internal/provision/deploy.go:753routesfilestoattachFilesPlacement→clan.AttachFiles, deliberately bypassingConfig.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:
fleetstate.DatasetsFromPlacement(internal/fleetstate/projection.go:120-145) derives datasets fromn.Services, soProjection.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.imp.Destructiveand theRemove & deploywording survive only becausesel.Removingforces 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.Assignmentoutside tests are a smoke binary (control-plane/cmd/smoke-fleet/main.go:227) andinternal/provision/impact_test.go'sMemoryInventoryfixtures (: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:46rendersdata-field="loses"correctly overimpact.loses), NOTimpact.go's LOSES rules (correct given a populatedServices), 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, soPlacedNode.Servicesis populated for a member device holdingfileswith datasetFiles & documents,DatasetsFromPlacementyields that dataset homed on the device, andlastHolderfires the live-copy LOSES row.This needs a ruling first — there are two credible designs and ADR 0103 §3 cuts against one of them:
internal/clan/render.go:319-330) with a per-machineserviceslist, written by the deploy that lands the placement and read back byReadPlacement→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.ReadPlacement(or a sibling reader ininternal/clan) derive assignments from what the config repo actually holds — the claninstancesmap forAttachService-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 & documentsfor thefilesslug) —impact.go's LOSES sentence andDatasetsFromPlacementboth key on it, and the drive asserts/files/iagainst the rendered row (deviceProvision.ts:275-280).A red-first seam test belongs at the composition seam, not just in
impact_test.go: build aconfigRepoInventoryover a config repo with a member-device files placement and assertPlacement()returns a node carrying that assignment and aFiles & documentsdataset 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, commit0e00c4ff),artifacts/journey.json,artifacts/host.json,artifacts/standing-founded.json,error-context.md+ 4 failure screenshots,logs/founding-state.log, thelogs/journal set.Absent or not usable: there is no
droplet-journal.txtunder that name (the run carriesdevice-journal.txtandgateway-journal.txtinstead).state/clan-config-snapshotIS present but is a snapshot of the workstation-sidetest-results/standing-rented/state/clan-config(HEADc54b3ffc9ffb), which holds onlymachines/gatewayanddeploy.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 writesPlacedNode.Servicesat all.drive
20260901T223244Zred atremove-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: 30000evidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260901T223244Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedSession 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-157back throughprojection.go:262toconfigRepoInventory.Placement()building everyPlacedNodewith noServices— and the observation that there is nowhere to read it from, because a member-device files placement deliberately bypassesConfig.AttachServiceunder the anti-phantom rule (#351/#428) — is the whole answer. I had reached "no dataset ⇒ no LOSES" fromDatasetsFromPlacement; 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:
confirmRemoveDeployis 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.
#854stays 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:
configRepoInventory— consistent with "the config repo is the fleet's state", but it is the surface the placement path deliberately bypasses today.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-728says 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-designfor 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.Cross-reference: #1123 (catalogue T5) landed while this was open, and is built directly on the empty
d.Servicesthis ticket documents.fleetCatalogueRead.RunningOn(internal/controlapi/catalogue.go:287-298) composesrunning_whereby iterating per-device assignments, so on a real community every service reports"not running yet"— confidently, sinceDegradedfires 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.
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
0963b679onmainRoot cause confirmed exactly as diagnosed: no production code path populated
PlacedNode.Services, soDatasetsFromPlacementhomed nothing for every real community and the removal diff (empty selection vsd.Services) found nothing removed. The unit LOSES tests passed only because they injected assignments the reader never produced.Three changes, derive-not-record:
internal/clan—ReadPlacementnow reads each machine's deployed<slug>.nixmodules back off the config repo intoPlacedMachine.Services(machineServices, the per-machine form of the existingReadDeployedServicesused for #875). No new durable state — the placement the deploy already wrote IS the source (ADR 0103 §3).internal/catalogue—LiveDataset(slug)is the one shared source for the dataset name a running service homes (files→"Files & documents", the service's own catalogueName), whichimpact.go's LOSES sentence andDatasetsFromPlacementboth key on.configRepoInventory.Placement()) — maps the placed slugs ontofleetstate.Assignments, binding the dataset viacatalogue.LiveDataset.A files placement on a member device now homes the
Files & documentsdataset on THAT device, solastHolderfires 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 aconfigRepoInventoryover a config repo with a member-device files placement; assertPlacement()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—ReadPlacementcarries per-machine services, attributed to the right machine.internal/catalogue/livedataset_test.go—LiveDatasetcontract (files homes, chat/unknown do not).go test ./...green (whole module);gofmt,go vetclean;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.
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:
So Ben had ruled this months ago and I treated it as open.
0963b679found 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>.nixmodules 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:Projection.Datasets()fleetCatalogueRead.RunningOn(#1123)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
fleetCatalogueReadagainst 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-deviceshould render the ⚠ LOSES row naming Files & documents, and reachreap.