Skip to content

sminos: prove the four stand-in Resume cases live (#84) - #294

Merged
SSFSKIM merged 2 commits into
mainfrom
sminos-live-resume-cases
Oct 20, 2026
Merged

SSFSKIM merged 2 commits into
mainfrom
sminos-live-resume-cases

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Board #84: the four Resume behaviours that rested only on the claude stand-in are now proven live against claude 2.1.304 by sminos/tests/mods/live-resume-check.py, and pinned so a release that breaks one fails loudly.

What the check covers

A terminal session runs one turn, joins its project and ends. Then, in one run:

  • Delivery after Resume. A peer's say from another machine and the owner's message from the desk, owed to the ended session, are reported recorded once by the daemon's tick. After Resume, the next tick delivers both: the outcome for the same key turns delivered, and the words reach the session's transcript.
  • Resume itself (kept from DC7): the session comes back as a --bg job under its own id. The ledger's launch and job are that process's. The engine's record carries startedAt.
  • A Resume while it runs is refused session-live (kept).
  • Two Resumes at once. As the daemon runs them (two workers, one lock per session), one is done, the other session-live, and there is one launch. Two raw claude --bg --resume launches at once from two processes leave one process holding the session.
  • Claim reconciliation after a daemon stop.
    • A claim whose job was kept is done from that job's process.
    • A claim stopped before its job was kept is done from the --bg process its launch started.
    • A process that started before a claim's launch is no evidence for it, whether its job id is the same or absent: not done, then interrupted once the window passes.
  • The copy race (kept): a reopen racing the launch ends copy-started, with the copy stopped.
  • The seat cases. A seat that sminos spawn started, then stopped, resumes under its own id and reads as running. Once retired, its session is refused unsupported and nothing is launched.

Every RPC runs as the daemon runs it: sealed, received with its code, checked, claimed in the ledger, executed on workers. A daemon stop is a process exit right after the job is kept, or right before. The next daemon is a fresh Rpcs reading that ledger. test_rpcs.py's test_j_the_live_checks_call_path_runs_against_the_stand_in runs every mode of the check's daemon side, and its reads of sminos, against the stand-in. A change to those call paths therefore fails CI, not only a by-hand run.

Live run (claude 2.1.304, haiku)

live resume check (/tmp/brl.lxc0ff5w):
  ok   a terminal session ran, joined its project, and ended — session 1da1b7cd, 1 answer rows, transcript ['/tmp/brl.lxc0ff5w/home/.claude/projects/-private-tmp-brl-lxc0ff5w-work/1da1b7cd-5c0d-4a51-b71a-fb00ab850def.jsonl'], membership {'kind': 'retired', 'reason': 'ended'}
  ok   an event from outside owed to the ended session (a peer's say, the owner's message from the desk) is reported recorded once, however many ticks — [[["recorded", "a terminal session that was closed: kept owed, and delivered if it comes back"]], [["recorded", "a terminal session that was closed: kept owed, and delivered if it comes back"]]]
  ok   Resume brings it back as a --bg job under its own id — outcome {'state': 'done', 'result': {'session': '1da1b7cd-5c0d-4a51-b71a-fb00ab850def'}}; holders [('bg', '1da1b7cd')]; job rows [('1da1b7cd', 'blocked')]; same transcript True
  ok   its launch and job are what the ledger kept, and the job's process is that launch's, its record carrying startedAt — kept launch 1792478352.09475, job 1da1b7cd (session 1da1b7cd); holders (kind, job, startedAt, started - launch) [('bg', '1da1b7cd', True, 2.51)]; job rows ['1da1b7cd']
  ok   once Resume brings it back, the daemon delivers both, each outcome turning delivered for the same key, and the words reach the session — outcomes [[["recorded", "a terminal session that was closed: kept owed, and delivered if it comes back"], ["delivered", "pushed to the live session"]], [["recorded", "a terminal session that was closed: kept owed, and delivered if it comes back"], ["delivered", "pushed to the live session"]]]; in the transcript: FIG37943 True, PLUM37943 True
  ok   a Resume while it runs is refused session-live, launching nothing — outcome {'state': 'failed', 'error': {'code': 'session-live', 'message': 'the session is running here (a --bg job, pid 47258): only an ended session is resumed'}}
  ok   two Resumes at once, as the daemon runs them, start one session: one done, the other session-live — outcomes [{'state': 'done', 'result': {'session': '1da1b7cd-5c0d-4a51-b71a-fb00ab850def'}}, {'state': 'failed', 'error': {'code': 'session-live', 'message': 'the session is running here (a --bg job, pid 47395): only an ended session is resumed'}}]; launches 1; holders [('bg', '1da1b7cd', True, None)]
  ok   two launches at once from two processes (an orphaned launch meeting the next daemon's) leave one process holding the session — launches: exit 0, backgrounded · 1da1b7cd (idle — send a prompt to start); exit 0, backgrounded · 1da1b7cd (idle — send a prompt to start); holders [('bg', '1da1b7cd', True, None)]; copies []
  ok   a Resume whose daemon stopped once its job was kept is reconciled done by the next daemon, from that job's process — claim left {'launched_at': 1792478395.880002, 'job': '1da1b7cd', 'outcome': None}; reconciled {'state': 'done', 'result': {'session': '1da1b7cd-5c0d-4a51-b71a-fb00ab850def'}}; holders (kind, job, startedAt, started - launch) [('bg', '1da1b7cd', True, 2.63)]
  ok   a Resume whose daemon stopped before its job was kept is reconciled done, from the --bg process its launch started — claim left {'launched_at': 1792478404.674816, 'job': None, 'outcome': None}; reconciled {'state': 'done', 'result': {'session': '1da1b7cd-5c0d-4a51-b71a-fb00ab850def'}}; holders (kind, job, startedAt, started - launch) [('bg', '1da1b7cd', True, 0.5)]
  ok   a process that started before a claim's launch is no evidence for it, its job id the same or none: not done, then interrupted once the window passes — first pass [None, None], past the window [('failed', 'interrupted'), ('failed', 'interrupted')]; holder (kind, job, startedAt, started - launch) [('bg', '1da1b7cd', True, -1.55)]
  ok   a Resume racing the owner's reopen stops the engine's copy and fails copy-started — outcome {'state': 'failed', 'error': {'code': 'copy-started', 'message': 'the session was opened elsewhere meanwhile, so the engine started a copy (89c97577) instead of continuing it; the copy was stopped'}}; holders [('interactive', 97941)]; copies [('89c97577', 'stopped', False)]
  ok   a stopped seat's session resumes under its own id, and the seat reads as running — spawned as job ['1f85001f']; stopped: {'alias': 'rsseat', 'status': 'working', 'state': 'stopped'}; outcome {'state': 'done', 'result': {'session': '1f85001f-8ebf-4e01-9f2f-817f67440e8d'}}; holders [('bg', '1f85001f', True, 0.72)]; job rows [('1f85001f', 'done')]; then {'alias': 'rsseat', 'status': 'working', 'state': 'idle'}
  ok   a retired seat's session is refused unsupported, nothing launched — retire: retired work/rsseat [1f85001f-8ebf-4e01-9f2f-817f67440e8d] (seat kept; re-fill with: sminos fill work/rsseat --resume "<task>"); seat {'alias': 'rsseat', 'status': 'retired', 'state': 'retired'}; outcome {'state': 'failed', 'error': {'code': 'unsupported', 'message': 'the seat rsseat holding it was retired: `sminos fill` or `sminos send` brings it back'}}; holders []
  workers under /tmp/cc-daemon-501/23df6d68: none left
  cleanup: nothing left running
  kept: /tmp/brl.lxc0ff5w
passed: 14 of 14 checks passed

The first run passed 13 of 14. The failure was the check's own: its "past the window" restart ran on a clock 421 s ahead, so the outcomes it kept carried a future done_at. The jobless reconcile after it then counted those two claims as Resumes still running. That case now runs last.

What the engine showed

  • startedAt. The session record carries it (ms). The resumed process started 0.5–2.6 s after the launch in every Resume, so launched_by never fell back to ps (the ticket's comment; the Linux ps tolerance itself is Narrow SDE no-subagents clauses to a reviewer-dispatch ban (v7.64.0) #85).
  • Job names. Every --bg job is named by its session id's first 8 characters: a fresh sminos spawn job as well as each Resume's. The engine keeps one job directory per session and reuses it for every Resume of it. A copy gets its own (its new session's first 8).
  • Two concurrent launches. Both exit 0 and print the same backgrounded · <job> (idle — send a prompt to start), and one process holds the session. The engine does not start a copy here; it joins the second launch to the running job.
  • A resumed job's listed state carries over from its job: blocked for a session's first --bg job, done for a seat whose job had finished a turn. Nothing in Resume reads it.

Stand-in corrections

  • fake_claude.py: the session record carries startedAt, and a fresh --bg launch is named by its session's first 8 characters, as the engine's are.
  • Each holder binds a socket of its own. Before, a session held again after its holder was killed could not bind the stale socket file, so its second holder never started. The pin test resumes one session several times.

test_rpcs.py (63) and test_policy_requests.py (43) pass locally. No sminos product code changed, so there is no version bump.

Review

doperpowers:reviewer-medium (opus) on 219b150..7748601 returned "correct", with one P3 finding. The older-process case never required the older process, so with no holder it would pass with two jobless claims. 40d5d3c adds that requirement. Run 2's detail line shows the condition held there: ('bg', …, True, -1.55).

ci-gate: GREEN on 40d5d3c (https://github.com/SSFSKIM/doperpowers/actions/runs/39383191997).

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)

…ainst the engine (#84)

live-resume-check.py now drives each Resume as the daemon runs it (sealed,
received, checked, claimed in the ledger, executed on workers) and covers
what rested on the claude stand-in: delivery after Resume (recorded, then
delivered for the same key), two Resumes at once (one daemon: one done,
one session-live; two raw launches: one process holds the session), claim
reconciliation after a daemon stop (job kept, job not kept, a holder older
than the launch), and the seat cases (a stopped seat resumes, a retired one
is refused unsupported). 14 of 14 pass against claude 2.1.304.

The stand-in corrected where the run contradicted it: the engine's session
record carries startedAt, and every --bg job, fresh or resumed, is named by
its session id's first 8 characters. Each holder now binds a socket of its
own, so a session held again after a kill can be held.

test_j_the_live_checks_call_path_runs_against_the_stand_in pins every mode
of the check's daemon side and its sminos reads against the stand-in.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
Its claims were jobless and its check passed with no holder at all when the session had none before the launch; it now requires the --bg process that started before the claims' launch.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit 2909844 into main Oct 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant