Skip to content

Rewrite Noodle image prompts before review - #299

Merged
SpicyMarinara merged 3 commits into
Pasta-Devs:stagingfrom
snpNEXT:feat/noodle-image-prompt-instructions
Aug 10, 2026
Merged

Rewrite Noodle image prompts before review#299
SpicyMarinara merged 3 commits into
Pasta-Devs:stagingfrom
snpNEXT:feat/noodle-image-prompt-instructions

Conversation

@snpNEXT

@snpNEXT snpNEXT commented Aug 10, 2026

Copy link
Copy Markdown

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #300

Why this change

  • Make Noodle image-connection instructions usable with smaller and local image providers.
  • Show a provider-ready rewritten prompt in the image review modal.
  • Keep confirmed prompts from being rewritten or receiving instruction text a second time.

This complements Pasta-Devs/Marinara-Engine#4842.

What changed

  • Affected package ID: noodle.
  • Added a bounded agent-text-model rewrite for public Noodle and private NoodleR image prompts.
  • Used the default agent text connection with the configured agent fallback.
  • Kept explicit reviewed prompt overrides unchanged.
  • Documented the normalized direct-instruction fallback when rewriting is unavailable.
  • Rebuilt the Noodle server/client payloads, ZIP artifact, manifest, and all catalog lanes.

Package and security impact

  • Affected package IDs: noodle
  • Engine compatibility impact: Requires Marinara Engine 2.4.2 or later, matching the existing manifest.
  • New or changed permissions/entrypoints: None.
  • Restart, storage, update, or uninstall impact: Existing restart behavior is unchanged; no storage migration is required.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Contributor manually tested Noodle prompt review with built-in Professor Mari context and confirmed that reviewed prompts are not rewritten twice.
  • Maintainer repair ran node scripts/test-catalog-lanes.mjs, node scripts/validate-package-locales.mjs, node scripts/validate-catalog.mjs, generated-bundle syntax checks, and git diff --check.
  • npm run test:browser:noodle completed with 20 passing tests and 12 project-specific skips.
  • The rebuilt ZIP contains the same Noodle manifest, server, client, and asset hashes recorded in the catalogs.
  • Required SpicyMarinara approval was submitted against the current head.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

UI evidence (if applicable)

No visual layout changes.

@snpNEXT
snpNEXT requested a review from SpicyMarinara as a code owner August 10, 2026 05:44
@github-actions github-actions Bot added feature New package or enhancement packages Agent package sources and manifests labels Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds rewriteNoodleImagePrompt for instruction-aware prompt rewriting. Noodle image services use it when connection instructions exist without explicit prompt overrides, with direct instruction appending as fallback. The image-post description and package manifest metadata are updated.

Changes

Noodle image prompt processing

Layer / File(s) Summary
Prompt rewrite workflow
packages/noodle/src/engine/packages/server/src/services/noodle/noodle-image-prompt-rewrite.ts
Adds rewriteNoodleImagePrompt with normalized inputs, connection and runtime resolution, tolerant JSON parsing, output truncation, and failure handling.
Image service integration
packages/noodle/src/engine/packages/server/src/services/noodle/noodle-noodler-images.service.ts, packages/noodle/src/engine/packages/server/src/services/noodle/noodle-public-images.service.ts
Applies connection-level instructions through prompt rewriting when no explicit override exists. Appends instructions when rewriting is unavailable.
Prompt contract and package artifacts
packages/noodle/src/engine/packages/server/src/services/prompt-overrides/registry/noodle.ts, packages/noodle/manifest.json
Documents the optional agent-model rewrite step and updates server.mjs and client.js checksums and sizes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ImageService
  participant rewriteNoodleImagePrompt
  participant AgentTextConnection
  participant IllustratorRuntime
  ImageService->>rewriteNoodleImagePrompt: Send prompt, instructions, and character context
  rewriteNoodleImagePrompt->>AgentTextConnection: Resolve agent text connection
  rewriteNoodleImagePrompt->>IllustratorRuntime: Submit rewrite request
  IllustratorRuntime-->>rewriteNoodleImagePrompt: Return JSON prompt
  rewriteNoodleImagePrompt-->>ImageService: Return rewritten prompt or null
Loading

Possibly related PRs

Suggested labels: artifacts, build

Suggested reviewers: spicymarinara

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed The description links the pull request to issue #300 with a valid Closes reference.
Out of Scope Changes check ✅ Passed The source, generated bundle, manifest, and prompt registry changes align with the stated Noodle prompt-rewrite objectives.
Title check ✅ Passed The title clearly states the primary change: rewriting Noodle image prompts before review.
Description check ✅ Passed The description includes the linked issue, rationale, changes, impact, validation notes, documentation status, and UI evidence.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SpicyMarinara SpicyMarinara self-assigned this Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/noodle/manifest.json`:
- Around line 66-72: Regenerate the downloadable ZIP artifact and rerun
archive/hash validation so server.mjs and client.js match the hashes recorded in
packages/noodle/manifest.json. Verify the rebuilt artifact is the one included
for release and that validation passes before merging.

In
`@packages/noodle/src/engine/packages/server/src/services/prompt-overrides/registry/noodle.ts`:
- Line 21: Update the prompt template description near rewriteNoodleImagePrompt
to state that the system attempts an agent-model rewrite when image instructions
exist, but appends normalized instructions directly when no agent connection is
available or rewriting fails.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a371f8c0-f9ed-4604-bf6c-f6bf61543ce3

📥 Commits

Reviewing files that changed from the base of the PR and between 1b8af3b and 0285562.

⛔ Files ignored due to path filters (2)
  • packages/noodle/client.js is excluded by !packages/**/client.js
  • packages/noodle/server.mjs is excluded by !packages/**/server.mjs
📒 Files selected for processing (5)
  • packages/noodle/manifest.json
  • packages/noodle/src/engine/packages/server/src/services/noodle/noodle-image-prompt-rewrite.ts
  • packages/noodle/src/engine/packages/server/src/services/noodle/noodle-noodler-images.service.ts
  • packages/noodle/src/engine/packages/server/src/services/noodle/noodle-public-images.service.ts
  • packages/noodle/src/engine/packages/server/src/services/prompt-overrides/registry/noodle.ts

Comment thread packages/noodle/manifest.json Outdated
@github-actions github-actions Bot added artifacts Generated downloadable package artifacts catalog Official catalog and package schemas labels Aug 10, 2026

@SpicyMarinara SpicyMarinara left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the current head after rebuilding the complete Noodle package family. Catalog, locale, archive, syntax, whitespace, and package-browser validation pass; both CodeRabbit findings are addressed.

@SpicyMarinara
SpicyMarinara merged commit b8d620c into Pasta-Devs:staging Aug 10, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

artifacts Generated downloadable package artifacts catalog Official catalog and package schemas feature New package or enhancement packages Agent package sources and manifests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants