Skip to content

sminos 1.27.7: test-sync.sh's former-name rejoin no longer races the uplink (#157) - #428

Merged
SSFSKIM merged 4 commits into
mainfrom
sminos-test-sync-rejoin
Oct 28, 2026
Merged

SSFSKIM merged 4 commits into
mainfrom
sminos-test-sync-rejoin

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 28, 2026

Copy link
Copy Markdown
Owner

What

sminos/tests/test-sync.sh's section "a member joined as betaold on an open stream" failed once in CI. That was #425's first gate, run 40667857445, with three FAILs:

  • ob joins again as beta got [["retired", null]];
  • the daemon's "still writes as betaold" notice was missing;
  • so said once counted 0.

It failed again on #156/#158's gate (run 40680605663). Board ticket #157.

Why: a race in the setup, not the poll. The section appended ob's betaold joined in syncproj and only then rewrote ob's engine record from its other checkout ($RO) to syncproj. The uplink reconciles as soon as an append lands (its delivery path → view_of → _reconcile). One that ran in that gap read the joined beside a record still naming $RO, and retired ob as moved under beta/ob. That retirement was the hub's first beta/ob event, so the poll on "the hub holds beta/ob" returned on it, and no longer wait could have helped. A 1.5 s sleep in that gap reproduces all three CI failures every run.

The fix keeps what the section proves:

  • ob's record moves to syncproj first, replaced whole (os.replace), as an SDK run's (entrypoint: sdk-cli), which no reconciliation joins on sight.
  • The betaold joined is appended only after two of beta's syncproj ticks (its daemon.json tick) have read the moved record.
  • The section then waits on what the daemon records (its notice in daemon.log) and only then on the hub, every wait bounded at 30 s.
  • It now also asserts the daemon's own line "ob in syncproj joined again as beta (it had joined as betaold)", so the join it checks is the rejoin of a former name. With ob's record left joinable, a join on sight passed the old assertions; the new line fails in that case, which I checked.

Validation Evidence

  • The diagnosis: with sleep 1.5 between the old append and the record rewrite, test-sync.sh fails exactly CI's three assertions: 3 of 118 sync assertions FAILED, actual: [["retired", null]].
  • The fixed section under load: 20 runs of test-sync.sh at 7c0d474, two at a time, all 119 sync assertions passed in every run, no FAIL (scratch/sync20.sh).
  • The new assertion bites: with the record left joinable, FAIL the daemon's rejoin of the former name is what joins ob as beta.
  • CI: ci-gate on d3cae94 (the PR head, main merged) is GREEN: https://github.com/SSFSKIM/doperpowers/actions/runs/40685982571
  • Review: doperpowers:reviewer-medium ran three rounds.
    • Round 1 on 188f2b7: a P2. A reconciliation between the record write and the append could join ob on sight, and the section would pass without proving the rejoin. Fixed in d7eef10 (SDK record, tick barrier, rejoin assertion).
    • Round 2: the tick poll expanded $(tick_b) once, so each wait ran to its bound. Fixed in 7c0d474.
    • Round 3: no material findings.

Unresolved Review Findings

  • test-sync.sh, the same section. An uplink reconciliation that read ob's old $RO record before the record move and that stays stalled across two whole daemon ticks before reading the log can still retire ob as moved. The reviewer forced this by pausing the uplink inside view_of; it calls it pre-existing, not introduced here. Left because closing it would need a barrier on the uplink process too, for a schedule that needs a stall of seconds inside one function. If it ever shows in CI, the first beta/ob event reads retired again.

Residue

None.

sminos 1.27.7 (test-only; bumped so the release number moves with the tree).

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

…uplink

#157: the section appended ob's betaold `joined` in syncproj and only then
moved ob's engine record there from its other checkout. The uplink
reconciles as soon as the append lands; one that ran in that gap read the
joined beside a record naming the other checkout and retired ob as
`moved`, the hub's first beta/ob event (CI's `[["retired", null]]`; a
1.5 s sleep in the gap reproduces all three failures every run). Now the
record is replaced whole, naming syncproj, just before the append, as a
session's record names where it runs before its hook writes there, and
the section waits on the daemon's own notice before the hub's state. What
it asserts is unchanged.

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

Review of 188f2b7: a reconciliation between the record's move and the
append could join ob on sight as beta, and the section would pass without
the daemon's rejoin of a former name. ob's record is now an SDK run's,
which nothing joins on sight, and the joined lands only after two of
beta's ticks have read the moved record, so no reconciliation can pair
the joined with the old one. The section asserts the daemon's own
"joined again as beta (it had joined as betaold)" line, which fails when
ob's record is left joinable.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Review of d7eef10: `test "$(tick_b)" != …` was expanded once, so each wait
ran to its 30 s bound without seeing a tick. A helper reads it each try, as
alpha's tick_moved does.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Versions kept at this branch's 1.27.7.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit b1e9543 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:32:33.936995Z d3cae94 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
…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