rescue move/rehome ladders attach a render-shipping service through raw AttachService — a phantom clan-core instance that would break the whole community's eval (the #2018/#1418 class) #2020

Open
opened 2026-09-30 05:03:25 +00:00 by matou-build-agent · 2 comments

Symptom

The rescue move ladders attach a service to a new device through the LOW-LEVEL clan seam Config().AttachService directly:

  • internal/rescue/deviceladder.go (rehome) and internal/rescue/serviceladder.go (move) call AttachService(ctx, target, ServiceInstance{Service: mv.Service, ...}) for whatever service is being moved — and the rescue tests exercise chat and files.

For a render-shipping service (chat, files, code, …) that path writes a phantom clan inventory instance {module: {name: "chat", input: "clan-core"}} — a module clan-core does not provide (they ship IDSS renders, not clan-core modules). That is the exact same phantom that broke node-req-0002's eval in #2018 (and #351/#428/#1418 before it): a committed phantom instance breaks the WHOLE community's clan select 'clanInternals.cliChecks' until removed.

Cause

The phantom-avoidance logic lives in the PROVISION orchestrator (internal/provision/deploy.go attachCatalogueServiceWith → renderShippingService refuse, PortRoutable routing). The rescue ladders bypass it and call the raw clan seam, so a move of a render-shipping service would write the phantom.

#2018 fixed the member-device backup-copy path (renderless services now land as marker module files, never a clan instance) but deliberately did NOT add a broad "refuse unmapped at the seam" guard to AttachService, because it would break these existing rescue moves.

Fix (proposed)

  • Route the rescue move/rehome ladders through the SAME render-aware attach the provision orchestrator uses (its Attach* / AttachPort renders), so a moved render-shipping service lands its real <slug>.nix, never a phantom instance; OR
  • Add a seam-level guard to clan.AttachService that refuses a service which ships a render (would be a phantom clan-core instance), and teach the ladders to route accordingly.
  • A rescue test that moves a render-shipping service (chat/files) and asserts NO phantom clan-core instance is committed (the #2018 shape), against the real config repo rather than the permissive fake.

Found while working

#2018 (member-device backup-copy phantom breaking eval).

Related: #351, #428, #1418, #2018, ADR 0104, GOTCHAS #379.

## Symptom The rescue move ladders attach a service to a new device through the LOW-LEVEL clan seam `Config().AttachService` directly: - `internal/rescue/deviceladder.go` (rehome) and `internal/rescue/serviceladder.go` (move) call `AttachService(ctx, target, ServiceInstance{Service: mv.Service, ...})` for whatever service is being moved — and the rescue tests exercise `chat` and `files`. For a render-shipping service (chat, files, code, …) that path writes a phantom clan inventory instance `{module: {name: "chat", input: "clan-core"}}` — a module clan-core does not provide (they ship IDSS renders, not clan-core modules). That is the exact same phantom that broke node-req-0002's eval in #2018 (and #351/#428/#1418 before it): a committed phantom instance breaks the WHOLE community's `clan select 'clanInternals.cliChecks'` until removed. ## Cause The phantom-avoidance logic lives in the PROVISION orchestrator (`internal/provision/deploy.go` `attachCatalogueServiceWith` → `renderShippingService` refuse, `PortRoutable` routing). The rescue ladders bypass it and call the raw clan seam, so a move of a render-shipping service would write the phantom. #2018 fixed the member-device backup-copy path (renderless services now land as marker module files, never a clan instance) but deliberately did NOT add a broad "refuse unmapped at the seam" guard to `AttachService`, because it would break these existing rescue moves. ## Fix (proposed) - Route the rescue move/rehome ladders through the SAME render-aware attach the provision orchestrator uses (its Attach* / AttachPort renders), so a moved render-shipping service lands its real `<slug>.nix`, never a phantom instance; OR - Add a seam-level guard to `clan.AttachService` that refuses a service which ships a render (would be a phantom clan-core instance), and teach the ladders to route accordingly. - A rescue test that moves a render-shipping service (chat/files) and asserts NO phantom clan-core instance is committed (the #2018 shape), against the real config repo rather than the permissive fake. ## Found while working #2018 (member-device backup-copy phantom breaking eval). Related: #351, #428, #1418, #2018, ADR 0104, GOTCHAS #379.
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime. Triaged as bug +
ready-for-agent. Verified against the code (rescue ladders call raw
Config().AttachService; the seam writes the phantom for any non-renderless
service; #2018's commit 47dd93aa explicitly deferred this here). The one
judgement call — ready-for-agent vs ready-for-human — is a two-way door: it
is a label change, fully revertible, and the fix is provable by an existing/
proposed regression test
(a rescue move of a render-shipping service asserting
no phantom clan-core instance is committed, against the real config repo). It is
not on the one-way-door list (no credentials, security widening, member-facing
trust accept, data destruction, or spend). The choice between the two fix
approaches below is likewise ordinary agent implementation latitude — both are
revertible and pinned by the same regression test.

Agent Brief

Category: bug
Summary: The rescue move/rehome ladders attach a moved service through the
raw low-level clan seam AttachService, which for a render-shipping service
(chat, files, code, …) writes a phantom {module:{name:<slug>,input:"clan-core"}}
inventory instance — the #351/#428/#1418 lie that breaks the WHOLE community's
clan select 'clanInternals.cliChecks' eval.

Current behavior:
When a node fails, the rescue move ladder and the rehome ladder relocate
each service off the gone node onto a healthy target by calling the low-level
clan seam directly: Config().AttachService(target, ServiceInstance{Service: svc, …}).
That seam writes a marker module file only for a renderless service
(backup-copy, the set renderlessModuleServices); for every other service it
writes a clan inventory instance naming module <slug> with input clan-core.
clan-core provides no such module for a render-shipping service (chat/files/code/
mail/meetings/static-sites/…), so the committed instance is a phantom that fails
evaluation of the whole community — exactly the class #2018 closed for the
renderless backup-copy case but deliberately left open for the rescue ladders
(commit 47dd93aa). The rescue tests exercise chat and files but pass today
only because they run against a permissive fake Config that never evaluates
the inventory — no test asserts the phantom is absent.

Desired behavior:
A rescue move or rehome of a render-shipping service must land that service's
real render (its own <slug>.nix module) — or be refused — never a phantom
clan-core inventory instance. The provision orchestrator already solves this in
its attach router (attachCatalogueServiceWith): it routes a PortRoutable
service through its real AttachPort render, refuses a render-shipping service
that provisioning cannot yet route, and only lets a genuinely renderless / role
service fall through to the raw declarative AttachService. The rescue ladders
must gain the same guarantee. Two acceptable approaches (agent's choice):

  1. Route the rescue ladders through the same render-aware attach the
    provision orchestrator uses, so a moved render-shipping service lands its real
    <slug>.nix (never a phantom). Note the render-aware router currently lives
    as a method on the provision Orchestrator, while the ladders hold only a
    fleet-clan handle — so this likely means lifting the routing switch into a
    shared helper or onto the clan seam.
  2. Add a seam-level guard on clan.AttachService that refuses a
    render-shipping service (one that ships a real render / whose Attach* exists)
    rather than writing the phantom, and teach the ladders to route render-shipping
    services through the real render instead. (Note #2018 explicitly did NOT add a
    broad seam guard because it would have broken these rescue moves — so a guard
    here must be paired with correct routing in the ladders, not added alone.)

Behavior for a renderless service (backup-copy) and role services is
unchanged — they still land as the declarative marker/placement.

Key interfaces (behavioral — no paths/lines, they will drift):

  • The rescue move ladder and rehome ladder — the step that, after
    detaching a service from the gone node, attaches it to the target. Today it
    calls the raw AttachService seam; it must instead route render-shipping
    services through their real render (or refuse), matching the provision
    orchestrator's attach-router semantics.
  • renderShippingService(service) bool and clan.PortRoutable(service) bool —
    the existing classifiers that decide "ships a real render" and "its render can
    be routed today." Reuse these; do not duplicate the service lists.
  • The provision orchestrator's catalogue-attach router (the AttachPort /
    Attach* dispatch that avoids the phantom) — the reference behavior to share
    or mirror, not re-implement divergently.
  • Config().AttachService and its renderless-marker branch
    (renderlessModuleServices) — the raw seam; whatever the fix, a render-shipping
    service must not reach the phantom-writing branch via a rescue move.

Acceptance criteria:

  • A rescue move of a render-shipping service (e.g. chat) commits its
    real render (its <slug>.nix module) and no clan inventory instance of
    the form {module:{name:<slug>,input:"clan-core"}}.
  • A rescue rehome of a render-shipping service satisfies the same — no
    phantom clan-core instance is committed.
  • A rescue move/rehome of a renderless service (backup-copy) still
    lands as the declarative marker file (unchanged).
  • A new rescue test moves a render-shipping service (chat and/or files) and
    asserts NO phantom clan-core instance is committed, run against the real
    config repo (not the permissive fake) — the #2018 test shape
    (TestAttachService_BackupCopyLandsAsRenderlessMarkerNeverAPhantomInstance
    / backupcopy_test.go) is the model.
  • The existing rescue move/rehome tests still pass; the fleet projection of a
    moved service (its deployed signal) is unchanged.
  • renderShippingService / PortRoutable service lists are reused, not
    forked into rescue.

Out of scope:

  • Adding a broad "refuse every unmapped service at the seam" guard to
    AttachService in isolation (that is what #2018 declined; only pair a guard
    with correct ladder routing).
  • Any change to renderless (backup-copy) marker-file behavior or the
    renderlessModuleServices set (#2018's territory).
  • Making currently-unroutable render-shipping services (chat/code/mail/meetings/
    static-sites) routable — if provisioning cannot route a service's render, the
    rescue path should refuse it the same way the orchestrator does, not invent a
    new render.
  • P4-S2 selection gating and the provision-side deploy path (already correct).

Verified: #351, #428, #1418, #2018, ADR 0104, GOTCHAS #14.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** Triaged as `bug` + `ready-for-agent`. Verified against the code (rescue ladders call raw `Config().AttachService`; the seam writes the phantom for any non-renderless service; #2018's commit `47dd93aa` explicitly deferred this here). The one judgement call — ready-for-agent vs ready-for-human — is a **two-way door**: it is a label change, fully revertible, and the fix is *provable by an existing/ proposed regression test* (a rescue move of a render-shipping service asserting no phantom clan-core instance is committed, against the real config repo). It is not on the one-way-door list (no credentials, security widening, member-facing trust accept, data destruction, or spend). The choice **between** the two fix approaches below is likewise ordinary agent implementation latitude — both are revertible and pinned by the same regression test. ## Agent Brief **Category:** bug **Summary:** The rescue move/rehome ladders attach a moved service through the raw low-level clan seam `AttachService`, which for a render-shipping service (chat, files, code, …) writes a phantom `{module:{name:<slug>,input:"clan-core"}}` inventory instance — the #351/#428/#1418 lie that breaks the WHOLE community's `clan select 'clanInternals.cliChecks'` eval. **Current behavior:** When a node fails, the rescue **move** ladder and the **rehome** ladder relocate each service off the gone node onto a healthy target by calling the low-level clan seam directly: `Config().AttachService(target, ServiceInstance{Service: svc, …})`. That seam writes a marker module *file* only for a renderless service (`backup-copy`, the set `renderlessModuleServices`); for every other service it writes a clan inventory instance naming module `<slug>` with input `clan-core`. clan-core provides no such module for a render-shipping service (chat/files/code/ mail/meetings/static-sites/…), so the committed instance is a phantom that fails evaluation of the whole community — exactly the class #2018 closed for the renderless backup-copy case but deliberately left open for the rescue ladders (commit `47dd93aa`). The rescue tests exercise `chat` and `files` but pass today only because they run against a permissive fake `Config` that never evaluates the inventory — no test asserts the phantom is absent. **Desired behavior:** A rescue move or rehome of a render-shipping service must land that service's **real render** (its own `<slug>.nix` module) — or be refused — never a phantom clan-core inventory instance. The provision orchestrator already solves this in its attach router (`attachCatalogueServiceWith`): it routes a `PortRoutable` service through its real `AttachPort` render, refuses a render-shipping service that provisioning cannot yet route, and only lets a genuinely renderless / role service fall through to the raw declarative `AttachService`. The rescue ladders must gain the same guarantee. Two acceptable approaches (agent's choice): 1. **Route the rescue ladders through the same render-aware attach** the provision orchestrator uses, so a moved render-shipping service lands its real `<slug>.nix` (never a phantom). Note the render-aware router currently lives as a method on the provision `Orchestrator`, while the ladders hold only a fleet-clan handle — so this likely means lifting the routing switch into a shared helper or onto the clan seam. 2. **Add a seam-level guard on `clan.AttachService`** that refuses a render-shipping service (one that ships a real render / whose `Attach*` exists) rather than writing the phantom, and teach the ladders to route render-shipping services through the real render instead. (Note #2018 explicitly did NOT add a broad seam guard because it would have broken these rescue moves — so a guard here must be paired with correct routing in the ladders, not added alone.) Behavior for a **renderless** service (backup-copy) and **role** services is unchanged — they still land as the declarative marker/placement. **Key interfaces (behavioral — no paths/lines, they will drift):** - The rescue **move** ladder and **rehome** ladder — the step that, after detaching a service from the gone node, attaches it to the target. Today it calls the raw `AttachService` seam; it must instead route render-shipping services through their real render (or refuse), matching the provision orchestrator's attach-router semantics. - `renderShippingService(service) bool` and `clan.PortRoutable(service) bool` — the existing classifiers that decide "ships a real render" and "its render can be routed today." Reuse these; do not duplicate the service lists. - The provision orchestrator's catalogue-attach router (the `AttachPort` / `Attach*` dispatch that avoids the phantom) — the reference behavior to share or mirror, not re-implement divergently. - `Config().AttachService` and its renderless-marker branch (`renderlessModuleServices`) — the raw seam; whatever the fix, a render-shipping service must not reach the phantom-writing branch via a rescue move. **Acceptance criteria:** - [ ] A rescue **move** of a render-shipping service (e.g. `chat`) commits its real render (its `<slug>.nix` module) and **no** clan inventory instance of the form `{module:{name:<slug>,input:"clan-core"}}`. - [ ] A rescue **rehome** of a render-shipping service satisfies the same — no phantom clan-core instance is committed. - [ ] A rescue move/rehome of a **renderless** service (`backup-copy`) still lands as the declarative marker file (unchanged). - [ ] A new rescue test moves a render-shipping service (chat and/or files) and asserts NO phantom clan-core instance is committed, run against the **real** config repo (not the permissive fake) — the #2018 test shape (`TestAttachService_BackupCopyLandsAsRenderlessMarkerNeverAPhantomInstance` / `backupcopy_test.go`) is the model. - [ ] The existing rescue move/rehome tests still pass; the fleet projection of a moved service (its deployed signal) is unchanged. - [ ] `renderShippingService` / `PortRoutable` service lists are reused, not forked into rescue. **Out of scope:** - Adding a broad "refuse every unmapped service at the seam" guard to `AttachService` in isolation (that is what #2018 declined; only pair a guard with correct ladder routing). - Any change to renderless (backup-copy) marker-file behavior or the `renderlessModuleServices` set (#2018's territory). - Making currently-unroutable render-shipping services (chat/code/mail/meetings/ static-sites) routable — if provisioning cannot route a service's render, the rescue path should refuse it the same way the orchestrator does, not invent a new render. - P4-S2 selection gating and the provision-side deploy path (already correct). Verified: #351, #428, #1418, #2018, ADR 0104, GOTCHAS #14.
Author
Member

Blocked — needs a human design ruling (asked, no reply within the window).

The phantom fix itself is clear, but what a rescue move/rehome of a render-shipping service should do instead is a flow-contract decision I do not want to rule solo, because it changes a wireframe-backed promise (docs/ux/flows/p8-rescue.mermaid: "move/rehome services to healthy nodes").

The decision

Rescue holds only a fleet-clan handle — no community apex / operators / service secrets — so it cannot itself render a service's real <slug>.nix. The provision orchestrator's attach-router (internal/provision/deploy.go attachCatalogueServiceWith), which does hold that context, renders routable render-shipping services (files/docs-editing/forward-auth ports) but refuses the render-shipping-but-not-routable ones (chat/code/mail/meetings/static-sites, via renderShippingService backstop). The rescue tests exercise chat — which even the orchestrator refuses.

So a render-shipping rescue move cannot land a real render without provisioning's live context, yet acceptance clause 1 wants it to "commit its real render", and the p8-rescue flow promises move/rehome to healthy nodes.

Two sanctioned approaches, very different sizes

(A) SMALL — add the seam guard to clan.AttachService (refuse a render-shipping service → never the phantom) + teach both ladders to pre-check (before any detach, to avoid orphaning) and produce an honest failed rung ("X ships a render provisioning must place — hand to re-provisioning P4-S1", the same route a returned rehomed device already takes). Fixes the community-breaking phantom now; proven against the real config repo (the #2018 test shape). But render-shipping services (chat and files) can no longer be rescue-moved until their render is routed — a change to the flow's move/rehome promise — and clause 1's "commit real render" is deferred to a follow-up (wiring provisioning's render-aware attach into rescue).

(B) LARGE — wire provisioning's render-aware attach into both ladders now (new delegate + NewServiceLadders/NewDeviceLadders constructor params + the 3 wiring sites: whole_composition.go, resting_composition.go, smoke-fleet), so routable services (files) land a real render and non-routable (chat) are refused. Satisfies clause 1 for files, but the rescue test fleets must gain full provisioning context (apex/gateway/operators) to render — a big slice, and it still refuses chat (the service the current tests move).

My lean

(A) now — a failed rung is a strict improvement over a community-breaking phantom — plus a filed follow-up for (B). But because (A) changes the p8-rescue flow's move/rehome promise (arguably needs-design), and (B) is a large re-scope, I'm parking this for a human to choose direction.

Why human

A flow-contract / UX change (the p8-rescue move/rehome promise) and a scope decision between a small phantom-fix-with-deferral and a large render-routing slice — beyond a clean two-way door. No prior ruling in comments; the ask (i15884…) posted to chat but got no reply in the window.

**Blocked — needs a human design ruling (asked, no reply within the window).** The phantom fix itself is clear, but *what a rescue move/rehome of a render-shipping service should do instead* is a flow-contract decision I do not want to rule solo, because it changes a wireframe-backed promise (`docs/ux/flows/p8-rescue.mermaid`: "move/rehome services to healthy nodes"). ## The decision Rescue holds only a fleet-clan handle — **no community apex / operators / service secrets** — so it cannot itself render a service's real `<slug>.nix`. The provision orchestrator's attach-router (`internal/provision/deploy.go` `attachCatalogueServiceWith`), which *does* hold that context, renders **routable** render-shipping services (files/docs-editing/forward-auth ports) but **refuses** the render-shipping-but-not-routable ones (chat/code/mail/meetings/static-sites, via `renderShippingService` backstop). The rescue tests exercise **chat** — which even the orchestrator refuses. So a render-shipping rescue move cannot land a real render without provisioning's live context, yet acceptance clause 1 wants it to "commit its real render", and the p8-rescue flow promises move/rehome to healthy nodes. ## Two sanctioned approaches, very different sizes **(A) SMALL** — add the seam guard to `clan.AttachService` (refuse a render-shipping service → never the phantom) + teach both ladders to **pre-check** (before any detach, to avoid orphaning) and produce an honest failed rung ("X ships a render provisioning must place — hand to re-provisioning P4-S1", the same route a returned rehomed device already takes). Fixes the community-breaking phantom now; proven against the real config repo (the #2018 test shape). **But** render-shipping services (chat *and* files) can no longer be rescue-moved until their render is routed — a change to the flow's move/rehome promise — and clause 1's "commit real render" is **deferred** to a follow-up (wiring provisioning's render-aware attach into rescue). **(B) LARGE** — wire provisioning's render-aware attach into **both** ladders now (new delegate + `NewServiceLadders`/`NewDeviceLadders` constructor params + the 3 wiring sites: `whole_composition.go`, `resting_composition.go`, `smoke-fleet`), so routable services (files) land a real render and non-routable (chat) are refused. Satisfies clause 1 for files, **but** the rescue test fleets must gain full provisioning context (apex/gateway/operators) to render — a big slice, and it still refuses chat (the service the current tests move). ## My lean (A) now — a failed rung is a strict improvement over a community-breaking phantom — plus a filed follow-up for (B). But because (A) changes the p8-rescue flow's move/rehome promise (arguably `needs-design`), and (B) is a large re-scope, I'm parking this for a human to choose direction. ## Why human A flow-contract / UX change (the p8-rescue move/rehome promise) and a scope decision between a small phantom-fix-with-deferral and a large render-routing slice — beyond a clean two-way door. No prior ruling in comments; the ask (`i15884…`) posted to chat but got no reply in the window.
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#2020
No description provided.