Skip to content

sminos 1.27.6: daemon/sends.json drops the sessions gone (#159) - #427

Merged
SSFSKIM merged 2 commits into
mainfrom
sminos-sends-prune
Oct 28, 2026
Merged

SSFSKIM merged 2 commits into
mainfrom
sminos-sends-prune

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 28, 2026

Copy link
Copy Markdown
Owner

What

daemon/sends.json, the RL10 send RPC's seq per session (#426, sminos 1.27.4), never dropped an entry. So it held one integer for every session ever sent to remotely. Board ticket #159.

Now a reserve drops an entry when all of these hold:

  • the session is not running (sminos.session_running);
  • its bridge holds no socket (bridge.endpoint);
  • none of its seqs is in flight (Sends.waiting).

The session being reserved always stays. Pruning happens at most once every SENDS_PRUNE_S (an hour), inside the write a reserve makes anyway, so it adds no write.

A durable floor. The file is now version 2, {version, floor, seq}. floor is the highest seq of any entry ever dropped. A session with no entry starts at max(floor, bridge mark) + 1, so a dropped session's next send goes above every seq it was ever handed.

The ticket assumed the bridge's kept mark alone was a safe floor. Review showed it is not, and reproduced a reused key:

  • the daemon's bridge sweep deletes a kept file after a day idle;
  • a bridge child's failed save leaves the mark on disk behind the mod's.

Compatibility. A version 1 file is read as floor 0. A 1.27.4 daemon refuses a version 2 file ("cannot be kept", so every send fails) rather than reuse a key below the floor. An unreadable file still refuses every send and is never rewritten, and the file is still replaced atomically at mode 0600.

Tests

test_rpcs.py, new class SendsPruned:

  • A gone session's entry is dropped. The running, bridged, in-flight and just-reserved entries stay, and the mode is 0600. With the gone session's kept file swept and the daemon restarted, its next send gets seq 10, above the 9 it was handed, and floor is 9. Before the floor fix this test returned 8, and with the kept file swept it would return 1.
  • Pruning happens at most once an interval, and again once the interval has passed.
  • An unreadable file raises and is left byte for byte.

The existing send tests in test_rpcs.py, test_words.py and test_rl10.py pass unchanged.

Docs: the scripts CLAUDE.md send paragraph, and Sends' docstring.

Validation Evidence

Residue

None.

sminos 1.27.6.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)

#159: Sends kept one seq per session ever sent to, forever. A reserve now
drops, at most once an hour (SENDS_PRUNE_S) and in the write it makes
anyway, each entry whose session is not running, whose bridge holds no
socket and none of whose seqs is in flight: its bridge's kept mark is then
every key it took, and a later send to it is taken above that mark. An
unreadable file still refuses every send and is never rewritten.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Review of 94da765: the bridge's kept mark is no floor for a dropped
entry. The daemon sweeps a kept file a day idle, and a child's failed
save leaves it behind the mod's, so a pruned session's next send could
take seq 1 again. The file is now version 2, `{version, floor, seq}`: an
entry dropped raises `floor` to its seq, and a session with no entry
starts above it. Version 1's file reads as floor 0; a daemon from before
refuses version 2's rather than reuse a key.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit 1f4bff1 into main Oct 28, 2026
1 check passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T12:12:43.471333Z a233d99 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

SSFSKIM added a commit that referenced this pull request Oct 28, 2026
Versions kept at this branch's 1.27.7.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
…lease-order

sminos 1.27.8 for this branch's #156 and #158, above main's 1.27.7.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
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