Skip to content

test(update): fix the Windows backup-rename regression on native Windows - #162352

Merged
steipete merged 1 commit into
mainfrom
fix/windows-backup-rename-native-test
Oct 1, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/windows-backup-rename-native-test

Conversation

@steipete

@steipete steipete commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Refs #162027

What Problem This Solves

Fixes the backup-rename regression test introduced by #162231, which failed on native Windows when exercising the Linux no-retry policy.

User Impact

The test exercises both retry policies on a Windows runner while keeping real filesystem staging, verification, and cleanup native. Default updater behavior is unchanged.

Why This Change Was Made

Spoofing process.platform around the whole swap caused fs-safe to select Linux retained-directory staging against the Windows native binding. The fixture returned helper-unavailable: native retained-directory staging is unavailable and packageRollbackVerified: false before reaching the injected EPERM rename.

The backup-rename policy now accepts a platform dependency that defaults to the real host. The test delegates to that real owner with its selected policy and leaves process.platform untouched. All existing error-code, rollback, retry-count, warning, and file-content assertions remain unchanged. No matcher was widened and no case was skipped.

Evidence

Head: 7b8d453d15bd2e5f0e9e3a8448946d45760f54fb, based on main 97e6d8e2592bff84fc9b651b794969f8b1a37da5.

  • Original native Windows job 110188916369 failed the Linux EPERM no-retry case with the unrelated staging refusal above.
  • Native Windows job passed on Node 24.21.0. All 11 regression cases passed; the previously failing Linux-policy case took 37 ms. The regression cases totaled about 0.635 seconds of test time. The infra project changed from 654 passed/1 failed/81 existing skips to 655 passed/81 existing skips.
  • Full exact-head PR CI passed.
  • Fresh Blacksmith Testbox tbx_01m3tqztj0k1thy7kscgywtxrj fetched the pushed SHA and installed with pnpm install --frozen-lockfile, without local tree sync. Regression: 11/11 passed. pnpm test src/infra/package-update-swap.windows.test.ts --maxWorkers=1 measured 7.00 seconds warm wall time, with about 0.21 seconds of test time.
  • All three direct filesystem-importing test files plus the swap owner suite passed three times: 4 files, 72 passed tests and 6 existing skips each run; wrapper wall times 7.53, 9.29, and 7.98 seconds.
  • CI=1 OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 node scripts/check-changed.mjs --base 97e6d8e2592bff84fc9b651b794969f8b1a37da5 passed, including core types, all 27 core-test type graphs, lint, formatting, dead-export scans, and selected guards.
  • Fresh isolated direct-route P1 autoreview passed on the exact commit with no findings. Review lease tbx_01m3tr4bdpe6f26eettb8d7p36 was stopped and task credentials were deleted.

Production: +2/-1 lines (net +1 platform dependency). Tests: +20/-13 lines (net +7). No dependency, schema, CLI, configuration, or baseline changes.

Auto-merge is off; this is a fix-forward PR, not a direct main push.

Inject the platform only into the backup-rename policy. Leave native filesystem staging, verification, and cleanup on the host platform so the Linux policy case reaches its injected EPERM on Windows. Preserve all existing failure, retry, rollback, and content assertions. Refs #162027.
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 30, 2026, 11:56 PM ET / October 1, 2026, 03:56 UTC (Revision 2).

ClawSweeper review

What this changes

The PR lets update tests select the backup-rename retry policy while staging, verification, and cleanup continue using the host’s native filesystem behavior.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: current main still needs this focused fixture repair. No introduced correctness defect was found, and the previously requested validation results remain pending.

Priority: P2
Reviewed head: 7b8d453d15bd2e5f0e9e3a8448946d45760f54fb

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture correction preserves meaningful boundary assertions with no concrete introduced defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The host identifies a member-authored PR, exempt from ordinary external-contributor proof. The changed backup-rename owner remains exercised through the real swap fixture, but the promised native Windows after-fix result is still pending; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The host identifies a member-authored PR, exempt from ordinary external-contributor proof. The changed backup-rename owner remains exercised through the real swap fixture, but the promised native Windows after-fix result is still pending; no stored-data contract changes.
Evidence reviewed 10 items Pinned introduced change: The production change adds an optional platform argument defaulting to process.platform. The test replaces whole-swap platform spoofing with delegation to the existing backup-rename owner; all existing assertions remain intact.
Boundary coverage retained: The 11 cases retain transient-error recovery, persistent-error rollback, retry-count, warning, file-content, and authority/source/destination-change assertions. The only production caller supplies four arguments, preserving host-selected behavior.
Still necessary on current main: Fetched main retains the original process.platform branch without the policy dependency. The latest release predates the backup-rename retry implementation, so it does not contain this fixture repair.
Findings None None.
Security None None.

How this fits together

The package updater stages a replacement installation, backs up the installed package, and verifies activation or rollback. These tests inject rename failures into that production swap path to check retry and recovery behavior.

flowchart TD
  A[Staged replacement package] --> B[Package swap]
  C[Test-selected retry policy] --> D[Backup rename]
  B --> D
  D --> E[Native filesystem operations]
  E --> F[Activation or rollback]
  F --> G[Package and launcher assertions]
Loading

Before merge

  • Complete next step (P2) - Record the promised native Windows regression pass and focused validation results, including measured changed-test cost, before merge.
Agent review details

Security

None.

PR surface

Source +1, Tests +7. Total +8 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
Tests 1 20 13 +7
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 22 14 +8

Review metrics

None.

Technical review

Best possible solution:

Keep one backup-rename policy owner and exercise both policies through the package swap without changing the native filesystem platform.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: the existing Linux-policy case spoofs process.platform across a native Windows swap, allowing fs-safe to reject staging before the injected EPERM rename. No failing execution was performed during this read-only review.

Is this the best way to solve the issue?

Yes: selecting the policy at its existing owner preserves the actual swap boundary and assertions while avoiding a global platform mismatch.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 37952aee0f0e.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a bounded Windows regression fixture while preserving default updater behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The host identifies a member-authored PR, exempt from ordinary external-contributor proof. The changed backup-rename owner remains exercised through the real swap fixture, but the promised native Windows after-fix result is still pending; no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b5555b0 adds src/infra/package-update-filesystem.ts:118 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b5555b0bd9ed; files: src/infra/package-update-filesystem.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the native Windows regression result and focused validation results, including measured changed-test cost, in the PR body.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-01T03:42:58.160Z sha 7b8d453 :: needs changes before merge. :: none

@steipete
steipete marked this pull request as ready for review October 1, 2026 03:53
@steipete
steipete merged commit d7b0293 into main Oct 1, 2026
309 of 311 checks passed
@steipete
steipete deleted the fix/windows-backup-rename-native-test branch October 1, 2026 04:19
@steipete

steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Independent verification for the Windows fixture blocker affecting #161827 and #162098: this fix is already merged as d7b029347fd0cb9fcc7d21e9f99e10578d5843e2. Both changed files at the merge are byte-identical to head 7b8d453d15bd2e5f0e9e3a8448946d45760f54fb, and the merge is an ancestor of current main.

Reused and inspected native Windows job 110210852632, Node 24.21.0, from successful exact-head CI attempt 1. Its checkout was 200960b84f2140e00a245bc115c52fccec60fd79 (merge of the PR head into 2fd8e321baea18b32c64d61da04cf690a11c6f45). The command was node --import ./scripts/tsx.mjs scripts/test-projects.mts <WINDOWS_TARGETS_JSON files> --fileParallelism. All 11 package-swap regression cases passed; the infra project finished with 655 passed and 81 existing skips.

Exact original failure: src/infra/package-update-swap.windows.test.ts > preserves the package after persistent EPERM on linux (retries=false). The retained updater job 110199813287 failed before the injected rename with helper-unavailable, because the global platform mock selected non-Windows native staging. The repaired case passed in 37 ms. This verifies that shared fixture root; each affected PR still owns its complete CI-failure and cancellation accounting.

Compared the unpublished test-only alternative (+7/-1 test lines, zero production lines). It scopes the platform mock to backup, while this landed fix removes global platform mocking throughout the file and preserves every assertion. Measured landed PR delta: production +2/-1 (net +1); tests +20/-13 (net +7). No duplicate PR or repeated successful suite was needed.

steipete added a commit that referenced this pull request Oct 1, 2026
Keep the extension package-boundary check on Blacksmith during optional hybrid/runson hosted overflow. Hosted boundary jobs could not restore the self-hosted compiled-declaration archives (restore key includes runner.environment) and took 22-23 minutes; 2 of 25 boundary jobs in a 40-run census ran hosted. Explicit GitHub overrides, retry/manual/trust fallbacks, compiler checks, canary, deadlines and concurrency are unchanged.

Merged past one inherited red: checks-windows-node-test-3 src/infra/package-update-swap.windows.test.ts "preserves the package after persistent EPERM on linux (retries=false)" came from b5555b0 (#162231), is red on main in hourly 36811800156, and is fixed on main by d7b0293 (#162352). This PR touches no Windows or updater code.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
…ows (openclaw#162352)

The regression added by openclaw#162231 spoofed the platform globally in its fixture, which made fs-safe select Linux staging on a native Windows host and failed the linux-case assertion. Platform injection now affects only the backup-rename retry policy; assertions are unchanged. Native Windows passes all 11 cases.

Refs openclaw#162027
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
…#162289)

Keep the extension package-boundary check on Blacksmith during optional hybrid/runson hosted overflow. Hosted boundary jobs could not restore the self-hosted compiled-declaration archives (restore key includes runner.environment) and took 22-23 minutes; 2 of 25 boundary jobs in a 40-run census ran hosted. Explicit GitHub overrides, retry/manual/trust fallbacks, compiler checks, canary, deadlines and concurrency are unchanged.

Merged past one inherited red: checks-windows-node-test-3 src/infra/package-update-swap.windows.test.ts "preserves the package after persistent EPERM on linux (retries=false)" came from 1b0ec4c (openclaw#162231), is red on main in hourly 36811800156, and is fixed on main by 74ffe77 (openclaw#162352). This PR touches no Windows or updater code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant