Skip to content

fix(macos): resume notarization without rebuilding signed artifacts - #135601

Merged
steipete merged 3 commits into
mainfrom
codex/macos-notary-resume
Sep 1, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/macos-notary-resume

Conversation

@steipete

@steipete steipete commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where release operators had to rebuild a signed macOS release after a network failure interrupted Apple's notarization status polling. The submission had already reached Apple, but the packaging script discarded its ZIP and retained neither the submission ID nor a resumable artifact checkpoint.

Why This Change Was Made

The notarization helper now persists the submission ID and artifact hash before waiting. scripts/package-mac-dist.sh --resume-notarization verifies the retained source, version, signed bundle, and artifact hashes, then continues the existing submission and packaging without compiling or signing the app again. DMG stapling records both approved byte representations so an interrupted replacement remains recoverable. Apple's rejection remains a hard failure. Successful packaging marks the checkpoint complete for artifact retention; the next ordinary build verifies and retires it automatically.

The package owner retains the original signed app archive and symbols; release automation can preserve that checkpoint between jobs. The existing raw NOTARY_RESULT_FILE contract remains unchanged for other notarization callers. Recovery requires artifacts produced with this change; older failed jobs without retained artifacts cannot be recovered retroactively.

User Impact

A transient Apple polling or runner-network failure no longer requires repeating a completed native app build. Operators get an explicit resume command and integrity failures stop recovery before submission. This change adds a recovery capability to release tooling; it does not alter the current published version or an in-flight release.

Evidence

  • 38 focused tests cover checkpoint identity/integrity, interrupted Apple polling, cached acceptance/rejection, DMG stapling interruption, package recovery, and successful recovery followed by a fresh package run.
  • The package regression reproduces a disconnected first wait, deletes the build outputs, and resumes with a builder that would fail if invoked. Recovery succeeds with exactly one upload. The same regression fails on the previous package script because the retained archive is missing.
  • Live, authenticated notarytool wait against an existing accepted submission returned Accepted for the same ID; no new upload was made for this check.
  • Codex review found no actionable P0–P2 defects. Strict root test types, script lint, and 690 installer/packaging/signing tests passed locally. Three later filesystem fixtures were blocked by stale shared fs-safe 0.5.6 dependencies (checkout requires 0.7.0); the matching hosted macOS job passed. Final exact-head CI is tracked before landing.

Production tooling delta: +363/-68 (net +295); tests: +443/-37 (net +406); docs/changelog: +4/-1. The production growth implements the new persisted submission, source/integrity verification, and interrupted-stapling recovery contract. Repeating the build or retrying upload would not preserve those invariants.

A signed-fixture probe also verifies checkpointed skip flags with absent and conflicting resume environment values: both recoveries produce only the intended ZIP, retain one submission, and do not rebuild.

@steipete
steipete requested a review from a team as a code owner September 1, 2026 22:30
@clawsweeper

clawsweeper Bot commented Sep 1, 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 docs Improvements or additions to documentation scripts Repository scripts size: L maintainer Maintainer-authored PR labels Sep 1, 2026
@steipete steipete self-assigned this Sep 1, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 7:27 PM ET / 23:27 UTC.

ClawSweeper review

What this changes

This PR retains source- and hash-bound macOS signing artifacts and Apple submission IDs so an interrupted notarization can resume without rebuilding the app or symbols.

Merge readiness

⚠️ Ready for maintainer review - 5 items remain

No actionable introduced correctness defect was found, but this maintainer-labeled release-tooling change should remain open pending exact-head CI and release-owner confirmation that the checkpoint artifact handoff is available where resume will be used.

Priority: P2
Reviewed head: 64f8dd068a12339e77d07bed4e79912c186adac3
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has focused owner-boundary checks and regression coverage, with remaining release-handoff confirmation and exact-head CI gating.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored release-tooling PR is exempt from the external-contributor proof gate; the supplied fault-injected packaging scenario and authenticated existing-submission wait are supporting evidence, not independently executed review proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored release-tooling PR is exempt from the external-contributor proof gate; the supplied fault-injected packaging scenario and authenticated existing-submission wait are supporting evidence, not independently executed review proof.
Evidence reviewed 5 items Resumed packaging boundary: The packaging entrypoint verifies source and version, restores the retained app archive, verifies its signature, and reuses checkpointed skip settings before resuming output creation.
Single-submission recovery: The notarization helper hashes the artifact, persists the returned Apple submission ID before waiting, and on later invocations waits for that ID instead of submitting again.
Fault-injected regression coverage: Focused tests cover a failed first wait followed by resume without build products and assert exactly one submission; companion tests cover changed artifacts, corrupt checkpoints, rejection, and interrupted stapling.
Findings None None.
Security None None.

How this fits together

macOS release packaging signs an app, submits archives to Apple for notarization, then produces ZIP, DMG, and symbol artifacts. This change adds a validated checkpoint between submission and final packaging so an interrupted operator flow can safely continue.

flowchart LR
  A[Signed macOS app] --> B[Recovery checkpoint]
  B --> C[Apple notarization submission]
  C --> D[Resume verification]
  D --> E[Notarized app and DMG]
  E --> F[Release artifacts]
Loading

Decision needed

Question Recommendation
Does the macOS release owner approve relying on the retained checkpoint artifact handoff for the release path where interrupted notarization will be resumed? Confirm retention handoff and land: Confirm the release path preserves the completed checkpoint and proceed when exact-head CI is green.

Why: The scripts and focused fault-injection coverage support the implementation, but only the release owner can confirm the private runner or artifact-retention boundary that makes this recovery path operational.

Before merge

  • Resolve merge risk (P1) - The new fail-closed checkpoint flow depends on the release owner retaining dist/macos-notarization-recovery/ across the intended interruption boundary; the PR does not modify the separate public macOS validation workflow to establish that handoff.
  • Resolve merge risk (P1) - Exact-head CI is still incomplete, so this is not a merge-ready verdict.
  • Resolve merge risk (P1) - A current-main source comparison could not be completed locally because missing promisor objects could not be fetched when DNS resolution failed; this is a reviewer limitation, not missing contributor proof.
  • Complete next step (P2) - The protected maintainer release change has no discrete repair finding, but requires release-owner confirmation of the artifact-retention boundary and exact-head CI completion.
Agent review details

Security

None.

PR surface

Tests +406, Docs +3, Other +295. Total +704 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 443 37 +406
Docs 2 4 1 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 3 363 68 +295
Total 7 810 106 +704

Review metrics

Metric Value Why it matters
Implementation and regression coverage production +295 net; tests +406 net; docs/changelog +3 net The production growth implements a new retained-artifact recovery boundary, while the larger test change covers its integrity and interruption cases.

Merge-risk options

Maintainer options:

  1. Confirm release artifact retention (recommended)
    Verify the intended release owner preserves the checkpoint directory and its permissions across the interruption boundary before relying on resume.
  2. Pause until the handoff exists
    Do not land the recovery path if the release environment cannot retain the signed checkpoint for a later resume.

Technical review

Best possible solution:

Retain the source-bound checkpoint design, confirm the release owner can preserve it across the real interruption boundary, and land only after the exact head has clean required checks.

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

Yes, at source level: the focused tests model a disconnected notarization wait, remove build products, and resume while asserting a single submission. I did not execute the macOS-specific scenario in this read-only review.

Is this the best way to solve the issue?

Yes, provisionally: binding the retained archive to source, version, hashes, signatures, and the Apple submission ID addresses the failure at its packaging owner without retrying uploads; operational retention still needs owner confirmation.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored release-tooling PR is exempt from the external-contributor proof gate; the supplied fault-injected packaging scenario and authenticated existing-submission wait are supporting evidence, not independently executed review proof.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded release-operator reliability improvement with limited end-user blast radius.
  • merge-risk: 🚨 compatibility: Interrupted release jobs now intentionally require a retained, source-bound checkpoint rather than allowing an ordinary rebuild path.
  • 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 MEMBER-authored release-tooling PR is exempt from the external-contributor proof gate; the supplied fault-injected packaging scenario and authenticated existing-submission wait are supporting evidence, not independently executed review proof.

Evidence

What I checked:

  • Resumed packaging boundary: The packaging entrypoint verifies source and version, restores the retained app archive, verifies its signature, and reuses checkpointed skip settings before resuming output creation. (scripts/package-mac-dist.sh:181, 64f8dd068a12)
  • Single-submission recovery: The notarization helper hashes the artifact, persists the returned Apple submission ID before waiting, and on later invocations waits for that ID instead of submitting again. (scripts/notarize-mac-artifact.sh:155, 64f8dd068a12)
  • Fault-injected regression coverage: Focused tests cover a failed first wait followed by resume without build products and assert exactly one submission; companion tests cover changed artifacts, corrupt checkpoints, rejection, and interrupted stapling. (test/scripts/package-mac-dist.test.ts:486, 64f8dd068a12)
  • Operator contract: The release reference documents retaining the checkpoint, source/version-bound resume, and fail-closed behavior for changed bytes, rejected submissions, and invalid signatures. Public docs: docs/reference/RELEASING.md. (docs/reference/RELEASING.md:374, 64f8dd068a12)
  • Branch provenance: The reviewed head is the follow-up commit that adds completed-checkpoint retirement after the original recovery implementation; its direct parent is the test-shard consolidation commit. (scripts/package-mac-dist.sh:376, 64f8dd068a12)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Confirm the real release artifact-retention handoff preserves the checkpoint needed by --resume-notarization.

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 (3 earlier review cycles)
  • reviewed 2026-09-01T22:36:59.615Z sha f57d40ad07b4e96921234d7884c474b7527e7d6e :: found issues before merge. :: [P1] Retire completed recovery checkpoints | [P2] Remove the release-owned changelog edit
  • reviewed 2026-09-01T22:55:21.256Z sha 0cdbbf8e844c95c7b1038d48b8817c66624f1f0c :: needs changes before merge. :: [P1] Preserve checkpointed skip flags on resume
  • reviewed 2026-09-01T23:09:47.669Z sha 675776c77219bf81585da2bcc0341ce65329507d :: needs changes before merge. :: [P1] Keep checkpointed skip flags authoritative on resume

@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the completed-checkpoint finding and both rank-up points:

  • Packaging now records completion only after final artifacts are ready. The checkpoint remains available for artifact retention; the next normal invocation verifies its inventory and retires it. Pending and tampered checkpoints are preserved. The extended integration test fails on the old guard, then passes through interrupted wait → resume without build products → fresh normal packaging. All 38 focused tests pass, and independent P0–P2 review is clean.
  • Removed service-specific workflow input details from the public release reference and clarified the documentation boundary. Public documentation retains the local script contract; private service procedures stay in the maintainer runbook.

The changelog entry is intentionally retained: this PR is owner-directed release maintenance, and the explicit release/forward-port instruction includes changelog maintenance. It is not an unsolicited contributor edit to the release ledger.

The seven manifest cases were also consolidated into the existing notarization test file. This preserves coverage while keeping the GitHub planner within its existing 112-job cap; all three planner regression variants pass. No capacity limit was raised.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. and removed P1 High-priority user-facing bug, regression, or broken workflow. labels Sep 1, 2026
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

The remaining CI failure was deterministic, rather than a timing failure: the CI merge included #135523, which added a header marquee before the session-row marquee. The existing lifecycle test selected that header with an unscoped query.

Scoped its two queries to catalog session rows, preserving the node-replacement, scrolling-class and style-reset assertions. The focused test passes on the exact previously failing CI merge. Independent review is clean. This adds no UI runtime changes and no test files.

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Sep 1, 2026
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

The latest skip-flag finding is a false positive. The verified manifest assignments in scripts/package-mac-dist.sh:184–185 set shell variables before the default expressions at lines211–212. ${SKIP_DSYM:-0} and ${SKIP_DMG:-0} retain a nonempty assigned value; they do not reread the inherited environment or overwrite 1 with 0. The checkpoint therefore remains authoritative, including over conflicting environment values.

Direct execution under the system Bash with both variables initially unset, assigned 1, then passed through those exact default expressions prints dsym=1 dmg=1. No production ordering change is needed.

I also ran the unchanged packaging script through the existing signed-fixture setup: produce a checkpoint with both skip flags set, interrupt the first Apple wait, remove build products and make any rebuild fail, then resume with both variables absent and again with conflicting 0 values. Both resumes succeeded, retained exactly one total submission, produced the app ZIP, and produced neither DMG nor symbols. The optional rank-up request is covered by this fault-injected proof; the current production code already has the required behavior. The probe uses a simulated Apple transport failure, not a new live submission.

@steipete
steipete force-pushed the codex/macos-notary-resume branch from 675776c to 64f8dd0 Compare September 1, 2026 23:19
@openclaw-barnacle openclaw-barnacle Bot removed the app: web-ui App: web-ui label Sep 1, 2026
@clawsweeper clawsweeper Bot added 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 1, 2026
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Release-owner retention handoff is confirmed for the intended release path: the paired orchestration change has landed and retains the source-bound checkpoint across failed jobs, validates producer provenance, and restores the retained artifacts for resume. The public validation workflow is not that publication owner. This work is explicitly owner-directed release closeout.

Exact-head CI for 64f8dd068a12339e77d07bed4e79912c186adac3 is now successful: https://github.com/openclaw/openclaw/actions/runs/33570491759 (attempt 2). Only the two unassigned Swift jobs were retried; all other results were retained. Native hosted prepare has passed. The current-main owner comparison was completed locally, with no intervening changes to the recovery owners. This resolves the latest review's retention rank-up request, pending-CI concern, and source-comparison gap.

@steipete
steipete merged commit eb79a8f into main Sep 1, 2026
334 of 337 checks passed
@steipete
steipete deleted the codex/macos-notary-resume branch September 1, 2026 23:48
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
…penclaw#135601)

* fix(macos): resume notarization without rebuilding signed artifacts

* test(macos): keep notarization recovery within existing CI shards

* fix(macos): retire completed notarization checkpoints before new builds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L 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