[PR #3977] [MERGED] Sandbox Professor Mari and restore Personal Extensions #6180

Closed
opened 2026-10-23 04:07:51 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3977
Author: @SpicyMarinara
Created: 7/23/2026
Status: ✅ Merged
Merged: 7/23/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feature/personal-extensions


📝 Commits (2)

  • 6103691 Sandbox Professor Mari and restore personal extensions
  • cde2f56 Apply CodeRabbit review fixes for sandbox and extension consent

📊 Changes

41 files changed (+4889 additions, -164 deletions)

View changed files

📝 CHANGELOG.md (+9 -0)
📝 README.md (+4 -0)
📝 docs/FAQ.md (+2 -0)
📝 docs/data/backup-and-restore.md (+4 -2)
📝 docs/development/frontend.md (+9 -0)
➕ docs/development/personal-extensions.md (+72 -0)
➕ docs/extending/personal-extensions.md (+78 -0)
📝 docs/home/professor-mari.md (+17 -4)
📝 docs/settings/settings-overview.md (+3 -2)
📝 e2e/core-flows.e2e.ts (+136 -0)
📝 package.json (+2 -1)
📝 packages/client/src/App.tsx (+2 -0)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+255 -13)
➕ packages/client/src/components/layout/PersonalExtensionInjector.tsx (+214 -0)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+17 -2)
➕ packages/client/src/components/panels/settings/PersonalExtensionsSettings.tsx (+815 -0)
➕ packages/client/src/hooks/use-personal-extensions.ts (+83 -0)
➕ packages/client/src/lib/personal-extension-import.ts (+182 -0)
➕ packages/client/src/lib/personal-extension-transfer.ts (+35 -0)
📝 packages/server/src/app.ts (+20 -12)

...and 21 more files

📄 Description

Linked issue

Closes #3973

Why this change

Professor Mari previously launched model-generated shell commands with the Marinara process user's host permissions. Setting the repository as cwd did not prevent reads outside the workspace, inherited-secret exposure, network access, or arbitrary host writes.

This PR also restores a deliberately local-only Personal Extensions path for code authored or imported by the user, including drafts written with Professor Mari, without restoring remote catalogs, URL installers, automatic updates, or transferable execution trust.

What changed

  • Confined Professor Mari raw shell commands with macOS Seatbelt or Linux Bubblewrap, denied network access, stripped inherited secrets, restricted filesystem access, and failed closed when no supported sandbox is available.
  • Prevented path traversal and symbolic-link escapes in structured workspace tools; made .env files and Git internals unreadable.
  • Kept ordinary source editing available while staging dependency manifests, lockfiles, launchers, installers, and CI changes for explicit in-chat approval.
  • Replaced raw package-manager mutations with an approval-gated public npm flow using exact resolved versions, registry integrity checks, scriptless installation, and rollback on failure.
  • Reintroduced Personal Extensions under Settings → Addons for desktop and mobile. New, changed, imported, restored, or transferred code stays disabled until the user approves its exact SHA-256 fingerprint.
  • Added separate browser and server runtimes with explicit full-trust warnings; Professor Mari can create or update disabled drafts but cannot approve or enable them.
  • Kept the retired /api/extensions surface removed and added local privileged /api/personal-extensions routes instead.
  • Updated backup/restore handling, documentation, release notes, deterministic regressions, and focused browser coverage.

Validation evidence

  • pnpm install --frozen-lockfile
  • pnpm check
  • pnpm version:check
  • pnpm regression:extensions-security
  • pnpm regression:professor-mari-shell-sandbox — passed with macOS Seatbelt
  • Linux container proof using Node 24 + Bubblewrap — passed with linux-bubblewrap; verified outside-file denial, network denial, secret stripping, .env denial, protected-manifest write denial, and permitted ordinary workspace writes
  • pnpm regression:request-security
  • Capability package lifecycle regression
  • Focused Playwright coverage for Personal Extension exact-code approval and Professor Mari dependency/sensitive-file reviews: 4/4 passed across desktop and mobile Chromium

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

Manual verification notes

  • Manually verify creating, approving, editing, disabling, importing, and exporting a Personal Browser Extension and Personal Server Extension.
  • Manually verify Professor Mari can still edit ordinary source files while sensitive files and dependencies wait for approval.
  • Manually verify the new Settings and approval surfaces in both light and dark themes on desktop and mobile.
  • Linux/Bubblewrap and macOS/Seatbelt isolation were exercised by automated runtime proofs; Windows intentionally fails closed for raw shell because no supported native sandbox is configured.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

Documentation and CHANGELOG.md are updated. There is no version bump.

UI evidence

No screenshots attached. Focused Playwright assertions cover the responsive Personal Extensions workflow and Professor Mari approval cards.

Summary by CodeRabbit

  • New Features
    • Added local-only Personal Extensions for browser and server customization.
    • Extensions remain disabled until users review and approve the exact code fingerprint.
    • Added import, export, revision history, rollback, storage, and restore support.
    • Professor Mari now provides review cards for sensitive file changes and exact npm dependency installations.
  • Security
    • Restricted raw shell commands with platform sandboxing, no outbound networking, limited file access, and fail-closed behavior.
  • Documentation
    • Added guides and updated FAQs covering Personal Extensions, approvals, backups, and Professor Mari safety controls.

🔄 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/3977 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/23/2026 **Status:** ✅ Merged **Merged:** 7/23/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feature/personal-extensions` --- ### 📝 Commits (2) - [`6103691`](https://github.com/Pasta-Devs/Marinara-Engine/commit/61036915d550878d83851454f0ad95088cc4258e) Sandbox Professor Mari and restore personal extensions - [`cde2f56`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cde2f56f9ef0513c4bdb45332627b6a454680134) Apply CodeRabbit review fixes for sandbox and extension consent ### 📊 Changes **41 files changed** (+4889 additions, -164 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+9 -0) 📝 `README.md` (+4 -0) 📝 `docs/FAQ.md` (+2 -0) 📝 `docs/data/backup-and-restore.md` (+4 -2) 📝 `docs/development/frontend.md` (+9 -0) ➕ `docs/development/personal-extensions.md` (+72 -0) ➕ `docs/extending/personal-extensions.md` (+78 -0) 📝 `docs/home/professor-mari.md` (+17 -4) 📝 `docs/settings/settings-overview.md` (+3 -2) 📝 `e2e/core-flows.e2e.ts` (+136 -0) 📝 `package.json` (+2 -1) 📝 `packages/client/src/App.tsx` (+2 -0) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+255 -13) ➕ `packages/client/src/components/layout/PersonalExtensionInjector.tsx` (+214 -0) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+17 -2) ➕ `packages/client/src/components/panels/settings/PersonalExtensionsSettings.tsx` (+815 -0) ➕ `packages/client/src/hooks/use-personal-extensions.ts` (+83 -0) ➕ `packages/client/src/lib/personal-extension-import.ts` (+182 -0) ➕ `packages/client/src/lib/personal-extension-transfer.ts` (+35 -0) 📝 `packages/server/src/app.ts` (+20 -12) _...and 21 more files_ </details> ### 📄 Description ## Linked issue Closes #3973 ## Why this change Professor Mari previously launched model-generated shell commands with the Marinara process user's host permissions. Setting the repository as `cwd` did not prevent reads outside the workspace, inherited-secret exposure, network access, or arbitrary host writes. This PR also restores a deliberately local-only Personal Extensions path for code authored or imported by the user, including drafts written with Professor Mari, without restoring remote catalogs, URL installers, automatic updates, or transferable execution trust. ## What changed - Confined Professor Mari raw shell commands with macOS Seatbelt or Linux Bubblewrap, denied network access, stripped inherited secrets, restricted filesystem access, and failed closed when no supported sandbox is available. - Prevented path traversal and symbolic-link escapes in structured workspace tools; made `.env` files and Git internals unreadable. - Kept ordinary source editing available while staging dependency manifests, lockfiles, launchers, installers, and CI changes for explicit in-chat approval. - Replaced raw package-manager mutations with an approval-gated public npm flow using exact resolved versions, registry integrity checks, scriptless installation, and rollback on failure. - Reintroduced Personal Extensions under **Settings → Addons** for desktop and mobile. New, changed, imported, restored, or transferred code stays disabled until the user approves its exact SHA-256 fingerprint. - Added separate browser and server runtimes with explicit full-trust warnings; Professor Mari can create or update disabled drafts but cannot approve or enable them. - Kept the retired `/api/extensions` surface removed and added local privileged `/api/personal-extensions` routes instead. - Updated backup/restore handling, documentation, release notes, deterministic regressions, and focused browser coverage. ## Validation evidence - `pnpm install --frozen-lockfile` - `pnpm check` - `pnpm version:check` - `pnpm regression:extensions-security` - `pnpm regression:professor-mari-shell-sandbox` — passed with macOS Seatbelt - Linux container proof using Node 24 + Bubblewrap — passed with `linux-bubblewrap`; verified outside-file denial, network denial, secret stripping, `.env` denial, protected-manifest write denial, and permitted ordinary workspace writes - `pnpm regression:request-security` - Capability package lifecycle regression - Focused Playwright coverage for Personal Extension exact-code approval and Professor Mari dependency/sensitive-file reviews: 4/4 passed across desktop and mobile Chromium ## 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` ### Manual verification notes - Manually verify creating, approving, editing, disabling, importing, and exporting a Personal Browser Extension and Personal Server Extension. - Manually verify Professor Mari can still edit ordinary source files while sensitive files and dependencies wait for approval. - Manually verify the new Settings and approval surfaces in both light and dark themes on desktop and mobile. - Linux/Bubblewrap and macOS/Seatbelt isolation were exercised by automated runtime proofs; Windows intentionally fails closed for raw shell because no supported native sandbox is configured. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) Documentation and `CHANGELOG.md` are updated. There is no version bump. ## UI evidence No screenshots attached. Focused Playwright assertions cover the responsive Personal Extensions workflow and Professor Mari approval cards. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added local-only Personal Extensions for browser and server customization. * Extensions remain disabled until users review and approve the exact code fingerprint. * Added import, export, revision history, rollback, storage, and restore support. * Professor Mari now provides review cards for sensitive file changes and exact npm dependency installations. * **Security** * Restricted raw shell commands with platform sandboxing, no outbound networking, limited file access, and fail-closed behavior. * **Documentation** * Added guides and updated FAQs covering Personal Extensions, approvals, backups, and Professor Mari safety controls. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:07:51 +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#6180
No description provided.