[PR #3751] [MERGED] feat(noodle): isolate private accounts #6087

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

📋 Pull Request Information

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

Base: staging ← Head: noodl-split-1b-private-account-schema


📝 Commits (2)

  • ae235ef feat(noodle): isolate private accounts
  • 8288594 fix(noodle): address private account review

📊 Changes

8 files changed (+370 additions, -43 deletions)

View changed files

📝 docs/noodle/settings.md (+7 -0)
📝 packages/client/src/components/noodle/NoodleView.tsx (+30 -0)
📝 packages/client/src/hooks/use-noodle.ts (+10 -0)
📝 packages/server/src/db/schema/noodle.ts (+21 -13)
📝 packages/server/src/routes/noodle.routes.ts (+26 -0)
📝 packages/server/src/services/storage/noodle.storage.ts (+267 -30)
📝 packages/shared/src/schemas/noodle.schema.ts (+5 -0)
📝 packages/shared/src/types/noodle.ts (+4 -0)

📄 Description

Linked issue

Closes #3754

Why this change

NoodleR private-account creation previously required inserting a private row and separately writing a reverse link onto the public account. A failure between those writes could leave an orphan, while concurrent requests could create duplicate private accounts.

Private records also need a hard boundary from existing public Noodle queries and mutations before later NoodleR features build on them.

What changed

  • Added visibility and nullable publicAccountId fields to Noodle account rows.
  • Added a conditional unique constraint so one public account can own at most one private account.
  • Made private-account creation a single insert; the reverse relationship is derived from publicAccountId.
  • Added a default-off NoodleR access gate and gated private-account list/create endpoints.
  • Return a clean 409 when concurrent creation loses the unique-constraint race.
  • Scoped public account, post, interaction, digest, invite-reset, and timeline-reset operations so private data cannot be read, mutated, or deleted through public-mode paths.
  • Added the minimal NoodleR access setting stub and documented its default-off behavior.

Storage impact

This changes the persisted noodle_accounts row shape. No standalone migration script is required for the file-native backend: existing rows are normalized on load to visibility: "public" and publicAccountId: null.

Validation

  • Run pnpm check.
  • Run pnpm guard:installer-artifacts.
  • Run pnpm version:check.
  • Run pnpm regression.
  • Manually verify NoodleR access gating in a browser.
  • Manually verify public Noodle behavior with NoodleR enabled and disabled.

Automated evidence gathered while preparing this PR:

  • pnpm check passed, including TypeScript, ESLint, and production builds.
  • pnpm guard:installer-artifacts passed.
  • pnpm version:check passed.
  • Every deterministic non-browser lane reached by pnpm regression passed, including all Noodle regressions.
  • A final focused pnpm regression:noodle passed after isolation hardening.
  • smoke:ui could not run because the Playwright Chromium host is missing libnspr4.so; no browser automation host was connected for a substitute browser check.

Controlled concurrency and isolation proof

A temporary proof script was run against isolated file-native storage and removed before handoff. It used Promise.all for two HTTP creation requests against the same public account and verified:

  • Exactly one request returned 201 and the other returned 409.
  • Exactly one private row existed in live storage.
  • The row contained the expected publicAccountId; no reverse-link write or orphan was created.
  • The disabled feature gate returned 404.
  • Private accounts, posts, and interactions were inaccessible through public queries.
  • Public timeline reset preserved private data.
  • Reopened persisted storage still contained exactly one private account and preserved public-query isolation.

Manual verification needed

  • Manually verify the NoodleR access toggle in the Noodle settings UI.
  • Manually verify the gated private-account endpoint before and after enabling access.
  • Manually verify the public timeline, profile editing, interactions, and reset behavior with private fixture data present.

Summary by CodeRabbit

  • New Features

    • Added an optional NoodleR Access setting, disabled by default.
    • Enabled users can view available private creator accounts and see their loading status and count.
    • Added support for creating private creator accounts.
    • Public Noodle timelines, posts, interactions, and digests now exclude private-account data.
  • Documentation

    • Updated the Noodle settings guide with details about NoodleR access and private account visibility.

🔄 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/3751 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 7/17/2026 **Status:** ✅ Merged **Merged:** 7/17/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `noodl-split-1b-private-account-schema` --- ### 📝 Commits (2) - [`ae235ef`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ae235ef2b0fe3dea51a246b284268e207b2b0f07) feat(noodle): isolate private accounts - [`8288594`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8288594ac883c6bef429f2e1423f628b56924db4) fix(noodle): address private account review ### 📊 Changes **8 files changed** (+370 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `docs/noodle/settings.md` (+7 -0) 📝 `packages/client/src/components/noodle/NoodleView.tsx` (+30 -0) 📝 `packages/client/src/hooks/use-noodle.ts` (+10 -0) 📝 `packages/server/src/db/schema/noodle.ts` (+21 -13) 📝 `packages/server/src/routes/noodle.routes.ts` (+26 -0) 📝 `packages/server/src/services/storage/noodle.storage.ts` (+267 -30) 📝 `packages/shared/src/schemas/noodle.schema.ts` (+5 -0) 📝 `packages/shared/src/types/noodle.ts` (+4 -0) </details> ### 📄 Description ## Linked issue Closes #3754 ## Why this change NoodleR private-account creation previously required inserting a private row and separately writing a reverse link onto the public account. A failure between those writes could leave an orphan, while concurrent requests could create duplicate private accounts. Private records also need a hard boundary from existing public Noodle queries and mutations before later NoodleR features build on them. ## What changed - Added `visibility` and nullable `publicAccountId` fields to Noodle account rows. - Added a conditional unique constraint so one public account can own at most one private account. - Made private-account creation a single insert; the reverse relationship is derived from `publicAccountId`. - Added a default-off NoodleR access gate and gated private-account list/create endpoints. - Return a clean `409` when concurrent creation loses the unique-constraint race. - Scoped public account, post, interaction, digest, invite-reset, and timeline-reset operations so private data cannot be read, mutated, or deleted through public-mode paths. - Added the minimal NoodleR access setting stub and documented its default-off behavior. ## Storage impact This changes the persisted `noodle_accounts` row shape. No standalone migration script is required for the file-native backend: existing rows are normalized on load to `visibility: "public"` and `publicAccountId: null`. ## Validation - [ ] Run `pnpm check`. - [ ] Run `pnpm guard:installer-artifacts`. - [ ] Run `pnpm version:check`. - [ ] Run `pnpm regression`. - [ ] Manually verify NoodleR access gating in a browser. - [ ] Manually verify public Noodle behavior with NoodleR enabled and disabled. Automated evidence gathered while preparing this PR: - `pnpm check` passed, including TypeScript, ESLint, and production builds. - `pnpm guard:installer-artifacts` passed. - `pnpm version:check` passed. - Every deterministic non-browser lane reached by `pnpm regression` passed, including all Noodle regressions. - A final focused `pnpm regression:noodle` passed after isolation hardening. - `smoke:ui` could not run because the Playwright Chromium host is missing `libnspr4.so`; no browser automation host was connected for a substitute browser check. ## Controlled concurrency and isolation proof A temporary proof script was run against isolated file-native storage and removed before handoff. It used `Promise.all` for two HTTP creation requests against the same public account and verified: - Exactly one request returned `201` and the other returned `409`. - Exactly one private row existed in live storage. - The row contained the expected `publicAccountId`; no reverse-link write or orphan was created. - The disabled feature gate returned `404`. - Private accounts, posts, and interactions were inaccessible through public queries. - Public timeline reset preserved private data. - Reopened persisted storage still contained exactly one private account and preserved public-query isolation. ## Manual verification needed - Manually verify the NoodleR access toggle in the Noodle settings UI. - Manually verify the gated private-account endpoint before and after enabling access. - Manually verify the public timeline, profile editing, interactions, and reset behavior with private fixture data present. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added an optional **NoodleR Access** setting, disabled by default. * Enabled users can view available private creator accounts and see their loading status and count. * Added support for creating private creator accounts. * Public Noodle timelines, posts, interactions, and digests now exclude private-account data. * **Documentation** * Updated the Noodle settings guide with details about NoodleR access and private account visibility. <!-- 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:06:58 +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#6087
No description provided.