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

Closed
opened 2026-08-28 21:17:58 +00:00 by matou-build-agent · 4 comments

Split from #953 (which wired join.Orchestrator.Resume into 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 standing agent join service resume it at startup (resumeStrandedJoin, agent/cmd/agent/main.go). That covers the dominant deaths definitively:

  • reboot — the box restarts, the service restarts, the startup resume fires;
  • agent/service crash — systemd restarts the unit, the startup resume fires.

It does NOT cover the case where the foreground enroll/install terminal dies but the box stays up and the standing service never restarts — a lost SSH session, a killed terminal. The anchor is on disk, but resumeStrandedJoin only 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 to Resume+Enroll the 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)

  • A filesystem watch (inotify) on the anchor path that fires a resume when the anchor appears AND has been untouched for a grace window (the foreground would normally clear it on landing) — the grace window is how it avoids racing a live foreground.
  • A lease/owner marker the foreground writes beside the anchor and refreshes; the standing service only resumes an anchor whose lease has gone stale.
  • Accept the residue as-is and document it (a lost-SSH join lands on the next reboot/restart) — cheapest, and reboots are common.

Refs: #953 (startup resume, landed), #952 (transient-blip half, landed), ADR 0209, ADR 0100.

Split from #953 (which wired `join.Orchestrator.Resume` into 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 standing `agent join` service resume it **at startup** (`resumeStrandedJoin`, `agent/cmd/agent/main.go`). That covers the dominant deaths definitively: - **reboot** — the box restarts, the service restarts, the startup resume fires; - **agent/service crash** — systemd restarts the unit, the startup resume fires. It does NOT cover the case where the **foreground `enroll`/`install` terminal dies but the box stays up and the standing service never restarts** — a lost SSH session, a killed terminal. The anchor is on disk, but `resumeStrandedJoin` only 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 to `Resume`+`Enroll` the 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) - A **filesystem watch** (inotify) on the anchor path that fires a resume when the anchor appears AND has been untouched for a grace window (the foreground would normally clear it on landing) — the grace window is how it avoids racing a live foreground. - A **lease/owner marker** the foreground writes beside the anchor and refreshes; the standing service only resumes an anchor whose lease has gone stale. - Accept the residue as-is and document it (a lost-SSH join lands on the next reboot/restart) — cheapest, and reboots are common. Refs: #953 (startup resume, landed), #952 (transient-blip half, landed), ADR 0209, ADR 0100.
Author
Member

This was generated by AI during triage.

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/enroll foreground and the standing service both exist for one
request, who owns the landing so they don't both Resume+Enroll it. The issue
offers 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):

  • The foreground writes an owner lease beside the resume anchor and refreshes
    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

  • Revertible — the coordination model is a code/config change; a later commit
    can swap to inotify or fall back to accept-the-residue, and this label moves
    with it. Nothing here is persisted irreversibly.
  • Not on the one-way-door list — no personal credentials, no security-posture
    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

  • No-double-land is drive-provable: the phase-5 standing device-add drive
    (#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.
  • The new resume path is unit/integration-testable in isolation: a stale (or
    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 join service should pick up a stranded join without a service restart — resolving the two-landers race with an owner lease.

Current behavior:
join.Orchestrator persists a resume anchor {code, requestID} at Pending, and
the standing service resumes it only at startup (resumeStrandedJoin, run
once 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/install terminal dying while the box stays up (a
lost 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+Enroll the same request. Enroll's steps are idempotent, but two
landers 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:

  • While a foreground process is actively landing a request, it holds an owner
    lease
    (a marker beside the anchor) that it refreshes for the duration of its
    landing (including the days-long Pending long-poll).
  • The standing service resumes-and-lands an anchor only when no fresh lease
    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.
  • When the foreground terminal dies without restarting the service, its lease
    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.
  • The existing startup resume is preserved and remains the sole lander after a
    reboot (no foreground competes there); the continuous watch is additive.
  • The resume remains best-effort and non-fatal to the socket, and keeps the
    fail-loud-on-revoked-code and declined-teardown outcomes the startup path
    already logs (ADR 0100, ADR 0209).

Key interfaces:

  • The resume anchor's persisted record — gains a companion owner lease the
    foreground writes/refreshes and the standing service reads; the anchor's own
    {code, requestID} shape need not change.
  • join.Orchestrator's resume entry point (today ResumeAndLand) — reused
    unchanged 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 watch
    that gates on lease staleness; startup remains a special case of it.

Acceptance criteria:

  • A foreground enroll/install holds a lease that it refreshes for the
    full duration of its landing, including a Pending long-poll.
  • With a live, refreshed lease present, the standing service does not
    resume the same request — proven by the phase-5 standing device-add drive
    (#854) staying GREEN (no double-land).
  • With the lease absent or stale, the standing service resumes-and-lands the
    anchored request without a service restart — proven by a test that
    strands a Pending/Approved anchor with a stale lease and observes the land.
  • Reboot/crash behavior is unchanged: the startup resume still lands the
    anchor when there is no foreground and no live lease.
  • The revoked/foreign-code fail-loud and the declined-teardown outcomes are
    logged, not fatal — the join socket still serves fresh joins.

Out of scope:

  • The inotify grace-window shape (#958 option 1) and the accept-the-residue shape
    (option 3) — ruled against above; do not implement them.
  • More than one in-flight join at a time — the anchor persists a single request;
    multi-request queuing is a separate concern.
  • Changing the anchor's persisted {code, requestID} shape or the
    startup-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.

> *This was generated by AI during triage.* **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`/`enroll` foreground *and* the standing service both exist for one request, who owns the landing so they don't both `Resume`+`Enroll` it. The issue offers 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): - The foreground writes an **owner lease** beside the resume anchor and refreshes 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 - **Revertible** — the coordination model is a code/config change; a later commit can swap to inotify or fall back to accept-the-residue, and this label moves with it. Nothing here is persisted irreversibly. - **Not on the one-way-door list** — no personal credentials, no security-posture 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 - **No-double-land** is drive-provable: the phase-5 standing device-add drive (#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. - **The new resume path** is unit/integration-testable in isolation: a stale (or 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 join` service should pick up a stranded join *without a service restart* — resolving the two-landers race with an owner lease. **Current behavior:** `join.Orchestrator` persists a resume anchor `{code, requestID}` at Pending, and the standing service resumes it **only at startup** (`resumeStrandedJoin`, run once 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`/`install` terminal dying while the box stays up (a lost 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`+`Enroll` the same request. `Enroll`'s steps are idempotent, but two landers 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: - While a foreground process is actively landing a request, it holds an **owner lease** (a marker beside the anchor) that it refreshes for the duration of its landing (including the days-long Pending long-poll). - The standing service resumes-and-lands an anchor **only** when no fresh lease 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. - When the foreground terminal dies without restarting the service, its lease 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. - The existing startup resume is preserved and remains the sole lander after a reboot (no foreground competes there); the continuous watch is **additive**. - The resume remains best-effort and non-fatal to the socket, and keeps the fail-loud-on-revoked-code and declined-teardown outcomes the startup path already logs (ADR 0100, ADR 0209). **Key interfaces:** - The resume anchor's persisted record — gains a companion **owner lease** the foreground writes/refreshes and the standing service reads; the anchor's own `{code, requestID}` shape need not change. - `join.Orchestrator`'s resume entry point (today `ResumeAndLand`) — reused unchanged 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 watch that gates on lease staleness; startup remains a special case of it. **Acceptance criteria:** - [ ] A foreground `enroll`/`install` holds a lease that it refreshes for the full duration of its landing, including a Pending long-poll. - [ ] With a live, refreshed lease present, the standing service does **not** resume the same request — proven by the phase-5 standing device-add drive (#854) staying GREEN (no double-land). - [ ] With the lease absent or stale, the standing service resumes-and-lands the anchored request **without a service restart** — proven by a test that strands a Pending/Approved anchor with a stale lease and observes the land. - [ ] Reboot/crash behavior is unchanged: the startup resume still lands the anchor when there is no foreground and no live lease. - [ ] The revoked/foreign-code fail-loud and the declined-teardown outcomes are logged, not fatal — the join socket still serves fresh joins. **Out of scope:** - The inotify grace-window shape (#958 option 1) and the accept-the-residue shape (option 3) — ruled against above; do not implement them. - More than one in-flight join at a time — the anchor persists a single request; multi-request queuing is a separate concern. - Changing the anchor's persisted `{code, requestID}` shape or the startup-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.
Author
Member

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

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

close-report for #958 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • commit dd9193ff5b is not reachable from origin/main (not landed)
  • changed_files: 'STATUS.md' is not in the diff of the claimed commits
  • changed_files: 'agent/cmd/agent/main.go' is not in the diff of the claimed commits
  • changed_files: 'internal/join/cli.go' is not in the diff of the claimed commits
  • changed_files: 'internal/join/join.go' is not in the diff of the claimed commits
  • changed_files: 'internal/join/lease.go' is not in the diff of the claimed commits
  • changed_files: 'internal/join/resume.go' is not in the diff of the claimed commits
  • changed_files: 'internal/join/resume_lease_test.go' is not in the diff of the claimed commits
  • changed_files: 'internal/resumeanchor/lease.go' is not in the diff of the claimed commits
  • changed_files: 'internal/resumeanchor/lease_test.go' is not in the diff of the claimed commits
envelope
{
  "issue": 958,
  "status": "success",
  "commits": [
    "dd9193ff5bde9d2298e654e09a6bdff304b7f13a"
  ],
  "changed_files": [
    "STATUS.md",
    "agent/cmd/agent/main.go",
    "internal/join/cli.go",
    "internal/join/join.go",
    "internal/join/lease.go",
    "internal/join/resume.go",
    "internal/join/resume_lease_test.go",
    "internal/resumeanchor/lease.go",
    "internal/resumeanchor/lease_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/join/... ./internal/resumeanchor/... ./agent/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/join/... ./internal/resumeanchor/... ./agent/cmd/agent/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A foreground enroll/install holds a lease it refreshes for the full duration of its landing, including a Pending long-poll": "Orchestrator.withLease (internal/join/lease.go) refreshes the lease up front and on a ticker for the whole landing; it wraps AwaitAndLand (internal/join/cli.go) and ResumeAndLand (internal/join/resume.go). Proven by TestAwaitAndLand_RefreshesLeaseThroughLongPoll (refreshes >=2 across the long-poll, cleared once at the end).",
    "With a live, refreshed lease present, the standing service does not resume the same request (no double-land)": "Orchestrator.ResumeStrandedOnce withholds when LeaseStore.Fresh returns true. Proven by TestResumeStrandedOnce_WithholdsWhileLeaseFresh (resumed=false, anchor left untouched, nothing below the seam runs).",
    "With the lease absent or stale, the standing service resumes-and-lands the anchored request without a service restart": "ResumeStrandedOnce resumes when Fresh is false. Proven by TestResumeStrandedOnce_ResumesWhenLeaseStale (resumed=true, lands to Enrolled, anchor cleared, lease refreshed then cleared) and the file-store TestLease_StaleBelowThreshold.",
    "Reboot/crash behavior is unchanged: the startup resume still lands the anchor when there is no foreground and no live lease": "watchStrandedJoin's first tick is the startup resume (agent/cmd/agent/main.go); Config.Lease nil is a pass-through and a pre-reboot lease is stale on its timestamp. Proven by TestResumeStrandedOnce_ResumesWithNoLeaseStore.",
    "The revoked/foreign-code fail-loud and the declined-teardown outcomes are logged, not fatal — the join socket still serves fresh joins": "watchStrandedJoin logs each outcome (errIsDeclined -> info, other errors -> error) and never returns; ResumeStrandedOnce is best-effort. ServeListener runs beside the watch goroutine. Existing resume_anchor_test.go (declined-while-down -> ErrDeclined) unchanged and green."
  },
  "summary": "The standing agent resumes a lost-SSH join without a service restart: the foreground holds an owner lease it refreshes for the life of its landing, and a 30s resume watch resumes an anchor only when no fresh lease is present.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #958 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit dd9193ff5bde9d2298e654e09a6bdff304b7f13a is not reachable from origin/main (not landed) - changed_files: 'STATUS.md' is not in the diff of the claimed commits - changed_files: 'agent/cmd/agent/main.go' is not in the diff of the claimed commits - changed_files: 'internal/join/cli.go' is not in the diff of the claimed commits - changed_files: 'internal/join/join.go' is not in the diff of the claimed commits - changed_files: 'internal/join/lease.go' is not in the diff of the claimed commits - changed_files: 'internal/join/resume.go' is not in the diff of the claimed commits - changed_files: 'internal/join/resume_lease_test.go' is not in the diff of the claimed commits - changed_files: 'internal/resumeanchor/lease.go' is not in the diff of the claimed commits - changed_files: 'internal/resumeanchor/lease_test.go' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 958, "status": "success", "commits": [ "dd9193ff5bde9d2298e654e09a6bdff304b7f13a" ], "changed_files": [ "STATUS.md", "agent/cmd/agent/main.go", "internal/join/cli.go", "internal/join/join.go", "internal/join/lease.go", "internal/join/resume.go", "internal/join/resume_lease_test.go", "internal/resumeanchor/lease.go", "internal/resumeanchor/lease_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/join/... ./internal/resumeanchor/... ./agent/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/join/... ./internal/resumeanchor/... ./agent/cmd/agent/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./...", "exit_code": 0 } ], "criteria": { "A foreground enroll/install holds a lease it refreshes for the full duration of its landing, including a Pending long-poll": "Orchestrator.withLease (internal/join/lease.go) refreshes the lease up front and on a ticker for the whole landing; it wraps AwaitAndLand (internal/join/cli.go) and ResumeAndLand (internal/join/resume.go). Proven by TestAwaitAndLand_RefreshesLeaseThroughLongPoll (refreshes >=2 across the long-poll, cleared once at the end).", "With a live, refreshed lease present, the standing service does not resume the same request (no double-land)": "Orchestrator.ResumeStrandedOnce withholds when LeaseStore.Fresh returns true. Proven by TestResumeStrandedOnce_WithholdsWhileLeaseFresh (resumed=false, anchor left untouched, nothing below the seam runs).", "With the lease absent or stale, the standing service resumes-and-lands the anchored request without a service restart": "ResumeStrandedOnce resumes when Fresh is false. Proven by TestResumeStrandedOnce_ResumesWhenLeaseStale (resumed=true, lands to Enrolled, anchor cleared, lease refreshed then cleared) and the file-store TestLease_StaleBelowThreshold.", "Reboot/crash behavior is unchanged: the startup resume still lands the anchor when there is no foreground and no live lease": "watchStrandedJoin's first tick is the startup resume (agent/cmd/agent/main.go); Config.Lease nil is a pass-through and a pre-reboot lease is stale on its timestamp. Proven by TestResumeStrandedOnce_ResumesWithNoLeaseStore.", "The revoked/foreign-code fail-loud and the declined-teardown outcomes are logged, not fatal — the join socket still serves fresh joins": "watchStrandedJoin logs each outcome (errIsDeclined -> info, other errors -> error) and never returns; ResumeStrandedOnce is best-effort. ServeListener runs beside the watch goroutine. Existing resume_anchor_test.go (declined-while-down -> ErrDeclined) unchanged and green." }, "summary": "The standing agent resumes a lost-SSH join without a service restart: the foreground holds an owner lease it refreshes for the life of its landing, and a 30s resume watch resumes an anchor only when no fresh lease is present.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Author
Member

close-report for #958 — status success

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

envelope
{
  "issue": 958,
  "status": "success",
  "commits": [
    "dd9193ff5bde9d2298e654e09a6bdff304b7f13a"
  ],
  "changed_files": [
    "STATUS.md",
    "agent/cmd/agent/main.go",
    "internal/join/cli.go",
    "internal/join/join.go",
    "internal/join/lease.go",
    "internal/join/resume.go",
    "internal/join/resume_lease_test.go",
    "internal/resumeanchor/lease.go",
    "internal/resumeanchor/lease_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/join/... ./internal/resumeanchor/... ./agent/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/join/... ./internal/resumeanchor/... ./agent/cmd/agent/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A foreground enroll/install holds a lease it refreshes for the full duration of its landing, including a Pending long-poll": "Orchestrator.withLease (internal/join/lease.go) refreshes the lease up front and on a ticker for the whole landing; it wraps AwaitAndLand (internal/join/cli.go) and ResumeAndLand (internal/join/resume.go). Proven by TestAwaitAndLand_RefreshesLeaseThroughLongPoll (refreshes >=2 across the long-poll, cleared once at the end).",
    "With a live, refreshed lease present, the standing service does not resume the same request (no double-land)": "Orchestrator.ResumeStrandedOnce withholds when LeaseStore.Fresh returns true. Proven by TestResumeStrandedOnce_WithholdsWhileLeaseFresh (resumed=false, anchor left untouched, nothing below the seam runs).",
    "With the lease absent or stale, the standing service resumes-and-lands the anchored request without a service restart": "ResumeStrandedOnce resumes when Fresh is false. Proven by TestResumeStrandedOnce_ResumesWhenLeaseStale (resumed=true, lands to Enrolled, anchor cleared, lease refreshed then cleared) and the file-store TestLease_StaleBelowThreshold.",
    "Reboot/crash behavior is unchanged: the startup resume still lands the anchor when there is no foreground and no live lease": "watchStrandedJoin's first tick is the startup resume (agent/cmd/agent/main.go); Config.Lease nil is a pass-through and a pre-reboot lease is stale on its timestamp. Proven by TestResumeStrandedOnce_ResumesWithNoLeaseStore.",
    "The revoked/foreign-code fail-loud and the declined-teardown outcomes are logged, not fatal — the join socket still serves fresh joins": "watchStrandedJoin logs each outcome (errIsDeclined -> info, other errors -> error) and never returns; ResumeStrandedOnce is best-effort. ServeListener runs beside the watch goroutine. Existing resume_anchor_test.go (declined-while-down -> ErrDeclined) unchanged and green."
  },
  "summary": "The standing agent resumes a lost-SSH join without a service restart: the foreground holds an owner lease it refreshes for the life of its landing, and a 30s resume watch resumes an anchor only when no fresh lease is present.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #958 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 958, "status": "success", "commits": [ "dd9193ff5bde9d2298e654e09a6bdff304b7f13a" ], "changed_files": [ "STATUS.md", "agent/cmd/agent/main.go", "internal/join/cli.go", "internal/join/join.go", "internal/join/lease.go", "internal/join/resume.go", "internal/join/resume_lease_test.go", "internal/resumeanchor/lease.go", "internal/resumeanchor/lease_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/join/... ./internal/resumeanchor/... ./agent/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/join/... ./internal/resumeanchor/... ./agent/cmd/agent/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./...", "exit_code": 0 } ], "criteria": { "A foreground enroll/install holds a lease it refreshes for the full duration of its landing, including a Pending long-poll": "Orchestrator.withLease (internal/join/lease.go) refreshes the lease up front and on a ticker for the whole landing; it wraps AwaitAndLand (internal/join/cli.go) and ResumeAndLand (internal/join/resume.go). Proven by TestAwaitAndLand_RefreshesLeaseThroughLongPoll (refreshes >=2 across the long-poll, cleared once at the end).", "With a live, refreshed lease present, the standing service does not resume the same request (no double-land)": "Orchestrator.ResumeStrandedOnce withholds when LeaseStore.Fresh returns true. Proven by TestResumeStrandedOnce_WithholdsWhileLeaseFresh (resumed=false, anchor left untouched, nothing below the seam runs).", "With the lease absent or stale, the standing service resumes-and-lands the anchored request without a service restart": "ResumeStrandedOnce resumes when Fresh is false. Proven by TestResumeStrandedOnce_ResumesWhenLeaseStale (resumed=true, lands to Enrolled, anchor cleared, lease refreshed then cleared) and the file-store TestLease_StaleBelowThreshold.", "Reboot/crash behavior is unchanged: the startup resume still lands the anchor when there is no foreground and no live lease": "watchStrandedJoin's first tick is the startup resume (agent/cmd/agent/main.go); Config.Lease nil is a pass-through and a pre-reboot lease is stale on its timestamp. Proven by TestResumeStrandedOnce_ResumesWithNoLeaseStore.", "The revoked/foreign-code fail-loud and the declined-teardown outcomes are logged, not fatal — the join socket still serves fresh joins": "watchStrandedJoin logs each outcome (errIsDeclined -> info, other errors -> error) and never returns; ResumeStrandedOnce is best-effort. ServeListener runs beside the watch goroutine. Existing resume_anchor_test.go (declined-while-down -> ErrDeclined) unchanged and green." }, "summary": "The standing agent resumes a lost-SSH join without a service restart: the foreground holds an owner lease it refreshes for the life of its landing, and a 30s resume watch resumes an anchor only when no fresh lease is present.", "reason": "", "blockers": [], "no_code_change": "" } ``` </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.

Dependencies

No dependencies set.

Reference
Matou/idss#958
No description provided.