Repository navigation
feat: add opt-in Linux host-root access - #24
Conversation
Reject persisted host-root state on non-Linux systems, verify final Compose merge semantics, and restore or stop the runtime when an access-mode activation fails.
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (21)
📝 WalkthroughWalkthroughThe PR adds an opt-in Linux host-root installation mode, persists access settings through configuration and Compose, supports Arch-family Docker setup, adds rollback handling, and publishes the prerelease through a selectable ChangesHost-root installation and runtime
Release and documentation
Estimated code review effort: 5 (Critical) | ~90 minutes Sequence Diagram(s)sequenceDiagram
participant Operator
participant Launcher
participant Compose
participant Core
participant CLI
Operator->>Launcher: install --access host-root
Launcher->>Compose: write and load host-access overlay
Compose->>Core: mount /host read-only
Compose->>CLI: mount /host read-write
CLI->>CLI: run as container root when enabled
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
Replace the private acceptance target identifier with a generic live-installation boundary so the sanitized export remains publishable.
There was a problem hiding this comment.
Actionable comments posted: 8
🧹 Nitpick comments (3)
packages/run-spaceapp/src/cli.mjs (1)
609-623: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDuplicated usage string.
The same usage message is constructed twice; extract it once.
♻️ Suggested refactor
function parseInstallArgs(args) { + const usage = `Usage: ${UNIVERSAL_COMMAND} install [--profile auto|light|standard] [--access isolated|host-root] [--no-open]`; let requestedProfile = "auto";and replace both
throw new Error(...)bodies withthrow new Error(usage);.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/run-spaceapp/src/cli.mjs` around lines 609 - 623, Extract the repeated install usage text into a shared `usage` variable near the validation logic, then replace both `throw new Error(...)` constructions in the `install` argument checks with `throw new Error(usage)`.packages/run-spaceapp/tests/cli.test.mjs (1)
647-647: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueVersion literals are duplicated across assertions.
These now hardcode
0.1.15-hostroot.0in several places and must be edited on every release. ImportingPACKAGE_VERSIONfromsrc/package-info.mjswould keep them in sync.Also applies to: 680-681, 715-718
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/run-spaceapp/tests/cli.test.mjs` at line 647, Update the assertions in the CLI tests, including the referenced ranges, to import and reuse PACKAGE_VERSION from src/package-info.mjs instead of hardcoding 0.1.15-hostroot.0; preserve the existing regular-expression matching behavior while deriving every version expectation from that shared value.packages/run-spaceapp/src/prerequisites.mjs (1)
646-672: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOnly the Arch branch uses
idFamily.Debian/Ubuntu and Fedora/RHEL derivatives still match on
IDalone, so e.g. Linux Mint or Rocky fall through to the unsupported message even thoughID_LIKEidentifies them. Consider usingidFamilyconsistently for all three branches (keepingidfor codename/repo selection).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/run-spaceapp/src/prerequisites.mjs` around lines 646 - 672, Update the distribution checks in the Docker engine installation flow to use idFamily for Debian/Ubuntu and Fedora/RHEL branches, so ID_LIKE derivatives such as Mint and Rocky are recognized. Keep using the original id when passing the Debian codename and selecting repository-specific behavior, and leave the existing Arch branch unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yml:
- Around line 10-17: Update the release workflow’s npm_tag handling to enforce
the invariant that versions containing the host-root marker map exclusively to
the personal tag, preventing them from publishing to next; either derive the tag
from inputs.version or add a pre-publish validation guard, and extend the
workflow test to cover this mapping.
- Around line 360-361: Update the “Publish sanitized tarball to selected
prerelease channel” step so the workflow expression for inputs.npm_tag is
assigned through the step’s env configuration, then reference that environment
variable as "$RELEASE_DIST_TAG" in the npm publish command. Keep the existing
artifact path, provenance flag, and publish behavior unchanged.
In `@deploy/docker/cli-entrypoint.sh`:
- Around line 23-25: Update the host-root handling in cli-entrypoint.sh so
root-created state under /var/lib/spaceapp-cli cannot block later isolated
sessions. Before launching the isolated-mode path, recursively restore ownership
of that state directory to spaceapp, or otherwise ensure host-root sessions use
a separate state directory; preserve the existing root-mode execution through
packages/cli-host/dist/main.js.
In `@docs/clean-room-testing.md`:
- Around line 101-104: Add an explicit effective-user verification to the
container-root execution procedure, using a command such as id -u and requiring
UID 0 before accepting host-root behavior. Keep the existing mount permission,
file mutation, and isolation checks unchanged.
In `@packages/run-spaceapp/README.md`:
- Around line 71-72: Keep all prerelease follow-up commands on the same launcher
channel: update the provider, token, credentials, and uninstall examples in
packages/run-spaceapp/README.md (lines 71-72), the token-rotation example in
README.md (lines 118-119), and the rollback example in docs/operations.md (lines
122-124) to use `@personal`, or explicitly document any intentional `@latest`
exception.
- Around line 61-64: Update the security description in the README paragraph to
distinguish the CLI service’s read/write host-root mount from the core service’s
read-only /host mount. Preserve the existing warnings and clarify that
spaceapp-core receives the host mount read-only.
In `@packages/run-spaceapp/src/cli.mjs`:
- Around line 507-513: Update the failed-install recovery flow around
restoreRuntimeAfterFailedInstall so the previous runtime is re-committed to the
persistent root before recovery completes, and restart it using paths under root
rather than stagedStateRoot. Ensure failAfterRuntimeMutation and subsequent
Compose operations no longer retain references to the temporary directory that
the finally block removes.
In `@scripts/public-release-readiness.mjs`:
- Line 8: Replace the versionPattern validators in
scripts/public-release-readiness.mjs (line 8),
scripts/release-artifact-preflight.mjs (line 7), and
scripts/verify-published-containers.mjs (line 7) with a complete SemVer
validator that rejects leading zeros in numeric core and prerelease identifiers
while accepting valid build metadata such as 1.0.0+build.123; keep all release
gates consistent with the package version contract.
---
Nitpick comments:
In `@packages/run-spaceapp/src/cli.mjs`:
- Around line 609-623: Extract the repeated install usage text into a shared
`usage` variable near the validation logic, then replace both `throw new
Error(...)` constructions in the `install` argument checks with `throw new
Error(usage)`.
In `@packages/run-spaceapp/src/prerequisites.mjs`:
- Around line 646-672: Update the distribution checks in the Docker engine
installation flow to use idFamily for Debian/Ubuntu and Fedora/RHEL branches, so
ID_LIKE derivatives such as Mint and Rocky are recognized. Keep using the
original id when passing the Debian codename and selecting repository-specific
behavior, and leave the existing Arch branch unchanged.
In `@packages/run-spaceapp/tests/cli.test.mjs`:
- Line 647: Update the assertions in the CLI tests, including the referenced
ranges, to import and reuse PACKAGE_VERSION from src/package-info.mjs instead of
hardcoding 0.1.15-hostroot.0; preserve the existing regular-expression matching
behavior while deriving every version expectation from that shared value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 48ce503f-8214-44d0-8cc2-6305c53db33c
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (29)
.github/workflows/release.ymlREADME.mddeploy/docker/cli-entrypoint.shdocs/clean-room-testing.mddocs/decisions/ADR-011-linux-host-root-access.mddocs/getting-started.mddocs/operations.mddocs/public-release.mddocs/security-model.mddocs/specs/linux-host-root-access.mdpackages/run-spaceapp/README.mdpackages/run-spaceapp/package.jsonpackages/run-spaceapp/src/cli.mjspackages/run-spaceapp/src/index.mjspackages/run-spaceapp/src/package-info.mjspackages/run-spaceapp/src/prerequisites.mjspackages/run-spaceapp/tests/cli.test.mjspackages/run-spaceapp/tests/command-contracts.test.mjspackages/run-spaceapp/tests/config.test.mjspackages/run-spaceapp/tests/prerequisites.test.mjspackages/run-spaceapp/tests/runtime.test.mjsscripts/public-release-readiness.mjsscripts/release-artifact-preflight.mjsscripts/tests/public-compose-config.test.mjsscripts/tests/public-docker-distribution.test.mjsscripts/tests/public-package-metadata.test.mjsscripts/tests/public-release-readiness.test.mjsscripts/tests/public-workflows.test.mjsscripts/verify-published-containers.mjs
| npm_tag: | ||
| description: npm prerelease channel | ||
| required: true | ||
| default: next | ||
| type: choice | ||
| options: | ||
| - next | ||
| - personal |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Enforce the host-root version-to-tag invariant.
packages/run-spaceapp/src/package-info.mjs maps -hostroot. versions to personal, while this input defaults to next and permits next for the same version. A normal dispatch can therefore publish 0.1.15-hostroot.0 to next while the documented @personal command remains stale. Add a pre-publish guard or derive the tag from inputs.version; update the workflow test with that invariant.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/release.yml around lines 10 - 17, Update the release
workflow’s npm_tag handling to enforce the invariant that versions containing
the host-root marker map exclusively to the personal tag, preventing them from
publishing to next; either derive the tag from inputs.version or add a
pre-publish validation guard, and extend the workflow test to cover this
mapping.
Summary
--access isolated|host-rootinstallation mode/at/hostread-only in core and read/write in the CLI service0.1.15-hostroot.0for the npmpersonaltag without changinglatestSecurity boundaries
--access isolatedremoves/hostwhile preserving persistent stateVerification
npm run test:publicnpm run checknpm run buildnpm audit --audit-level=high(0 vulnerabilities)npm run pack:dry-run -w run-spaceappnpm run hygiene:statusnpm run hygiene:preflightnode scripts/public-release-readiness.mjs --version 0.1.15-hostroot.0The repository-wide
npm teststill stops at the pre-existing@space/contractsworkspace because it declares
vitest runbut contains no test files. Thecanonical CI and release command is
npm run test:public, which passes.Rollout
After required CI and review are green, merge to
main, then dispatch the OIDCrelease with version
0.1.15-hostroot.0and npm tagpersonal. Keeplatestand
nextunchanged. Real CachyOS acceptance remains required before handingthe install command to the owner.
Rollback
Before publish: close this PR and delete the feature branch. After publish:
restore npm dist-tags if any protected tag changed, keep immutable exact-version
artifacts for audit, and switch the test installation back to isolated mode.
Summary by CodeRabbit
New Features
--access isolated|host-root, with isolated access remaining the default.nextorpersonalnpm tag.pacman.Bug Fixes
Documentation