Skip to content

fix(swift): repair release build, signing, and draft paths - #20

Open
steipete wants to merge 8 commits into
mainfrom
fix/swift-linux-bash-shell
Open

fix(swift): repair release build, signing, and draft paths#20
steipete wants to merge 8 commits into
mainfrom
fix/swift-linux-bash-shell

Conversation

@steipete

@steipete steipete commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The first production Swift CLI release uncovered several broken paths in the reusable workflow:

  • Linux container steps ran Bash-only syntax under /bin/sh.
  • Hosted macOS rejected direct PKCS#12 import.
  • PKCS#12 compatibility handling differed between OpenSSL 3 and LibreSSL, and Bash 3 rejected an empty-array expansion under set -u.
  • The ephemeral signing keychain was not selected in the user search list, so codesign could not access an imported identity.
  • The draft job invoked gh release create --verify-tag without a Git checkout.
  • The release-by-tag REST endpoint returned 404 for a newly created draft.

Why This Change Was Made

Repair each failure at the shared workflow boundary without changing caller inputs, permissions, signing identity, artifact names, verification gates, publication binding, or Homebrew handoff:

  • select Bash for the Swift Linux container job;
  • extract PKCS#12 certificate/key material with capability-driven OpenSSL compatibility;
  • import the certificate and private key separately;
  • select the ephemeral keychain before signing;
  • check out the already validated frozen tag before draft creation;
  • resolve draft IDs through draft-aware gh release view.

Contract tests cover every repaired invariant.

Evidence

  • Full scripts/validate-workflows.sh suite passes, including actionlint, YAML parsing, tag-freeze, signing, draft-binding, verifier, and Homebrew adversarial scenarios.
  • Real swift:6.3.3-noble linux/amd64 proof resolves dependencies, patches them, builds imsg-linux-x86_64.tar.gz, runs the ELF binary, and reports 0.14.0.
  • Real Developer ID proof extracts the stored credential, imports certificate/key into an ephemeral keychain, signs a Mach-O probe, and passes strict verification.
  • Production release run https://github.com/openclaw/imsg/actions/runs/31434537833 passed macOS/Linux builds, signing, notarization, arm64/Intel verification, publication, and Homebrew handoff.
  • Published release: https://github.com/openclaw/imsg/releases/tag/v0.14.0

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 10, 2026 15:57
@clawsweeper clawsweeper Bot added P1 Urgent regression or broken agent/channel workflow affecting real users now. 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. labels Aug 10, 2026
@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codex review: found issues before merge. Reviewed August 10, 2026, 5:55 PM ET / 21:55 UTC.

ClawSweeper review

What this changes

This PR repairs the reusable Swift release workflow’s Linux shell, macOS signing import, and draft-release creation paths, with matching contract assertions.

Merge readiness

⚠️ Needs maintainer review before merge - 2 items remain

Keep open: the signing repair still replaces the macOS user keychain search list without restoring it after deleting the ephemeral keychain.

Likely related people: steipete (high-confidence original Swift workflow author) and vincentkoc (medium-confidence recent release-workflow contributor).

Priority: P1
Reviewed head: 6ecd9e56984238f6bab55eb5504a64fbf867e260

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The production release evidence is strong, but the unresolved keychain-state defect blocks merge.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR body provides a linked completed production release run showing the repaired macOS and Linux release path through publication and handoff.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR body provides a linked completed production release run showing the repaired macOS and Linux release path through publication and handoff.
Evidence reviewed 4 items Current main lacks the repaired paths: Current main still runs the Linux container without an explicit Bash default and retains the pre-repair signing and draft behavior; the requested repair is not already implemented.
Unrestored keychain search list: The branch replaces the user keychain search list with the ephemeral keychain, while its always-run cleanup only deletes that keychain.
Workflow provenance: The reusable Swift workflow originated with the Swift release workflow feature; current-main blame attributes the surrounding release workflow lines to the v1.7.5 release preparation.
Findings 1 actionable finding [P2] Restore the prior user keychain search list
Security None None.

How this fits together

The reusable Swift release workflow builds tagged macOS and Linux archives, imports a signing identity to sign and notarize macOS assets, then creates and verifies a draft release. It consumes caller release inputs and secrets and produces signed artifacts for publication and Homebrew handoff.

flowchart LR
  A[Release inputs and frozen tag] --> B[Swift build jobs]
  B --> C[Signing keychain setup]
  C --> D[Sign and notarize assets]
  D --> E[Create draft release]
  E --> F[Independent verification]
  F --> G[Publish and handoff]
Loading

Before merge

  • Restore the prior user keychain search list (P2) - security list-keychains -d user -s replaces the runner’s user search list, but the final cleanup only deletes $KEYCHAIN. Save the prior list and restore it in an always-run step; otherwise later signing work can retain a reference to the deleted ephemeral keychain.
  • Resolve merge risk (P1) - Merging may leave a macOS runner’s user keychain search list pointing at a deleted temporary keychain, disrupting later signing work in that runner context.

Findings

  • [P2] Restore the prior user keychain search list — .github/workflows/release-swift-cli.yml:543
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta workflow +30/-2, contract tests +18/-0 The focused release-path change has corresponding static coverage for each repaired invariant.

Merge-risk options

Maintainer options:

  1. Restore the user keychain list (recommended)
    Save the existing user search list and restore it in always-run cleanup so this signing repair does not leave the runner with only a deleted ephemeral keychain.

Technical review

Best possible solution:

Preserve the previous user keychain search list before selecting the ephemeral keychain and restore it in always-run cleanup, with a focused workflow contract assertion.

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

Yes — source inspection shows that the workflow replaces the user keychain search list and its cleanup deletes the replacement without restoring the prior list.

Is this the best way to solve the issue?

No — the import repair is appropriate, but it must restore the prior runner keychain state in guaranteed cleanup to be upgrade-safe.

Full review comments:

  • [P2] Restore the prior user keychain search list — .github/workflows/release-swift-cli.yml:543
    security list-keychains -d user -s replaces the runner’s user search list, but the final cleanup only deletes $KEYCHAIN. Save the prior list and restore it in an always-run step; otherwise later signing work can retain a reference to the deleted ephemeral keychain.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: not found in the target repository.

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

Labels

Label justifications:

  • P1: This shared release path can block real Swift releases until its runner-state cleanup is safe.
  • merge-risk: 🚨 availability: A stale user keychain search list can disrupt subsequent macOS signing work.
  • merge-risk: 🚨 security-boundary: The patch changes lifecycle and selection of production signing credentials and keychains.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides a linked completed production release run showing the repaired macOS and Linux release path through publication and handoff.

Evidence

What I checked:

  • Current main lacks the repaired paths: Current main still runs the Linux container without an explicit Bash default and retains the pre-repair signing and draft behavior; the requested repair is not already implemented. (.github/workflows/release-swift-cli.yml:443, 4abeffbc697a)
  • Unrestored keychain search list: The branch replaces the user keychain search list with the ephemeral keychain, while its always-run cleanup only deletes that keychain. (.github/workflows/release-swift-cli.yml:543, 6ecd9e569842)
  • Workflow provenance: The reusable Swift workflow originated with the Swift release workflow feature; current-main blame attributes the surrounding release workflow lines to the v1.7.5 release preparation. (.github/workflows/release-swift-cli.yml:439, 748f5176b95f)
  • After-fix production proof: The PR body links a completed imsg production release run and published v0.14.0 release covering builds, signing, notarization, verification, publication, and Homebrew handoff. (6ecd9e569842)

Likely related people:

  • steipete: Authored the original reusable Swift release workflow and the current repair series. (role: original feature author and recent area contributor; confidence: high; commits: 748f5176b95f, 6ecd9e569842; files: .github/workflows/release-swift-cli.yml, scripts/test-swift-cli-workflow.mjs)
  • vincentkoc: Authored the v1.7.5 release preparation that current-main blame associates with the surrounding workflow surface. (role: recent release-workflow contributor; confidence: medium; commits: 2b62750c82ee, 4abeffbc697a; files: .github/workflows/release-swift-cli.yml)

Rank-up moves

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

  • Restore and test preservation of the existing user keychain search list.

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 (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-10T17:30:09.443Z sha 61a1fc6 :: passed. :: none
  • reviewed 2026-08-10T20:00:30.332Z sha 0d04fb8 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-10T20:20:08.392Z sha 011e389 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-10T20:36:27.372Z sha 45a465d :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-10T20:57:09.909Z sha f91db4a :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-10T21:13:44.622Z sha 4a7f792 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-10T21:20:18.146Z sha 4a7f792 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-10T21:31:10.135Z sha 6ecd9e5 :: needs real behavior proof before merge. :: [P2] Restore the prior user keychain search list

@steipete

Copy link
Copy Markdown
Contributor Author

Real after-fix container proof on a6e45450a50a5be4f2e86fba0f138275e53d0055:

  • source: immutable openclaw/imsg tag v0.14.0 at 7e8f89ab6efc120129605dc23d8cb1cc2d7e8855
  • image: swift:6.3.3-noble
  • platform: linux/amd64
  • shell: Bash with set -euo pipefail

Observed terminal result:

PHASE:resolve-ok
PHASE:patch-ok
Built .../imsg-linux-x86_64.tar.gz
PHASE:archive-ok
imsg: ELF 64-bit LSB pie executable, x86-64
0.14.0

This exercises the affected dependency-preparation and archive-build steps in the actual Swift release container, including the Bash-only pipefail and [[ ... ]] syntax that failed under /bin/sh.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. 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. and removed 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. labels Aug 10, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Addressed the sole re-review finding in 61a1fc61b482dc1befdaa0fc172e5506958b8608 by removing the release-owned changelog line; the release context remains in the PR body and commit history for the upcoming v1.7.6 release prep.

Focused proof remains green: actionlint, the Swift CLI workflow contract test, git diff --check, and independent review all pass. Exact-head CI is rerunning now. The accepted real swift:6.3.3-noble amd64 container proof is unchanged because workflow behavior did not change in this follow-up.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready on 61a1fc61b482dc1befdaa0fc172e5506958b8608.

Verification:

  • CI run 31411102985: validate succeeded
  • full scripts/validate-workflows.sh suite passed
  • real swift:6.3.3-noble linux/amd64 proof passed dependency resolution, patching, archive creation, ELF x86-64 inspection, and imsg --version = 0.14.0
  • ClawSweeper marks proof sufficient
  • the sole release-owned changelog finding is addressed in 61a1fc6
  • final full-branch independent review is clean
  • git diff --check passed

No known proof gaps remain. After merge, the fix will be released as backward-compatible v1.7.6 and the moving v1 compatibility tag will advance to that immutable release before imsg retries its frozen release.

@steipete
steipete requested a review from a team August 10, 2026 16:53
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 10, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper automerge

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper automerge is enabled.

  • Head: 4a7f792b1f4b
  • Label: clawsweeper:automerge (pause labels cleared)
  • Action: exact-head review queued (workflow sweep.yml, event repository_dispatch).
  • Flow: review this head, repair/rebase only if needed, then re-review the exact repaired head before merge.

Draft PRs stay fix-only until GitHub marks them ready for review. Pause with /clawsweeper stop.

Automerge progress:

  • 2026-08-10 17:26:05 UTC review queued 61a1fc61b482 (queued)
  • 2026-08-10 17:49:49 UTC review passed 61a1fc61b482 (structured ClawSweeper verdict: pass (sha=61a1fc61b482dc1befdaa0fc172e5506958b8...)
  • 2026-08-10 21:15:39 UTC review queued 4a7f792b1f4b (queued)

@clawsweeper clawsweeper Bot added clawsweeper:automerge Maintainer opted this ClawSweeper PR into bounded ClawSweeper-reviewed automerge status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 10, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@openclaw/openclaw-secops independent code-owner approval is the only remaining gate.

The exact head has green CI, full workflow validation, accepted real swift:6.3.3-noble amd64 behavior proof, a passing ClawSweeper review, and protected automerge armed. This backward-compatible shell fix currently blocks completion of the already-frozen imsg v0.14.0 release. I am intentionally not using the administrator bypass.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. and removed proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 10, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:human-review ClawSweeper automerge is paused for maintainer review labels Aug 10, 2026
@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: - [ ] Add real behavior proof - Needs stronger real behavior proof before merge: The accepted Linux container transcript proves the Bash repair, but it predates and does not exercise the final credentialed macOS sig...; Review finding: [medium] Validate the changed signing-key import path — .github/workflows/release-swift-cli.yml:524 (sha=0d04fb8583639378db1bc3f8ed897ee2eafb61d1)

Why human review is needed:
This item has security-sensitive risk. ClawSweeper is pausing instead of making an autonomous change that could affect trust, credentials, permissions, or exposure.

What the maintainer can do as a next step:
If the maintainer accepts the current risk and wants ClawSweeper to continue merge gates, comment @clawsweeper approve. If the security-sensitive detail still needs changes, describe the safe path or push the fix, then comment @clawsweeper automerge. If the risk should not be automated, keep the PR paused for manual review or comment @clawsweeper stop.

I added clawsweeper:human-review and left the final call with a maintainer.

@clawsweeper clawsweeper Bot removed the status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. label Aug 10, 2026
@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: - [ ] Add real behavior proof - Needs stronger real behavior proof before merge: The supplied terminal transcript convincingly exercises the Linux Bash repair, but it predates and does not exercise the final macOS P...; Review finding: [medium] Prove the revised signer import path — .github/workflows/release-swift-cli.yml:519 (sha=45a465d20a6defe9f4f9d8ee4ecb0c81d0069f28)

Why human review is needed:
ClawSweeper found a blocker that should be resolved or accepted by a maintainer before the repair or automerge loop continues.

What the maintainer can do as a next step:
If the maintainer accepts the current risk and wants ClawSweeper to continue merge gates, comment @clawsweeper approve. If more work is needed, resolve the blocker first, then comment @clawsweeper automerge to re-review and continue. If automation should stay paused, leave clawsweeper:human-review in place or comment @clawsweeper stop.

I added clawsweeper:human-review and left the final call with a maintainer.

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: - [ ] Add real behavior proof - Needs stronger real behavior proof before merge: The supplied terminal proof convincingly covers the original Linux Bash fix, but it predates and does not exercise the final macOS PKC... (sha=4a7f792b1f4ba57563ebbc589774b775b152a15a)

Why human review is needed:
ClawSweeper found a blocker that should be resolved or accepted by a maintainer before the repair or automerge loop continues.

What the maintainer can do as a next step:
If the maintainer accepts the current risk and wants ClawSweeper to continue merge gates, comment @clawsweeper approve. If more work is needed, resolve the blocker first, then comment @clawsweeper automerge to re-review and continue. If automation should stay paused, leave clawsweeper:human-review in place or comment @clawsweeper stop.

I added clawsweeper:human-review and left the final call with a maintainer.

@clawsweeper clawsweeper Bot added status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. and removed clawsweeper:human-review ClawSweeper automerge is paused for maintainer review labels Aug 10, 2026
@clawsweeper clawsweeper Bot added the clawsweeper:human-review ClawSweeper automerge is paused for maintainer review label Aug 10, 2026
@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: - [ ] Add real behavior proof - Needs stronger real behavior proof before merge: The accepted terminal transcript proves the original Linux Bash fix, but not the final PKCS#12/keychain and draft-release behavior; ad...; Review finding: [P2] Restore the prior user keychain search list — .github/workflows/release-swift-cli.yml:543 - [medium] User keychain search list is not restored — .github/workf... (sha=6ecd9e56984238f6bab55eb5504a64fbf867e260)

Why human review is needed:
ClawSweeper found a blocker that should be resolved or accepted by a maintainer before the repair or automerge loop continues.

What the maintainer can do as a next step:
If the maintainer accepts the current risk and wants ClawSweeper to continue merge gates, comment @clawsweeper approve. If more work is needed, resolve the blocker first, then comment @clawsweeper automerge to re-review and continue. If automation should stay paused, leave clawsweeper:human-review in place or comment @clawsweeper stop.

I added clawsweeper:human-review and left the final call with a maintainer.

@steipete steipete changed the title fix(swift): run Linux container steps with Bash fix(swift): repair release build, signing, and draft paths Aug 10, 2026
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. and removed status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. labels Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:automerge Maintainer opted this ClawSweeper PR into bounded ClawSweeper-reviewed automerge clawsweeper:human-review ClawSweeper automerge is paused for maintainer review merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P1 Urgent regression or broken agent/channel workflow affecting real users now. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant