Skip to content

Add MacBook Neo installation and native Recovery setup - #57

Merged
maralcbr merged 44 commits into
omacom:mainfrom
aurora-silicon:feat/neo
Oct 18, 2026
Merged

maralcbr merged 44 commits into
omacom:mainfrom
aurora-silicon:feat/neo

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Add developer-gated MacBook Neo installation and an Omarchy-branded native Recovery app. The flow stages firmware and boot files, guides the power-button Recovery boot, creates the recovery account, and hands ownership authorization to Startup Disk. Account setup also supports deferring setup with “Skip, Restart Now”.

The normal edge Neo image profile selects omarchy-dev, omarchy-settings-dev and the Neo support packages, and carries the pinned native Recovery template unchanged. Offline artifact verification, per-device repair payloads and interruption recovery cover boot/account metadata; helper account mutations are restricted and developer clients are bound to their code hash.

Image inspection checks the actual embedded AArch64 Btrfs executable, retains the upstream encryption activation link without requiring the removed downstream root-mount gate from package PR #1101, and requires each installed package mtree to match its original archive. This catches local test packages that omitted .MTREE; normal makepkg recipes already generate it. Recovery ZIP validation rejects extra files and directories outside the frozen template inventory.

CI now checks its actual macOS-built Recovery artifact together with the Neo image contract, using a signed fixture package channel and disposable fixture filesystems. It records the source commit and native template digest, removes the synthetic image, and explicitly does not claim a full channel-image build or hardware qualification. The two image-builder shell cases also run on macOS. A separate manual neo-image.yml workflow builds native Recovery from the same checkout and resolves the real channel with --hardware-profile neo --recovery-app; by default it authenticates inputs, with full AArch64 image builds opt-in. It preserves the existing legacy release path and requires published qualified Neo packages. The branch includes current main's acceptance-runner updates.

Validation: portable installer and image-builder source suites passed, including 65 inspection tests at the preceding head. The combined Neo/Recovery check passed locally with the preserved native Recovery artifact. All four CI jobs at the preceding head (3211d492) passed: https://github.com/omacom/omarchy-mac-installer/actions/runs/39107353102 . This includes native debug/release tests, Recovery/app assembly, engine reproduction, macOS shell portability, and the combined native-artifact/Neo contract check. The manual real-channel workflow has not been run against unpublished channel packages. Its work directory is initialized from $RUNNER_TEMP through $GITHUB_ENV, matching the normal image workflow; actionlint 1.7.12 passes and rejects the previous job-level expression as expected.

The root-gate removal additionally passes all 66 focused inspection tests, including acceptance of an otherwise valid initramfs without the extra drop-in. Restoring the old requirement makes that regression test fail. The full image-builder source suite also passed on native AArch64 Linux. The embedded Btrfs checks remain in place.

Neo completed the local corrected-image installation on integration/aurora 5d570a78a4ab, kernel 7.1.12-7-1-ARCH. The owner reported it works and ran a system update. After restoring the missing kernel/m1n1 mtree references from the exact original package archives, both the full Apple Silicon boot check and its update boot-chain check passed; kernel, UKI and Stage 2 hashes were unchanged by that repair. This local test does not qualify the future published channel package set or the newer SEP configuration in package PR #1101.

Remaining qualification: post-update reboot, explicit Neo peripheral/suspend coverage, deferred/interrupted Recovery paths, and legacy-machine coverage. Canonical engine asset publication and any stronger Recovery provenance/signer policy remain maintainer release decisions. No release or tag is created by these changes.

@maralcbr maralcbr 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.

Reviewed at 880fff8. Requesting changes: there is a root-helper auth hole, several rollback gaps on boot and account state, and a handful of policy changes that need maintainer sign-off before this leaves draft.

Must fix

  1. The helper creates a root-level admin account with no owner authorization. ClosedEngineHelperServer.swift:182: unlike submit and removal, recoveryAccount() never validates a MachineOwnerAuthorization.

    • After inspect hands back a ticket, prepare creates uid 501 in the stub's admin group with a password the caller chooses, and finalize grants it a SecureToken and runs updatePreboot.
    • The app UI only calls inspect and handoff, so prepare and finalize are reachable but unused.
    • build-developer-pkg.sh installs a root LaunchDaemon from an ad-hoc build whose client requirement is just identifier "<app id>" (build-app.sh:72). Any local user can sign a binary with that identifier, claim the stub, and the real owner's attempt then fails with "already has a different recovery account".
    • Fix: drop prepare and finalize from the XPC surface, or require owner authorization and pin developer clients to a real signing identity or cdhash.
  2. Remove Omarchy is locked out once Stage 1 completes. RecoveryAccountHandoff.discover() returns any live Stage 1 completion journal and never checks whether Recovery step 2 finished.

    • recoveryAccount therefore stays set, and canChangeChannel (InstallerSession.swift:82) stays false.
    • "Remove Omarchy…" (OmarchyAppleInstallerApp.swift:197) stays disabled, and the page shows only RecoveryHandoffView.
    • This hits both abandoned installs and completed ones. Removal eligibility shouldn't depend on channel eligibility, and discovery needs to tell pending setup apart from a finished install.
  3. One unusable journal breaks inspection. discover() calls completedEvidence with try, which throws for any outcome other than awaiting_recovery, a short transcript, or a missing evidence file.

    • The failure surfaces in InstallerSession.swift:236: inspect() drops into .unsupported and loses the existing-install/removal guidance.
    • Every .attachInstallationMedia completion and every shell-only legacy payload routes to "Installation could not be verified" (InstallerSession.swift:765).
    • Fix: skip unusable journals inside discover(), and don't let an inspectRecoveryAccount failure override the existing-install phase.
  4. Rollback gaps can leave the target in an inconsistent boot or login state.

    • RecoveryActions.swift:364-389: the bputil change and the iSCPreboot ditto run outside any rollback, and ditto merges into the existing var rather than replacing it.
    • In the same block, Stage 2 is restored only when kmutil fails, not when atomic() fails after the swap. journal.json, isc-var.before and restore.json are written but never read.
    • RecoveryAccountCore.swift:699-749: Preboot metadata is backed up and its schg flag cleared before updatePreboot -od. Neither the backup nor schg is ever restored, so a timeout or partial failure leaves the paired Recovery metadata half-written and unprotected.
    • RecoveryActions.swift:393-413: .IAPhysicalMedia is removed before the version metadata is restored and the completion receipt is saved. A power loss in that window loses the "Finish Installation" autolaunch with nothing recording completion, and account setup needs that receipt.
  5. Recovery tests never run. Nothing invokes AuthorizationCheck.c, EnrollmentGateCheck, BootstrapOwnerCheck, RecoveryOwnerCheck, BootSelectionCheck, InstallerLogCheck or LogTextViewCheck; Recovery/build-app.sh runs only the configuration and baseline checks. RecoveryAccountCore is covered only by the manual Development/RecoveryAccountQualification.

  6. Notarization will likely fail. Packaging/build-app.sh:289 re-signs the bundled Recovery template without --options runtime. The outer app is signed without --deep, so the nested OmarchyRecovery executable is never hardened.

  7. Neo audio packages reuse the stock package names. image-builder/audio/build-packages.py:110,117 builds alsa-ucm-conf-asahi and asahi-audio as 10.aurora1-<hash> and 4.1.aurora1-<hash>.

    • Any newer repo version (e.g. 4.1.1) replaces them on pacman -Syu, the J700 UCM/DSP profiles disappear and Neo audio goes silent. These changes should go to the upstream packages, not into forked copies.
    • The commit-pin checks (lines 41-42) are asserts, which python3 -O skips.
    • The unit.replace(...) edits (lines 84-88) do nothing, with no error, if upstream text drifts, which would drop -C AppleJ700.

Policy changes that need maintainer opt-in

  • Weaker boot policy than the legacy path. Native enrollment runs bputil -nca (RecoveryActions.swift:364), where the legacy step2 runs -nc (omarchy_asahi.py:187,296). The extra -a lifts the boot-args restriction, but the UI still says "Your macOS security settings are unaffected" (Recovery/Sources/main.swift:606).
  • Persistent admin account on the stub. Native installs now require it: uid 501 in staff/admin, a SecureToken AuthenticationAuthority written by hand via dscl -merge rather than sysadminctl, Preboot plists overwritten and schg never put back. Its credential lifecycle needs an explicit decision.
  • Common Stage 1 on every board. When esp/aurora/stage1.bin is in the image, install_board_stage1/board_stage1 (omarchy_asahi.py:470-498) use it on every device class.
    • That bypasses J613's os_firmware="26.6.2" gate and drops J700's 5000 ms window to 0.
    • It also replaces asahi's Stage 1 on M1, M2 and M3, decided by what the image contains rather than by board qualification. Needs sign-off from Chris and Ryan.
  • Neo peripherals now block the install. Radio and Touch ID failures (omarchy_asahi.py:728-773) were previously warnings.
    • The radio path hard-codes a timestamped PTX name, so a point release that renames it fails every Neo install.
    • Touch ID calibration is documented as not yet hardware-qualified, yet a parse failure refuses the install.
  • Native Recovery GUI turns on implicitly. It's selected just because the manifest is in the payload (omarchy_asahi.py:1975), while Recovery/README.md says the template must declare recovery_gui.
  • Neo default firmware. 26.6.2 wins even when another version is offered (test_omarchy_firmware.py:147), which contradicts the patch comment.

Minor

  • Firmware ordering is unused and would break things once wired. image-builder/firmware-ordering/ is never installed or tested, despite the README's claim.
    • As written, it blacklists aop everywhere and loads it only from ExecStartPost. A failed vendor-firmware service then loses AOP mics and ALS on non-Neo Macs too.
    • On a Neo with a missing firmware file, aurora-peripheral-firmware.sh exits 1, which fails the service.
  • Removal is no longer atomic (omarchy_asahi.py:1275-1281). Root, boot and ESP are erased before deleteContainer, so if that fails the stub is left with no ESP and the retry reports that the approved install changed.
  • Recovery app template (RecoveryAccountHandoff.swift):
    • It is copied from a hard-coded /Applications/<name>.app path and checked with codesign --verify without -R.
    • Updates are skipped when only resources or Info.plist change.
    • AppBackups/<uuid>.app is never pruned on the small stub volume.
  • omarchy_recovery.py:245,282-290 isn't idempotent. The app is published with os.replace before the launcher and marker. If either write fails, reruns stop at "already exists".
  • Two owner sources. resolveOwner reads listUsers <systemUUID>, while requireOwnership reads <dataUUID>. A hardware check is needed on which keybag Startup Disk updates.
  • Authorization.c:
    • The pty fds aren't O_CLOEXEC.
    • On timeout it kills only the direct child, not the process group, so kmutil/bputil helpers can outlive it.
  • Password copies aren't wiped. The Swift String/Data copies of the password are never zeroed.
  • Private APFS call. account-volume.c calls the private APFSGetVolumeGroupID through a guessed prototype, with no OS-version guard.
  • Source lock. It leaves out test_omarchy_als.py, test_omarchy_isp.py and test_omarchy_recovery.py.
  • Build tooling. Building the Recovery template needs xcodebuildmcp, so release hosts without it can't package.

Checked, no problems found

  • Offline bundling: bundled artifacts are still checked against the catalog's size and hash before and after copy, and a missing file fails with no download fallback.
  • Credentials and C code: passwords never reach argv, env or logs, and the C buffers are bounds-checked.
  • Board gating: Neo stays gated by the signed catalog, and the j614s exclusion still holds.
  • Archive and firmware extraction: archive .. members are rejected, and the ISP/ALS extraction and mesa DER bounds look right.
  • Test runs: the Python overlay tests pass (307), as do the engine and bless-version tests (44) and the offline packager tests (6).

Add developer-gated J700 installation, firmware extraction, an Omarchy-branded Recovery app and recovery-account ownership handoff. Preserve per-device repair payloads, offline artifact verification and interruption recovery for boot and account metadata. Keep public model restrictions and explicit template qualification.

Co-authored-by: Scott Jones <scottajones@gmail.com>
Co-authored-by: Eryk Wieliczko <github@wieliczko.ninja>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: DjDeveloperr <hey@djdev.me>
Assisted-by: LLM
Keep optional radio collection failures nonfatal and pin the reproducibly repacked .42 engine. Build the standalone Recovery app and preview in macOS CI, including its authorization, journal, owner and UI fixtures.

Add “Skip, Restart Now” to recovery-account setup. Verify the installed startup bundle, persist the deferral and restart directly while retaining account setup for a later Recovery visit. Preview builds simulate the restart. Cover rejected unfinished setup, persistence failures and restart ordering with a pure fixture.

Signed-off-by: DjDeveloperr <hey@djdev.me>
Assisted-by: LLM
Signed-off-by: DjDeveloperr <hey@djdev.me>

Assisted-by: LLM
Use the same target-volume mount update as enrollment before saving the deferred account choice.

Signed-off-by: DjDeveloperr <hey@djdev.me>

Assisted-by: LLM

@maralcbr maralcbr 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.

Re-reviewed at 440064a against my 880fff8 review. Big improvement: the helper auth hole, removal lockout, journal discovery, Recovery tests in CI and hardened Recovery signing are fixed, and rollback/resume is reworked. The items below remain.

Must fix before release

  1. Engine/overlay/bin/omarchy-restore-image has incomplete, non-reproducible provenance. It's a 10.7 MB arm64 Mach-O, ad-hoc signed as a.out. source-lock.json pins only its hash, and omarchy_apple_aea.py:16-18 names an engine source directory and recipe that aren't in the repo. It decrypts macOS 26 restore images (keys from Apple's FCS service), and the stub boots the output. It's used beyond the Neo: J613/J615 on 26.6.2 as well as J700. Please add the source repo, commit and a reproducible build recipe (or build it in CI), and document the new network dependency.
  2. "Skip, Restart Now" can return to macOS with no guided way back. skipRecoveryAccountAndRestart() (RecoveryActions.swift:638) restarts without bless --setBoot and without checking targetIsDefaultBoot(). The installed receipt suppresses the macOS-side handoff (RecoveryAccountHandoff.swift:326,350-375), and .IAPhysicalMedia is already gone, so the Recovery app no longer autolaunches. Manually reopening the Recovery app does resume account setup (main.swift:62-74), but nothing tells the user to. Either set or verify the boot target before restarting, or show explicit instructions for coming back. recoveryAccountDeferred is written but never read. (Where the restart lands, and what Startup Disk allows without the account, isn't hardware-verified.)
  3. Common Stage 1 can refuse supported Macs. If an image ships esp/aurora/stage1.bin, omarchy_asahi.py:470-492 refuses every board/firmware pair missing from qualified_machines instead of falling back to asahi's Stage 1. Catalog coverage of M1/M2/M3 is unchanged, but installs would narrow. The current build6-m123-neo.sh doesn't ship it, so this blocks only once an image does. For pairs outside common-image qualification, keep the existing per-board selection: the J613/J700 overrides, and upstream Stage 1 everywhere else.

Should fix

  • Two sources for the same packages. image-builder/audio/build-packages.py still builds aurora-audio / alsa-ucm-conf-aurora with different metadata from omarchy-pkgs#1101: a hex pkgrel and replaces=asahi-audio on a stock name, which #1101 deliberately dropped. image-builder/firmware-ordering/ duplicates omarchy-aurora-firmware and has already drifted (regulatory.db, optional policies). Delete both and consume the packages.
  • Audio fallback. build-mac-image qualified() (:774-793) falls back to stock asahi-audio when the candidate set lacks aurora-audio, so a Neo image can build without Neo audio support. It should fail for Neo images.
  • Durability. Rollback/resume is implemented and fixture-tested, but complete power-loss durability isn't proven. RecoveryDirectorySwap.swift:24-30 flushes the parent but not the copied contents, and RecoveryFileTransaction.swift:120-127 flushes only files that existed before, not new ones.
  • .aurora-var-before-<op> on iSCPreboot is never cleaned up after a successful install.
  • test_an_encrypted_image_is_attached_decrypted_on_any_running_macos fails under the default macOS TMPDIR (/var vs /private/var).

Policy still open (maintainer opt-in)

  • Persistent admin uid 501 on the stub, with SecureToken via dscl -merge: the credential lifecycle needs a decision. schg is now restored.
  • No password minimum. Beyond non-empty, validatePassword (RecoveryAccountCore.swift:173) sets no minimum length for that SecureToken admin. macOS's own dscl -passwd and verification still apply.
  • Handoff without fresh owner authorization. handoff still replaces the stub's Recovery app as root (pinned template, ClosedEngineHelperServer.swift:224-227).
  • Helper install fallback. When there's no SMJobBless declaration, it installs through an admin do shell script (cdhash-pinned).
  • Neo speaker protection. The Neo replaces feedback protection (speakersafetyd) with feed-forward speakerguardd.
  • J700 Stage 1 window. When a common Stage 1 image is supplied and J700 is explicitly qualified, its window changes from 5000 ms to 0 ms (the per-board image keeps 5000 ms).
  • Neo default firmware. 26.6.2 still wins for J700 when 26.6 is offered (test_omarchy_firmware.py:147), contradicting the patch comment.
  • Engine bump. The release engine moves .28 → .42, and the .42 asset must be published first.
  • What users see. The Recovery app is called "Omarchy Installer", and there is a new defer path.

Now fixed

bputil -nc, explicit recovery_gui, stub-first removal (retryable when container deletion fails), Recovery template -R verification and backup pruning, resumable publish, single owner source, Authorization.c CLOEXEC/process group, private APFS call gone, source-lock test entries, xcodebuildmcp fallback. Neo radio/Touch ID failures now warn unless the template requires them. J614s is still refused.

Local runs: Python overlay 319/320 (the TMPDIR test above), Recovery fixtures 14/14, swift test RecoveryAccount/ClosedEngineHelper 37/37, audio/bless guards 4/4.

Eryk Wieliczko and others added 11 commits October 16, 2026 03:24
Seeking to the end of a macOS raw disk device reports 0, so Touch ID collection refused /dev/rdisk0s1 as 0 bytes on every Neo with a sensor, and a template requiring Touch ID stopped the installation after the disk was changed. A character device's size now comes from DKIOCGETBLOCKSIZE and DKIOCGETBLOCKCOUNT. Engine v0.9.2-omarchy.43 (23,860,038 bytes, f4b339dd…) carries it; two repacks from the authenticated .14 base were identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-size

Size the Neo's iBoot System Container through its disk driver
Verify the selected startup target before skipping account creation, resume deferred handoff, retain the required owner account, and authorize Aura boot arguments with bputil -nca. Flush copied metadata before publication and clean committed iSC backups.

Retain per-board boot fallback unless the common boot chain is qualified. Use authenticated canonical audio, firmware and boot packages in images, and update the locked engine overlay reproducibly.

Signed-off-by: DjDeveloperr <hey@djdev.me>
Assisted-by: LLM
Signed-off-by: DjDeveloperr <hey@djdev.me>
Assisted-by: LLM
Keep the production CLI and bounded concurrent range extraction, using native Apple crypto and compression. Add Go-generated interoperability fixtures and macOS debug/release CI for the source build.

Signed-off-by: DjDeveloperr <hey@djdev.me>
Assisted-by: LLM
Test exact HTTP range responses, redirect refusal and cancellation, retain Go compatibility vectors, require macOS 14 for native HPKE, and apply the Xcode formatter output.

Signed-off-by: DjDeveloperr <hey@djdev.me>
Assisted-by: LLM
Use explicit Codable field names, fix HTTP fixture initialization, and retain reference vector generators with the port.

Signed-off-by: DjDeveloperr <hey@djdev.me>
Assisted-by: LLM
Signed-off-by: DjDeveloperr <hey@djdev.me>
Assisted-by: LLM
Signed-off-by: DjDeveloperr <hey@djdev.me>
Assisted-by: LLM
Disable release debug metadata, normalize linker object prefixes and preserve mismatched candidates for diagnosis. Keep strict formatting and both native test configurations.

Signed-off-by: DjDeveloperr <hey@djdev.me>
Assisted-by: LLM
Replace the opaque Go binary with the 470104-byte native helper, bind it to its source commit and reproducible build record, and verify that identity when building the engine. Record the Apple key-service network dependency and update all engine pins.

The native helper passes 11 debug and release tests and two clean builds are byte-identical. Installer CI passes 752 debug and 738 release tests plus Recovery fixtures; the engine repacks identically with the final locked recipe.

Signed-off-by: DjDeveloperr <hey@djdev.me>
Assisted-by: LLM
Assisted-by: LLM

Signed-off-by: DjDeveloperr <hey@djdev.me>

@maralcbr maralcbr 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.

Re-reviewed at a75ef5f against my 39c3832 review. Both must-fixes are fixed, -nca is now Neo-only with a disclosure, and the inspect path is side-effect free. One new likely blocker is in the Recovery publication check.

Must fix

  1. Legitimate re-signing can leave unequal stripped executables, so the publication check can reject a valid install. _verify_staged_app (omarchy_recovery.py:226-232,258) strips both signatures with codesign --remove-signature and compares raw bytes. Stripping doesn't normalise the __LINKEDIT vmsize, which reflects the original signature's size. A local repro with a larger (entitlements-bearing) signature, re-signed ad-hoc the way stage() does, kept vmsize 0x10000 vs 0x8000 after stripping, and the bytes differed at offsets 1073-1074; a runtime-only signature matched. Release templates are Developer ID + runtime + timestamp signed (Packaging/build-app.sh:282), so please reproduce actual Developer ID release publication before relying on this. The test covers only ad-hoc → ad-hoc (test_omarchy_recovery.py:153-167). Use a carefully normalised executable comparison (load commands included; CodeDirectory page hashes alone also cover the changing headers), and add a Developer ID-shaped fixture. Separately, --force --sign - (omarchy_recovery.py:375) drops hardened runtime and any existing entitlements on the staged copy, and losing runtime is a security-policy decision.

Should fix

  • Engine pins. All references agree on v0.9.2-omarchy.49, but none of .45/.47/.48/.49 is published. The app build now reproduces the engine, while the catalog still points at the unpublished engine-v0.9.2-omarchy.49 URL.
  • Build trust chain. prepare-engine.py pins the .28 base by sha256 and size, which is good. But that asset is a pre-release titled "draft, not a release", and deleting it breaks uncached reproduction (prepare-engine.py:118, cached_base()). Arrange durable retention or a mirror (changing its release status alone doesn't prevent deletion), and document the native-byte comparison. The .14 → .28 base switch rests on a README claim ("78 Mach-O match .14") that should get maintainer review.
  • Provenance after merge. downstreamRevision ca3ecd5 and restore_image_source (7115941) name commits in the author's fork. They're metadata, not fetched dependencies (prepare-engine.py:110-127, verify-source-lock.py:208-219). Preserve immutable source references and reconcile release provenance after merge, especially if it's squashed.
  • The autolaunch marker is disarmed too early. install() disarms it before the install transaction runs (RecoveryActions.swift:329). Finalize commits the disarm (RecoveryAccountCore.swift:855-858) before the install snapshot (RecoveryActions.swift:401), so in a deferred run a later policy or enrollment failure leaves no "Finish Installation" autolaunch for the retry.
  • Finalize fixture. RecoveryAccountTests.swift:126-162 exercises the metadata completion directly. Please also drive the full native finalize() through skip → handoff → finalize.

Minor

  • The LZVN parser accepts undefined opcodes (0x1e/0x26/0x2e/0x36/0x3e, 0x70-0x7f, 0xd0-0xdf) as instructions. It fails closed (decode error, never wrong bytes), but rejecting them is cleaner.
  • The firmware-range work dirs (Ranges.swift:112-154) still rely on defer; they hold no key. Keep the abandoned-workspace sweep limited to matching siblings beside the next output.
  • TOCTOU: the executable is read once, and only the bundle signature is re-verified on disk. That needs root on the stub, so it's low risk.

Policy (maintainer opt-in), unchanged

  • Neo-only bputil -nca, now with disclosure.
  • The persistent stub admin account, with no password minimum.
  • Handoff without fresh owner authorization.
  • Helper install fallback without SMJobBless.
  • Neo speaker protection.
  • J700 Stage 1 window (common image only).
  • Neo default firmware 26.6.2.
  • "Omarchy Installer" Recovery name and the defer path.

Verified fixed

  • Aura scope. The Aura boot chain and support packages are scoped to hardware_profiles.neo (policy.json:63-79). Legacy images keep m1n1-aurora/uboot-asahi, m1n1 is still refused, and channel images are forced to the legacy set.
  • Launcher. finishAccountSetup disarms the launcher, restores SystemVersion.plist and clears the deferral inside the finalize transaction (RecoveryVersionMetadata.swift:42-83, RecoveryAccountCore.swift:685-699,855), and older journals still resume.
  • -nca. It is -nc by default and -nca only for j700ap, in the engine, GUI and Recovery publisher, with Neo-only disclosure text.
  • Inspect. recoveryAccount() mounts read-only and no longer writes the receipt.
  • Restore workspaces. They're flock-leased, and abandoned ones are swept.
  • LZVN. Bounds and budgets are enforced, and storage and output are SHA-256-checked.
  • Owner rule. M1/M2/M3 coverage is unchanged, and legacy images exclude only j700ap. The new Neo template admits only J700, and only on firmware 26.6.2 (build-mac-image:1529,1536); please record that exception explicitly.

Local runs at a75ef5f: overlay 326, engine 53, swift test RecoveryAccount/ClosedEngineHelper 39/39, RestoreImage 14/14, and the Recovery fixtures pass. My local image-builder/packaging run hit a collection error, so for those I'm relying on CI, which is green at a75ef5f (run 39010031009).

Copy the authenticated Recovery app unchanged, including its original signature, runtime options and entitlements. Publish target configuration and boot/firmware baselines under Aurora/Recovery/InstallData before selecting autolaunch. Bind both publications to one resumable operation and reject incompatible embedded-layout templates before disk changes.

Keep app updates immutable, migrate validated legacy inputs outside the bundle, and bind app backups with separate target records. Recovery state journals retain their existing paths.

Validation: 24 native publication tests, including an entitlements-bearing runtime signature, byte-identical copying, tamper rejection and interrupted app/data publication; 15 account tests pass in debug and release; Recovery enrollment build and standalone fixtures pass. Two engine50 repacks match.

Assisted-by: LLM

Signed-off-by: DjDeveloperr <hey@djdev.me>
Assisted-by: LLM

Signed-off-by: DjDeveloperr <hey@djdev.me>
Assisted-by: LLM

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

The Recovery signature issue is fixed on feat/neo at 991e4ba.

The signed app is now copied unchanged. Per-install configuration, Stage 1/2 and device firmware are published separately under Aurora/Recovery/InstallData. There is no signature stripping or per-install re-signing. The complete app inventory, including signature files, must match the authenticated template exactly. App updates retain the external baseline and migrate older embedded inputs after checking target identities and payload hashes; app-backup bindings live in separate sidecars.

A signed OmarchyRecoveryDataLayout=external-install-data-v1 marker is required at payload preflight, source validation, packaging and handoff, so an older app cannot silently be paired with the new paths. Interrupted data/app publication resumes through the same target/build-bound journal, and existing account state is preserved.

Validation: 24 native publication tests pass, including a runtime-signed, large-entitlements fixture whose staged app remains byte-identical, signed-code replacement rejection, interrupted app/data publication, and external-data path/tamper rejection. The account/migration tests pass 15/15 in both debug and release. The Recovery enrollment build and standalone fixtures pass; main app/helper assembly and the release-layout guard pass. The full portable suite passes. Engine 50 reproduces in two independent repacks (313f91571422170094a8fa1ac65fb24002d708bba86f7a2dbfe4821f89b12e6e); current-head CI is running.

The separate kernel suffix correction is pushed to omarchy-pkgs#1101 at 12c25778: the recipe preserves the shared CONFIG_LOCALVERSION="-ARCH" so the existing DTB selectors keep working. A kernel rebuild and hardware upgrade test are still required.

This addresses the two changes above; it does not claim the other review follow-ups, release-input publication or exact-image hardware qualification are finished.

Assisted-by: LLM

@maralcbr maralcbr 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.

Checked 6b64475..991e4ba. The must-fix is resolved by the better route.

  • Recovery publication. The authenticated app is now copied unchanged, keeping its original signature, hardened runtime and entitlements. The staged copy is checked by full inventory equality with the template plus codesign --verify --deep --strict (omarchy_recovery.py:_verify_staged_app). Per-install config and payloads move to Aurora/Recovery/InstallData, with their own inventory and hash checks, bound to the same resumable journal. The Python stager flushes both complete trees before publication. That removes the re-signing problem, and the --force --sign - runtime/entitlement loss with it. The OmarchyRecoveryDataLayout=external-install-data-v1 marker refuses older embedded-data templates before partitioning, and legacy installs migrate after their target UUIDs and payload hashes are checked (RecoveryInstallData.migrateLegacy).
  • Legacy migration durability. RecoveryInstallData.migrateLegacy (:95-107) writes the files but never flushes the complete tree before the rename; RecoveryFileTransaction.write flushes only each file and its immediate parent. On retry, an existing external directory passes after only its config is checked (:40-43). Flush the whole tree before publishing, and validate the full baseline on retry. (Missing guarantee, not demonstrated corruption.)
  • Defensive hardening. payloadRoot() (RecoveryActions.swift:76-77) appends an unchecked AuraPayloads directory, and RecoveryBaseline.swift:31 resolves that root's symlinks, while protectedRead rejects only a final-component symlink. Validate the AuraPayloads directory too, then use bounded protected reads for its manifest (manifest() still uses Data(contentsOf:)) and payloads. That isn't a demonstrated unprivileged exploit. The install data isn't signed, which matches the previous ad-hoc trust level on the stub; please say so in the README.

Still open from my previous review:

  • Early disarm. install() still runs account finalize, which disarms autolaunch, before the install snapshot (RecoveryActions.swift:332 → RecoveryAccountCore.swift:855-858, snapshot at RecoveryActions.swift:404-405). A later policy or enrollment failure in a deferred run leaves no "Finish Installation" autolaunch for the retry.
  • Engine .50 is now pinned everywhere but not published.
  • The .28 base needs durable retention or a mirror.
  • Provenance. Fork-commit references need reconciling after merge.
  • Hardware. Qualification of the PR-built Neo image.

Local: overlay 330 passed at 991e4ba, and CI is green.

Keep autolaunch armed while account ownership completes before boot enrollment. Flush the entire migrated baseline before publication and validate every payload again on retry. Reject linked payload roots and bound descriptor reads of manifests and assets.

Validated on Neo macOS: 15 account tests pass in debug and release; 24 publication tests and all Recovery fixtures pass; native Recovery app build, signature checks and strict formatting pass.

Assisted-by: LLM

Signed-off-by: DjDeveloperr <hey@djdev.me>
Use the available engine release URL and retain an independent runtime-base mirror with identical size and SHA-256 verification. Cover unavailable-primary and invalid-mirror cases and preserve repository-qualified source references across a squash.

Validation: engine tests pass and the locked producer validates the engine 50 archive. Published release asset sizes and digests match the source lock.

Assisted-by: LLM

Signed-off-by: DjDeveloperr <hey@djdev.me>
Resolve the existing Neo profile through the normal signed edge channel,
including its Mesa, Vulkan and bless packages. Preserve legacy defaults and
bind the profile to canonical inputs, import, inspection and provenance.
Qualify base runtime requests against the selected package set.

Pin the native Recovery app inventory as an explicit image input, freeze and
copy the signed template unchanged into the ESP, and declare the native
Recovery metadata. Refuse modified templates, embedded installation data and
mismatched input records. Keep the existing board-specific Stage 1 contract.

Restore the intended upstream engine catalog URL without changing allowed
release locations. The previously selected fork URL failed catalog checks.

Validation: image producer checks, engine payload contract fixtures and
portable installer checks pass, including resumed checks after correcting
fixtures. The existing native Recovery template passes macOS code-signature
verification and the new inventory check. No exact-image hardware
qualification is claimed; signed channel inputs remain unavailable.

Assisted-by: LLM
Signed-off-by: DjDeveloperr <hey@djdev.me>
Keep the independent portable package-role assertion aligned with the required Mesa, Vulkan and bless packages added by the image producer. The three focused role tests pass; current-head image-builder CI already passed.

Assisted-by: LLM
Signed-off-by: DjDeveloperr <hey@djdev.me>

@maralcbr maralcbr 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.

Checked e034103..243c044. Five of my six r4 items are resolved; the engine publication is half done, and the Recovery input needs a provenance decision.

Resolved

  • Migration durability. migrateLegacy flushes the whole temporary tree before the move (RecoveryInstallData.swift:71-72). A retry runs verifiedBaseline on an existing directory, checking the config, the manifest, every payload hash and a non-symlinked AuraPayloads. Tests cover a tampered payload and a symlinked AuraPayloads (RecoveryAccountTests.swift:84-98).
  • AuraPayloads hardening. payloadDirectory lstat-checks the directory, manifest() uses protectedRead, and RecoveryBaseline.read uses O_NOFOLLOW + fstat with bounded chunks instead of resolving the root.
  • Early disarm. install() passes installationPending: true (RecoveryActions.swift:335), so account finalize leaves the marker and version armed. Only install finalize disarms, after the receipt is written (:464-480); there's a test at RecoveryAccountTests.swift:253-262. Note that bputil now also runs with the version hidden on this path, as the deferred branch already did; that's not hardware-checked.
  • .28 base. It now has a hash- and size-pinned fallback (source-lock.json:501-503, prepare-engine.py:65-74).
  • README. It now notes that the install data is unsigned.

Before release

  1. The engine .50 URL is dead. .github/mac-release-pipeline.json names omacom/omarchy-mac-installer/releases/download/engine-v0.9.2-omarchy.50/…, but that release doesn't exist on omacom. It exists only as a pre-release in aurora-silicon/omarchy-mac, with a size and hash that match every pin. The missing asset blocks catalog publication, because catalog preparation verifies remote artifacts before signing (mac-catalog.yml:161-165, catalog_release.py:879-882). A maintainer should publish .50 on omacom (same bytes) first. Until then, Engine/README.md:21 overstates its availability.
  2. Recovery provenance (maintainer decision). recovery_app.py:87-104 pins the digest of whatever directory is passed to --recovery-app, and the installer's codesign --verify --deep --strict has no -R requirement (omarchy_recovery.py:110,234). The enclosing payload is authenticated through the signed catalog (ClosedEngineProcessAdapter.swift:118-153), and ad-hoc signing is intentional (Recovery/build-app.sh:40-41). But nothing independently records which source built the app, which then runs as root in Recovery. Maintainers should decide whether catalog authentication is enough or whether to require build evidence (the Recovery source commit in PROVENANCE) or a signer identity. Native Recovery is optional per image, not Neo-only (build-mac-image:1561-1573).

Should fix

  • No automated full Neo/native-Recovery image build. Source and fixture CI covers both features (checks.yml:139-157), but mac-image.yml:78-88 and edge-dispatch.yml pass neither --recovery-app nor --hardware-profile neo. Please wire at least a check-only Neo lane.
  • Neo depends on #1101 being published. hardware_profiles.neo.support_packages now includes mesa-aurora, vulkan-aurora and aurora-bless. The edge database I checked doesn't have the Neo packages, so Neo channel resolution fails until omarchy-pkgs#1101 publishes. The legacy path doesn't check the Neo list, so M1/M2/M3 aren't affected.
  • available_base changes legacy builds too (build-mac-image:816-830). Base names that match a set package now resolve as omarchy-candidates/<pkg>. That's probably safe, but please check it against a real legacy build.
  • Local test portability. image-builder/test/all stops on macOS at two pre-existing shell failures (BSD install without -D; mac-image-inputs-test.sh:152), so the new Neo/Recovery shell cases didn't run locally. Linux CI is green.

Minor

  • validate_zip checks only entries under esp/aurora/recovery/Omarchy Installer.app/, so stray files elsewhere under esp/aurora/recovery/ pass mac-image-check.

Owner rule

No further narrowing since r4. Legacy images exclude only j700ap. The Neo profile admits only j700ap, so that image remains a deliberate exception to the every-model rule (build-mac-image:1566-1567).

Local at 243c044: overlay 330, engine 55, image-builder pytest 225, swift test RecoveryAccount/ClosedEngineHelper 41/41, Recovery fixtures pass. CI is green. Hardware qualification of the exact PR-built Neo image is still outstanding.

Require the embedded Btrfs executable to be AArch64 ELF. Cross-build helpers can restore the target executable in the sealed root after mkinitcpio already copied a host wrapper into the UKI, so checking the root alone misses a broken first-boot encryption tool.

Cover the leaked host script, an x86 ELF and a truncated header. All 63 image inspection tests passed; corrected image boot qualification is pending.

Assisted-by: LLM
Signed-off-by: DjDeveloperr <hey@djdev.me>
Reject images whose embedded initrd omits the sysroot dependency on successful encryption. This gate remains independent of the runtime mapper override.

Validation: all 63 image inspection tests passed.

Assisted-by: LLM
Signed-off-by: DjDeveloperr <hey@djdev.me>
…o inputs

Reject missing or replaced package mtree references and stray Recovery ZIP files. Check the macOS-built immutable Recovery template with the Neo image contract in CI, exercise the portable shell cases on macOS, and clarify the canonical engine publication prerequisite.

Validation: portable installer suite and image-builder source suite passed, including 65 inspection tests. The combined contract check passed with the preserved native Recovery artifact; hardware and production channel qualification remain separate.

Assisted-by: LLM
Signed-off-by: Dj <hey@djdev.me>
Assisted-by: LLM
Signed-off-by: Dj <hey@djdev.me>
Use the signed fixture set actual package table, database identity, runtime revisions and inspection report for payload provenance checks. Record their digests with the native template and source revision.

Assisted-by: LLM
Signed-off-by: Dj <hey@djdev.me>
Build native Recovery from the same checkout, record its source and tools, and pass the pinned template plus Neo profile to the real channel resolver and image producer. Default to input authentication, keep full image builds manual, and preserve the existing legacy release workflow.

Validation: release-pipeline trigger tests, identity guard, YAML parsing and shell syntax checks passed. The live-channel workflow remains gated by published qualified Neo packages.

Assisted-by: LLM
Signed-off-by: Dj <hey@djdev.me>

@maralcbr maralcbr 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.

Checked 243c044..a404657. The merge of main is clean: neither side's changes were dropped. Two new blockers, both from this round.

Must fix

  1. Every image build, legacy included, now depends on an unpublished omarchy-mac-boot.
    • 8f667c2 adds sysroot.mount.d/10-omarchy-mac-encrypt-required.conf to INITRD_FILES (apple_limine.py:33).
    • check_embedded_initramfs validates that list for every image, with no profile check (inspection.py:409-412).
    • Only omarchy-mac-boot 20261010-2 ships that drop-in, from the still-open omarchy-pkgs#1101 (e2d8406). Edge has 20261010-1 without it, and policy.json:43 still sets the minimum at 20260921-10, so resolve doesn't stop it.
    • Result: if this merges first, the next M1/M2/M3 edge build fails after sealing, before packaging (build-mac-image:1733-1744). CI stays green only because the fixtures manufacture every INITRD_FILES entry (fixtures.py:461-469), so it can't establish channel compatibility.
    • I've asked on #1101 for that omarchy-mac-boot change to go to omarchy-mac-pkgs and its own omarchy-pkgs PR, since it changes boot for every encrypted Mac. Until that's published, either drop the requirement here, or make it conditional on the boot package version and raise minimum_versions to match once it ships.
  2. neo-image.yml can't run. Line 60 uses ${{ runner.temp }} in job-level env, where the runner context isn't available; actionlint rejects it. This dispatch-only workflow isn't exercised by pull-request CI. Set WORK from $RUNNER_TEMP via $GITHUB_ENV, as mac-image.yml:58-59 does.

Policy (maintainer opt-in)

  • Root mount gated on encryption, on every Mac. Together with #1101, this adds a direct sysroot.mount dependency on the encryption service across all Mac profiles, which prevents mounting after that service fails. The previous graph already required encryption through initrd-root-device.target (apple_limine.py:42), and plaintext continuation after a failure hasn't been demonstrated. Intentional plaintext installs still work (omarchy-mac-encrypt:881-891). Because it changes boot behaviour for every encrypted M1/M2/M3, Chris and Ryan should accept it explicitly.
  • btrfs in every initramfs. Every image now requires an executable AArch64 ELF btrfs inside its initramfs (apple_limine.py:284-294). That's safe on current edge, where the hook already adds it, but it's a new requirement for all images.

Still open from r5

  • Engine .50 on omacom. Still "release not found". Engine/README.md:21 now says a maintainer must publish it before catalog publication, which is accurate.
  • Recovery provenance. There's no dedicated Recovery-source binding in image PROVENANCE, and still no signer requirement. neo-image.yml:32-51 builds the app and image from the same checkout, whose builder commit is recorded (build-mac-image:1589). image-builder/README.md:43 leaves it to maintainers, which is fine if they decide.
  • Real-channel Neo lane. The PR CI job (checks.yml:182-209) is check-only against signed fixtures (channelPackagesBuilt:false). The manual neo-image.yml would also fail at resolve until #1101's Neo packages are on edge.
  • available_base legacy behaviour (build-mac-image:816-832) is unchanged, with no legacy build evidence yet.

Resolved

  • Local test portability. install -D is replaced, mac-image-inputs-test.sh:151 uses -eq, and there's a new macOS CI step.
  • validate_zip. It now rejects stray files, directories and duplicates under esp/aurora/recovery/ (recovery_app.py:124-145).

Minor

  • .MTREE requirement. check_package_mtrees applies to legacy too. All current edge set packages carry .MTREE, but lab or local candidates packaged without makepkg will now fail inspection (the README notes this).
  • Artifact upload. In neo-image.yml, the upload runs if: always() over out/, so a full build would upload a multi-GB image.
  • Action versions. checks.yml uses download-artifact v4; neo-image.yml uses v8.0.2.

Owner rule

Unchanged: legacy excludes only j700ap, and Neo allows only j700ap.

Local at a404657: overlay 330, engine 55, image-builder 229, image-builder/test/all exit 0, swift test RecoveryAccount/ClosedEngineHelper 41/41. CI is green. Hardware qualification of the exact image is still outstanding.

Stop requiring the downstream sysroot mount gate removed from the package PR. Preserve the upstream encryption activation link and embedded AArch64 Btrfs validation. Cover an otherwise valid initramfs without the extra drop-in.

Validation: all 66 focused inspection tests and the full image-builder source suite passed on native aarch64 Linux. Restoring the old gate requirement reproduces the new regression test failure.

Assisted-by: LLM

Signed-off-by: Diljit Singh <hey@djdev.me>
@maralcbr

Copy link
Copy Markdown
Member

Thanks: 3211d49 resolves must-fix 1. Legacy images no longer need the unpublished drop-in, and the regression test covers it. Remaining asks:

  1. neo-image.yml:60 still fails actionlint (runner isn't allowed in job-level env). Set WORK from $RUNNER_TEMP via $GITHUB_ENV, as mac-image.yml:58-59 does.
  2. Neo image run. Once omarchy-pkgs#1101's packages are on edge, a full neo-image.yml run on the real channel, then a Neo hardware install from that exact image.

Engine .50 on omacom and the policy decisions are with the maintainers.

DjDeveloperr and others added 2 commits October 18, 2026 03:54
Set WORK from RUNNER_TEMP through GITHUB_ENV, matching the normal image workflow. The runner context is unavailable in job-level env.

Validation: actionlint 1.7.12 passes for the workflow and rejects the prior expression. The setup step writes the expected path with spaces in RUNNER_TEMP; git diff checks passed.

Assisted-by: LLM

Signed-off-by: Diljit Singh <hey@djdev.me>
@maralcbr
maralcbr marked this pull request as ready for review October 18, 2026 10:26

@maralcbr maralcbr 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.

Approving at ef40714 (main merged in, clean). The earlier blockers are resolved, CI is green, engine .50 is published on omacom, and the Neo packages from omacom/omarchy-pkgs#1101 are on edge. DJ reports the hardware testing as covered. The real-channel neo-image.yml full build runs on main right after this merge, and catalog and release work wait until it passes.

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.

3 participants