Skip to content
This repository was archived by the owner on Jul 24, 2026. It is now read-only.

ls: --tree — spawn-parentage tree + remote section (cross-machine ls, Phase 1) - #50

Merged
myobie merged 2 commits into
mainfrom
ls-tree
Jul 16, 2026
Merged

ls: --tree — spawn-parentage tree + remote section (cross-machine ls, Phase 1)#50
myobie merged 2 commits into
mainfrom
ls-tree

Conversation

@myobie

@myobie myobie commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

convoy ls --tree — spawn-parentage tree + a remote section (Phase 1)

Nathan wants a tree instead of the flat member list, now that cross-machine agents are real. Phase 1 (convoy-only, per your GO), with the heuristic labeled + caveats documented.

What it shows

network /Users/myobie/.local/state/convoy

LOCAL (this host) — spawn parentage:
  cos-claude  available
  ├─ sup-claude  available          # nested via convoy.spawner (post-#48 agents)
  │  └─ worker-claude  busy
  evals-claude  available           # flat: no spawner tag yet (pre-#48)

REMOTE (no local session on this host — running elsewhere OR offline; liveness inferred
from last bus activity = HEURISTIC, not confirmed):
  hetz-codex  ~active 12m ago (heuristic)
  hetz-demo   ~active 18m ago (heuristic)

23 members: 15 local, 8 remote.
  • LOCAL: spawn-parentage forest (cos → supervisor → worker) from the convoy.spawner / convoy.tier tags on each local pty session (the same tags crash-ding: page cos + the crashed worker's spawner, not the whole permanent crew (Nathan-flagged) + double-ding fix #48's crash-ding targeting stamps). cos-tier roots sort first.
  • REMOTE: bus members with no local session. convoy can't confirm cross-machine liveness yet, so it shows the last bus activity age, explicitly labeled (heuristic) (your requirement — Nathan shouldn't over-trust activity-as-liveness). This ends the old "offline lie": the hetz agents now read ~active Nm ago instead of offline.

Phase-1 caveats (documented in code)

Phase 2 (separate, co-designed with smalltalk — you're briefing them)

host + spawner + live-status carried in the synced bus record → named hosts (alive-on-hetz) + true cross-machine parentage + accurate remote liveness. --tree --by-host grouping can follow if Nathan wants machine-first.

Verified

  • tsc clean, 170 tests green (pure agentForest parentage/roots/cos-first/remote-partition, orphan-spawner→root, renderForest box-drawing, formatActivityAge). ls also gains unknownFlag validation (it had none). Live-verified against the real network (screenshot above is real output).

…s, Phase 1)

Nathan wants a tree instead of the flat member list now that cross-machine agents are
real (hetz-demo/hetz-codex on the fabric-synced bus). `convoy ls --tree`:

- LOCAL: a spawn-parentage forest (cos -> supervisor -> worker) from the convoy.spawner /
  convoy.tier tags on each LOCAL pty session (the same tags #48's crash-ding stamps);
  cos-tier roots sort first.
- REMOTE: bus members with no local session (running elsewhere OR offline) — convoy can't
  confirm liveness cross-machine yet, so it shows last-bus-activity age LABELED "(heuristic)"
  so it isn't over-trusted. Ends the old "offline lie" for the hetz agents (now ~active Nm ago).

Phase-1 caveats (documented): parentage only as complete as the LOCAL convoy.spawner tags
(post-#48 agents on this host — older/remote show flat); remote liveness is a lastActivity
heuristic + the host isn't named. Phase 2 (separate, co-designed with smalltalk): host +
spawner + live-status in the synced bus record -> named hosts + true cross-machine parentage.

Pure agentForest / renderForest / formatActivityAge (tested); ls also gains unknownFlag
validation. tsc clean, 170 green. Live-verified against the real network.
@myobie

myobie commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

HOLD (per cos): the spawn-parentage FOREST is the keeper, but the remote/heuristic-liveness half is likely SUPERSEDED by Nathan's real-synced-status redesign (presence record + host field + push-on-change). Not building further on the heuristic path. cos walks when the design locks — decide keep-as-interim vs fold the liveness half into real synced status; the forest stands either way.

…item 2), replacing the heuristic

Completes convoy ls --tree per the JOINT SEAM (convoy item 2): liveness is now the synced
status file's MTIME (fresh < --stale-after = alive; frozen = dead — the ding heartbeat stops
when the harness dies), and the host comes from a per-agent host file. Reads both DIRECTLY
(readAgentPresence stats <root>/<id>/status + reads <root>/<id>/host) — smalltalk doesn't
touch st agents; convoy owns the read. LOCAL vs REMOTE is now host == this machine's
os.hostname() (replaces #50's pty-session cross-ref); remote shows "alive on <host>" / "DEAD
on <host> (status stale Nm ago)".

Ships SAFE in any rollout order: both the mtime-liveness AND the host determination gate on the
host FILE being present — which co-ships with smalltalk's new ding (30s heartbeat + host write).
Absent (pre-rollout, or the current 5min-refresh ding) → falls back to #50's activity heuristic /
bus status, so a naive tight T never false-deads a live agent. Auto-upgrades per agent as
smalltalk rolls out items 1/3/4. --stale-after <ms> (default 120000 = ~2min death-detection).

tsc clean, 173 green (readAgentPresence reads/nulls, shortHost). renderForest gains a label fn
(default = status, existing test unchanged). Live-verified: fallback path renders correctly
against the real network (no host files yet). Supersedes the #50 heuristic-only remote section.
@myobie

myobie commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

HOLD LIFTED — item 2 is in (0009fb1). This PR is now the COMPLETE feature: the spawn-parentage forest + REAL cross-machine liveness (synced status-file mtime + host file, read directly per the joint seam), replacing the activity-heuristic. Ships SAFE in any rollout order: mtime-liveness + host determination gate on the host FILE's presence (co-ships with smalltalk's new ding), falling back to the activity heuristic until then — so it never false-deads a live agent and auto-upgrades per agent as smalltalk lands items 1/3/4. 173 green, live-verified (fallback). Walk + merge whenever (no rush per your fabric fire); smalltalk's 1/3/4 are separate PRs.

@myobie
myobie merged commit 0794176 into main Jul 16, 2026
@myobie
myobie deleted the ls-tree branch July 16, 2026 10:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant