[PR #8419] [MERGED] fix(mari): allow MacPorts runtime reads in the macOS sandbox #8590

Closed
opened 2026-11-07 16:45:49 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8419
Author: @SpicyMarinara
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/8416-macports-sandbox-read-root


📝 Commits (1)

  • 0290d2e fix(mari): allow MacPorts runtime reads in the macOS sandbox

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 packages/server/src/services/professor-mari/workspace-shell-sandbox.ts (+1 -0)

📄 Description

Linked issue

Closes #8416

Why this change

On macOS, MacPorts Node can start from /opt/local/bin but its dynamic linker cannot read libraries in /opt/local/lib inside Professor Mari's sandbox. This prevents workspace shell commands and mari db transform from starting.

What changed

  • Add /opt/local to the existing macOS sandbox read roots, alongside the Homebrew prefix. This also permits MacPorts tools to read their shared data and configuration.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Tested revision: 0290d2ec5b1fabb532aa094caf02dc3a98884120.

  • pnpm install: passed.
  • pnpm check: passed, including formatting, localization, lint/type checks, and the production build.
  • Focused regressions: professor-mari/shell-sandbox, professor-mari/sandbox-secrets, and mari/db-execution-security each passed (3/3 files) with real macOS Seatbelt runtime proof.
  • A temporary profile-builder proof failed before the fix and passed after it when modeling an existing MacPorts prefix. For both writable shell and read-only transform profiles, the added read root was the only profile difference: write, process, and network rules were identical. The actual absent-directory case remained omitted. This proof does not install MacPorts or modify /opt/local.
  • No dedicated regression was added for the one-line allowlist change; the existing runtime security regressions were exercised.
  • Completed local CodeRabbit review covered the changed source file and reported zero findings.
  • Local Docker validation was unavailable: the configured OrbStack Docker socket does not exist, so no container build/runtime pass is claimed.

Manual verification notes

  • Manually verify workspace shell commands and mari db transform on a MacPorts Node installation, including successful dynamic-library loading.
  • This Mac has nvm Node and no /opt/local, so the reporter's exact MacPorts dyld failure has not been exercised locally.

Sandbox claim boundary

  • Core claim: an existing MacPorts prefix is included in the shared macOS read allowlist for workspace shells and DB transforms.
  • Risk: intentionally expands read access to the MacPorts prefix, matching the existing Homebrew policy.
  • Entry point: macosReadRoots, shared by buildMacosWorkspaceShellProfile and both command runners.
  • Negative controls verified: existing runtime tests preserve workspace write restrictions, secret-file protection and transform isolation; the profile comparison preserves process/network rules, and an absent MacPorts directory remains omitted.
  • No unsafe fallback, global filesystem changes, or MacPorts installation is part of this fix.

Docs and release impact

One server source line changes. No UI, docs, storage, dependency, version, or CHANGELOG.md changes.

UI evidence (if applicable)

Not applicable: no UI changes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8419 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/8416-macports-sandbox-read-root` --- ### 📝 Commits (1) - [`0290d2e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0290d2ec5b1fabb532aa094caf02dc3a98884120) fix(mari): allow MacPorts runtime reads in the macOS sandbox ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/professor-mari/workspace-shell-sandbox.ts` (+1 -0) </details> ### 📄 Description ## Linked issue Closes #8416 ## Why this change On macOS, MacPorts Node can start from /opt/local/bin but its dynamic linker cannot read libraries in /opt/local/lib inside Professor Mari's sandbox. This prevents workspace shell commands and mari db transform from starting. ## What changed - Add /opt/local to the existing macOS sandbox read roots, alongside the Homebrew prefix. This also permits MacPorts tools to read their shared data and configuration. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Tested revision: `0290d2ec5b1fabb532aa094caf02dc3a98884120`. - `pnpm install`: passed. - `pnpm check`: passed, including formatting, localization, lint/type checks, and the production build. - Focused regressions: professor-mari/shell-sandbox, professor-mari/sandbox-secrets, and mari/db-execution-security each passed (3/3 files) with real macOS Seatbelt runtime proof. - A temporary profile-builder proof failed before the fix and passed after it when modeling an existing MacPorts prefix. For both writable shell and read-only transform profiles, the added read root was the only profile difference: write, process, and network rules were identical. The actual absent-directory case remained omitted. This proof does not install MacPorts or modify /opt/local. - No dedicated regression was added for the one-line allowlist change; the existing runtime security regressions were exercised. - Completed local CodeRabbit review covered the changed source file and reported zero findings. - Local Docker validation was unavailable: the configured OrbStack Docker socket does not exist, so no container build/runtime pass is claimed. ### Manual verification notes - Manually verify workspace shell commands and mari db transform on a MacPorts Node installation, including successful dynamic-library loading. - This Mac has nvm Node and no /opt/local, so the reporter's exact MacPorts dyld failure has not been exercised locally. ### Sandbox claim boundary - Core claim: an existing MacPorts prefix is included in the shared macOS read allowlist for workspace shells and DB transforms. - Risk: intentionally expands read access to the MacPorts prefix, matching the existing Homebrew policy. - Entry point: macosReadRoots, shared by buildMacosWorkspaceShellProfile and both command runners. - Negative controls verified: existing runtime tests preserve workspace write restrictions, secret-file protection and transform isolation; the profile comparison preserves process/network rules, and an absent MacPorts directory remains omitted. - No unsafe fallback, global filesystem changes, or MacPorts installation is part of this fix. ## Docs and release impact One server source line changes. No UI, docs, storage, dependency, version, or CHANGELOG.md changes. ## UI evidence (if applicable) Not applicable: no UI changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:45:49 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8590
No description provided.