Skip to content

test(ios): replay the round engine vectors through the round adapter - #681

Merged
sunnylqm merged 2 commits into
masterfrom
claude/ios-round-replay
Oct 16, 2026
Merged

sunnylqm merged 2 commits into
masterfrom
claude/ios-round-replay

Conversation

@sunnylqm

@sunnylqm sunnylqm commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • New scripts/tests/ios-purge-restore/round_replay_test.mm, built by scripts/test-ios-purge-restore.sh (so the existing Native purge-restore ordering CI job runs it, with ASan/UBSan). It compiles the unchanged RCTPushyOrchestrator round adapter — runOnce, perform:, download:, commit:, finishRound:, PushyWaitSeconds and their globals, extracted by extract.py into round*.inc — against a scripted flowcore::StepRound. No production code changes.
  • For each trace in cpp/update_flow_core/tests/round-engine-vectors.json the engine returns the trace's commands and the IO (PushyHttpRequest, install check, RCTPushyInstaller fetch, commitRoundWithGeneration:, monotonic clock) is faked from the trace's next event. Checked: every answered event (type/text/installed/ok/code/timedOut/reason/error/activated/now, ok/code as the engine reads them), sticky crashHold/forceActivate, the arguments each command ran with, the start facts, the host result, the remembered unactivated hash, the breadcrumb.
  • 30 traces replay — crash hold, forceActivate (activation dropped by the commit), round deadlines and timed-out downloads included; only the protocol-error traces are skipped. Same idea as Harmony's harmonySyncRound.test.ts and Android's SyncRoundReplayTest (test(android): replay the round engine vectors through the sync adapter #680).
  • New negative control drop-config-changed (VERIFY_REGRESSIONS): a lost commit reported without reason: "config_changed" fails the config-change trace.

Test plan

  • SANITIZE=1 VERIFY_REGRESSIONS=1 bash scripts/test-ios-purge-restore.sh: all orderings, round replay: 30 rounds, all seven negative controls detected
  • CI

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Tests
    • Expanded update-flow validation with iOS round replay scenarios, checking event results, state, timing, command arguments, and protocol errors.
    • Added Android round-replay coverage and a regression check for configuration changes during a round.
  • Documentation
    • Documented how to run an individual iOS round replay and updated the negative-control check count.

round_replay_test compiles the unchanged RCTPushyOrchestrator round
adapter (runOnce, perform:, download:, commit:, finishRound:) extracted
by extract.py, with a scripted flowcore::StepRound playing each trace of
round-engine-vectors.json and the IO faked from the trace's next event.
It checks every event the adapter answers with, the sticky crash-hold
and forceActivate flags, the arguments each command ran with, the start
facts, the host result, the unactivated hash and the breadcrumb. 30
traces replay, crash hold, forceActivate, deadlines and timeouts
included. A drop-config-changed mutant joins the negative controls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 75a02b94-bc83-4f00-be27-eb43fcbbe092
📥 Commits

Reviewing files that changed from the base of the PR and between 3558280 and 339ea41.

📒 Files selected for processing: 1
  • docs/NATIVE_CHECKUPDATE_DESIGN.md
🚧 Files skipped from review as they are similar to previous changes: 1
  • docs/NATIVE_CHECKUPDATE_DESIGN.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

📝 Walkthrough

The iOS test harness now builds a round-adapter replay executable, checks round-engine vectors, and verifies a config-change mutation. The test script, extractor, test host, README, and design test list include the new replay checks.

Changes: iOS Round Adapter Replay

Layer / File(s) Summary
Extract the round adapter
scripts/tests/ios-purge-restore/extract.py, scripts/tests/ios-purge-restore/test_extract.py
The extractor generates round adapter sections and applies the drop-config-changed mutation to the round commit. The source-drift test checks that mutation target.
Run vector-backed adapter replays
scripts/tests/ios-purge-restore/round_replay_test.mm
The Foundation-only host replays eligible vectors with scripted events and IO. It checks event values, state flags, command arguments, finish results, and cleanup.
Build and verify replay runs
scripts/test-ios-purge-restore.sh, scripts/tests/ios-purge-restore/README.md, docs/NATIVE_CHECKUPDATE_DESIGN.md
The script builds and runs the replay test when no test-name arguments are supplied. Its regression check verifies the config-change mutation. The README and design test list describe the replay test.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 339ea

This change adds an iOS test replay harness and updates documentation. It does not change production behavior, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding iOS round-engine vector replay through the round adapter.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sunnylqm
sunnylqm merged commit e11c13d into master Oct 16, 2026
7 checks passed
@sunnylqm
sunnylqm deleted the claude/ios-round-replay branch October 16, 2026 04:09
@sunnylqm sunnylqm mentioned this pull request Oct 16, 2026
sunnylqm added a commit that referenced this pull request Oct 17, 2026
Bump package.json and harmony/pushy/oh-package.json5 together, with the
bilingual release notes. Ships everything since 10.60.0: the shared native
round engine (#673-#681), the cross-platform alignment and fixes (#664,
#666, #671, #687, #688), the JS client fixes and split (#667, #684, #685),
the bounded host prepareBundle (#669), the generated cross-platform contract
(#683, #686) and the trimmed npm package (#670).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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