Skip to content

feat(update): Add verified standalone Craft self-update - #907

Merged
BYK merged 6 commits into
codex/native-installerfrom
codex/native-updater
Oct 15, 2026
Merged

BYK merged 6 commits into
codex/native-installerfrom
codex/native-updater

Conversation

@MathurAditya724

@MathurAditya724 MathurAditya724 commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

craft update [releaseVersion] updates standalone Craft to the latest stable or an explicit published release. Pinned binpatch 0.4.2 discovers stable delta chains when available and smaller than a full download; Craft validates patch bounds and the resulting target digest before signature/version checks and replacement. Unusable patches fall back to the canonical HTTPS binary download. Explicit prereleases use full downloads.

Both build workflows generate optional patches with the pinned BYK/binpatch action against the previous stable release. Raw Unix assets supply GitHub target digests; gzip assets supply patch source/size inputs, including Windows EXE gzip. These sources are required before publishing; patches remain optional. Published checksum sidecars and full-download checksum requests have been removed following review. Binpatch's target digest remains necessary to reject incompatible patch output.

--check and dry-run fetch metadata only; --force permits reinstalls/downgrades. npm/pnpm and Homebrew installations receive package-manager instructions. The placement lock rejects concurrent replacement during download. Windows restores its backup if final rename fails and reports backups that remain in use.

Review-requested cleanup removes updater-smoke.mjs and the native-image delta roundtrip test, along with their dedicated CI setup. Binpatch owns patch algorithm coverage. Focused tests retain Craft-specific release selection, URL/download/output bounds, malformed-patch preflight, fallback, version checks, dry-run, placement rollback, and concurrent-replacement guards. Local focused tests, types, and lint pass.

Stacked on #906. Ready for review.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-15 18:45 UTC

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be using binpatch like the CLI does for patch updates

@MathurAditya724

Copy link
Copy Markdown
Member Author

Addressed the binpatch request in c53a109, propagated through #908 and #909. Both build workflows generate optional stable-release patches using the same pinned binpatch action revision as Sentry CLI. The updater discovers stable chains, bounds download/decompression/application sizes, verifies the resulting target digest, then performs the existing signature/version checks and atomic replacement. Missing or unusable patches fall back to the verified full download; explicit prereleases use full downloads.

Independent review also caught an upstream malformed-control overrun. Craft now validates all decoded blocks and control lengths before applying in memory, and keeps writes inside its dry-run-aware staging abstraction. Reproducing regression tests now pass. The native artifact test runs an actual stable-image delta update without downloading the full image, then verifies corrupt-patch fallback.

All current-head checks on this draft pass, including Node 22/24, docs/container builds, and macOS ARM64 installer/updater/delta execution. The same artifact test runs across macOS/Linux ARM64/x64 and Windows x64 in #908/#909. Please re-review the updater changes; all PRs remain drafts.

@MathurAditya724
MathurAditya724 marked this pull request as ready for review October 15, 2026 18:12
Comment thread .github/scripts/updater-smoke.mjs Outdated
Comment thread src/__tests__/distribution/delta.test.ts Outdated
@BYK
BYK merged commit 9a19b0c into codex/native-installer Oct 15, 2026
22 of 23 checks passed
@BYK
BYK deleted the codex/native-updater branch October 15, 2026 18:45

This branch was successfully deployed

1 active deployment
false — dd39efdd Deployed Oct 15, 2026 by MathurAditya724 via Build #3068
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants