device-add: resume a lost-SSH join without a service restart — the standing agent should pick up an anchor whose foreground terminal died while the box stayed up #958
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#958
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split from #953 (which wired
join.Orchestrator.Resumeinto the standing agent as a startup resume). This is the named residue that ticket deliberately did NOT widen into its two-way door.The gap
#953 persists a resume anchor
{code, requestID}at Pending and has the standingagent joinservice resume it at startup (resumeStrandedJoin,agent/cmd/agent/main.go). That covers the dominant deaths definitively:It does NOT cover the case where the foreground
enroll/installterminal dies but the box stays up and the standing service never restarts — a lost SSH session, a killed terminal. The anchor is on disk, butresumeStrandedJoinonly runs once at boot, so the already-running service never re-reads it. The stranded join is only picked up at the next service restart.Why it was held out of #953
A continuous anchor watch races the LIVE foreground landing: during an
install, the standing service and the foreground process both exist, and both would try toResume+Enrollthe same request.Enroll's steps are idempotent, but two landers on one request is a design question (who owns the landing, how they coordinate), not a mechanical add — exactly the kind of one-more-door #953's ADR 0174 ruling declined to open unprompted.Proposed shapes (for triage / a ruling)
Refs: #953 (startup resume, landed), #952 (transient-blip half, landed), ADR 0209, ADR 0100.
Ruled by agent under ADR 0174 — veto anytime.
Category: enhancement · State: ready-for-agent
The ruling
#958's only real blocker is the one thing #953 deliberately held out: when a live
install/enrollforeground and the standing service both exist for onerequest, who owns the landing so they don't both
Resume+Enrollit. The issueoffers three shapes; I rule for the lease/owner marker (shape 2) as the
coordination model, and rule against shapes 1 (inotify grace-window) and 3
(accept-the-residue):
it for the life of its landing long-poll. The standing service resumes an
anchor only when its lease is absent or stale. That makes "who owns the
landing" an explicit, observable fact rather than a guessed timeout — which is
why it beats shape 1's grace window (a race dressed as a constant), and why it
supersedes shape 3 (whose whole reason to exist is that #958 closes this gap,
not documents it).
Why this is a two-way door
can swap to inotify or fall back to accept-the-residue, and this label moves
with it. Nothing here is persisted irreversibly.
widening, no member-facing trust accept, no data destruction, no non-routine
spend, no hardware hands/eyes. It is agent-internal join plumbing.
What proves it
(#854) exercises the normal foreground landing — with a live lease held, the
standing service must withhold its resume, so the drive staying GREEN proves
the two landers don't collide.
absent) lease → the standing service resumes-and-lands without a restart; a
fresh lease → the standing service withholds.
Ben can veto by comment or digest at any time; a veto reverts to the residue
#953 shipped (a lost-SSH join lands on the next reboot/restart).
Agent Brief
Category: enhancement
Summary: The standing
agent joinservice should pick up a stranded join without a service restart — resolving the two-landers race with an owner lease.Current behavior:
join.Orchestratorpersists a resume anchor{code, requestID}at Pending, andthe standing service resumes it only at startup (
resumeStrandedJoin, runonce as the join socket comes up). That definitively covers deaths that restart
the service — reboot, and systemd restarting a crashed unit. It does not
cover a foreground
enroll/installterminal dying while the box stays up (alost SSH session, a killed terminal): the anchor is on disk, but the
already-running service never re-reads it, so the stranded join waits for the
next restart.
A continuous anchor watch was held out of #953 because, during a live
install,the foreground process and the standing service both exist and would both
Resume+Enrollthe same request.Enroll's steps are idempotent, but twolanders on one request is a coordination question — resolved here by the ruling
above.
Desired behavior:
The standing service continuously observes the resume anchor and lands a stranded
join whose foreground owner is gone, without waiting for a restart, while never
racing a live foreground:
lease (a marker beside the anchor) that it refreshes for the duration of its
landing (including the days-long Pending long-poll).
is present — i.e. the lease is absent or has gone stale past a bounded
threshold. A live, refreshed lease withholds the standing service's resume.
stops refreshing and goes stale; the standing service then resumes the anchor
and lands (or tears down) it, exactly as the startup path does today.
reboot (no foreground competes there); the continuous watch is additive.
fail-loud-on-revoked-code and declined-teardown outcomes the startup path
already logs (ADR 0100, ADR 0209).
Key interfaces:
foreground writes/refreshes and the standing service reads; the anchor's own
{code, requestID}shape need not change.join.Orchestrator's resume entry point (todayResumeAndLand) — reusedunchanged for the landing; the new logic is when the standing service is
allowed to call it.
resumeStrandedJoin(the startup one-shot) generalizes into a standing watchthat gates on lease staleness; startup remains a special case of it.
Acceptance criteria:
enroll/installholds a lease that it refreshes for thefull duration of its landing, including a Pending long-poll.
resume the same request — proven by the phase-5 standing device-add drive
(#854) staying GREEN (no double-land).
anchored request without a service restart — proven by a test that
strands a Pending/Approved anchor with a stale lease and observes the land.
anchor when there is no foreground and no live lease.
logged, not fatal — the join socket still serves fresh joins.
Out of scope:
(option 3) — ruled against above; do not implement them.
multi-request queuing is a separate concern.
{code, requestID}shape or thestartup-resume semantics beyond adding the lease gate.
Refs: #953 (startup resume, landed), #952 (transient-blip half, landed), #854
(the standing drive that proves no-double-land), ADR 0209, ADR 0100.
swarm-claim host=elitebook-distributed-server-03 run=13454
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #958 — status
success⛔ close-report gates REFUSED this close — the following claims did not verify:
dd9193ff5bis not reachable from origin/main (not landed)envelope
close-report for #958 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope