[PR #3795] [MERGED] feat(noodle): add private generation operation #6106

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

📋 Pull Request Information

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

Base: staging ← Head: noodl-split-4-private-generation


📝 Commits (3)

  • c73e79b feat(noodle): add private generation operation
  • e9f2246 Merge branch 'staging' into noodl-split-4-private-generation
  • b83d7c6 fix(noodle): honor agent debug logging

📊 Changes

10 files changed (+402 additions, -18 deletions)

View changed files

📝 packages/client/src/hooks/use-noodle.ts (+1 -0)
📝 packages/server/src/routes/noodle.routes.ts (+31 -2)
➕ packages/server/src/services/noodle/noodle-generation-log.ts (+5 -0)
➕ packages/server/src/services/noodle/noodle-private-generation.service.ts (+175 -0)
📝 packages/server/src/services/noodle/noodle-public-generation.service.ts (+1 -4)
📝 packages/server/src/services/noodle/noodle-refresh-scheduler.service.ts (+1 -1)
📝 packages/server/src/services/noodle/noodle-response-format.ts (+15 -3)
📝 packages/server/src/services/storage/noodle.storage.ts (+50 -0)
📝 packages/shared/src/schemas/noodle.schema.ts (+55 -5)
📝 scripts/regressions/noodle-prompt.regression.ts (+68 -3)

📄 Description

IMPORTANT: NOODLER IMPLEMENTATION PLAN - SLICE 4. This PR is Slice 4, the private generation operation. It builds on Slice 1A (#3744), Slice 1B (#3751), Slice 2 (#3759), and Slice 3 (#3782). Later NoodleR capabilities, including stage identity and guided-generation UI, subscriptions and access, fan activity, automatic posting, cross-mode integration, and creator-project orchestration, remain intentionally out of scope.

Linked issue

Closes #3793

Summary

  • Add generatePrivatePost() as a typed, single-account operation beside the public generation service established in Slice 3.
  • Replace the flattened refresh request with strict mode: "public" and mode: "private" schema variants.
  • Restrict targetAccountId, privatePostGuide, and privateProjectWork to the private variant at both the Zod-schema and inferred-TypeScript levels.
  • Add private-only post list/get/create storage operations without widening existing public account or post reads.
  • Keep private generation out of public participant selection, interactions, follows, digests, bootstrap data, and refresh-run history.
  • Preserve generated private image prompts for a later private-media workflow without serving private generated image files in this slice.

Why

The original oversized NoodleR implementation added private targeted generation as optional branches throughout the public timeline pipeline. That allowed public-mode requests to carry private-only fields and coupled one private creator post to public participant selection, timeline activity, refresh runs, and later NoodleR policies.

This slice resolves P2 Finding 4 by making public and private generation different typed operations. The route validates and dispatches the discriminated request, but the private service never calls or branches inside the public generation service.

Known limitations

  • This PR adds the server operation only; Slice 5 owns stage identity, disclosure rules, and guided-generation UI.
  • privatePostGuide and privateProjectWork are bounded instruction strings only. They do not define modal controls, project IDs, milestone lifecycle, access tiers, or scheduling behavior.
  • Private image prompts are persisted, but private image generation/review/serving is intentionally deferred until a private media path can enforce isolation.
  • No public client path invokes private generation yet; current public refresh callers now send mode: "public" explicitly.
  • The full pnpm regression command passed every deterministic/non-browser lane, then Playwright failed before executing browser assertions because Chromium could not load the host library libnspr4.so.

Test plan

  • Run pnpm check.
  • Run pnpm guard:installer-artifacts.
  • Run pnpm regression:noodle.
  • Run pnpm regression on a host with Playwright Chromium dependencies installed.
  • Verify a public request containing targetAccountId returns HTTP 400 before generation starts.
  • Verify a public request containing privatePostGuide returns HTTP 400 before generation starts.
  • Verify a public request containing privateProjectWork returns HTTP 400 before generation starts.
  • Verify a private request targeting a public account returns 404 and creates no post.
  • Verify a private request targeting a private account creates exactly one private post.
  • Verify the private post is absent from public account, post, bootstrap, digest, and refresh-run reads.
  • Verify two concurrent requests for the same private account return one generation and one conflict response.
  • Verify separate private accounts can generate independently.
  • Verify malformed model output receives one correction attempt and valid corrected output persists.
  • Verify NoodleR-disabled private requests return 404 without revealing connection configuration.

Validation notes

A temporary deterministic service fixture used isolated file storage and a local OpenAI-compatible provider. It returned malformed output first and valid corrected output second. The proof confirmed one private post was persisted, its image prompt remained private with no served image URL, and the private account/post did not appear in public account, post, bootstrap, digest, or refresh-run reads. The temporary fixture was removed before commit.

pnpm check, pnpm guard:installer-artifacts, and pnpm regression:noodle passed locally. Every deterministic/non-browser lane in pnpm regression also passed. Playwright could not launch Chromium because libnspr4.so is missing from the host, so no browser assertions were personally verified.

Docs touched

None. This slice adds an internal generation operation and request contract but no user-facing NoodleR generation workflow. User-facing documentation belongs with the later slice that exposes the operation in the UI.

Summary by CodeRabbit

  • New Features

    • Added support for generating private posts for private accounts.
    • Added private post content, image prompts, polls, and optional guidance to generation requests.
    • Added storage and retrieval for private posts.
    • Added validation for public and private generation request formats.
  • Bug Fixes

    • Refresh requests now explicitly identify public generation mode.
    • Added safeguards to prevent duplicate private generations for the same account.

🔄 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/3795 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 7/18/2026 **Status:** ✅ Merged **Merged:** 7/18/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `noodl-split-4-private-generation` --- ### 📝 Commits (3) - [`c73e79b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c73e79bb46fa61044e69a1e3111952631d4e1276) feat(noodle): add private generation operation - [`e9f2246`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e9f224664d070d60cc4820015b18b4477dcc32c3) Merge branch 'staging' into noodl-split-4-private-generation - [`b83d7c6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b83d7c6a2992a14a93a6dded5b2daa47d7f94e6b) fix(noodle): honor agent debug logging ### 📊 Changes **10 files changed** (+402 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/hooks/use-noodle.ts` (+1 -0) 📝 `packages/server/src/routes/noodle.routes.ts` (+31 -2) ➕ `packages/server/src/services/noodle/noodle-generation-log.ts` (+5 -0) ➕ `packages/server/src/services/noodle/noodle-private-generation.service.ts` (+175 -0) 📝 `packages/server/src/services/noodle/noodle-public-generation.service.ts` (+1 -4) 📝 `packages/server/src/services/noodle/noodle-refresh-scheduler.service.ts` (+1 -1) 📝 `packages/server/src/services/noodle/noodle-response-format.ts` (+15 -3) 📝 `packages/server/src/services/storage/noodle.storage.ts` (+50 -0) 📝 `packages/shared/src/schemas/noodle.schema.ts` (+55 -5) 📝 `scripts/regressions/noodle-prompt.regression.ts` (+68 -3) </details> ### 📄 Description > **IMPORTANT: NOODLER IMPLEMENTATION PLAN - SLICE 4.** This PR is Slice 4, the private generation operation. It builds on Slice 1A (#3744), Slice 1B (#3751), Slice 2 (#3759), and Slice 3 (#3782). Later NoodleR capabilities, including stage identity and guided-generation UI, subscriptions and access, fan activity, automatic posting, cross-mode integration, and creator-project orchestration, remain intentionally out of scope. ## Linked issue Closes #3793 ## Summary - Add `generatePrivatePost()` as a typed, single-account operation beside the public generation service established in Slice 3. - Replace the flattened refresh request with strict `mode: "public"` and `mode: "private"` schema variants. - Restrict `targetAccountId`, `privatePostGuide`, and `privateProjectWork` to the private variant at both the Zod-schema and inferred-TypeScript levels. - Add private-only post list/get/create storage operations without widening existing public account or post reads. - Keep private generation out of public participant selection, interactions, follows, digests, bootstrap data, and refresh-run history. - Preserve generated private image prompts for a later private-media workflow without serving private generated image files in this slice. ## Why The original oversized NoodleR implementation added private targeted generation as optional branches throughout the public timeline pipeline. That allowed public-mode requests to carry private-only fields and coupled one private creator post to public participant selection, timeline activity, refresh runs, and later NoodleR policies. This slice resolves P2 Finding 4 by making public and private generation different typed operations. The route validates and dispatches the discriminated request, but the private service never calls or branches inside the public generation service. ## Known limitations - This PR adds the server operation only; Slice 5 owns stage identity, disclosure rules, and guided-generation UI. - `privatePostGuide` and `privateProjectWork` are bounded instruction strings only. They do not define modal controls, project IDs, milestone lifecycle, access tiers, or scheduling behavior. - Private image prompts are persisted, but private image generation/review/serving is intentionally deferred until a private media path can enforce isolation. - No public client path invokes private generation yet; current public refresh callers now send `mode: "public"` explicitly. - The full `pnpm regression` command passed every deterministic/non-browser lane, then Playwright failed before executing browser assertions because Chromium could not load the host library `libnspr4.so`. ## Test plan - [ ] Run `pnpm check`. - [ ] Run `pnpm guard:installer-artifacts`. - [ ] Run `pnpm regression:noodle`. - [ ] Run `pnpm regression` on a host with Playwright Chromium dependencies installed. - [ ] Verify a public request containing `targetAccountId` returns HTTP 400 before generation starts. - [ ] Verify a public request containing `privatePostGuide` returns HTTP 400 before generation starts. - [ ] Verify a public request containing `privateProjectWork` returns HTTP 400 before generation starts. - [ ] Verify a private request targeting a public account returns 404 and creates no post. - [ ] Verify a private request targeting a private account creates exactly one private post. - [ ] Verify the private post is absent from public account, post, bootstrap, digest, and refresh-run reads. - [ ] Verify two concurrent requests for the same private account return one generation and one conflict response. - [ ] Verify separate private accounts can generate independently. - [ ] Verify malformed model output receives one correction attempt and valid corrected output persists. - [ ] Verify NoodleR-disabled private requests return 404 without revealing connection configuration. ## Validation notes A temporary deterministic service fixture used isolated file storage and a local OpenAI-compatible provider. It returned malformed output first and valid corrected output second. The proof confirmed one private post was persisted, its image prompt remained private with no served image URL, and the private account/post did not appear in public account, post, bootstrap, digest, or refresh-run reads. The temporary fixture was removed before commit. `pnpm check`, `pnpm guard:installer-artifacts`, and `pnpm regression:noodle` passed locally. Every deterministic/non-browser lane in `pnpm regression` also passed. Playwright could not launch Chromium because `libnspr4.so` is missing from the host, so no browser assertions were personally verified. ## Docs touched None. This slice adds an internal generation operation and request contract but no user-facing NoodleR generation workflow. User-facing documentation belongs with the later slice that exposes the operation in the UI. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for generating private posts for private accounts. * Added private post content, image prompts, polls, and optional guidance to generation requests. * Added storage and retrieval for private posts. * Added validation for public and private generation request formats. * **Bug Fixes** * Refresh requests now explicitly identify public generation mode. * Added safeguards to prevent duplicate private generations for the same account. <!-- 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:08 +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#6106
No description provided.