[PR #6426] [MERGED] feat: route package generation through host integrations #7174

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6426
Author: @SpicyMarinara
Created: 9/20/2026
Status: ✅ Merged
Merged: 9/20/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/sept20-package-host-services


📝 Commits (10+)

  • 67a17be chore: coordinate package host integration migration
  • c23b332 feat: expose live host generation integrations to packages
  • 4ea7076 Merge remote-tracking branch 'origin/staging' into codex/sept20-package-host-services
  • 816fbc5 feat: share local model and image sizing helpers with packages
  • 73dd2fd Merge remote-tracking branch 'origin/staging' into codex/sept20-package-host-services
  • 812f61e fix: enforce package generation and media permissions
  • 5dae7d9 Merge branch 'codex/pr6416-review' into codex/sept20-package-host-services
  • 1d6f6bf Merge branch 'codex/pr6416-review' into codex/sept20-package-host-services
  • fe1376e fix: keep image URL policy under host control
  • bef8571 fix: apply free ruleset check abilities and clarify wound guidance

📊 Changes

21 files changed (+851 additions, -408 deletions)

View changed files

📝 CHANGELOG.md (+2 -1)
📝 docs/development/optional-agent-packages.md (+12 -0)
📝 packages/server/src/routes/generate.routes.ts (+10 -7)
➕ packages/server/src/services/capability-packages/capability-integrations.service.ts (+87 -0)
📝 packages/server/src/services/capability-packages/capability-module-runtime.service.ts (+2 -0)
📝 packages/server/src/services/game/gm-prompts.ts (+1 -1)
📝 packages/server/src/services/game/skill-check-resolution.service.ts (+1 -1)
📝 packages/server/src/services/generation/connection-admission.ts (+10 -14)
📝 packages/server/src/services/generation/fallback-notification.ts (+6 -10)
📝 packages/server/src/services/image/image-generation.ts (+7 -90)
📝 packages/server/src/services/llm/base-provider.ts (+19 -175)
📝 packages/server/src/services/llm/connection-fallback-provider.ts (+6 -31)
📝 packages/server/src/services/video/video-generation.ts (+19 -72)
📝 packages/shared/src/features/rulesets/sheet-prompt.ts (+5 -1)
📝 packages/shared/src/index.ts (+1 -0)
📝 packages/shared/src/schemas/capability-package.schema.ts (+2 -1)
📝 packages/shared/src/types/capability-runtime.ts (+3 -0)
➕ packages/shared/src/types/generation-integration.ts (+468 -0)
➕ scripts/regressions/capability-integrations.regression.ts (+172 -0)
📝 scripts/regressions/capability-package-lifecycle.regression.ts (+4 -4)

...and 1 more files

📄 Description

Linked issue

Refs #6385, Pasta-Devs/Marinara-Agents#955. Companion package migration: Pasta-Devs/Marinara-Agents#970. The API 1.30 ruleset work is already on staging; this adds API 1.31.

Why this change

Downloaded packages were bundling live LLM, image and video services, so they missed Engine fixes until somebody copied them again. The new API lets them call the installed Engine's implementations directly.

What changed

  • Add optional api.runtime.integrations under Capability API 1.31, using the existing provider factory, fallback wrapper, local sidecar, media generators and safe media storage.
  • Move transport request/result types into shared contracts; retain the existing server import paths as type re-exports. Provider algorithms stay in their existing services.
  • Keep connection defaults/headers, admission, queues, cancellation, logging and network safeguards on the host. Provider creation and media generation require the package's network permission; media persistence requires storage.
  • Bind fallback providers to the package's own host and expose a frozen provider facade without credential properties.
  • Migrate Noodle, Slurp Legacy, Slurp Remastered and Calls in the companion PR. Package prompts, orchestration and pure helpers remain package-owned.
  • Reuse per-turn catalogs across prompt/check/sheet passes. Scalable check abilities show their actual resource cost in the prompt, and direct zero/negative offers cannot get an effect without paying the base cost.

Validation

  • 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

Completed: pnpm check; full Node regression lane, 342/342 files passed; host integration HTTP/storage regression including custom defaults and headers, tools/usage, primary failure and fallback, foreign provider rejection, cancellation, permission denial, staged gallery promotion/compensation and path traversal rejection. The fixture uses a synthetic local provider, not paid external services.

The rebuilt, installed Slurp Remastered artifact reaches a real host image route and saves the returned avatar bytes: 2 browser checks passed. Existing installed-package browser paths also passed: Noodle editing/settings (3), Slurp Legacy setup/image settings (4), Calls autoplay recovery (2), and Slurp Remastered settings/refresh (2). These are desktop/mobile Chromium emulation, not physical-device or live-provider verification.

Local CodeRabbit reviewed all 15 host-diff files. Its permission and helper-documentation findings were addressed; translated docs are coordinated in #6401 / #6429. Hosted CodeRabbit completed the combined code review; its final changelog-only review on 3ae1879d0 produced no actionable comments. The prompt-string CodeQL annotation was traced to its server-only LLM caller and documented as a false positive, not an HTML sink. Required CI remains a merge gate.

Core claim: package generation uses current host services without a bundled provider fork. Risk: provider request shaping, package compatibility and media writes. Current manifests require API 1.31 before activation; old hosts reject them. Existing packages can omit this optional host property. Negative controls cover missing permissions, foreign providers, aborted requests and unsafe paths. No claim is made that every historical vendored storage/helper file has been removed.

Still to verify manually:

  • Install/update the four companion packages on staging and generate a normal post, image and call video using configured providers.
  • Confirm debug prompt visibility, connection-specific queues and fallback notices in a representative live setup.

Docs and release impact

  • 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)

Updated the Unreleased changelog and package-development guide; #6401 / #6429 covers the translated guide. No app version bump. Package releases are built in Marinara-Agents.

UI evidence (if applicable)

No new Engine UI. Existing package interfaces were exercised through installed-artifact browser tests using synthetic data.


🔄 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/6426 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/20/2026 **Status:** ✅ Merged **Merged:** 9/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/sept20-package-host-services` --- ### 📝 Commits (10+) - [`67a17be`](https://github.com/Pasta-Devs/Marinara-Engine/commit/67a17be21349253a3d422aea399a802d3041ca08) chore: coordinate package host integration migration - [`c23b332`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c23b3324cc15d8b10ebdc7aafc955250877a24bc) feat: expose live host generation integrations to packages - [`4ea7076`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4ea70763902cbfd54b9f76313ce3efb4d7f4b141) Merge remote-tracking branch 'origin/staging' into codex/sept20-package-host-services - [`816fbc5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/816fbc5c6d7702147ce966bacacede7b3c3a9064) feat: share local model and image sizing helpers with packages - [`73dd2fd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/73dd2fd5eaf78d0084f784cf5fb6cf4e5a797140) Merge remote-tracking branch 'origin/staging' into codex/sept20-package-host-services - [`812f61e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/812f61ecbf9318d07aa42018fc2984ebaae95b38) fix: enforce package generation and media permissions - [`5dae7d9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5dae7d9b4c38fc87c3b0e09e0e816509df22fac1) Merge branch 'codex/pr6416-review' into codex/sept20-package-host-services - [`1d6f6bf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1d6f6bfa575b2b1fb6a63c5299b4ddfb0efd679c) Merge branch 'codex/pr6416-review' into codex/sept20-package-host-services - [`fe1376e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fe1376e88692c0fe6605f4d8d4d6b5abf725a2dc) fix: keep image URL policy under host control - [`bef8571`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bef85712cf98e73e86159bddf7220f984e65c780) fix: apply free ruleset check abilities and clarify wound guidance ### 📊 Changes **21 files changed** (+851 additions, -408 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -1) 📝 `docs/development/optional-agent-packages.md` (+12 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+10 -7) ➕ `packages/server/src/services/capability-packages/capability-integrations.service.ts` (+87 -0) 📝 `packages/server/src/services/capability-packages/capability-module-runtime.service.ts` (+2 -0) 📝 `packages/server/src/services/game/gm-prompts.ts` (+1 -1) 📝 `packages/server/src/services/game/skill-check-resolution.service.ts` (+1 -1) 📝 `packages/server/src/services/generation/connection-admission.ts` (+10 -14) 📝 `packages/server/src/services/generation/fallback-notification.ts` (+6 -10) 📝 `packages/server/src/services/image/image-generation.ts` (+7 -90) 📝 `packages/server/src/services/llm/base-provider.ts` (+19 -175) 📝 `packages/server/src/services/llm/connection-fallback-provider.ts` (+6 -31) 📝 `packages/server/src/services/video/video-generation.ts` (+19 -72) 📝 `packages/shared/src/features/rulesets/sheet-prompt.ts` (+5 -1) 📝 `packages/shared/src/index.ts` (+1 -0) 📝 `packages/shared/src/schemas/capability-package.schema.ts` (+2 -1) 📝 `packages/shared/src/types/capability-runtime.ts` (+3 -0) ➕ `packages/shared/src/types/generation-integration.ts` (+468 -0) ➕ `scripts/regressions/capability-integrations.regression.ts` (+172 -0) 📝 `scripts/regressions/capability-package-lifecycle.regression.ts` (+4 -4) _...and 1 more files_ </details> ### 📄 Description ## Linked issue Refs #6385, Pasta-Devs/Marinara-Agents#955. Companion package migration: Pasta-Devs/Marinara-Agents#970. The API 1.30 ruleset work is already on staging; this adds API 1.31. ## Why this change Downloaded packages were bundling live LLM, image and video services, so they missed Engine fixes until somebody copied them again. The new API lets them call the installed Engine's implementations directly. ## What changed - Add optional `api.runtime.integrations` under Capability API 1.31, using the existing provider factory, fallback wrapper, local sidecar, media generators and safe media storage. - Move transport request/result types into shared contracts; retain the existing server import paths as type re-exports. Provider algorithms stay in their existing services. - Keep connection defaults/headers, admission, queues, cancellation, logging and network safeguards on the host. Provider creation and media generation require the package's `network` permission; media persistence requires `storage`. - Bind fallback providers to the package's own host and expose a frozen provider facade without credential properties. - Migrate Noodle, Slurp Legacy, Slurp Remastered and Calls in the companion PR. Package prompts, orchestration and pure helpers remain package-owned. - Reuse per-turn catalogs across prompt/check/sheet passes. Scalable check abilities show their actual resource cost in the prompt, and direct zero/negative offers cannot get an effect without paying the base cost. ## Validation - [ ] `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 Completed: `pnpm check`; full Node regression lane, **342/342 files passed**; host integration HTTP/storage regression including custom defaults and headers, tools/usage, primary failure and fallback, foreign provider rejection, cancellation, permission denial, staged gallery promotion/compensation and path traversal rejection. The fixture uses a synthetic local provider, not paid external services. The rebuilt, installed Slurp Remastered artifact reaches a real host image route and saves the returned avatar bytes: 2 browser checks passed. Existing installed-package browser paths also passed: Noodle editing/settings (3), Slurp Legacy setup/image settings (4), Calls autoplay recovery (2), and Slurp Remastered settings/refresh (2). These are desktop/mobile Chromium emulation, not physical-device or live-provider verification. Local CodeRabbit reviewed all 15 host-diff files. Its permission and helper-documentation findings were addressed; translated docs are coordinated in #6401 / #6429. Hosted CodeRabbit completed the combined code review; its final changelog-only review on `3ae1879d0` produced no actionable comments. The prompt-string CodeQL annotation was traced to its server-only LLM caller and documented as a false positive, not an HTML sink. Required CI remains a merge gate. Core claim: package generation uses current host services without a bundled provider fork. Risk: provider request shaping, package compatibility and media writes. Current manifests require API 1.31 before activation; old hosts reject them. Existing packages can omit this optional host property. Negative controls cover missing permissions, foreign providers, aborted requests and unsafe paths. No claim is made that every historical vendored storage/helper file has been removed. Still to verify manually: - Install/update the four companion packages on staging and generate a normal post, image and call video using configured providers. - Confirm debug prompt visibility, connection-specific queues and fallback notices in a representative live setup. ## Docs and release impact - [ ] 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) Updated the Unreleased changelog and package-development guide; #6401 / #6429 covers the translated guide. No app version bump. Package releases are built in Marinara-Agents. ## UI evidence (if applicable) No new Engine UI. Existing package interfaces were exercised through installed-artifact browser tests using synthetic data. --- <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:13 +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#7174
No description provided.