Skip to content

fix(ci): unblock macOS Swift test discovery - #131866

Merged
steipete merged 2 commits into
mainfrom
steipete/sleepy-jepsen-d08195
Aug 28, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/sleepy-jepsen-d08195

Conversation

@steipete

@steipete steipete commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

macOS Swift tests can build successfully and then fail before discovery because SwiftPM's default Swift Build backend omits the runtime search path needed by the nested test bundle to load Sparkle.

The reproduction uses Xcode 27.0 build 27A5237l, Apple Swift 6.4 (swiftlang-6.4.0.30.4), SwiftPM 6.4.0-dev and pinned Sparkle 2.9.6. Generated extraction tasks and identical artifact hashes prove Sparkle is staged correctly; the test bundle cannot reach it. This matches swiftlang/swift-package-manager#10384.

Why This Change Was Made

Select the supported native backend for the macOS test build and test execution, using one shared argument array. Preserve current main's separate coverage-enabled --build-tests phase, build-success output, --skip-build execution and isolated health-render gating. The preceding release build remains on the default backend. Neither phase retries test failures.

The build-cache key and fallback prefix move to swift-build-v4-native-tests. Exact cache hits are immutable and skip saving, so a pre-native exact hit otherwise keeps restoring old contents after a successful native build. The new namespace excludes those entries from both restore paths. The SwiftPM dependency cache, dependency pins and artifact handling are unchanged. This addresses the latest ClawSweeper cache-identity feedback without claiming old caches are corrupt.

This is an explicitly temporary maintainer-requested mitigation. Native is deprecated; remove the override after runner toolchains containing swiftlang/swift-package-manager#10394 pass the default test path. No application code, Package.swift, library-search-path, framework-copy or packaged-app RPATH change is included.

User Impact

No application or Gateway runtime change. Maintainers retain actual macOS test execution on affected toolchains instead of stopping at discovery. Release builds continue to exercise the default backend; the native test rollout gets a distinct immutable build-cache identity.

Evidence

  • Before: the frozen default-backend build completed in 406.29s, then swiftpm-xctest-helper failed loading @rpath/Sparkle.framework/Versions/B/Sparkle, exit 1.
  • Affected Swift 6.4 live proof: coverage-enabled native swift build --build-tests completed in 551.59s. Subsequent coverage-enabled swift test --skip-build executed all three selected ownership tests in each of parallel and serial modes, exit 0 (21.80s / 5.84s); one test has four cases. Selectors retain the actual listed literal backticks. Fresh LLVM coverage contains the tested source paths, and the binary has @loader_path/../../../. Sparkle's binary hash still matches the pinned artifact. This is selected execution, not full-suite or default-backend success.
  • Local runs used isolated source/build/HOME/state, locked dependencies, scrubbed environment and the unchanged outer no-network/no-real-home/Keychain/preferences sandbox. No installed app, Gateway, or original in-progress candidate was operated or modified. SwiftPM's nested manifest sandbox alone was disabled. The Swift sources/manifests and pins are unchanged across the final locale-only rebase; the adopted resource catalogs pass their own strict verification.
  • The original default and native control scripts also used the same scratch directory, with the later correctly filtered native run executing three tests. The final cache rollout nevertheless does not rely on restoring those old entries: both primary and prefix identities exclude the pre-native namespace. actions/cache's pinned restore implementation and documented exact-hit/prefix semantics were inspected directly.
  • Regression coverage: parsed cache-identity assertions failed on the old namespace, then passed. The existing shell fixture exercises exact build/test argv, both execution modes, build-success/render gating, build failure before marker publication, first test failure without retry, and default release argv. Final full workflow guard suite: 151 passed, 2 skipped.
  • Final root test types and scoped actionlint with ShellCheck, pinned zizmor, composite-input and conflict-marker checks passed. The prior changed gate also passed its type/lint and three Knip scans. Fresh isolated Codex reviews of the split-flow integration and cache rollout found no accepted/actionable findings.
  • Historical full hosted proof at e76dd8: default release build, 1,493 OpenClawKit tests, 1,859 app Swift Testing tests in 191 suites and 3 XCTest tests passed on Xcode 26.6 / Swift 6.3.3: https://github.com/openclaw/openclaw/actions/runs/33188970674/job/98909571610. This result is not promoted to the final head.
  • Final exact-target native job passed: https://github.com/openclaw/openclaw/actions/runs/33203113976/job/98957292290 checked out 22a0fa21a9598abe46ea51ef2501a4aeb0a2fa1d and ran the unchanged parsed macos-swift job/global environment via a one-off scope selector (workflow commit d23a944bb9f49e8f467c3be0f60f678d4c1ece0c, not part of this PR). On the configured Blacksmith 12-vCPU runner, Xcode 26.6 / Swift 6.3.3, it finished in 8m38s within the unchanged 20-minute limit. The dependency cache restored, both new v4-native-tests build-cache keys missed, and the preserve-exact-hit step was skipped. Default release build, trait opt-out, 1,496 Kit tests, 1,872 app Swift tests plus 3 XCTest cases, and the health-render test passed. All four generated ready/running/stale-socket/disabled renders were opened and inspected. Cache writes stayed disabled; no provider hydration occurred.
  • Final required CI passed: https://github.com/openclaw/openclaw/actions/runs/33202680239 on the exact PR head above. The prior cold GitHub-hosted attempt https://github.com/openclaw/openclaw/actions/runs/33197263249/job/98937711027 reached its existing 30-minute deadline after native compilation and while app tests were running; it is not counted as a full pass. No timeout or runner-policy change is included.

Validation also exposed separate issues, tracked without folding unrelated runtime changes into this PR:

  • The test-only Code Mode public-wait repair passed 82 tests and was adopted by current main via 2f7d141. Git dropped that already-upstream commit during rebase; it is not part of the final PR diff.
  • A full Doctor timeout passed an exact failed-tree/artifact/cache diagnostic and then the uninstrumented required retry: https://github.com/openclaw/openclaw/actions/runs/33188970656/job/98929046031. No Doctor, SQLite, timeout or cache-policy patch was made; the original stall's precise cause remains unknown.
  • The stale mobile-toast assertion was fixed by fix(ui): keep moved toasts clear of mobile header #131840. Strict native locale parity was fixed by chore(i18n): refresh native locales #131987; that canonical commit is now our base, and local source verification plus strict checks pass for all 21 catalogs / 4,301 entries without generating changes. The broad lint job emitted no lint finding: its runner shut down with exit 143.
  • The optional all-workflow local sweep hit actionlint 1.7.12's confirmed stdin-before-spawn pipe deadlock on an unchanged oversized release-publisher script. It was stopped after a stack dump, not counted as passed; the changed workflow passes with ShellCheck enabled. A separate tooling follow-up is recorded.

Final scope: two files. Application runtime +0/-0; CI +9/-4 (net +5, primarily context comments); tests +15/-5. No dependency, generated locale, persistence, release-publisher, app or Gateway changes. CHANGELOG.md is release-only and untouched. Documentation alignment already landed separately in #131502 and #131650.

AI-assisted implementation and review.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 28, 2026
@steipete steipete self-assigned this Aug 28, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 3:23 PM ET / 19:23 UTC.

ClawSweeper review

What this changes

The PR runs macOS Swift test builds and execution through SwiftPM’s native backend and gives those artifacts a separate cache namespace, with guard coverage for the commands.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: this is a focused, source-supported CI repair that remains necessary because current main still uses the default Swift test backend. The final-head macOS Swift job is currently skipped in pull-request CI, so merge should wait for its dedicated native-backend validation evidence.

Priority: P2
Reviewed head: 22a0fa21a9598abe46ea51ef2501a4aeb0a2fa1d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, guarded CI mitigation with a concrete remaining exact-head runner-validation gap.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored CI-only PR is exempt from the external-contributor proof gate; its supplied local before/after account supports the proposed path, but the exact-head hosted macOS job is still skipped and remains merge-validation evidence to obtain.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored CI-only PR is exempt from the external-contributor proof gate; its supplied local before/after account supports the proposed path, but the exact-head hosted macOS job is still skipped and remains merge-validation evidence to obtain.
Evidence reviewed 6 items Introduced CI behavior: The test step now builds and runs the macOS package with --build-system native, while the preceding release build remains unchanged on the default backend.
Cache isolation: Both the primary key and restore prefix use the new native-test namespace, preventing fallback restoration from the prior v3 build-cache family.
Current-main comparison: Fetched current main still uses the v3 cache namespace and default-backend swift build/swift test commands, so the requested repair is not already implemented.
Findings None None.
Security None None.

How this fits together

The macOS CI lane restores a Swift build cache, builds the desktop app, then builds and runs Swift tests. This change affects only the test-build backend and cache identity, leaving the release build on its existing backend.

flowchart LR
  A[Pull request CI] --> B[Restore Swift build cache]
  B --> C[Default release build]
  C --> D[Native Swift test build]
  D --> E[Swift test execution]
  E --> F[MacOS CI result]
Loading

Before merge

  • Resolve merge risk (P1) - The exact-head pull-request run skipped macos-swift; the guard validates command construction but cannot prove the native SwiftPM backend resolves and discovers the Sparkle-linked test bundle on the hosted Xcode toolchain.
  • Complete next step (P2) - This maintainer-owned PR needs normal exact-head CI validation, not an automated repair branch.
Agent review details

Security

None.

PR surface

Tests +10, Config +5. Total +15 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 15 5 +10
Docs 0 0 0 0
Config 1 9 4 +5
Generated 0 0 0 0
Other 0 0 0 0
Total 2 24 9 +15

Review metrics

Metric Value Why it matters
Production versus test delta CI tooling +9/-4; tests +15/-5 The small production change is confined to one workflow’s test backend and cache identity, with corresponding shell-level regression coverage.

Merge-risk options

Maintainer options:

  1. Verify the exact native macOS lane (recommended)
    Complete or attach a final-head macOS Swift run that executes the native build and test path on the affected runner before merging.

Technical review

Best possible solution:

Retain the narrow native-test mitigation and separate cache namespace, backed by a completed exact-head macOS Swift execution on the affected hosted toolchain before merge.

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

Yes, at source level: current main retains the default-backend test commands and the PR supplies a concrete affected Xcode/SwiftPM failure path. This review did not independently execute macOS Swift tooling.

Is this the best way to solve the issue?

Yes, as an acceptable temporary mitigation: it confines the native backend to test building/execution, preserves the release-build path, and separates cache identities. Hosted final-head execution remains the needed confirmation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against cd19ee2cca09.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded repair to macOS CI test discovery with no application-runtime change.
  • merge-risk: 🚨 automation: The PR changes the macOS CI test backend and cache restore namespace, while the normal pull-request macOS job is skipped.
  • 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: This maintainer-authored CI-only PR is exempt from the external-contributor proof gate; its supplied local before/after account supports the proposed path, but the exact-head hosted macOS job is still skipped and remains merge-validation evidence to obtain.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the two reviewed commits and recent current-main CI-routing work in the same workflow history. (role: recent CI contributor; confidence: high; commits: 0560a99e5541, 22a0fa21a959, d18b0a966141; files: .github/workflows/ci.yml, test/scripts/ci-workflow-guards.test.ts)
  • vincentkoc: Recent workflow history includes macOS CI failure-handling work, providing useful context for the lane’s existing execution policy. (role: adjacent CI contributor; confidence: medium; commits: c7706d59089a; files: .github/workflows/ci.yml)

Rank-up moves

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

  • Provide the completed exact-head macOS Swift job or an equivalent hosted trace showing native build and test discovery on the affected toolchain.

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 (6 earlier review cycles)
  • reviewed 2026-08-28T15:48:04.777Z sha 9c36c31 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T16:24:31.130Z sha e76dd81 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T16:33:52.474Z sha e76dd81 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T17:27:58.945Z sha e76dd81 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T18:02:14.897Z sha de0e7fe :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T18:20:29.696Z sha de0e7fe :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S and removed size: XS labels Aug 28, 2026
@steipete
steipete marked this pull request as ready for review August 28, 2026 16:13
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 28, 2026
@steipete
steipete force-pushed the steipete/sleepy-jepsen-d08195 branch from e76dd81 to de0e7fe Compare August 28, 2026 17:54
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 28, 2026
@steipete
steipete force-pushed the steipete/sleepy-jepsen-d08195 branch from de0e7fe to 22a0fa2 Compare August 28, 2026 19:10
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed agents Agent runtime and tooling size: S labels Aug 28, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 28, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready at 22a0fa21a9598abe46ea51ef2501a4aeb0a2fa1d.

The cache review/Rank-up move is addressed: both primary and fallback identities use v4-native-tests, with a failing-before/passing-after guard. Old pre-native build entries are intentionally excluded, not accepted as an unverified compatibility path. The live run restored the dependency cache, missed both new build-cache keys, skipped exact-hit preservation, rebuilt and passed. No dependency pins, library-search paths, app code, timeouts or runner policy changed.

Required exact-head CI: https://github.com/openclaw/openclaw/actions/runs/33202680239 — success.

Complete native job at the exact PR checkout: https://github.com/openclaw/openclaw/actions/runs/33203113976/job/98957292290 — success in 8m38s, within the existing 20-minute budget. The one-off workflow pins this PR head; its parsed macos-swift job and global environment are identical to the candidate's CI configuration. It uses normal automatic routing on the configured Blacksmith 12-vCPU runner, with cache restore only and no provider hydration. The diagnostic workflow is not part of this PR.

That job ran Xcode 26.6 / Swift 6.3.3 and passed the default release build, Talk-trait opt-out, 1,496 OpenClawKit tests, 1,872 app Swift Testing tests plus 3 XCTest cases, and the health-render test. I opened all four render artifacts and verified the expected ready, startup-grace/running, degraded/stale-socket and disabled channel states.

The separate isolated Swift 6.4 proof remains explicit: complete instrumented native test-bundle build, three actual selected ownership tests in each parallel/serial mode (one four-case test), fresh LLVM coverage, the native relative RPATH and unchanged pinned Sparkle hash. This does not claim default-backend Swift 6.4 success or a full local Swift 6.4 suite. Original candidate and installed apps/Gateways remained untouched.

Final local validation included:

node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts --reporter=dot

151 passed, 2 skipped.

node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.root.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-root.tsbuildinfo
actionlint .github/workflows/ci.yml
node --import ./scripts/tsx.mjs scripts/native-app-i18n.ts verify
node --import ./scripts/tsx.mjs scripts/native-app-i18n.ts check

All passed. Strict locale verification reads 4,301 entries across 21 catalogs without generating changes. Pinned zizmor, composite-input/conflict checks, prior changed type/lint/Knip gates and fresh isolated Codex reviews also passed.

Recorded limitations are not hidden: the earlier cold GitHub-hosted full job exhausted its 30-minute budget and is not counted passed; the unrelated all-workflow local sweep hit a confirmed actionlint pipe deadlock on an unchanged oversized release script, while the changed workflow passes with ShellCheck enabled. Both are documented in the body. The Code Mode repair is already upstream and was dropped during rebase; the canonical locale/toast fixes are in the base rather than duplicated here.

Final diff: two files, application runtime +0/-0, CI +9/-4, tests +15/-5. The pending ClawSweeper refresh is not being used as a substitute for proof; its substantive cache feedback is implemented and verified.

@steipete
steipete merged commit de7a0c0 into main Aug 28, 2026
192 checks passed
@steipete
steipete deleted the steipete/sleepy-jepsen-d08195 branch August 28, 2026 19:39
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 29, 2026
* fix(ci): unblock macOS Swift test discovery

* fix(ci): isolate native Swift test build caches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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