Skip to content

docs(linux): document orcad update restart safety - #17320

Merged
nwparker merged 5 commits into
nwparker/linux-cli-launch-contractfrom
nwparker/linux-orcad-restart-safety
Sep 2, 2026
Merged

nwparker merged 5 commits into
nwparker/linux-cli-launch-contractfrom
nwparker/linux-orcad-restart-safety

Conversation

@nwparker

@nwparker nwparker commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​708 $\color{#cf222e}{\Huge{\mathbf{−}}}$​47 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​661
Prod 23 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​506 $\color{#cf222e}{\Huge{\mathbf{−}}}$​179 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​327

ELI5

A PID-scoped orcad replacement can leave its detached terminal daemon alive, but a systemd service restart still kills every process in the service cgroup. The docs previously blurred those two operations and could lead an operator to destroy live agent work during an update.

What Changed

  • Distinguishes PID-scoped orcad replacement from cgroup-wide systemd stop/restart behavior.
  • Explains that KillMode=mixed preserves graceful teardown, not daemon or PTY survival.
  • Documents the current warm-adoption path for PID-scoped updates and legacy daemon protocol adapters.
  • Documents a fail-closed pre-maintenance census: the result must be fresh, untruncated, explicitly host-scoped, cover every host affected by the stop, list no terminals there, and account for every omission outside the service boundary.
  • Calls loss of contact or incomplete scope unverifiable instead of treating it as an empty result.
  • States that Orca does not yet provide an atomic census-and-stop fence.
  • Corrects decommissioning and health text so process ownership is not overclaimed.
  • Documents that ordinary Linux shells use orca-ide; bare orca is only Orca's terminal-scoped shim, preserving the GNOME Orca screen reader command.
  • Removes a stale reference to an unavailable internal design document.

Why

Replacing orcad through the built-in PID-owned deployment path and restarting a combined systemd unit have materially different process boundaries. Operators need that distinction before updating a host with live Claude Code, Codex, or OpenCode sessions.

Linked Issue

Refs #15956
Refs #5188

Visual Proof

N/A — documentation-only change; no rendered UI or interaction changes.

Testing

  • 2 changed test files / 15 tests
  • Formatting check for all touched Markdown and test files
  • Contract coverage for PID/cgroup wording, fail-closed census requirements, unavailable-design removal, and Linux CLI naming
  • The rebase repaired stale test merge artifacts and revalidated the intended shutdown/marker ordering assertion
  • git diff --check

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 7 of 7, stacked on #17318. It is the final documentation contract for the restart procedure after the package handoff.

  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

  • Documentation and documentation-contract tests only; no runtime, wire, mobile, persistence, provider, or package behavior changes; no mobile-facing RPC/protocol/pairing surface was touched.
  • Covers local, SSH/paired runtime, and systemd ownership boundaries without assuming a git worktree.
  • Does not recommend a global bare-orca symlink that could shadow the GNOME accessibility tool.

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

None. Documentation only — no code changes.

One documentation gap found in review and not fixed here: the KillMode=mixed section says the detached daemon is killed "when the stop completes", but never states that the stop itself blocks for systemd's default 90 second TimeoutStopSec while live agent terminals keep the cgroup non-empty. grep -c TimeoutStopSec over the file returns 0. An operator who reads this, runs the documented upgrade script with several live terminals, sees systemctl stop hang for 90s and assumes it wedged may kill -9 the main PID mid-stop — which skips the state flush that this same document's migration guarantee depends on.

Every other factual claim in the change was verified against code rather than comments: orcad's own restart calls disconnectDaemon() and never shutdownDaemon(); PID-scoped restart preserves PTYs; and the terminal-census fields (hostScope, omittedHostIds, truncated, totalCount) all exist with the documented "absent on older hosts" semantics.

@greptile-apps

greptile-apps Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Greptile Summary

The PR clarifies the difference between PID-scoped orcad replacement and cgroup-wide systemd restarts, emphasizing that systemd teardown does not preserve live terminal processes.

  • Documents restart boundaries, daemon adoption, and legacy protocol adapters.
  • Adds fail-closed pre-maintenance census guidance with explicit handling for omitted hosts and unverifiable results.
  • Corrects Linux CLI naming and removes a stale internal-design reference.
  • Adds documentation-contract tests for the revised operational guidance.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
docs/reference/orcad-operations.md Clarifies process-versus-cgroup lifecycle semantics and revises the census rule to account explicitly for omitted hosts outside the affected service boundary.
docs/reference/headless-linux-server.md Documents that service restarts destroy live cgroup-owned work and adds a fail-closed census procedure before upgrades.
docs/reference/ssh-execution-boundary.md Updates execution-boundary guidance consistently with the revised process-ownership terminology.
config/scripts/orcad-operations-restart-safety.test.mjs Adds contract checks for restart semantics, census requirements, launcher paths, and removal of the unavailable design reference.
config/scripts/headless-serve-shutdown-workflow.test.mjs Extends documentation checks for persisted-state wording, census scope, and ordinary Linux CLI naming.

Reviews (19): Last reviewed commit: "docs(linux): use absolute service CLI la..." | Re-trigger Greptile

Comment thread docs/reference/orcad-operations.md Resolved
@coderabbitai

coderabbitai Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

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: d794aa39-9c22-41ad-a557-2d80638c94b2

📥 Commits

Reviewing files that changed from the base of the PR and between 0a995cc and 3309abb.

📒 Files selected for processing (5)
  • config/scripts/headless-serve-shutdown-workflow.test.mjs
  • config/scripts/orcad-operations-restart-safety.test.mjs
  • docs/reference/headless-linux-server.md
  • docs/reference/orcad-operations.md
  • docs/reference/ssh-execution-boundary.md

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


📝 Walkthrough

Walkthrough

The changes document restart and shutdown behavior for headless Linux deployments. They distinguish persisted state from live processes, define orca-ide shell usage, and require a verified empty terminal census before cgroup-wide stops. The orcad reference separates PID-scoped stops from systemd cgroup teardown and updates decommissioning and health-field semantics. SSH documentation now aligns PTY states with these stop scopes. New tests validate the documented rules and remove an unavailable design-document reference.

Merge Risk: 🔵 Low · up to 3309a

The documentation now clearly separates safe PID-scoped updates from destructive systemd restarts and requires a fresh, complete empty-session check before maintenance. Because that check and the subsequent stop are not atomic, newly admitted work could still be interrupted during the transition; the change is mergeable with explicit owner awareness or follow-up on an atomic maintenance fence.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (3 skipped: 3 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: documenting Linux orcad update and restart safety.
Description check ✅ Passed The description is complete and aligned with the template. It explains the change and rationale, links related issues, documents testing, states that visual proof is not applicable, and completes the …
Full details: Docstring Coverage

Explanation

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

Full details: Description check

Explanation

The description is complete and aligned with the template. It explains the change and rationale, links related issues, documents testing, states that visual proof is not applicable, and completes the review and checklist sections.

  • 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.

@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch 6 times, most recently from 160c77d to 6b05ef2 Compare August 30, 2026 09:21
@nwparker
nwparker requested a review from brennanb2025 as a code owner August 30, 2026 09:21
@nwparker
nwparker changed the base branch from main to nwparker/linux-system-package-manual-update 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-orcad-restart-safety branch from 6b05ef2 to a65256a 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-orcad-restart-safety branch 2 times, most recently from 2916743 to f1b8ebc Compare August 31, 2026 00:24
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch 2 times, most recently from cb7594e to 5eb925b Compare August 31, 2026 01:09
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch 2 times, most recently from 24eed39 to ac48e2d Compare August 31, 2026 01:17
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch 2 times, most recently from 4a2ad72 to 9cf0382 Compare August 31, 2026 01:38
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch from ac48e2d to 79082e9 Compare August 31, 2026 01:38
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from 9cf0382 to 8b4b207 Compare August 31, 2026 03:13
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch 2 times, most recently from 4dcb42c to fd09d73 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-orcad-restart-safety branch from fd09d73 to ecbbcac Compare August 31, 2026 05:19
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from 106ae25 to 9c9f1f1 Compare August 31, 2026 06:02
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch from ecbbcac to 100c083 Compare August 31, 2026 06:05
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from b395a23 to 7bc3124 Compare August 31, 2026 13:04
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch from 6b034a2 to 903d821 Compare August 31, 2026 13:04
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch from 903d821 to 1486b1a Compare August 31, 2026 14:10
@nwparker

Copy link
Copy Markdown
Contributor Author

Restacked onto the updated #17318 head (ecdda0c5b91) after the Linux updater message deduplication pass. The three #17320 commits are preserved byte-for-byte by range-diff; CI is running on the new head.

@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from ecdda0c to 2fb6c24 Compare September 1, 2026 09:17
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch from 1486b1a to 1b1ca5d Compare September 1, 2026 09:18
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from 2fb6c24 to df041eb Compare September 1, 2026 10:07
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch from 1b1ca5d to ff0f27d Compare September 1, 2026 10:07
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from df041eb to 50b7959 Compare September 1, 2026 10:29
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch from ff0f27d to 7e37e1e Compare September 1, 2026 10:29
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from 50b7959 to 65d9706 Compare September 1, 2026 10:34
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch from 7e37e1e to 984b8cc Compare September 1, 2026 10:34
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from 65d9706 to afbdaee Compare September 1, 2026 10:41
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch from 984b8cc to cfda0c5 Compare September 1, 2026 10:41
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from afbdaee to 8390e2f Compare September 2, 2026 05:41
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch from 317d5c9 to b4809cb Compare September 2, 2026 05:45
@nwparker
nwparker force-pushed the nwparker/linux-system-package-manual-update branch from 8390e2f to 3c536aa Compare September 2, 2026 05:55
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch from b4809cb to 7ef9d5d Compare September 2, 2026 05:55
@nwparker
nwparker force-pushed the nwparker/linux-orcad-restart-safety branch from 7ef9d5d to e663823 Compare September 2, 2026 06:12
@nwparker
nwparker changed the base branch from nwparker/linux-system-package-manual-update to nwparker/linux-cli-launch-contract September 2, 2026 06:12
…ly (#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.
@nwparker
nwparker merged commit 39d20cf into nwparker/linux-cli-launch-contract Sep 2, 2026
36 of 37 checks passed
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.

1 participant