Skip to content

bot: a saved hand the store already holds is not reported lost - #972

Merged
svanlabs[bot] merged 1 commit into
mainfrom
fix/stale-resumable-false-loss
Oct 12, 2026
Merged

svanlabs[bot] merged 1 commit into
mainfrom
fix/stale-resumable-false-loss

Conversation

@svanlabs

@svanlabs svanlabs Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

What generated this?

Generated-by: claude-code/claude-sonnet-5-5

Motivation

Closes #968.

report_unsettled names a saved open hand "lost" whenever the resync snapshot has moved past it, without asking the store. Three false warnings in 35 hours on build 7a1494c (2026-10-10 11:00 to 2026-10-11 22:12 UTC), each for a hand whose row is in the hands table:

  • SvanBotV10 at 11:00:04, the hot swap: hand 08305a02 was stored at 10:59:57 by the process that was swapped out.
  • SurSvan at 13:34:43 and Svanism at 14:03:59, at reconnects hours after the swap: hands 1e8862bf and 7abdd813 were stored at 11:00:23 and 11:00:39 by the live path, which left their saved starts in shared.resumable (resume_open_hand returns early when the tracker already knows the hand).

The warning exists so that a row lost at a hot swap is not silent (0315); a false one at every swap hides a true one, and the next release is a swap.

Solution

One check in the one reporter, in crates/apps/bot/src/client/recover.rs: after the entry is dropped, report_unsettled asks shared.store.hand and returns without a warning on Ok(Some(_)). A store that cannot answer still warns, because an unreadable store says nothing about the row. It covers all three causes.

Test: a_saved_hand_the_store_already_holds_is_not_reported_lost stores the saved hand's row, then resyncs onto another hand; it failed on origin/main with "the row is stored: nothing is lost" before the fix. The existing a_saved_hand_the_replay_cannot_settle_is_reported_lost_once still passes: with no stored row the warning stays.

Log-only change off the decision path, so no paired simulation and no golden change. Not released: the running build is 7a1494c.

Checklist

  • scripts/check.sh full passes on this exact commit (e842e1b), run in a worktree on the shared warm target/dev:
test.py: 897 passed, 0 failed, 4 ignored in 35 binaries; build 0.2s, run 4.4s (6 jobs x 2 threads, profile gate, peak test RSS 195 MB)
== ok (full, 154 s)
check.sh full: exit 0
  • This is one change.
  • Not a behaviour change on the decision path: no paired simulation; the golden snapshot is untouched.
  • Not a performance change.
  • No document names the changed behaviour.
  • The AI-provenance rule was followed: Generated-by: is in the commit footer and in the section above.

🤖 Generated with Claude Code

`report_unsettled` named a saved open hand "lost" whenever the resync
snapshot had moved past it, without asking the store. Three false
warnings on 2026-10-10: SvanBotV10 at the hot swap, where the swapped-out
process had stored the hand two seconds before it was replaced, and
SurSvan and Svanism at reconnects hours later, where the live path had
stored the hand after the restart but left its saved start in
`resumable`.

The reporter now asks the store first and says nothing when the row is
there. A store that cannot answer still warns, because an unreadable
store says nothing about the row.

Closes #968.

Generated-by: claude-code/claude-sonnet-5-5
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@svanlabs
svanlabs Bot merged commit 0e3d584 into main Oct 12, 2026
3 checks passed
@svanlabs
svanlabs Bot deleted the fix/stale-resumable-false-loss branch October 12, 2026 09:41
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.

Fix: a hand saved before a restart and stored since is reported as a lost row at the next resync

0 participants