Repository navigation
fix(update): shorten package rollback verification - #179797
Merged
Merged
Conversation
Batch final package stat reads without changing fingerprint observations or traversal-order failure precedence. Preserve timeout fallback and prove the slow-storage deadline, rollback, and real-filesystem scan behavior. Co-authored-by: Aaron08140 <[email protected]>
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
steipete
marked this pull request as ready for review
October 21, 2026 18:39
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
Author
|
Landing despite one red job: |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 22, 2026
The integrity reader's final drift sweep read files one at a time. It now batches 32 reads while preserving traversal-order errors; fingerprints are identical and measured sweep latency fell 59%. Supersedes openclaw#169599, thanks @Tsuki-hash. Co-authored-by: Aaron08140 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Large npm installations spend one filesystem round trip per entry in the final package-integrity drift sweep. That unnecessarily extends update and rollback verification and can consume the verifier's deadline.
Supersedes #169599, thanks @Tsuki-hash.
User Impact
Package update and rollback verification complete sooner while checking the same entries and producing the same fingerprint. Existing timeouts, resource-error fallback, and integrity refusals remain intact. This improves the installed updater; staging a candidate cannot change the updater already running.
Why This Change Was Made
Batch up to 32 final stat reads inside the existing integrity reader and inspect settled results in traversal order. A later timeout cannot hide an earlier integrity failure. No new exported helper, cache, configuration, dependency, or persistent state is needed. The rollback mutation fixture now targets the entry's own final observation, independent of sibling I/O order.
Runtime production delta: +4 lines (12 added / 8 removed); the small growth preserves deterministic error precedence rather than adding a separate sweep owner. Tests: +74 net lines. Rerunnable benchmark tooling: 77 lines.
Release-note context: faster package update/rollback integrity verification, preserving drift detection and resource fallback; contributor credit for #169599 belongs to @Tsuki-hash (Aaron08140).
Evidence
Acceptance: preserve fingerprints and stat counts, reduce drift-sweep time, and avoid a material full-scan regression. The committed
scripts/bench-package-integrity.tsscanned the same synthetic package (2,048 4-KiB files, a symlink and a hardlink) with separately bundled baseline and candidate readers, alternating A/B six times. The first pair is cold; the remaining five pairs are warm. Local macOS APFS, Node 26.12.0.All 12 fingerprints matched. Cold full scan: 109.12 → 87.28 ms. CPU did not improve; process-wide RSS rose during both readers' repeated scans, so this is a latency claim, not a memory improvement claim. This small local fixture does not establish a full real-world upgrade speedup.
Package rollback verification timed out, then passed after the fix. A second regression preserves earlier drift over a faster later timeout.swapStagedPackageInstallcommitted a synthetic staged npm package, then rolled back successfully (exit 0), restoring the original version, exact bytes, and launcher. No filesystem mocks or operator state. A full installed-CLI/Gateway upgrade was not exercised.git diff --checkclean.check:changedSQLite inventory is skipped; scoped types/lint/format/tests and Madge substitute, with PR CI owning broad proof.Commands used an isolated
HOMEandOPENCLAW_STATE_DIRunder.artifacts/:Additional consumer command:
Current-main recheck before publication:
origin/mainat2a597857a055has no newer changes to either touched runtime/test owner; #169599 remains open and unmerged.