[PR #1387] [MERGED] perf(slurp2): 0.3.41 — small Engine avatars, report sheet on first open #1433

Closed
opened 2026-10-21 05:11:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1387
Author: @Gunterlie
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @Gunterlie

Base: staging ← Head: slurp-diet


📝 Commits (2)

  • 3edde37 perf(slurp2): 0.3.41 — small copies of Engine avatars, report sheet built on first open, ambient look after paint
  • 6454663 fix(slurp2): 0.3.41 — cancel the queued ambient look on cleanup

📊 Changes

26 files changed (+704 additions, -450 deletions)

View changed files

➕ artifacts/slurp2-0.3.41.zip (+0 -0)
📝 catalog/catalog.json (+8 -8)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+8 -8)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+8 -8)
📝 catalog/v3/notes.json (+6 -6)
📝 package.json (+1 -1)
📝 packages/slurp2/CHANGELOG.md (+6 -0)
📝 packages/slurp2/client.js (+67 -67)
📝 packages/slurp2/manifest.json (+5 -5)
📝 packages/slurp2/server.mjs (+299 -299)
📝 packages/slurp2/src/engine/packages/client/src/slp/base/chrome/SlpChrome.tsx (+7 -2)
📝 packages/slurp2/src/engine/packages/client/src/slp/base/media/slp-media-src.ts (+11 -3)
📝 packages/slurp2/src/engine/packages/client/src/slp/features/creators/SlpProfileSurface.tsx (+1 -0)
📝 packages/slurp2/src/engine/packages/client/src/slp/features/messages/SlpSharePostModal.tsx (+7 -1)
📝 packages/slurp2/src/engine/packages/client/src/slp/features/onboarding/slp-release.ts (+6 -10)
📝 packages/slurp2/src/engine/packages/client/src/slp/features/projects/SlpArcTimelineCard.tsx (+6 -1)
📝 packages/slurp2/src/engine/packages/client/src/slp/modules/chrome/SlpCanvasAmbient.tsx (+15 -2)
📝 packages/slurp2/src/engine/packages/client/src/slp/modules/post/SlpReportModal.tsx (+15 -9)

...and 6 more files

📄 Description

Pull request

Important

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

Linked issue

Closes #1386

Why this change

  • On a phone, opening Slurp downloaded 16.6 MB of Engine avatar PNGs that it shows at 44 px. Discover downloaded 14 MB more. These downloads held the browser's connections, so the feed's API calls queued for about 230 ms each. Every post card and reply also built a closed "Report" sheet, which was the largest single Slurp cost on mount. Numbers are in #1386 (production 0.3.40, 4× CPU throttle).

What changed

  • slurp2 0.3.40 → 0.3.41 (patch).
  • New route GET /api/slurp2/engine-avatars/:fileName?width=N (slp-media-routes.ts, resolveEngineAvatarVariant in slp-media.ts). It makes a WebP width variant of an Engine avatar with the existing variant code. The variant is cached in Slurp's own slurp2-media/engine-avatars/ namespace, keyed by the source mtime, and never written into the Engine's avatar folder. The .w<N>.webp suffix keeps the variants out of backups. The source gets the checks the Engine's /api/avatars/file route makes: a plain name, an image extension, a real path inside the avatar folder (a symlink out is refused), a regular file, and image magic bytes.
  • Client: variantUrl sends an Engine avatar that is asked for at a width to that route. Such a URL is now fetched like other Slurp media (admin header, blob URL). SlurpMediaImg has a mediaWidth prop. The profile hero, share sheet and arc timeline avatars now ask for a width.
  • SlpReportModal renders nothing until it is first opened. Then it stays mounted so the sheet can play its close.
  • SlpCanvasAmbient measures images just after a painted frame, not from a bare timer.
  • Tests: a new runtime regression tests/slurp2-engine-avatar-variant.regression.ts. It covers the variant size, the cache place, the backup exclusion and the refused names (traversal, dotfiles, non-image extension, a fake .png, a symlink out of the folder). The test is registered as a plain-tsx file in package.json and scripts/run-slurp-regressions.mjs. The route inventory gets +1 GET. The release list drops 0.2.4 to keep slp-release.ts under the 800-line limit.
  • Generated: packages/slurp2/{client.js,server.mjs,manifest.json}, artifacts/slurp2-0.3.41.zip, catalogs and notes.

Not in this PR:

  • The Engine half (the chat selection button forces a layout on every app scroll) is Pasta-Devs/Marinara-Engine#7641.
  • I measured that the Creator posts list ships every interaction (116 of 197 kB). Brotli brings this to about 31 kB on the wire, and the card builds its whole thread from it, so trimming it is left for a follow-up.

Package and security impact

  • Affected package IDs: slurp2
  • Engine compatibility impact: none; the range is unchanged.
  • New or changed permissions/entrypoints: one new privileged GET route under the package's route prefix. It only reads image files from the Engine's avatar folder, with the checks above.
  • Restart, storage, update, or uninstall impact: adds small cached WebP files under the package's gallery namespace. Backups skip them.

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

  • The agent ran these on the final commit with MARINARA_ENGINE_ROOT set to an isolated staging Engine checkout. All exited 0:
    • npm run check
    • slurp2-architecture
    • node scripts/typecheck-packages.mjs slurp2
    • node scripts/build-feature-packages.mjs slurp2
    • test-catalog-lanes, validate-package-locales, validate-catalog, catalog-release-notes
    • git diff --check
    • node scripts/run-slurp-regressions.mjs: 292 passed, 0 failed.
  • The new avatar regression was checked by mutation. With the name check removed, it fails on .env is refused.
  • A read-only reviewer pass found that the first version of the route sent the source without the Engine's realpath and magic-byte checks. That is fixed and tested.
  • Not done: no sideload to a running Engine, and no browser measurement of 0.3.41. A reviewer should install it and check that avatars appear in Hub, Discover and Creator profiles, and that the network panel shows engine-avatars/...?width=96 WebP files of a few kB.

Documentation impact

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

UI evidence (if applicable)

  • No visual change intended; avatars are the same pictures at a matching size.

Summary by CodeRabbit

  • New Features
    • Updated Slurp to version 0.3.41, with faster-loading, smaller avatar images and reports that load when opened.
  • Performance
    • Ambient background colors are now measured after the screen draws.

🔄 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-Agents/pull/1387 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `slurp-diet` --- ### 📝 Commits (2) - [`3edde37`](https://github.com/Pasta-Devs/Marinara-Agents/commit/3edde370c86f9d6012f0e0662151f58de21215a6) perf(slurp2): 0.3.41 — small copies of Engine avatars, report sheet built on first open, ambient look after paint - [`6454663`](https://github.com/Pasta-Devs/Marinara-Agents/commit/6454663c84535cb302375b0834dbed8f4d2f545d) fix(slurp2): 0.3.41 — cancel the queued ambient look on cleanup ### 📊 Changes **26 files changed** (+704 additions, -450 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/slurp2-0.3.41.zip` (+0 -0) 📝 `catalog/catalog.json` (+8 -8) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+8 -8) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+8 -8) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `package.json` (+1 -1) 📝 `packages/slurp2/CHANGELOG.md` (+6 -0) 📝 `packages/slurp2/client.js` (+67 -67) 📝 `packages/slurp2/manifest.json` (+5 -5) 📝 `packages/slurp2/server.mjs` (+299 -299) 📝 `packages/slurp2/src/engine/packages/client/src/slp/base/chrome/SlpChrome.tsx` (+7 -2) 📝 `packages/slurp2/src/engine/packages/client/src/slp/base/media/slp-media-src.ts` (+11 -3) 📝 `packages/slurp2/src/engine/packages/client/src/slp/features/creators/SlpProfileSurface.tsx` (+1 -0) 📝 `packages/slurp2/src/engine/packages/client/src/slp/features/messages/SlpSharePostModal.tsx` (+7 -1) 📝 `packages/slurp2/src/engine/packages/client/src/slp/features/onboarding/slp-release.ts` (+6 -10) 📝 `packages/slurp2/src/engine/packages/client/src/slp/features/projects/SlpArcTimelineCard.tsx` (+6 -1) 📝 `packages/slurp2/src/engine/packages/client/src/slp/modules/chrome/SlpCanvasAmbient.tsx` (+15 -2) 📝 `packages/slurp2/src/engine/packages/client/src/slp/modules/post/SlpReportModal.tsx` (+15 -9) _...and 6 more files_ </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #1386 ## Why this change - On a phone, opening Slurp downloaded 16.6 MB of Engine avatar PNGs that it shows at 44 px. Discover downloaded 14 MB more. These downloads held the browser's connections, so the feed's API calls queued for about 230 ms each. Every post card and reply also built a closed "Report" sheet, which was the largest single Slurp cost on mount. Numbers are in #1386 (production 0.3.40, 4× CPU throttle). ## What changed - **slurp2 0.3.40 → 0.3.41** (patch). - **New route `GET /api/slurp2/engine-avatars/:fileName?width=N`** (`slp-media-routes.ts`, `resolveEngineAvatarVariant` in `slp-media.ts`). It makes a WebP width variant of an Engine avatar with the existing variant code. The variant is cached in Slurp's own `slurp2-media/engine-avatars/` namespace, keyed by the source mtime, and never written into the Engine's avatar folder. The `.w<N>.webp` suffix keeps the variants out of backups. The source gets the checks the Engine's `/api/avatars/file` route makes: a plain name, an image extension, a real path inside the avatar folder (a symlink out is refused), a regular file, and image magic bytes. - **Client:** `variantUrl` sends an Engine avatar that is asked for at a width to that route. Such a URL is now fetched like other Slurp media (admin header, blob URL). `SlurpMediaImg` has a `mediaWidth` prop. The profile hero, share sheet and arc timeline avatars now ask for a width. - **`SlpReportModal`** renders nothing until it is first opened. Then it stays mounted so the sheet can play its close. - **`SlpCanvasAmbient`** measures images just after a painted frame, not from a bare timer. - **Tests:** a new runtime regression `tests/slurp2-engine-avatar-variant.regression.ts`. It covers the variant size, the cache place, the backup exclusion and the refused names (traversal, dotfiles, non-image extension, a fake `.png`, a symlink out of the folder). The test is registered as a plain-tsx file in `package.json` and `scripts/run-slurp-regressions.mjs`. The route inventory gets +1 GET. The release list drops 0.2.4 to keep `slp-release.ts` under the 800-line limit. - **Generated:** `packages/slurp2/{client.js,server.mjs,manifest.json}`, `artifacts/slurp2-0.3.41.zip`, catalogs and notes. Not in this PR: - The Engine half (the chat selection button forces a layout on every app scroll) is Pasta-Devs/Marinara-Engine#7641. - I measured that the Creator posts list ships every interaction (116 of 197 kB). Brotli brings this to about 31 kB on the wire, and the card builds its whole thread from it, so trimming it is left for a follow-up. ## Package and security impact - Affected package IDs: `slurp2` - Engine compatibility impact: none; the range is unchanged. - New or changed permissions/entrypoints: one new privileged GET route under the package's route prefix. It only reads image files from the Engine's avatar folder, with the checks above. - Restart, storage, update, or uninstall impact: adds small cached WebP files under the package's gallery namespace. Backups skip them. ## 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 - The agent ran these on the final commit with `MARINARA_ENGINE_ROOT` set to an isolated staging Engine checkout. All exited 0: - `npm run check` - `slurp2-architecture` - `node scripts/typecheck-packages.mjs slurp2` - `node scripts/build-feature-packages.mjs slurp2` - `test-catalog-lanes`, `validate-package-locales`, `validate-catalog`, `catalog-release-notes` - `git diff --check` - `node scripts/run-slurp-regressions.mjs`: 292 passed, 0 failed. - The new avatar regression was checked by mutation. With the name check removed, it fails on `.env is refused`. - A read-only reviewer pass found that the first version of the route sent the source without the Engine's realpath and magic-byte checks. That is fixed and tested. - Not done: no sideload to a running Engine, and no browser measurement of 0.3.41. A reviewer should install it and check that avatars appear in Hub, Discover and Creator profiles, and that the network panel shows `engine-avatars/...?width=96` WebP files of a few kB. ## Documentation impact - [x] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) - No visual change intended; avatars are the same pictures at a matching size. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Updated Slurp to version 0.3.41, with faster-loading, smaller avatar images and reports that load when opened. * **Performance** * Ambient background colors are now measured after the screen draws. <!-- 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-21 05:11:23 +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-Agents#1433
No description provided.