mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5985] [MERGED] fix: enforce package chat persistence permissions #7019
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7019
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5985
Author: @SpicyMarinara
Created: 9/9/2026
Status: ✅ Merged
Merged: 9/9/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/capability-persistence-permissions-5899📝 Commits (3)
bfcd3eechore: reserve package permission issue sweep2f22933fix: enforce package chat persistence permissions8713607Merge remote-tracking branch 'origin/staging' into fix/capability-persistence-permissions-5899📊 Changes
9 files changed (+416 additions, -26 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/development/optional-agent-packages.md(+15 -8)➕
e2e/capability-permissions.e2e.ts(+97 -0)📝
packages/client/src/components/agents/AgentCatalogView.tsx(+51 -8)📝
packages/client/src/localization/locales/en.json(+4 -0)📝
packages/server/src/services/capability-packages/capability-module-runtime.service.ts(+7 -3)📝
packages/server/src/services/capability-packages/capability-persistence.service.ts(+42 -7)📝
scripts/regressions/capability-package-lifecycle.regression.ts(+2 -0)➕
scripts/regressions/capability-persistence-permissions.regression.ts(+197 -0)📄 Description
Linked issue
Closes #5899.
Why this change
A package with no declared chat permissions still received unrestricted chat persistence methods. The catalog could also show a newer version's permissions as though they described the installed version.
What changed
Package activation builds the persistence host from its declared permissions. Chat/message/game-state and spatial-snapshot reads require chat-read; chat/message/event and snapshot writes require chat-write. Transactions retain the same checks, and package chat locks require at least one chat permission. Trusted Engine callers retain their existing host.
The existing catalog detail view shows installed permissions and, when different, the catalog version's permissions separately. It explains the API checks and model-command write scope while explicitly identifying network, storage and UI as trusted-code access declarations. These checks do not sandbox package JavaScript or change the existing exact-version/checksum install approval flow.
Validation
Passed
pnpm check,capability-persistence-permissions.regression.ts, the package lifecycle/readiness regression, and the Game Master verb runtime regression. The new proof activates four real local package modules through registry loading, file digest verification, runtime snapshots and service registration. It tests no permissions, read-only, write-only and both permissions against actual file storage; denied methods, nested transaction sessions, chat locks, persisted positive writes and manifest-array mutation are covered. The same proof fails against the original activation/persistence code because a denied read succeeds. Updated the existing readiness fixtures to declare the chat reads they perform.Passed 6 browser cases across desktop Chromium, mobile Chromium and mobile WebKit, covering empty/read-only installed permissions, differing update permissions and reloads. Captured both themes and inspected mobile screenshots. The UI cases use catalog/installed API fixtures; the separate server proof uses actual package activation and persistence. Screenshots are attached to the browser test artifacts.
Docs and release impact
Updated the optional-package contributor guide, English UI copy and Unreleased changelog. Translation follow-up: #5986. Packages that use undeclared chat APIs must add the relevant permission to their manifest; this is an API enforcement change, not a JavaScript sandbox.
Summary by CodeRabbit
New Features
chat-readandchat-writepermissions for chat and spatial snapshot access, including transactions.Documentation
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.