join: the frontier poll cats /var/log/idss-agent-enroll.log, a path nothing ever writes #936

Closed
opened 2026-08-28 09:33:46 +00:00 by matou-build-agent · 2 comments

The failure

join is the only red leg of 23 (artifacts/verdict.json: "firstRedLeg": "join", "green": 22, "red": 1, "skip": 0). It spent its entire ceiling without the predicate ever going true — from artifacts/legs.json:

{ "leg": "join", "status": "red", "ms": 599456,
  "error": "the agent never reached the waiting-on-operator frontier
            ... Timeout 600000ms exceeded while waiting on the predicate" }

599456 ms against a 600000 ms CEILING.join: not one poll in ten minutes matched /waiting for the operator/i.

Fault 1 — CONFIRMED, harness layer: the frontier poll reads a file nothing writes

This run's own healer already found and committed it (logs/healer-claude.out, quoted verbatim):

journey.device.spec.ts:847-854's peekTranscript SSH-catted /var/log/idss-agent-enroll.log — a path that appears exactly once in the repo, in the peek itself. Nothing writes it. The agent prints the frontier line only to its terminal writer (internal/join/cli.go:228), and neither internal/join, internal/install, the /get doorway script, nor any NixOS module opens a file under /var/log. So the poll read empty forever and burned its full 600s ceiling.

Fix commit 7fed27e1ba503839ac207ff247aa167906ecc86b: sshDropletInteractive now returns an InteractiveSession exposing peek() over the live PTY accumulator, and the join leg keeps the transcript as evidence on a red.

The harvested device journal corroborates independently — a fresh full SSH login every 2 s for the whole ceiling and nothing else (logs/device-journal.txt):

Aug 28 09:20:42 clan-lab-rehearsal-2fcabeef systemd[1]: Started session-310.scope - Session 310 of User root.
Aug 28 09:20:42 clan-lab-rehearsal-2fcabeef systemd[1]: session-310.scope: Deactivated successfully.
Aug 28 09:20:44 clan-lab-rehearsal-2fcabeef systemd[1]: Started session-311.scope - Session 311 of User root.
Aug 28 09:20:44 clan-lab-rehearsal-2fcabeef systemd[1]: session-311.scope: Deactivated successfully.

193 such open/close pairs in the harvest, ~290 journal lines per minute. The storm was loud enough to evict its own context: the journal harvest (last 2000 lines) begins at Aug 28 09:14:11, so 09:10:45–09:14:11 — exactly the window the join one-liner started in — is gone.

That the agent can reach that frontier is shown one leg earlier, where the words were read off the PTY rather than off a file (artifacts/decline-transcript.txt):

✓ consent recorded — the wipe runs at first deploy
probing: linux · x86_64 · 2 threads · 3 GB memory · 76 GB disk
✓ connection request sent to 
waiting for the operator's decision…

(Aside, cosmetic: connection request sent to prints with an empty origin.)

Fault 2 — LIKELY but UNPROVEN: the join session was not alive on the box

The healer looked for a second, substantive fault and reported none concretely shown. Three things in the harvest suggest there is one, and that a re-drive on 7fed27e may still go red:

1. No long-lived session exists. Across the whole harvested window (09:14:11–09:21:10) every SSH session opens and closes inside the same second. The only unpaired session is session-312 — the forensics harvest itself at 09:21:10. The join PTY is specified to be HELD OPEN through the approve leg; no such session is present.

2. The user manager idles out 10 s after the final poll, which means no other root session remained at 09:20:44:

Aug 28 09:20:44 clan-lab-rehearsal-2fcabeef systemd[1]: session-311.scope: Deactivated successfully.
Aug 28 09:20:54 clan-lab-rehearsal-2fcabeef systemd[1]: Stopping user@0.service - User Manager for UID 0...

3. The gateway saw no connection request for the entire join window. logs/gateway-journal.txt carries only rental-lease heartbeats between 09:10:29 and 09:20:45:

Aug 28 09:15:13 idss-gateway-rehearsal-c-6f44 idss-control-plane-start[3403]: level=INFO msg="address heartbeat: renewed gateway rental lease (ADR 0189)" component=control-plane
Aug 28 09:20:13 idss-gateway-rehearsal-c-6f44 idss-control-plane-start[3403]: level=INFO msg="address heartbeat: renewed gateway rental lease (ADR 0189)" component=control-plane

And at forensics time the device carries no agent at all: logs/device-units.txt shows systemctl --failed empty and only sshd + systemd-resolve listening; logs/device-stall.txt's process grep matches two sshd and nothing else, with a single established SSH connection (the forensics one).

Leading hypothesis (consistent with the evidence, not demonstrated): the declined agent's self-removal is incomplete. The /var/lib/idss listing appended to logs/device-journal.txt (taken 09:21) still holds the identity minted during the decline:

/var/lib/idss:
-rw-------  1 root root   64 Aug 28 09:10 device.key
-rw-------  1 root root   64 Aug 28 09:10 ssh_host_ed25519_key

— even though the decline transcript claims ✕ declined by the operator — this machine was not joined and the agent has removed itself. A re-run one-liner finding a stale device.key could take an already-has-identity path and exit rather than send a fresh connection request. Needs the join transcript to confirm; that layer would be product, not harness.

Not the known frontier

The drive's KNOWN frontier — pairing never flips, the own-VPS carrier issue — does not apply to this red. legs.json carries no skip reasons at all this run ("skip": 0), and pair is green at 147 ms. This is a distinct, new failure.

What is absent

  • artifacts/join-transcript.txt — the drive writes it only in the approve leg (line 550), so the failing leg discarded the one record that would name the defect. 7fed27e addresses exactly this.
  • logs/droplet-journal.txt — not written under that name; this drive harvests logs/device-journal.txt and logs/gateway-journal.txt.
  • logs/broker-journal.txt — harvest refused by design: dev@100.98.48.68: Permission denied (publickey), off the admin mesh (ADR 0208, #681); the verdict does not depend on it.
  • 09:10:45–09:14:11 of the device journal — evicted by the poll storm.
  • No live-box section was appended to this task, so I did not query the droplet and ran nothing against it. Everything above is from the harvested logs alone.

What plugging it needs

  1. Land/confirm 7fed27e — it deletes the dead /var/log/idss-agent-enroll.log peek, polls the live PTY accumulator, and keeps the transcript on a red. That alone converts the next failure from a silent 10-minute timeout into a named error.
  2. Fail fast on a dead PTY. The join leg creates joinPty and then never inspects it — a one-liner that exits in seconds stays invisible for the full ceiling. Race the PTY promise against the frontier poll: if the session resolves first, fail immediately with its exit code and transcript.
  3. Add a cheap liveness assertion inside the poll (pgrep -f idss-agent, or an established-session count) so "the one-liner died" is distinguishable from "the frontier line never printed".
  4. Re-drive on 7fed27e. Green ⇒ the peek was the whole fault. Red again ⇒ artifacts/join-transcript.txt now names the real defect; check it against the surviving /var/lib/idss/device.key and the decline self-removal path.
  5. Throttle the poll — 2-second full SSH logins for 10 minutes flood the journal and destroy the leg's own start window in the harvest.

Layer: harness (confirmed); a product fault behind it (agent join / decline self-removal) is likely but unproven from the harvested evidence.

drive 20260828T081514Z red at join: the agent never reached the waiting-on-operator frontier the agent never reached the waiting-on-operator frontier expect(received).toBe(expected) // Object.is equality Expected: true Received: false C
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260828T081514Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The failure `join` is the only red leg of 23 (`artifacts/verdict.json`: `"firstRedLeg": "join"`, `"green": 22`, `"red": 1`, `"skip": 0`). It spent its entire ceiling without the predicate ever going true — from `artifacts/legs.json`: ``` { "leg": "join", "status": "red", "ms": 599456, "error": "the agent never reached the waiting-on-operator frontier ... Timeout 600000ms exceeded while waiting on the predicate" } ``` 599456 ms against a 600000 ms `CEILING.join`: not one poll in ten minutes matched `/waiting for the operator/i`. ## Fault 1 — CONFIRMED, harness layer: the frontier poll reads a file nothing writes This run's own healer already found and committed it (`logs/healer-claude.out`, quoted verbatim): > `journey.device.spec.ts:847-854`'s `peekTranscript` SSH-catted `/var/log/idss-agent-enroll.log` — a path that appears exactly once in the repo, in the peek itself. Nothing writes it. The agent prints the frontier line only to its terminal writer (`internal/join/cli.go:228`), and neither `internal/join`, `internal/install`, the `/get` doorway script, nor any NixOS module opens a file under `/var/log`. So the poll read empty forever and burned its full 600s ceiling. Fix commit `7fed27e1ba503839ac207ff247aa167906ecc86b`: `sshDropletInteractive` now returns an `InteractiveSession` exposing `peek()` over the live PTY accumulator, and the join leg keeps the transcript as evidence on a red. The harvested device journal corroborates independently — a fresh full SSH login every 2 s for the whole ceiling and nothing else (`logs/device-journal.txt`): ``` Aug 28 09:20:42 clan-lab-rehearsal-2fcabeef systemd[1]: Started session-310.scope - Session 310 of User root. Aug 28 09:20:42 clan-lab-rehearsal-2fcabeef systemd[1]: session-310.scope: Deactivated successfully. Aug 28 09:20:44 clan-lab-rehearsal-2fcabeef systemd[1]: Started session-311.scope - Session 311 of User root. Aug 28 09:20:44 clan-lab-rehearsal-2fcabeef systemd[1]: session-311.scope: Deactivated successfully. ``` 193 such open/close pairs in the harvest, ~290 journal lines per minute. The storm was loud enough to evict its own context: the journal harvest (last 2000 lines) begins at `Aug 28 09:14:11`, so 09:10:45–09:14:11 — exactly the window the join one-liner started in — is gone. That the agent *can* reach that frontier is shown one leg earlier, where the words were read off the PTY rather than off a file (`artifacts/decline-transcript.txt`): ``` ✓ consent recorded — the wipe runs at first deploy probing: linux · x86_64 · 2 threads · 3 GB memory · 76 GB disk ✓ connection request sent to waiting for the operator's decision… ``` (Aside, cosmetic: `connection request sent to ` prints with an empty origin.) ## Fault 2 — LIKELY but UNPROVEN: the join session was not alive on the box The healer looked for a second, substantive fault and reported none concretely shown. Three things in the harvest suggest there is one, and that a re-drive on `7fed27e` may still go red: **1. No long-lived session exists.** Across the whole harvested window (09:14:11–09:21:10) every SSH session opens and closes inside the same second. The only unpaired session is `session-312` — the forensics harvest itself at 09:21:10. The join PTY is specified to be HELD OPEN through the approve leg; no such session is present. **2. The user manager idles out 10 s after the final poll**, which means no other root session remained at 09:20:44: ``` Aug 28 09:20:44 clan-lab-rehearsal-2fcabeef systemd[1]: session-311.scope: Deactivated successfully. Aug 28 09:20:54 clan-lab-rehearsal-2fcabeef systemd[1]: Stopping user@0.service - User Manager for UID 0... ``` **3. The gateway saw no connection request for the entire join window.** `logs/gateway-journal.txt` carries only rental-lease heartbeats between 09:10:29 and 09:20:45: ``` Aug 28 09:15:13 idss-gateway-rehearsal-c-6f44 idss-control-plane-start[3403]: level=INFO msg="address heartbeat: renewed gateway rental lease (ADR 0189)" component=control-plane Aug 28 09:20:13 idss-gateway-rehearsal-c-6f44 idss-control-plane-start[3403]: level=INFO msg="address heartbeat: renewed gateway rental lease (ADR 0189)" component=control-plane ``` And at forensics time the device carries no agent at all: `logs/device-units.txt` shows `systemctl --failed` empty and only `sshd` + `systemd-resolve` listening; `logs/device-stall.txt`'s process grep matches two `sshd` and nothing else, with a single established SSH connection (the forensics one). **Leading hypothesis** (consistent with the evidence, not demonstrated): the declined agent's self-removal is incomplete. The `/var/lib/idss` listing appended to `logs/device-journal.txt` (taken 09:21) still holds the identity minted during the decline: ``` /var/lib/idss: -rw------- 1 root root 64 Aug 28 09:10 device.key -rw------- 1 root root 64 Aug 28 09:10 ssh_host_ed25519_key ``` — even though the decline transcript claims `✕ declined by the operator — this machine was not joined and the agent has removed itself`. A re-run one-liner finding a stale `device.key` could take an already-has-identity path and exit rather than send a fresh connection request. Needs the join transcript to confirm; that layer would be product, not harness. ## Not the known frontier The drive's KNOWN frontier — pairing never flips, the own-VPS carrier issue — does not apply to this red. `legs.json` carries **no skip reasons at all** this run (`"skip": 0`), and `pair` is green at 147 ms. This is a distinct, new failure. ## What is absent - `artifacts/join-transcript.txt` — the drive writes it only in the *approve* leg (line 550), so the failing leg discarded the one record that would name the defect. `7fed27e` addresses exactly this. - `logs/droplet-journal.txt` — not written under that name; this drive harvests `logs/device-journal.txt` and `logs/gateway-journal.txt`. - `logs/broker-journal.txt` — harvest refused by design: `dev@100.98.48.68: Permission denied (publickey)`, off the admin mesh (ADR 0208, #681); the verdict does not depend on it. - 09:10:45–09:14:11 of the device journal — evicted by the poll storm. - **No live-box section was appended to this task**, so I did not query the droplet and ran nothing against it. Everything above is from the harvested logs alone. ## What plugging it needs 1. Land/confirm `7fed27e` — it deletes the dead `/var/log/idss-agent-enroll.log` peek, polls the live PTY accumulator, and keeps the transcript on a red. That alone converts the next failure from a silent 10-minute timeout into a named error. 2. **Fail fast on a dead PTY.** The join leg creates `joinPty` and then never inspects it — a one-liner that exits in seconds stays invisible for the full ceiling. Race the PTY promise against the frontier poll: if the session resolves first, fail immediately with its exit code and transcript. 3. Add a cheap liveness assertion inside the poll (`pgrep -f idss-agent`, or an established-session count) so "the one-liner died" is distinguishable from "the frontier line never printed". 4. Re-drive on `7fed27e`. Green ⇒ the peek was the whole fault. Red again ⇒ `artifacts/join-transcript.txt` now names the real defect; check it against the surviving `/var/lib/idss/device.key` and the decline self-removal path. 5. Throttle the poll — 2-second full SSH logins for 10 minutes flood the journal and destroy the leg's own start window in the harvest. **Layer:** harness (confirmed); a product fault behind it (agent join / decline self-removal) is likely but unproven from the harvested evidence. drive `20260828T081514Z` red at `join`: `the agent never reached the waiting-on-operator frontier the agent never reached the waiting-on-operator frontier expect(received).toBe(expected) // Object.is equality Expected: true Received: false C` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260828T081514Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 227571a3f8a9 -->
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=13171
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=13171 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #936 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 936,
  "status": "success",
  "commits": [
    "a4dfba7"
  ],
  "changed_files": [
    "STATUS.md",
    "app/tests/e2e/fixtures/droplet.ts",
    "app/tests/e2e/fixtures/droplet.test.ts",
    "app/tests/e2e/journey.device.spec.ts",
    "app/tests/e2e/journey.idip.spec.ts",
    "app/tests/e2e/journey.selfhosted.spec.ts"
  ],
  "tests": [
    {
      "command": "vue-tsc -p tsconfig.json",
      "exit_code": 0
    },
    {
      "command": "vitest run tests/e2e/fixtures/droplet.test.ts",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Land/confirm the dead /var/log/idss-agent-enroll.log peek is removed": "peekTranscript deleted in journey.device.spec.ts; grep for idss-agent-enroll.log now hits only the explanatory comment. sshDropletInteractive (droplet.ts) returns InteractiveSession with peek() over the live PTY accumulator.",
    "Fail fast on a dead PTY": "join leg (journey.device.spec.ts:532-556) races session.settled() inside the poll — when the one-liner's PTY exits before the frontier it throws immediately with the exit code + transcript instead of burning the ceiling.",
    "Liveness assertion distinguishing died vs never-printed": "session.settled() is a local, SSH-free exit-outcome check carrying the exit code; droplet.test.ts pins settled()==null while running and the exit outcome after close, and null-on-timeout (died vs never-closed distinguishable).",
    "Keep the transcript on a red": "both red paths in the join leg writeFileSync artifacts/join-transcript.txt (session settled transcript, or peek() on ceiling) before throwing.",
    "Throttle the poll / stop the SSH storm": "poll is now a local 2s loop over peek() with zero SSH per iteration; the per-poll ssh cat that produced 2s full-SSH logins is gone."
  },
  "summary": "The device drive's join leg now polls the live PTY accumulator (peek()) instead of ssh-catting a log nothing writes, fails fast via settled() when the one-liner dies, and keeps the join transcript on either red.",
  "blockers": []
}
**close-report** for #936 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 936, "status": "success", "commits": [ "a4dfba7" ], "changed_files": [ "STATUS.md", "app/tests/e2e/fixtures/droplet.ts", "app/tests/e2e/fixtures/droplet.test.ts", "app/tests/e2e/journey.device.spec.ts", "app/tests/e2e/journey.idip.spec.ts", "app/tests/e2e/journey.selfhosted.spec.ts" ], "tests": [ { "command": "vue-tsc -p tsconfig.json", "exit_code": 0 }, { "command": "vitest run tests/e2e/fixtures/droplet.test.ts", "exit_code": 0 } ], "criteria": { "Land/confirm the dead /var/log/idss-agent-enroll.log peek is removed": "peekTranscript deleted in journey.device.spec.ts; grep for idss-agent-enroll.log now hits only the explanatory comment. sshDropletInteractive (droplet.ts) returns InteractiveSession with peek() over the live PTY accumulator.", "Fail fast on a dead PTY": "join leg (journey.device.spec.ts:532-556) races session.settled() inside the poll — when the one-liner's PTY exits before the frontier it throws immediately with the exit code + transcript instead of burning the ceiling.", "Liveness assertion distinguishing died vs never-printed": "session.settled() is a local, SSH-free exit-outcome check carrying the exit code; droplet.test.ts pins settled()==null while running and the exit outcome after close, and null-on-timeout (died vs never-closed distinguishable).", "Keep the transcript on a red": "both red paths in the join leg writeFileSync artifacts/join-transcript.txt (session settled transcript, or peek() on ceiling) before throwing.", "Throttle the poll / stop the SSH storm": "poll is now a local 2s loop over peek() with zero SSH per iteration; the per-poll ssh cat that produced 2s full-SSH logins is gone." }, "summary": "The device drive's join leg now polls the live PTY accumulator (peek()) instead of ssh-catting a log nothing writes, fails fast via settled() when the one-liner dies, and keeps the join transcript on either red.", "blockers": [] } ``` </details>
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.

Reference
Matou/idss#936
No description provided.