Skip to content

fix(ci): recover incomplete Swift build caches#98818

Merged
steipete merged 1 commit into
mainfrom
codex/macos-swift-cache-repair
Jul 2, 2026
Merged

fix(ci): recover incomplete Swift build caches#98818
steipete merged 1 commit into
mainfrom
codex/macos-swift-cache-repair

Conversation

@steipete

@steipete steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The macOS Swift CI lane can restore an exact build cache whose Sparkle XCFramework is incomplete. The subsequent build fails before compilation because Sparkle.xcframework/Info.plist is missing, and each built-in retry reuses the same broken local build directory.

Why This Change Was Made

  • Rotates the Swift build cache namespace from v2 to v3, preventing reuse of the known-bad cache generation.
  • Validates a restored SwiftPM build directory before the macOS build starts.
  • Uses swift package reset when the required Sparkle artifact is absent, then allows SwiftPM to rebuild normally.
  • Skips the cache-hit timestamp optimization after a reset.

User Impact

No product behavior changes. macOS CI repairs an incomplete restored SwiftPM cache instead of failing all three build attempts.

Evidence

  • Exact-head macOS CI failed twice with the same missing Sparkle.xcframework/Info.plist error after restoring the same cache key.
  • actionlint .github/workflows/ci.yml
  • pnpm test test/scripts/ci-workflow-guards.test.ts — 32 passed
  • git diff --check
  • Fresh Codex autoreview — clean, 0.94 confidence

AI-assisted: implementation and review used Codex. No transcript attached; the PR contains the complete durable rationale and validation evidence.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 2, 2026
@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 1, 2026, 9:18 PM ET / 01:18 UTC.

Summary
This PR rotates the macos-swift Swift build cache namespace to v3 and adds a prebuild reset when a restored build directory is missing Sparkle.xcframework/Info.plist.

PR surface: Config +13. Total +13 across 1 file.

Reproducibility: no. high-confidence live reproduction was established in this review. Source inspection and the PR body make the failure path plausible because current main can restore a .build cache and then retry the same directory without validating the Sparkle artifact.

Review metrics: 1 noteworthy metric.

  • Swift cache behavior: 1 namespace changed, 1 validation/reset gate added. This makes existing v2 build caches cold and adds a new macos-swift recovery branch that normal green CI may not exercise.

Stored data model
Persistent data-model change detected: persistent cache schema: .github/workflows/ci.yml. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Attach redacted macos-swift job output or terminal/live logs showing the reset warning and a successful Swift build after an incomplete cache is restored.
  • Keep the existing actionlint and workflow-guard evidence alongside the real recovery proof so syntax and behavior are both covered.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body lists actionlint, a workflow-guard test, diff check, and before-failure evidence, but it does not show after-fix macos-swift recovery output; the latest live status rollup had macos-swift skipped. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] The latest exact-head status did not exercise macos-swift, so green checks do not prove the new reset branch against a restored incomplete apps/macos/.build cache.

Maintainer options:

  1. Prove the recovery path before merge (recommended)
    Attach a redacted macos-swift job log or terminal/live output showing the missing Sparkle artifact triggers reset and the subsequent Swift build succeeds.
  2. Accept cache-bust mitigation
    Maintainers can choose to merge based on the v3 cache namespace and monitor the next macos-swift run, accepting that the reset branch remains unproven before merge.

Next step before merge

  • [P1] Protected maintainer-label handling and missing after-fix macos-swift proof make this a human merge decision rather than an automated repair candidate.

Security
Cleared: The diff keeps the existing pinned actions/cache SHA and adds only shell reset logic in the existing macos-swift job; no new permissions, secrets, dependencies, or third-party execution source were introduced.

Review details

Best possible solution:

Land the narrow CI cache repair only after maintainer review and targeted macos-swift recovery proof, or after maintainers explicitly accept the unproven reset branch with post-merge monitoring.

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

No high-confidence live reproduction was established in this review. Source inspection and the PR body make the failure path plausible because current main can restore a .build cache and then retry the same directory without validating the Sparkle artifact.

Is this the best way to solve the issue?

Yes, this is a narrow CI-layer mitigation: rotating the cache namespace avoids the known-bad generation, and reset is limited to the missing Sparkle artifact condition. The remaining gap is after-fix proof from macos-swift or an equivalent real workflow run.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: This is a normal-priority CI reliability fix for the macOS Swift lane with limited blast radius outside build automation.
  • add merge-risk: 🚨 automation: The diff changes CI workflow cache recovery behavior, and the latest observed checks did not prove the new macos-swift reset path.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body lists actionlint, a workflow-guard test, diff check, and before-failure evidence, but it does not show after-fix macos-swift recovery output; the latest live status rollup had macos-swift skipped. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a normal-priority CI reliability fix for the macOS Swift lane with limited blast radius outside build automation.
  • merge-risk: 🚨 automation: The diff changes CI workflow cache recovery behavior, and the latest observed checks did not prove the new macos-swift reset path.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body lists actionlint, a workflow-guard test, diff check, and before-failure evidence, but it does not show after-fix macos-swift recovery output; the latest live status rollup had macos-swift skipped. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Config +13. Total +13 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 1 16 3 +13
Generated 0 0 0 0
Other 0 0 0 0
Total 1 16 3 +13

What I checked:

  • Current main behavior: Current main caches apps/macos/.build under swift-build-v2 and preserves mtimes on exact cache hits without checking whether the Sparkle artifact is complete. (.github/workflows/ci.yml:1735, a7a444e7ef1e)
  • PR diff: The branch changes the cache namespace to swift-build-v3, adds a Validate Swift build cache step, runs swift package --package-path apps/macos reset when Sparkle Info.plist is absent, and skips the mtime optimization after reset. (.github/workflows/ci.yml:1735, 5aa71cca6571)
  • Affected lane documentation: docs/ci.md describes macos-swift as the Swift lint/build/test lane for macOS-relevant changes and maps it to the macOS Blacksmith runner. Public docs: docs/ci.md. (docs/ci.md:44, a7a444e7ef1e)
  • Sparkle dependency source: apps/macos/Package.swift declares Sparkle as a package dependency and links the Sparkle product into the OpenClaw executable; Package.resolved pins Sparkle 2.9.3. (apps/macos/Package.swift:21, a7a444e7ef1e)
  • Live PR state: Live GitHub state shows the PR is open, mergeable but unstable, labeled maintainer and size: XS, and the latest status rollup included macos-swift as skipped rather than a successful recovery-path run. (5aa71cca6571)
  • Feature history: git log -S shows the Swift build directory cache was introduced by e85e6bc and carried to the current v2 cache generation in later CI rewrites. (.github/workflows/ci.yml:1735, e85e6bc4fbb8)

Likely related people:

  • @vincentkoc: git log -S shows the Swift build directory cache was introduced in e85e6bc, and later CI history carried the v2 cache generation through release work. (role: introduced behavior; confidence: high; commits: e85e6bc4fbb8, e085fa1a3ffd; files: .github/workflows/ci.yml, docs/ci.md, test/scripts/ci-workflow-guards.test.ts)
  • @obviyus: git blame attributes the current macos-swift cache stanza on main to the broad 53fe2e4 CI rewrite. (role: recent area contributor; confidence: medium; commits: 53fe2e4bc3ca; files: .github/workflows/ci.yml)
  • @steipete: Sparkle macOS updater support dates to ddbe680, and workflow history shows substantial adjacent CI contributions beyond this PR. (role: adjacent owner; confidence: medium; commits: ddbe680a585e, 9a7160786a7d; files: apps/macos/Package.swift, apps/macos/Sources/OpenClaw/MenuBar.swift, .github/workflows/ci.yml)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 2, 2026
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head 5aa71cca6571d0b0b33d61208248d856c8b7ae34:

The normal PR router intentionally skipped macOS for a workflow-only change; the manual workflow dispatch forced the exact affected lane against the same commit.

@steipete
steipete merged commit c1eee1a into main Jul 2, 2026
237 of 245 checks passed
@steipete
steipete deleted the codex/macos-swift-cache-repair branch July 2, 2026 01:23
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 2, 2026
* origin/main:
  test(plugins): align release fixtures with runtime contracts
  Require explicit iOS release versions
  fix(ci): recover incomplete Swift build caches (#98818)
  fix(memory-wiki): retry transient existing-page reads in wiki_apply and chatgpt import (#98787)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 2, 2026
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 3, 2026
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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant