Skip to content

fix(linux): move deb/rpm update installation outside Orca - #17318

Merged
nwparker merged 12 commits into
nwparker/linux-cli-launch-contractfrom
nwparker/linux-system-package-manual-update
Sep 2, 2026
Merged

nwparker merged 12 commits into
nwparker/linux-cli-launch-contractfrom
nwparker/linux-system-package-manual-update

Conversation

@nwparker

@nwparker nwparker commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1171 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1343 $\color{#cf222e}{\Huge{\mathbf{−}}}$​172
Prod 24 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​626 $\color{#cf222e}{\Huge{\mathbf{−}}}$​713 $\color{#cf222e}{\Huge{\mathbf{−}}}$​87

ELI5

Orca cannot safely replace a root-owned deb/rpm installation while its renderer is still running. It now downloads and verifies the system package, then gives the user a copyable install command and a validated “Show Package” action to run only after quitting Orca.

What Changed

  • Classifies packaged Linux installs from the build marker and fails closed when the marker is missing or unusable.
  • Converts successful deb/rpm downloads into an explicit manual-install recovery state instead of calling electron-updater's in-process root-package installer.
  • Keeps AppImage, macOS, and Windows install behavior unchanged.
  • Validates the retained artifact path, release metadata, version, digest, and file identity before exposing either recovery action.
  • Fences async copy/reveal results against replacement download cycles, including same-version redownloads.
  • Routes file reveal through Electron only after main-process validation and surfaces clipboard, reveal, and release-link failures inline.
  • Marks deb/rpm remote-server updates as non-automatic so clients do not wait forever for a restart that cannot occur.
  • Renames Settings' action to “Download Update” and explains that deb/rpm installation finishes outside Orca.
  • Removes the failed automatic-install retry path and the diagnostic machinery that existed only to recover from it.

The resulting implementation is 659 net lines smaller than the prior automatic-install recovery path.

Why

DebUpdater and RpmUpdater invoke the package manager synchronously, so they can replace Orca's installed files before its live renderer and PTYs are torn down. On root-owned installations, elevation can also fail immediately and leave a paired client waiting forever for a replacement server. A deliberate manual handoff avoids both failure modes while preserving the already downloaded, checksum-verified package.

Linked Issue

Fixes #11906
Fixes #15744
Refs #15176

Visual Proof

Manual-install recovery after status-bar reopen

Fresh Electron/CDP proof on commit 106ae250611036f8ed5f18c53563d13b1e404966 rendered the documented linux-package-install / manual-install-required deb state; after minimizing and reopening from the status bar, the recovery state and actions remained present and actionable. No console errors were observed. The proof ran on macOS with store injection; genuine Linux deb/rpm updater IPC, package-manager discovery, clipboard completion, and file-reveal results were not exercised.

Testing

  • 21 changed test files / 364 tests
  • pnpm tc:node
  • pnpm tc:web
  • Full lint, changed-code quality, reliability gates, max-lines ratchet, runtime-Electron ratchet, localization checks, and git diff --check
  • Electron CDP validation of expanded/collapsed recovery, status-bar re-expansion, light/dark themes, 480px layout, keyboard order, settings copy, IPC rejection, and a same-version stale recovery race; the fresh proof also exercised the documented manual-install deb state and actionability after reopen
  • Readiness review found no remaining candidate finding after the stale-cycle repair.

Stack readiness evidence on the published rebased stack (main@212c0e42): 56 changed test files, 785 tests passed, and 4 platform-gated skips. Typecheck, reliability/max-lines/runtime-Electron ratchets, changed-code quality/React Doctor, formatting, oxlint, shellcheck, and git diff --check passed. The full-suite control run had 7 failures in 3 untouched files: the zsh non-ASCII wrapper rename collision, the SSH host-key mock's missing ssh2.utils, and a renderer context-menu failure seen only in the full run (the isolated test passed). The zsh and SSH failures reproduce on pristine origin/main; fresh CI is running on the published heads.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

PR 6 of 7, stacked on #17319. It hands deb/rpm installation to the operator after the packaged runtime contract is in place, and precedes the restart-ownership documentation.

  1. fix(linux): give the CLI one entrypoint by extracting the AppImage once #15081 — one stable AppImage CLI entrypoint
  2. fix(linux): stop CLI commands from falling through to Chromium startup #15083 — unified launch redirect
  3. fix(linux): report a missing display instead of dying in uv_close #15084 — missing-display diagnosis
  4. test(linux): add a packaged-artifact contract for the CLI launch paths #15085 — packaged-artifact launch contract and rpm parity
  5. fix(linux): require static AppImage runtimes #17319 — static AppImage runtime validation
  6. fix(linux): move deb/rpm update installation outside Orca #17318 — manual deb/rpm package installation handoff
  7. docs(linux): document orcad update restart safety #17320 — orcad restart-ownership safety documentation

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • No RPC schema, remote-wire, mobile, relay, persistence, or provider contract changes; no mobile-facing RPC/protocol/pairing surface was touched.
  • The recovery command targets the computer where Orca is installed, never an SSH/folder workspace host.
  • AppImage auto-install and macOS/Windows native installers retain their existing paths.
  • The package remains user-owned after validation; same-UID replacement is an explicitly disclosed residual trust-boundary risk, not protection this handoff claims to provide.
  • Existing remote clients already understand automatic: false; no new wire field or opcode is introduced.

Checklist

  • Rebased onto current main
  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

User-facing regressions

Not zero. One needs product sign-off.

  1. Remote deb/rpm hosts lose automatic updates — but far less than first reported. getRemoteServerUpdateSupport() now returns automatic: false for any deb, rpm, or unusable marker, and assertRemoteServerUpdateAvailable() throws remote_update_manual_required on check, download and install.

    An earlier draft of this section claimed these hosts updated remotely on main. That was wrong, and three independent severity reviewers caught it. hasServeUpdateSupervisor() is process.platform === 'darwin' && getConfiguredHandoffPath() !== null — identical on main and here — so resolveUpdateInstallMode(true) already returned 'unsupported-headless-serve' for every Linux orca serve host, and main's gate already returned automatic: false for that mode. For the documented remote topology this clause is redundant: nothing was taken away.

    The only genuine delta is a Linux desktop deb/rpm install driven by a paired mobile or web client. On main that reported automatic: true and would have called quitAndInstall() into electron-updater's runCommandWithSudoIfNeeded, i.e. a local sudo/pkexec dialog the remote operator cannot answer. Replacing a prompt nobody can see with explicit guidance is a fix, not a loss.

    updater.getStatus remains deliberately ungated, so the operator still sees the available version and support.reason: 'manual-service-update-required'.

  2. A hand-edited or unrecognised package-type marker now resolves to unusable instead of null. Visible effect is one console-only warning per launch plus a non-retryable error after both a check and a Download click. Nearly invisible in practice — no shipped package writes such a marker.

Strictly safer than main and worth noting as the point of the change: autoInstallOnAppQuit is now gated to === 'non-root', and performQuitAndInstall hard-returns for deb/rpm, so Orca no longer reaches electron-updater's LinuxUpdater shell path — whose own comment states that "paths containing single-quotes (') are not supported".

Found in review and fixed here: the manual-update guidance told the operator to "update through the service manager that starts this server", which is correct for an unsupervised headless serve but wrong for a package install, where nothing about the remedy involves the service manager.

@nwparker
nwparker requested a review from brennanb2025 as a code owner August 30, 2026 01:48
@greptile-apps

greptile-apps Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Greptile Summary

The PR replaces in-process deb/rpm installation with a validated manual-install handoff while preserving existing AppImage, macOS, and Windows behavior.

  • Classifies packaged Linux installations using a packaged build marker.
  • Revalidates downloaded package metadata, digest, file identity, and lifecycle generation before copy or reveal actions.
  • Presents deb/rpm installation instructions and a validated package-reveal action after download.
  • Updates renderer status, recovery UI, settings copy, package configuration, and CI package verification.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
src/main/updater.ts Coordinates manual Linux package recovery, validates recovery freshness, and preserves native installation behavior on other platforms.
src/main/linux-package-update-recovery.ts Tracks downloaded deb/rpm artifacts and revalidates package type, cache containment, file identity, version, and digest before use.
src/main/linux-package-downloaded-status.ts Converts validated deb/rpm downloads into the manual-install recovery status and retains usable recovery state.
src/main/linux-update-package-type.ts Classifies packaged Linux installations from the build marker and fails closed for unusable marker state.
src/main/updater-events.ts Integrates artifact lifecycle management and manual recovery status into updater events.
src/renderer/src/components/LinuxPackageInstallRecoveryCard.tsx Presents package installation instructions, copy, reveal, and inline failure feedback.
src/shared/update-status-types.ts Extends the shared updater status contract with the additive manual-install recovery reason.
config/electron-builder.config.cjs Adds Linux package markers and retains Electron runtime dependencies in deb/rpm package metadata.
.github/workflows/pr.yml Builds deb and rpm artifacts in package CI and verifies their embedded package-type markers.

Sequence Diagram

sequenceDiagram
  participant U as Updater
  participant M as Main process
  participant R as Renderer
  participant O as Operating system
  U->>M: update-downloaded metadata
  M->>M: Classify deb/rpm installation
  M->>M: Capture and validate package artifact
  M-->>R: manual-install-required status
  R->>M: Request install command or Show Package
  M->>M: Revalidate version, digest, path, and identity
  M-->>R: Validated command or action result
  R->>O: User installs package after quitting Orca
Loading

Reviews (23): Last reviewed commit: "refactor(updater): keep Linux marker mes..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8015d62b-98eb-46a4-96a3-61457eb2aa3c

📥 Commits

Reviewing files that changed from the base of the PR and between 2e39380fc8dc410fe4935b0f9b9cde3ad8b62174 and 6914eb2.

📒 Files selected for processing (7)
  • .github/workflows/pr.yml
  • config/scripts/pr-workflow-parallelism.test.mjs
  • src/main/updater-events.test.ts
  • src/main/updater-events.ts
  • src/main/updater.headless-serve-install.test.ts
  • src/main/updater.quit-and-install.test.ts
  • src/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/i18n/locales/en.json

Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds Linux package markers and classifies packages as deb, rpm, non-root, or unusable. Root-package downloads now produce manual-install recovery statuses. Artifact validation tracks package identity and rejects stale asynchronous operations. Native installation and remote update policies distinguish root, non-root, and unusable packages. Renderer cards, status indicators, settings, translations, and tests now support the manual-install flow.

Merge Risk: 🟡 Moderate · up to 6914e

Linux RPM updates now rely on a later privileged manual install, but the generated commands disable package-signature checks while the cached package can still be replaced after validation, creating a bounded local privilege-escalation risk. Some update-event sequences may also hide the available installation recovery action. Merge should wait for remediation or explicit owner acceptance.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.51% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 78 functions across 37 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The description links multiple issues and includes Fixes #11906, Fixes #15744, and Refs #15176.
Out of Scope Changes check ✅ Passed The changes support the stated objective of moving Linux deb/rpm installation outside Orca. Related tests, packaging markers, remote-update behavior, and UI changes are within scope.
Title check ✅ Passed The title clearly and concisely summarizes the primary change: moving Linux deb/rpm update installation outside Orca.
Description check ✅ Passed The description includes all required template sections, linked issues, scope, rationale, visual proof, testing details, AI disclosure, review context, compatibility notes, and a completed checklist. …
Full details: Docstring Coverage

Explanation

Docstring coverage is 20.51% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 78 functions across 37 files. (2 skipped: 2 unsupported.)

Full details: Description check

Explanation

The description includes all required template sections, linked issues, scope, rationale, visual proof, testing details, AI disclosure, review context, compatibility notes, and a completed checklist. It also transparently documents the limited visual-test scope and unrelated full-suite failures.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/main/updater-test-harness.ts (1)

218-219: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Import LINUX_PACKAGE_MARKER_UNUSABLE_MESSAGE instead of copying its text. Four mock sites hard-code the same marker message. If the source constant in src/main/linux-update-package-type.ts changes, every copy keeps the old text and the assertions still pass against the stale string.

  • src/main/updater-test-harness.ts#L218-L219: import the constant from ./linux-update-package-type and pass it through the linuxUpdatePackageType factory.
  • src/main/updater-events.test.ts#L26-L27: import the constant and use it in the vi.mock factory and in the status assertion at Line 232.
  • src/main/updater.install-failure-cause.test.ts#L106-L107: import the constant and use it in the vi.mock factory.
  • src/main/updater-linux-package-recovery-actions.test.ts#L84-L85: import the constant and use it in the vi.mock factory.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b7b09314-d42e-4a1b-818d-2725ab3268a1

📥 Commits

Reviewing files that changed from the base of the PR and between 0a995cc and 9bf99d6.

📒 Files selected for processing (32)
  • config/electron-builder.config.cjs
  • config/scripts/electron-builder-config.test.mjs
  • src/main/linux-package-downloaded-status.ts
  • src/main/linux-package-install-diagnostic.test.ts
  • src/main/linux-package-install-diagnostic.ts
  • src/main/linux-package-update-recovery.test.ts
  • src/main/linux-package-update-recovery.ts
  • src/main/linux-update-package-type.test.ts
  • src/main/linux-update-package-type.ts
  • src/main/updater-events.test.ts
  • src/main/updater-events.ts
  • src/main/updater-fallback.ts
  • src/main/updater-linux-package-recovery-actions.test.ts
  • src/main/updater-test-harness.ts
  • src/main/updater.fallback.test.ts
  • src/main/updater.install-failure-cause.test.ts
  • src/main/updater.linux-root-package-install.test.ts
  • src/main/updater.ts
  • src/renderer/src/components/LinuxPackageInstallRecoveryCard.test.tsx
  • src/renderer/src/components/LinuxPackageInstallRecoveryCard.tsx
  • src/renderer/src/components/UpdateCard.error-card.test.tsx
  • src/renderer/src/components/UpdateCard.test.ts
  • src/renderer/src/components/UpdateCard.tsx
  • src/renderer/src/components/UpdateErrorCardContent.tsx
  • src/renderer/src/components/maintenance/update-card/UpdateCardStateContent.tsx
  • src/renderer/src/components/maintenance/update-card/update-card-error-model.ts
  • src/renderer/src/components/maintenance/update-card/update-card-visibility.ts
  • src/renderer/src/components/settings/GeneralUpdateSettingsSection.test.tsx
  • src/renderer/src/components/settings/GeneralUpdateSettingsSection.tsx
  • src/renderer/src/components/status-bar/UpdateStatusSegment.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/shared/update-status-types.ts
💤 Files with no reviewable changes (1)
  • src/renderer/src/components/UpdateCard.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Comment thread src/main/updater-events.ts Resolved
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from 9bf99d6 to 0cb14ee Compare August 30, 2026 03:05

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/updater-events.ts (1)

153-153: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve manual-install recovery on this early-return path.

If an older or current update-available event arrives while a verified Linux artifact is retained, Line 153 sends not-available. The artifact remains tracked, but the renderer loses the installation command and Show Package action. Send the retained recovery status here when it exists.

Proposed fix
-      sendStatus({ state: 'not-available', userInitiated: wasUserInitiated || undefined })
+      sendStatus(
+        getRetainedLinuxPackageManualInstallStatus() ??
+          { state: 'not-available', userInitiated: wasUserInitiated || undefined }
+      )

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 153e26c0-c3b1-42b7-a603-bb4bde6f0976

📥 Commits

Reviewing files that changed from the base of the PR and between 0cb14ee765311f98542742150dde353e14b2ecc7 and 90bb83afeba27cd12a9c16eb7b2420a22d79561c.

📒 Files selected for processing (4)
  • src/main/linux-package-downloaded-status.ts
  • src/main/updater-events.test.ts
  • src/main/updater-events.ts
  • src/main/updater-mac-install.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/linux-package-downloaded-status.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.

@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch 2 times, most recently from 710ebf9 to 2b71565 Compare August 30, 2026 05:09
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from 8850ffc to 2e39380 Compare August 30, 2026 05:49
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch 4 times, most recently from 6914eb2 to ef6d58d Compare August 30, 2026 09:21
@nwparker
nwparker changed the base branch from main to nwparker/linux-static-appimage-runtime August 30, 2026 09:22
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from ef6d58d to c0383df Compare August 30, 2026 23:48
@nwparker
nwparker force-pushed the nwparker/linux-static-appimage-runtime branch from 9f66b2c to 79136ab Compare August 30, 2026 23:48
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from c0383df to b62845e Compare August 31, 2026 00:06
@nwparker
nwparker force-pushed the nwparker/linux-static-appimage-runtime branch from 79136ab to 141879d Compare August 31, 2026 00:06
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from b62845e to cb7594e Compare August 31, 2026 00:24
@nwparker
nwparker force-pushed the nwparker/linux-static-appimage-runtime branch from 141879d to 15af627 Compare August 31, 2026 00:24
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from cb7594e to 5eb925b Compare August 31, 2026 01:09
@nwparker
nwparker force-pushed the nwparker/linux-static-appimage-runtime branch from 15af627 to 6423038 Compare August 31, 2026 01:09
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch 3 times, most recently from 9cf0382 to 8b4b207 Compare August 31, 2026 03:13
@nwparker
nwparker force-pushed the nwparker/linux-static-appimage-runtime branch 2 times, most recently from 07539be to a18193f Compare August 31, 2026 03:27
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from 8b4b207 to 1242078 Compare August 31, 2026 03:27
@nwparker
nwparker force-pushed the nwparker/linux-static-appimage-runtime branch from 107f8fb to 5964b76 Compare September 1, 2026 09:17
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch 2 times, most recently from 2fb6c24 to df041eb Compare September 1, 2026 10:07
@nwparker
nwparker force-pushed the nwparker/linux-static-appimage-runtime branch from 55d39e8 to 20b3544 Compare September 1, 2026 10:29
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch 2 times, most recently from 50b7959 to 65d9706 Compare September 1, 2026 10:34
@nwparker
nwparker changed the base branch from nwparker/linux-static-appimage-runtime to nwparker/linux-cli-launch-contract September 1, 2026 10:35
@nwparker
nwparker force-pushed the nwparker/linux-cli-launch-contract branch from 2d0f5cb to a0bacae Compare September 1, 2026 10:41
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch 2 times, most recently from afbdaee to 8390e2f Compare September 2, 2026 05:41
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from 8390e2f to 3c536aa Compare September 2, 2026 05:55
@nwparker
nwparker merged commit 5104aeb into nwparker/linux-cli-launch-contract Sep 2, 2026
32 checks passed
nwparker added a commit that referenced this pull request Sep 2, 2026
#15085)

* test(linux): add a packaged-artifact contract for the CLI launch paths

* test(linux): avoid buffered serve readiness detection

* test(linux): signal AppImage serve owner directly

* test(linux): tolerate readiness timeout boundary

* test(linux): add startup margin to shutdown oracle

* ci(linux): give package contracts timeout headroom

* fix(ci): route all Linux packaging contract changes

* test(linux): poll shutdown readiness without tail leaks

* test(linux): bound shutdown cleanup grace

* test(linux): assert on CLI output, not the harness's own control lines

run-cli-case.sh echoes `RESULT status=N case=<name>`, and the two cases named
*-skills asserted `expectOutput: 'skills'`. That substring was satisfied by
the case name in the harness's own line, so 2 of 8 cases asserted nothing
about the command -- gutting `skills` entirely would still have gone green.

Control lines are now excluded before matching, and both cases assert the
rendered help header, which only real help output produces. Verified on an
Ubuntu 24.04 host: 8/8 still pass against a stack-tip AppImage.

Also register the gate in reliability-gates.jsonc, which #15085 added a CI
Docker gate without. Red/green is recorded from a stock release AppImage
failing 4 of 8, three of them at status 133 (SIGTRAP).

* fix(linux): require static AppImage runtimes (#17319)

* test(linux): reject a wrong-architecture native binary at packaging time

Cross-building the arm64 slice on an x64 host silently packed an x86-64
`pty.node` -- the rebuild logged "Forcing native rebuild for linux-arm64" and
shipped the host's binary anyway. Every gate here inspects symbol versions,
which are perfectly valid on the wrong architecture, so nothing noticed.

Observed on a Raspberry Pi 5: the packaged app loaded, then failed with
"Failed to load native module: pty.node", and the launch contract reported
3 of 8 cases crashed rather than naming the cause. Swapping in the aarch64
`pty.node` took the same build to 8/8.

Compare ELF `e_machine` against the slice being packaged and fail with the
offending path. Checked before the glibc pass, because a wrong-architecture
binary's symbol versions are valid but meaningless and would send the reader
down the wrong path.

Release CI builds arm64 on a native runner, so this guards local and future
cross-builds rather than a shipped artifact.

* test(linux): judge per-arch vendored binaries against their own path

The first CI run of the architecture gate failed the x64 package job on
`@parcel/watcher-linux-arm64-glibc/watcher.node`. That binary is arm64 on
purpose: the package ships every architecture and its loader picks the match,
so its presence in an x64 build is correct.

Judge a binary against the architecture its own path names, falling back to
the slice when the path names none. That keeps the case this gate exists for
-- `bin/linux-arm64-*/node-pty.node` holding an x86-64 binary, which is what
shipped to a Raspberry Pi 5 -- while letting multi-arch dependencies through.

Dry-run over the real dependency tree flags nothing for either target arch.

* fix(linux): move deb/rpm update installation outside Orca (#17318)

* fix(linux): complete deb/rpm package metadata

* fix(linux): preserve CLI link during package upgrades

* docs(linux): document local RPM build prerequisites

* fix(linux): move deb/rpm update installation outside Orca

* fix(updater): preserve Linux recovery across stale events

* fix(updater): fence stale downloaded events by active target

* fix(updater): preserve active Linux package recovery

* test(linux): keep workflow order assertion in scope

* test(updater): assert stale recovery stays silent

* fix(updater): preserve Linux package recovery after checks

* refactor(updater): keep Linux marker message with status

* fix(linux): describe the right manual update path for deb/rpm hosts

A remote host installed from .deb or .rpm now reports
manual-service-update-required, and the guidance told the operator to
"update through the service manager that starts this server" -- which is
correct for unsupported-headless-serve but wrong for a package install,
where nothing about the remedy involves the service manager.

Say both, keyed on how the host was installed.
nwparker added a commit that referenced this pull request Sep 2, 2026
* fix(linux): give the CLI one entrypoint by extracting the AppImage once

* refactor(linux): trim AppImage CLI registration seams

* test(cli): assert registration lock serialization

* fix(linux): fence AppImage terminal shim mounts

* fix(linux): accept extracted AppImage runtimes with APPDIR only

* docs(linux): make headless AppImage extraction runnable

* refactor(linux): import bundled launcher directly

* fix(linux): reclaim superseded AppImage payloads and packaged symlinks

Pruning removed 3215 of 3216 files from a superseded generation and always
stranded resources/app.asar, leaking ~105 MB per version update. Electron's
asar shim reports a *.asar file as a directory, so the recursive remove tried
to rmdir a real file and failed with ENOTEMPTY; the .catch(() => {}) hid it.
Reproduced end to end on Ubuntu 24.04: 519M -> 623M across one update, and
519M again once the payload is actually reclaimed.

removeExtractedAppImagePayload holds process.noAsar for the removal, counted
so overlapping removals cannot hand the shim back early, and the prune site
now warns with the path instead of swallowing the rejection. All three
removal sites use it -- staging cleanup and displaced roots leaked the same
way.

Also reclaim symlinks left by a packaged deb/rpm install, which the
extracted-cache-only rule turned into a hard conflict on a deb -> AppImage
migration, and name the remedy in the conflict error.

* fix(linux): bound the CLI registration lock wait

`retries: 1000` caps the attempt count, not elapsed time, so at up to 1s per
attempt an IPC-driven registration could hang ~16 minutes against a wedged
holder with no feedback.

A legitimate holder is bounded by the extraction timeout, so wait that plus
slack and then fail with a message naming the lock file, rather than hanging.
`maxRetryTime` is forwarded verbatim to the `retry` package by proper-lockfile.

* fix(linux): stop re-extracting the AppImage on inode metadata churn

The extracted-payload cache key hashed ctime alongside dev/ino/size/mtime.
ctime moves on any inode metadata write -- `chmod +x`, which every AppImage
user is told to run, plus `chown`, an ACL or SELinux relabel, and a backup
restore -- none of which alter a byte of the payload.

Measured on Ubuntu 24.04: `chmod +x` leaves dev, ino, size and mtime
identical and moves ctime alone, so the key changed and the next launch paid
a full ~519 MB re-extraction and a multi-second stall to rebuild a payload it
already had, then pruned the old generation.

Key on content identity instead. An in-place content change moves mtime and
almost always size; a replacement moves the inode. The existing
replace-in-place test still passes.

* fix(linux): stop CLI commands from falling through to Chromium startup

* refactor(cli): remove redundant command membership check

* test(cli): cover command-named project selectors

* fix(cli): redirect the open-url command before startup

* test(linux): cover AUR serve wrapper flags

* fix(linux): tighten CLI launch detection

* fix(linux): respect CLI flag value boundaries

* fix(linux): strip injected Chromium switches from CLI args

* fix(linux): report a missing display instead of dying in uv_close

* refactor(linux): read display locks without a preflight race

* fix(linux): preserve unverified external displays

* chore: format reliability gate manifest

* test(packaging): split runtime resource checks

* fix(linux): fail serve when no display is available

* fix(linux): do not treat a lockless X socket as a dead display

An X server writes its lock beside its socket and both survive a crash
(verified against Xvfb under SIGKILL), so a socket with no lock was never
left by a crashed server. It is an endpoint published from elsewhere: a
container bind-mounting only /tmp/.X11-unix, WSLg, or a foreign PID
namespace. Declaring those dead made the desktop gate exit(1) on displays
that work, with no workaround, and the serve gate refuse to start.

Liveness now splits by ownership. A foreign DISPLAY trusts a lockless
socket; Orca's own :99 does not, because removeStaleDisplayArtifacts
unlinks the lock before the socket and so manufactures that state itself --
adopting it would resurrect the orphan-socket bug and stop the cleanup from
self-healing. The stale-lock rejection is unchanged.

Also correct four doc statements this behaviour falsified.

* fix(linux): fail closed when a stale socket blocks the Xvfb rebind

Readiness only checked that /tmp/.X11-unix/X99 exists. A stale socket we
could not unlink still exists after our own Xvfb refused to bind, so Orca set
DISPLAY to a dead server and Chromium died in Ozone init.

Measured on Ubuntu 24.04 against the pre-fix build: with a leftover :99
socket and no lock, serve exits 139 (SIGSEGV), the socket inode is unchanged
before and after, and no lock is recreated -- it neither cleaned up nor
respawned. To a user that is a crash, not a misconfiguration.

This is reachable in the documented topology, where orca-xvfb.service has no
User= and runs as root while serve runs as User=orca: /tmp is sticky, so the
orca uid cannot unlink a root-owned socket, rmSync fails, and Xvfb exits with
the display already active.

Readiness now requires the display to actually be live -- our socket plus a
lock naming a running process -- so the same state reports an unusable
display and exits 1 with the existing diagnosis.

* fix(linux): recognise abstract X sockets and inherited Wayland fds

Two display setups this gate could not prove were refused outright, and on the
desktop path that is app.exit(1) with no workaround.

An X server may bind only the abstract namespace (`@/tmp/.X11-unix/X0`), which
leaves no filesystem socket to stat. Abstract addresses are kernel-owned and
vanish the moment the owner exits, so an entry in /proc/net/unix is proof of a
live server -- no lock file needed and no stale entry possible. Verified on
Ubuntu 24.04, where 139 such addresses were present.

WAYLAND_SOCKET is an already-connected fd handed over by the compositor, so
there is no path to stat and WAYLAND_DISPLAY may be unset entirely. Its
presence is the display.

Both are consulted only after the filesystem-socket check fails, so no
existing verdict changes.

* fix(linux): never treat Orca's own display number as a foreign endpoint

Recognising a lockless X socket as live is correct for an endpoint published
from elsewhere -- a container bind mount, WSLg -- because an X server writes
its lock beside its socket and both survive a crash. It is wrong for
VIRTUAL_DISPLAY_NUMBER, because Orca's own teardown unlinks the lock before
the socket and so manufactures that exact state.

The managed branch was already strict, but a caller that sets DISPLAY=:99
explicitly takes the foreign path and skipped it, accepting a dead display
left by Orca's own interrupted cleanup. Route the managed number through the
strict probe on both paths.

Found by an adversarial audit of the asymmetry introduced earlier in this
branch; the documented systemd topology is unaffected because its Xvfb writes
a real lock.

* test(linux): add a packaged-artifact contract for the CLI launch paths

* test(linux): avoid buffered serve readiness detection

* test(linux): signal AppImage serve owner directly

* test(linux): tolerate readiness timeout boundary

* test(linux): add startup margin to shutdown oracle

* ci(linux): give package contracts timeout headroom

* fix(ci): route all Linux packaging contract changes

* test(linux): poll shutdown readiness without tail leaks

* test(linux): bound shutdown cleanup grace

* test(linux): assert on CLI output, not the harness's own control lines

run-cli-case.sh echoes `RESULT status=N case=<name>`, and the two cases named
*-skills asserted `expectOutput: 'skills'`. That substring was satisfied by
the case name in the harness's own line, so 2 of 8 cases asserted nothing
about the command -- gutting `skills` entirely would still have gone green.

Control lines are now excluded before matching, and both cases assert the
rendered help header, which only real help output produces. Verified on an
Ubuntu 24.04 host: 8/8 still pass against a stack-tip AppImage.

Also register the gate in reliability-gates.jsonc, which #15085 added a CI
Docker gate without. Red/green is recorded from a stock release AppImage
failing 4 of 8, three of them at status 133 (SIGTRAP).

* fix(linux): require static AppImage runtimes (#17319)

* test(linux): reject a wrong-architecture native binary at packaging time

Cross-building the arm64 slice on an x64 host silently packed an x86-64
`pty.node` -- the rebuild logged "Forcing native rebuild for linux-arm64" and
shipped the host's binary anyway. Every gate here inspects symbol versions,
which are perfectly valid on the wrong architecture, so nothing noticed.

Observed on a Raspberry Pi 5: the packaged app loaded, then failed with
"Failed to load native module: pty.node", and the launch contract reported
3 of 8 cases crashed rather than naming the cause. Swapping in the aarch64
`pty.node` took the same build to 8/8.

Compare ELF `e_machine` against the slice being packaged and fail with the
offending path. Checked before the glibc pass, because a wrong-architecture
binary's symbol versions are valid but meaningless and would send the reader
down the wrong path.

Release CI builds arm64 on a native runner, so this guards local and future
cross-builds rather than a shipped artifact.

* test(linux): judge per-arch vendored binaries against their own path

The first CI run of the architecture gate failed the x64 package job on
`@parcel/watcher-linux-arm64-glibc/watcher.node`. That binary is arm64 on
purpose: the package ships every architecture and its loader picks the match,
so its presence in an x64 build is correct.

Judge a binary against the architecture its own path names, falling back to
the slice when the path names none. That keeps the case this gate exists for
-- `bin/linux-arm64-*/node-pty.node` holding an x86-64 binary, which is what
shipped to a Raspberry Pi 5 -- while letting multi-arch dependencies through.

Dry-run over the real dependency tree flags nothing for either target arch.

* fix(linux): move deb/rpm update installation outside Orca (#17318)

* fix(linux): complete deb/rpm package metadata

* fix(linux): preserve CLI link during package upgrades

* docs(linux): document local RPM build prerequisites

* fix(linux): move deb/rpm update installation outside Orca

* fix(updater): preserve Linux recovery across stale events

* fix(updater): fence stale downloaded events by active target

* fix(updater): preserve active Linux package recovery

* test(linux): keep workflow order assertion in scope

* test(updater): assert stale recovery stays silent

* fix(updater): preserve Linux package recovery after checks

* refactor(updater): keep Linux marker message with status

* fix(linux): describe the right manual update path for deb/rpm hosts

A remote host installed from .deb or .rpm now reports
manual-service-update-required, and the guidance told the operator to
"update through the service manager that starts this server" -- which is
correct for unsupported-headless-serve but wrong for a package install,
where nothing about the remedy involves the service manager.

Say both, keyed on how the host was installed.

* docs(linux): document orcad update restart safety

* docs(linux): scope restart census omissions

* docs(linux): use absolute service CLI launcher

* fix(serve): validate in-process serve options before startup (#17683)

* fix(linux): stop offering updates a distro-managed install cannot apply (#17918)

Closes #17702.

The resources/package-type marker is authoritative but never checked against
the host, so any repackager that unpacks Orca's .deb -- AUR, Nix, a container
rebuild -- inherits `deb` verbatim. Install feasibility was then computed
after a ~165 MB download, so those users got check -> download -> a card
promising an install command -> a dead end.

Validate the marker against the host: a deb/rpm marker with no matching
package manager in the trusted directories means a package manager owns this
install. This reuses the exact lists and resolver that
buildLinuxPackageInstallCommand already loops over, so a false positive is
impossible by construction -- any host flagged here would have failed with
no-package-manager after the download anyway. The gate only moves that
verdict earlier. Verified across Debian 12, Ubuntu 24.04, Arch, Fedora 40 and
openSUSE Leap: no false positive on a real deb host, correct on every
repackaging host.

The release is still reported, because the user does want to know 1.4.194
exists and to update through their distro; only the download path is closed.
`externallyManaged` is an additive optional field on the existing `available`
status, so older paired clients decode it unchanged. downloadUpdate() refuses
authoritatively, since main owns this verdict rather than the card, and
unwinds any pinned-build state first -- a Linux pinned jump resolves to
'release', and stranding isPinnedBuildActive would silently kill every
background check for the rest of the process.

Note the fix the issue suggests cannot work: electron-updater builds a
PacmanUpdater whose doDownloadUpdate looks for a .pacman asset Orca does not
publish, then dereferences undefined.

* style(cli): restore prettier wrapping on install error copy

* test(linux): re-pin the child-process ratchets and the batch-shim allowlist after the merge
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…#18100)

* fix(linux): give the CLI one entrypoint by extracting the AppImage once

* refactor(linux): trim AppImage CLI registration seams

* test(cli): assert registration lock serialization

* fix(linux): fence AppImage terminal shim mounts

* fix(linux): accept extracted AppImage runtimes with APPDIR only

* docs(linux): make headless AppImage extraction runnable

* refactor(linux): import bundled launcher directly

* fix(linux): reclaim superseded AppImage payloads and packaged symlinks

Pruning removed 3215 of 3216 files from a superseded generation and always
stranded resources/app.asar, leaking ~105 MB per version update. Electron's
asar shim reports a *.asar file as a directory, so the recursive remove tried
to rmdir a real file and failed with ENOTEMPTY; the .catch(() => {}) hid it.
Reproduced end to end on Ubuntu 24.04: 519M -> 623M across one update, and
519M again once the payload is actually reclaimed.

removeExtractedAppImagePayload holds process.noAsar for the removal, counted
so overlapping removals cannot hand the shim back early, and the prune site
now warns with the path instead of swallowing the rejection. All three
removal sites use it -- staging cleanup and displaced roots leaked the same
way.

Also reclaim symlinks left by a packaged deb/rpm install, which the
extracted-cache-only rule turned into a hard conflict on a deb -> AppImage
migration, and name the remedy in the conflict error.

* fix(linux): bound the CLI registration lock wait

`retries: 1000` caps the attempt count, not elapsed time, so at up to 1s per
attempt an IPC-driven registration could hang ~16 minutes against a wedged
holder with no feedback.

A legitimate holder is bounded by the extraction timeout, so wait that plus
slack and then fail with a message naming the lock file, rather than hanging.
`maxRetryTime` is forwarded verbatim to the `retry` package by proper-lockfile.

* fix(linux): stop re-extracting the AppImage on inode metadata churn

The extracted-payload cache key hashed ctime alongside dev/ino/size/mtime.
ctime moves on any inode metadata write -- `chmod +x`, which every AppImage
user is told to run, plus `chown`, an ACL or SELinux relabel, and a backup
restore -- none of which alter a byte of the payload.

Measured on Ubuntu 24.04: `chmod +x` leaves dev, ino, size and mtime
identical and moves ctime alone, so the key changed and the next launch paid
a full ~519 MB re-extraction and a multi-second stall to rebuild a payload it
already had, then pruned the old generation.

Key on content identity instead. An in-place content change moves mtime and
almost always size; a replacement moves the inode. The existing
replace-in-place test still passes.

* fix(linux): stop CLI commands from falling through to Chromium startup

* refactor(cli): remove redundant command membership check

* test(cli): cover command-named project selectors

* fix(cli): redirect the open-url command before startup

* test(linux): cover AUR serve wrapper flags

* fix(linux): tighten CLI launch detection

* fix(linux): respect CLI flag value boundaries

* fix(linux): strip injected Chromium switches from CLI args

* fix(linux): report a missing display instead of dying in uv_close

* refactor(linux): read display locks without a preflight race

* fix(linux): preserve unverified external displays

* chore: format reliability gate manifest

* test(packaging): split runtime resource checks

* fix(linux): fail serve when no display is available

* fix(linux): do not treat a lockless X socket as a dead display

An X server writes its lock beside its socket and both survive a crash
(verified against Xvfb under SIGKILL), so a socket with no lock was never
left by a crashed server. It is an endpoint published from elsewhere: a
container bind-mounting only /tmp/.X11-unix, WSLg, or a foreign PID
namespace. Declaring those dead made the desktop gate exit(1) on displays
that work, with no workaround, and the serve gate refuse to start.

Liveness now splits by ownership. A foreign DISPLAY trusts a lockless
socket; Orca's own :99 does not, because removeStaleDisplayArtifacts
unlinks the lock before the socket and so manufactures that state itself --
adopting it would resurrect the orphan-socket bug and stop the cleanup from
self-healing. The stale-lock rejection is unchanged.

Also correct four doc statements this behaviour falsified.

* fix(linux): fail closed when a stale socket blocks the Xvfb rebind

Readiness only checked that /tmp/.X11-unix/X99 exists. A stale socket we
could not unlink still exists after our own Xvfb refused to bind, so Orca set
DISPLAY to a dead server and Chromium died in Ozone init.

Measured on Ubuntu 24.04 against the pre-fix build: with a leftover :99
socket and no lock, serve exits 139 (SIGSEGV), the socket inode is unchanged
before and after, and no lock is recreated -- it neither cleaned up nor
respawned. To a user that is a crash, not a misconfiguration.

This is reachable in the documented topology, where orca-xvfb.service has no
User= and runs as root while serve runs as User=orca: /tmp is sticky, so the
orca uid cannot unlink a root-owned socket, rmSync fails, and Xvfb exits with
the display already active.

Readiness now requires the display to actually be live -- our socket plus a
lock naming a running process -- so the same state reports an unusable
display and exits 1 with the existing diagnosis.

* fix(linux): recognise abstract X sockets and inherited Wayland fds

Two display setups this gate could not prove were refused outright, and on the
desktop path that is app.exit(1) with no workaround.

An X server may bind only the abstract namespace (`@/tmp/.X11-unix/X0`), which
leaves no filesystem socket to stat. Abstract addresses are kernel-owned and
vanish the moment the owner exits, so an entry in /proc/net/unix is proof of a
live server -- no lock file needed and no stale entry possible. Verified on
Ubuntu 24.04, where 139 such addresses were present.

WAYLAND_SOCKET is an already-connected fd handed over by the compositor, so
there is no path to stat and WAYLAND_DISPLAY may be unset entirely. Its
presence is the display.

Both are consulted only after the filesystem-socket check fails, so no
existing verdict changes.

* fix(linux): never treat Orca's own display number as a foreign endpoint

Recognising a lockless X socket as live is correct for an endpoint published
from elsewhere -- a container bind mount, WSLg -- because an X server writes
its lock beside its socket and both survive a crash. It is wrong for
VIRTUAL_DISPLAY_NUMBER, because Orca's own teardown unlinks the lock before
the socket and so manufactures that exact state.

The managed branch was already strict, but a caller that sets DISPLAY=:99
explicitly takes the foreign path and skipped it, accepting a dead display
left by Orca's own interrupted cleanup. Route the managed number through the
strict probe on both paths.

Found by an adversarial audit of the asymmetry introduced earlier in this
branch; the documented systemd topology is unaffected because its Xvfb writes
a real lock.

* test(linux): add a packaged-artifact contract for the CLI launch paths

* test(linux): avoid buffered serve readiness detection

* test(linux): signal AppImage serve owner directly

* test(linux): tolerate readiness timeout boundary

* test(linux): add startup margin to shutdown oracle

* ci(linux): give package contracts timeout headroom

* fix(ci): route all Linux packaging contract changes

* test(linux): poll shutdown readiness without tail leaks

* test(linux): bound shutdown cleanup grace

* test(linux): assert on CLI output, not the harness's own control lines

run-cli-case.sh echoes `RESULT status=N case=<name>`, and the two cases named
*-skills asserted `expectOutput: 'skills'`. That substring was satisfied by
the case name in the harness's own line, so 2 of 8 cases asserted nothing
about the command -- gutting `skills` entirely would still have gone green.

Control lines are now excluded before matching, and both cases assert the
rendered help header, which only real help output produces. Verified on an
Ubuntu 24.04 host: 8/8 still pass against a stack-tip AppImage.

Also register the gate in reliability-gates.jsonc, which stablyai#15085 added a CI
Docker gate without. Red/green is recorded from a stock release AppImage
failing 4 of 8, three of them at status 133 (SIGTRAP).

* fix(linux): require static AppImage runtimes (stablyai#17319)

* test(linux): reject a wrong-architecture native binary at packaging time

Cross-building the arm64 slice on an x64 host silently packed an x86-64
`pty.node` -- the rebuild logged "Forcing native rebuild for linux-arm64" and
shipped the host's binary anyway. Every gate here inspects symbol versions,
which are perfectly valid on the wrong architecture, so nothing noticed.

Observed on a Raspberry Pi 5: the packaged app loaded, then failed with
"Failed to load native module: pty.node", and the launch contract reported
3 of 8 cases crashed rather than naming the cause. Swapping in the aarch64
`pty.node` took the same build to 8/8.

Compare ELF `e_machine` against the slice being packaged and fail with the
offending path. Checked before the glibc pass, because a wrong-architecture
binary's symbol versions are valid but meaningless and would send the reader
down the wrong path.

Release CI builds arm64 on a native runner, so this guards local and future
cross-builds rather than a shipped artifact.

* test(linux): judge per-arch vendored binaries against their own path

The first CI run of the architecture gate failed the x64 package job on
`@parcel/watcher-linux-arm64-glibc/watcher.node`. That binary is arm64 on
purpose: the package ships every architecture and its loader picks the match,
so its presence in an x64 build is correct.

Judge a binary against the architecture its own path names, falling back to
the slice when the path names none. That keeps the case this gate exists for
-- `bin/linux-arm64-*/node-pty.node` holding an x86-64 binary, which is what
shipped to a Raspberry Pi 5 -- while letting multi-arch dependencies through.

Dry-run over the real dependency tree flags nothing for either target arch.

* fix(linux): move deb/rpm update installation outside Orca (stablyai#17318)

* fix(linux): complete deb/rpm package metadata

* fix(linux): preserve CLI link during package upgrades

* docs(linux): document local RPM build prerequisites

* fix(linux): move deb/rpm update installation outside Orca

* fix(updater): preserve Linux recovery across stale events

* fix(updater): fence stale downloaded events by active target

* fix(updater): preserve active Linux package recovery

* test(linux): keep workflow order assertion in scope

* test(updater): assert stale recovery stays silent

* fix(updater): preserve Linux package recovery after checks

* refactor(updater): keep Linux marker message with status

* fix(linux): describe the right manual update path for deb/rpm hosts

A remote host installed from .deb or .rpm now reports
manual-service-update-required, and the guidance told the operator to
"update through the service manager that starts this server" -- which is
correct for unsupported-headless-serve but wrong for a package install,
where nothing about the remedy involves the service manager.

Say both, keyed on how the host was installed.

* docs(linux): document orcad update restart safety

* docs(linux): scope restart census omissions

* docs(linux): use absolute service CLI launcher

* fix(serve): validate in-process serve options before startup (stablyai#17683)

* fix(linux): stop offering updates a distro-managed install cannot apply (stablyai#17918)

Closes stablyai#17702.

The resources/package-type marker is authoritative but never checked against
the host, so any repackager that unpacks Orca's .deb -- AUR, Nix, a container
rebuild -- inherits `deb` verbatim. Install feasibility was then computed
after a ~165 MB download, so those users got check -> download -> a card
promising an install command -> a dead end.

Validate the marker against the host: a deb/rpm marker with no matching
package manager in the trusted directories means a package manager owns this
install. This reuses the exact lists and resolver that
buildLinuxPackageInstallCommand already loops over, so a false positive is
impossible by construction -- any host flagged here would have failed with
no-package-manager after the download anyway. The gate only moves that
verdict earlier. Verified across Debian 12, Ubuntu 24.04, Arch, Fedora 40 and
openSUSE Leap: no false positive on a real deb host, correct on every
repackaging host.

The release is still reported, because the user does want to know 1.4.194
exists and to update through their distro; only the download path is closed.
`externallyManaged` is an additive optional field on the existing `available`
status, so older paired clients decode it unchanged. downloadUpdate() refuses
authoritatively, since main owns this verdict rather than the card, and
unwinds any pinned-build state first -- a Linux pinned jump resolves to
'release', and stranding isPinnedBuildActive would silently kill every
background check for the rest of the process.

Note the fix the issue suggests cannot work: electron-updater builds a
PacmanUpdater whose doDownloadUpdate looks for a .pacman asset Orca does not
publish, then dereferences undefined.

* style(cli): restore prettier wrapping on install error copy

* test(linux): re-pin the child-process ratchets and the batch-shim allowlist after the merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant