Files
amethyst/cli/tests/cordn
Vitor PamplonaandClaude Opus 5 d627ba7846 fix(cordn): a handshake that answers is a call, and two counts of one
Three things an afternoon of driving the cordn screens on a tablet turned up.

**"Ask who it is" left the coordinator card contradicting itself.** It printed
"Nothing asked of it yet." directly above "Says it is: cordn-server · 0.1.0",
because `health.recordSuccess` was only reached from `CordnGroupManager.call`
and `serverInfo()` goes to the coordinator through `CoordinatorClient` without
passing that way. The screen's own comment says health is "only ever what a
call of ours already observed", and this is one — usually the very first,
since the button exists so someone can find out whether a coordinator they
just added answers at all. Recorded in `CordnSession.serverInfo` now, where
the session already holds the health it feeds.

An answer counts as a success and a throw as a failure; `null` counts as
neither, because a scope that did no handshake returns `null` and a call that
never left the device must not report a coordinator as reachable.

**"1 single-use packages available."** — and "1 packages this device cannot
open". Both are now plurals.

Three tests cover the health path: an answer marks it observed, a throw counts
a failure and keeps its reason, and silence leaves it unknown.

---

The live migrate harness could not run on this machine at all; none of it was
the product.

- `stack.sh` ran the coordinator with `--network host` so it could reach a
  relay on the host's loopback. On Docker Desktop the daemon is inside a VM,
  so that is the *VM's* loopback and `127.0.0.1:$PORT` is nothing: the
  coordinator retried "Relay connection error" until `stack_up` gave up
  waiting for a pubkey that was never coming. It now uses
  `host.docker.internal` off Linux and keeps `--network host` on it.
- `BLOB_PORT` defaulted to **877**, which is privileged, so the blob
  stand-in died with `PermissionError` for anyone who is not root — on Linux
  too. Now 8877.
- `blob_up` did not check the server came up. A dead one surfaced thirty lines
  later as `migrate export` reporting "no server accepted the document", plus
  two more failures behind it, none naming the blob server. It now waits for
  the port and exits 2 with the real error.

With those, `cli/tests/cordn/migrate.sh` passes end to end on stock defaults.
Worth knowing for whoever runs it next: the image is amd64-only, so on Apple
Silicon the pull needs `--platform linux/amd64` and then runs emulated.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 18:59:09 -04:00
..