deploy: member-device routable-port removal and gateway co-host FILES removal fall to bare DetachService (sibling of #1348) #1349
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1349
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?
Split out of #1348. That fix added the removal mirror (
clan.DetachPort+detachCohostPort) for a routable forward-auth port removed from a GATEWAY CO-HOST. Two sibling paths indeployServicesOnly's removed loop (internal/provision/deploy.go) still fall to bareConfig().DetachService, which edits only the inventory JSON and leaves the<slug>.nixmodule on disk — the same defect class #1348 documents (GOTCHAS #207):A routable PORT removed from a real MEMBER DEVICE (mesh address + gateway).
attachRoutablePortcomposes the member entry module + front-door mesh route on attach, but the removed loop only DetachServices it — the module stays imported and routed, andmachineServiceskeeps reporting it. Needs adetachMemberPortmirror (DetachPort +composeMemberEntrywithout it + front-door rewrite), analogous todetachMemberFilesPlacement.FILES removed from a GATEWAY CO-HOST. The files block only handles the member-device case; a gateway co-host files untick falls to bare DetachService. Its mirror is more involved (Nextcloud + the
EnableGatewayNextcloudExportcontrol-plane export whose generator lives infiles.nix— droppingfiles.nixwithout unwinding the export is a Nix eval error), so it needs its own design, notdetachCohostPort.The brand-reach drive only exercises gateway co-host routable ports, so these are latent but real. Prove each with a red-first provision-layer test mirroring
TestDeploy_GatewayCohostPortRemovalDropsTheModule.Agent Brief
Category: bug
Summary: Two sibling removal paths in the services-only deploy loop fall to bare
DetachService, leaving the removed service's module on disk (still imported, routed, and running) — the same defect class #1348 fixed for gateway co-host routable ports (GOTCHAS #207).Current behavior:
In the provisioning orchestrator's services-only removal loop (
deployServicesOnly), only two removal cases have a full mirror of their attach path:detachMemberFilesPlacement.detachCohostPort(the #1348 fix).Every other removal falls to
Config().DetachService, which edits only the inventory JSON. A routable port's render and a files placement both land a module FILE / import, so a DetachService-only removal leaves<slug>.nixon disk — still imported, still routed, still reported bymachineServicesas deployed. Two such paths are still latent:attachRoutablePortcomposes the member entry module + front-door mesh route on attach, but the removed loop onlyDetachServices it.DetachService.The brand-reach drive only exercises gateway co-host routable ports, so both are latent but real.
Desired behavior:
Each of the two removals fully unwinds what its attach path composed, mirroring the two existing detach helpers:
Member-device routable port removal — add a
detachMemberPortmirror analogous todetachMemberFilesPlacement: drop the port module (DetachPort), recompose the member entry module (composeMemberEntry) without it, and rewrite the gateway front door WITHOUT the route. After removal,machineServicesno longer reports the slug and the guest stops serving it.Gateway co-host files removal — this one needs its own unwind design, not
detachCohostPort: the files block wires Nextcloud plus theEnableGatewayNextcloudExportcontrol-plane export whose generator lives infiles.nix. Droppingfiles.nixwithout first unwinding the export is a Nix eval error, so the removal must unwind the export before/with dropping the module. Design and build the correct co-host files detach so removal leaves no dangling module or export.Key interfaces:
deployServicesOnly(theremoved/deselected loop) — currently routes member-files and cohost-routable-port through dedicated detach helpers and everything else throughConfig().DetachService. Add the two missing routes.detachMemberFilesPlacement/detachCohostPort— the existing mirrors to model the new helpers on (DetachPort/DetachService+composeMemberEntry+ front-door rewrite).attachRoutablePort(member-device branch) and the files/EnableGatewayNextcloudExportattach path — the compose steps each detach must reverse.Acceptance criteria:
TestDeploy_GatewayCohostPortRemovalDropsTheModule) proves that removing a routable port from a member device drops the module, the front-door route, and the import — and thatmachineServicesno longer reports the slug. It fails before the fix and passes after.EnableGatewayNextcloudExportexport with no Nix eval error and no<slug>.nixleft on disk. It fails before the fix and passes after.Out of scope:
swarm-claim host=matou-dev-server-01 run=20438
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1349 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope