[PR #6446] [CLOSED] Add a private notebook with scoped revision-safe notes #7183

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6446
Author: @SirAdoni
Created: 9/20/2026
Status: ❌ Closed

Base: staging ← Head: contrib/e24-private-notebook


📝 Commits (1)

  • 6355aa4 feat(notebook): add private scoped revision-safe notes

📊 Changes

24 files changed (+2432 additions, -62 deletions)

View changed files

📝 CHANGELOG.md (+3 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+128 -27)
📝 packages/client/src/components/chat/ChatConversationSurface.tsx (+6 -0)
📝 packages/client/src/components/chat/ChatHelpOverlay.tsx (+9 -2)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+16 -0)
📝 packages/client/src/components/chat/ChatToolbarControls.tsx (+15 -3)
📝 packages/client/src/components/chat/ConversationView.tsx (+6 -0)
➕ packages/client/src/components/chat/PrivateNotebookPanel.tsx (+672 -0)
📝 packages/client/src/components/game/GameSurface.tsx (+2 -0)
➕ packages/client/src/hooks/use-private-notebook.ts (+69 -0)
📝 packages/client/src/localization/locales/en.json (+32 -0)
📝 packages/server/src/db/file-backed-store.ts (+16 -6)
📝 packages/server/src/routes/index.ts (+2 -0)
➕ packages/server/src/routes/private-notebook.routes.ts (+57 -0)
📝 packages/server/src/services/mari-db/mari-db.service.ts (+110 -18)
📝 packages/server/src/services/mari-db/mari-transform-sandbox.ts (+20 -4)
➕ packages/server/src/services/private-notebook.service.ts (+227 -0)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+8 -0)
📝 packages/server/src/services/professor-mari/workspace-change-review.service.ts (+71 -2)
📝 packages/server/src/services/storage/characters.storage.ts (+2 -0)

...and 4 more files

📄 Description

Linked issue

Closes #6433

Why this change

Players need a place to write private notes without adding those notes to model context. Notes must survive reloads and scope changes without silently overwriting a newer revision from another view.

What changed

  • Add a private notebook accessible from chat and Game Mode, with global, character, chat and branch-family scopes where available.
  • Autosave through a serialized revision-aware flow; retain local text on conflicts and offer explicit reload or save-mine handling.
  • Add bounded, validated GET/PUT endpoints with no-store responses, scope ownership checks and durable writes. Nested durable transactions upgrade the outer commit while preserving rollback behavior.
  • Clean up owner-specific notes when a chat or character is permanently deleted, retaining family notes while another family member exists.
  • Keep notebook rows out of assembled prompts and generic Professor Mari database reads, search, counts and transform input. Reject indirect owner deletion that would discard protected notes through those generic commands.
  • Guard managed notebook storage and backups in workspace reads, transform script access and actual mari code Git output. Preserve ordinary source-file inspection.
  • Add English localization, an Unreleased entry and a runnable storage/API/privacy regression.

Notes are private application data, not encrypted secrets. Existing installation/OS access controls still apply. The Node transform fallback is not claimed to be a malicious-code security boundary.

Validation

Passed localization, formatting, lint, E2E/token types, server/client/shared TypeScript and production build with repository-pinned Corepack pnpm. The root check's context stage is blocked by the Windows checkout's tracked skills symlink being represented as a text file; the unchanged context and skill target passed the real guard in an isolated copy. No tracked skill or build-policy changes are included.

The storage/API regression passed save/read/reload, scope isolation, revision conflict, corrupt records, lifecycle cleanup, nested durable commit/rollback and prompt exclusion. After parent security review, it additionally exercised a real transform reading its supplied table context and a real mari code Git diff over synthetic tracked storage/backups: private rows/content were absent while ordinary source changes remained visible.

An isolated Chromium session passed two existing chat smoke cases and a focused notebook fixture covering toolbar opening, typing/autosave, scope switching, close/reopen, reload and conflict draft retention. Notebook HTTP responses were mocked for that browser proof; the separate API regression uses real application storage/routes. No live campaign or provider calls were used. Privacy review classified the sole email match as a reserved synthetic example.invalid test identity; no personal data is included.

  • 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

  • Use real notes across all available scopes, reload and switch chats/branches, verifying scope labels and persistence.
  • Edit the same document from two views and verify conflict recovery preserves the intended text.
  • Verify light/dark/mobile presentation, keyboard focus, close handling and owner deletion behavior.
  • Review notebook privacy against the installed Professor Mari tools and supported OS sandbox configurations.
  • Complete required CI and CodeRabbit review before merge. This AI-assisted PR remains draft; human validation boxes are intentionally unchecked.

Docs and release impact

Localized UI/help text and Unreleased changelog included. No release metadata or user-facing docs under docs/ changed.

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Browser fixtures use synthetic notes. Private campaigns, screenshots, local paths and credentials are excluded.


🔄 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/6446 **Author:** [@SirAdoni](https://github.com/SirAdoni) **Created:** 9/20/2026 **Status:** ❌ Closed **Base:** `staging` ← **Head:** `contrib/e24-private-notebook` --- ### 📝 Commits (1) - [`6355aa4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6355aa47b3e0a22984846b01b9402ebec078d342) feat(notebook): add private scoped revision-safe notes ### 📊 Changes **24 files changed** (+2432 additions, -62 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+3 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+128 -27) 📝 `packages/client/src/components/chat/ChatConversationSurface.tsx` (+6 -0) 📝 `packages/client/src/components/chat/ChatHelpOverlay.tsx` (+9 -2) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+16 -0) 📝 `packages/client/src/components/chat/ChatToolbarControls.tsx` (+15 -3) 📝 `packages/client/src/components/chat/ConversationView.tsx` (+6 -0) ➕ `packages/client/src/components/chat/PrivateNotebookPanel.tsx` (+672 -0) 📝 `packages/client/src/components/game/GameSurface.tsx` (+2 -0) ➕ `packages/client/src/hooks/use-private-notebook.ts` (+69 -0) 📝 `packages/client/src/localization/locales/en.json` (+32 -0) 📝 `packages/server/src/db/file-backed-store.ts` (+16 -6) 📝 `packages/server/src/routes/index.ts` (+2 -0) ➕ `packages/server/src/routes/private-notebook.routes.ts` (+57 -0) 📝 `packages/server/src/services/mari-db/mari-db.service.ts` (+110 -18) 📝 `packages/server/src/services/mari-db/mari-transform-sandbox.ts` (+20 -4) ➕ `packages/server/src/services/private-notebook.service.ts` (+227 -0) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+8 -0) 📝 `packages/server/src/services/professor-mari/workspace-change-review.service.ts` (+71 -2) 📝 `packages/server/src/services/storage/characters.storage.ts` (+2 -0) _...and 4 more files_ </details> ### 📄 Description ## Linked issue Closes #6433 ## Why this change Players need a place to write private notes without adding those notes to model context. Notes must survive reloads and scope changes without silently overwriting a newer revision from another view. ## What changed - Add a private notebook accessible from chat and Game Mode, with global, character, chat and branch-family scopes where available. - Autosave through a serialized revision-aware flow; retain local text on conflicts and offer explicit reload or save-mine handling. - Add bounded, validated GET/PUT endpoints with no-store responses, scope ownership checks and durable writes. Nested durable transactions upgrade the outer commit while preserving rollback behavior. - Clean up owner-specific notes when a chat or character is permanently deleted, retaining family notes while another family member exists. - Keep notebook rows out of assembled prompts and generic Professor Mari database reads, search, counts and transform input. Reject indirect owner deletion that would discard protected notes through those generic commands. - Guard managed notebook storage and backups in workspace reads, transform script access and actual mari code Git output. Preserve ordinary source-file inspection. - Add English localization, an Unreleased entry and a runnable storage/API/privacy regression. Notes are private application data, not encrypted secrets. Existing installation/OS access controls still apply. The Node transform fallback is not claimed to be a malicious-code security boundary. ## Validation Passed localization, formatting, lint, E2E/token types, server/client/shared TypeScript and production build with repository-pinned Corepack pnpm. The root check's context stage is blocked by the Windows checkout's tracked skills symlink being represented as a text file; the unchanged context and skill target passed the real guard in an isolated copy. No tracked skill or build-policy changes are included. The storage/API regression passed save/read/reload, scope isolation, revision conflict, corrupt records, lifecycle cleanup, nested durable commit/rollback and prompt exclusion. After parent security review, it additionally exercised a real transform reading its supplied table context and a real mari code Git diff over synthetic tracked storage/backups: private rows/content were absent while ordinary source changes remained visible. An isolated Chromium session passed two existing chat smoke cases and a focused notebook fixture covering toolbar opening, typing/autosave, scope switching, close/reopen, reload and conflict draft retention. Notebook HTTP responses were mocked for that browser proof; the separate API regression uses real application storage/routes. No live campaign or provider calls were used. Privacy review classified the sole email match as a reserved synthetic example.invalid test identity; no personal data is included. - [ ] `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 - [ ] Use real notes across all available scopes, reload and switch chats/branches, verifying scope labels and persistence. - [ ] Edit the same document from two views and verify conflict recovery preserves the intended text. - [ ] Verify light/dark/mobile presentation, keyboard focus, close handling and owner deletion behavior. - [ ] Review notebook privacy against the installed Professor Mari tools and supported OS sandbox configurations. - [ ] Complete required CI and CodeRabbit review before merge. This AI-assisted PR remains draft; human validation boxes are intentionally unchecked. ## Docs and release impact Localized UI/help text and Unreleased changelog included. No release metadata or user-facing docs under docs/ changed. - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Browser fixtures use synthetic notes. Private campaigns, screenshots, local paths and credentials are excluded. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:17:18 +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#7183
No description provided.