deploy-takeover: #1099's relay sources the gateway from standing facts.json, which is EMPTY on every re-found drive — the relay never dials; and files-door's mesh-route assertion has never run (silent skip + stdout read off a refused dial) #1105

Closed
opened 2026-09-01 06:33:41 +00:00 by ben · 0 comments
Owner

Failure

Drive 20260901T052209Z — the first carrying #1099's gateway relay — red at deploy-takeover, 26/27 green, with the relay never dialling once:

no standing gateway IP on record (facts.json .ip) — cannot reach the taken-over device,
which trusts only the gateway's own deploy key (#1099)

Diagnosis — the relay hop is sourced from a file that is empty on exactly the drives that reach the takeover

journey.device.spec.ts resolved the relay's gateway as readStandingFacts()?.ip. That reader's own doc comment states the constraint:

"Read the standing facts.json best-effort — absent on a first re-found drive (the carrier's staleness gate found nothing to adopt) … the standing leg's re-found branch founds the community and WRITES the facts the carrier then persists."

The carrier persists facts.json after the drive; during a re-found run the file is empty. Confirmed on the host:

$ cat test-results/standing-rented/facts.json      # (empty)
$ ls -la --time-style=+%H:%M:%S test-results/standing-rented/
drwx------ … 06:13:49 .        <- wiped and re-founded by this drive
$ cat test-results/drive-device/20260901T052209Z/artifacts/droplet-ip.txt
209.38.20.29                    <- the gateway, known since the wizard-rent leg

Every red drive re-founds (the standing world is stale/absent → teardown → re-found through the phase-4 legs, ADR 0208). So the relay was unresolvable on precisely the drives that get far enough to need it. The IP was in memory the whole time — the re-found branch holds prefix.dropletIP and writes it to artifacts/standing-founded.json — it simply was not carried to the leg.

The same leg's sibling assertion could not fail, twice over

While fixing the source I found files-door (leg 11) carrying the identical defect plus a second one:

const facts2 = readStandingFacts();
const gatewayIp = facts2?.ip;
if (gatewayIp) {                                  // (1) silently skipped on every re-found drive
  const route = await sshDroplet(gatewayIp, 'grep -rh reverse_proxy …', 60_000);   // (2) no identity
  if (/127\.0\.0\.1:8084/.test(route.stdout)) { throw … }
}
  1. Silent skip — same empty-facts cause, so the one assertion that proves ADR 0210's point (the front door proxies to the device over the mesh, not 127.0.0.1:8084) has never run on a re-found drive.
  2. Vacuous pass — the dial names no identity. A rented gateway trusts EXACTLY the rent-operator key since #744 scrubbed the build droplet's authorized_keys (#885, GOTCHAS #101), so the dial is refused, stdout is empty, the regex does not match, and the leg passes. That is reading stdout off a refused dial — the very lesson #1099 was filed for, in the leg next door.

So even had the IP resolved, this check would have reported success without testing anything.

Fix

  • Hoist an explicit gatewayIp the standing leg sets in both branches (prefix.dropletIP when re-founding, the facts' .ip when adopting), with OC_E2E_DROPLET_IP as last resort. deploy-takeover and files-door both use it.
  • files-door: no IP now fails loud instead of skipping; the dial carries the rent-operator identity; a non-zero ssh exit fails loud naming the exit and stderr; an empty route listing fails loud ("the route is absent, not merely wrong") — all ADR 0100, no masked success.

app/tests/e2e/fixtures 237/237 green, eslint and vue-tsc clean on the spec.

Filed and fixed in one motion by the watching session under ADR 0174 (harness-only change, revertible, no product surface touched) — the executor was mid-arc and each cycle costs a ~60-minute gateway-image rebuild before it would re-hit the same line.

Note the shape of this one: #1099's fix was correct in mechanism and landed with tests, and still could not run, because it drew one input from a store that is empty in the common case. Same family as #740 (a filter that never matched), #871 (a gate that could not fail) and #1096/#1100 (a key that never differs) — the fourth this arc. Worth a GOTCHAS-level habit: when a check gains a new input, ask what that input holds on the failure path, not just the happy one.

## Failure Drive `20260901T052209Z` — the first carrying #1099's gateway relay — red at `deploy-takeover`, 26/27 green, with the relay never dialling once: ``` no standing gateway IP on record (facts.json .ip) — cannot reach the taken-over device, which trusts only the gateway's own deploy key (#1099) ``` ## Diagnosis — the relay hop is sourced from a file that is empty on exactly the drives that reach the takeover `journey.device.spec.ts` resolved the relay's gateway as `readStandingFacts()?.ip`. That reader's own doc comment states the constraint: > *"Read the standing facts.json best-effort — **absent on a first re-found drive** (the carrier's staleness gate found nothing to adopt) … the standing leg's re-found branch founds the community and WRITES the facts the carrier then persists."* The carrier persists `facts.json` **after** the drive; during a re-found run the file is empty. Confirmed on the host: ``` $ cat test-results/standing-rented/facts.json # (empty) $ ls -la --time-style=+%H:%M:%S test-results/standing-rented/ drwx------ … 06:13:49 . <- wiped and re-founded by this drive $ cat test-results/drive-device/20260901T052209Z/artifacts/droplet-ip.txt 209.38.20.29 <- the gateway, known since the wizard-rent leg ``` **Every red drive re-founds** (the standing world is stale/absent → teardown → re-found through the phase-4 legs, ADR 0208). So the relay was unresolvable on precisely the drives that get far enough to need it. The IP was in memory the whole time — the re-found branch holds `prefix.dropletIP` and writes it to `artifacts/standing-founded.json` — it simply was not carried to the leg. ## The same leg's sibling assertion could not fail, twice over While fixing the source I found `files-door` (leg 11) carrying the identical defect plus a second one: ```ts const facts2 = readStandingFacts(); const gatewayIp = facts2?.ip; if (gatewayIp) { // (1) silently skipped on every re-found drive const route = await sshDroplet(gatewayIp, 'grep -rh reverse_proxy …', 60_000); // (2) no identity if (/127\.0\.0\.1:8084/.test(route.stdout)) { throw … } } ``` 1. **Silent skip** — same empty-facts cause, so the one assertion that proves ADR 0210's point (the front door proxies to the device *over the mesh*, not `127.0.0.1:8084`) has never run on a re-found drive. 2. **Vacuous pass** — the dial names no identity. A rented gateway trusts EXACTLY the rent-operator key since #744 scrubbed the build droplet's `authorized_keys` (#885, GOTCHAS #101), so the dial is **refused**, `stdout` is empty, the regex does not match, and the leg passes. That is reading stdout off a refused dial — the very lesson #1099 was filed for, in the leg next door. So even had the IP resolved, this check would have reported success without testing anything. ## Fix - Hoist an explicit `gatewayIp` the standing leg sets in **both** branches (`prefix.dropletIP` when re-founding, the facts' `.ip` when adopting), with `OC_E2E_DROPLET_IP` as last resort. `deploy-takeover` and `files-door` both use it. - `files-door`: no IP now fails loud instead of skipping; the dial carries the rent-operator identity; a non-zero ssh exit fails loud naming the exit and stderr; an empty route listing fails loud ("the route is absent, not merely wrong") — all ADR 0100, no masked success. `app/tests/e2e/fixtures` 237/237 green, eslint and vue-tsc clean on the spec. Filed and fixed in one motion by the watching session under ADR 0174 (harness-only change, revertible, no product surface touched) — the executor was mid-arc and each cycle costs a ~60-minute gateway-image rebuild before it would re-hit the same line. **Note the shape of this one:** #1099's fix was correct in mechanism and landed with tests, and still could not run, because it drew one input from a store that is empty in the common case. Same family as #740 (a filter that never matched), #871 (a gate that could not fail) and #1096/#1100 (a key that never differs) — the fourth this arc. Worth a GOTCHAS-level habit: when a check gains a new input, ask what that input holds on the failure path, not just the happy one.
ben closed this issue 2026-09-01 06:34:22 +00:00
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#1105
No description provided.