[PR #1002] [MERGED] feat(slurp2): reuse real pictures for callbacks, reposts, and previews (slice 5) #1238

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1002
Author: @Gunterlie
Created: 9/21/2026
Status: ✅ Merged
Merged: 9/21/2026
Merged by: @Gunterlie

Base: producing-content ← Head: slice/05-media-reuse


📝 Commits (1)

  • 8621015 feat(slurp2): reuse real pictures for callbacks, reposts, and previews

📊 Changes

25 files changed (+920 additions, -361 deletions)

View changed files

➕ artifacts/slurp2-0.1.27.zip (+0 -0)
📝 catalog/catalog.json (+6 -6)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+6 -6)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+6 -6)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/slurp2/CHANGELOG.md (+7 -0)
📝 packages/slurp2/manifest.json (+3 -3)
📝 packages/slurp2/server.mjs (+235 -235)
📝 packages/slurp2/src/engine/packages/server/src/db/schema/slurp.ts (+5 -0)
📝 packages/slurp2/src/engine/packages/server/src/slp/data/feed/slp-shoot-storage.ts (+13 -1)
📝 packages/slurp2/src/engine/packages/server/src/slp/features/feed/reserve/slp-reserve-operation.ts (+5 -1)
📝 packages/slurp2/src/engine/packages/server/src/slp/features/feed/slp-generation-service.ts (+75 -73)
➕ packages/slurp2/src/engine/packages/server/src/slp/features/feed/slp-post-plan-service.ts (+129 -0)
📝 packages/slurp2/src/engine/packages/server/src/slp/features/media/slp-media-contract.ts (+2 -0)
➕ packages/slurp2/src/engine/packages/server/src/slp/features/media/slp-media-reuse-service.ts (+79 -0)
📝 packages/slurp2/src/engine/packages/server/src/slp/modules/feed/slp-content-axes.ts (+39 -3)
📝 packages/slurp2/src/engine/packages/server/src/slp/modules/feed/slp-image-brief.ts (+3 -1)
➕ packages/slurp2/src/engine/packages/server/src/slp/modules/feed/slp-media-reuse.ts (+107 -0)

...and 5 more files

📄 Description

Why

Slice 5 of plan/concept.md. "Old photo", "one more from that shoot", and "preview of the set" were prompt text only. The model was told a picture was older, and then a brand-new picture was generated. So a callback never showed the shoot it named, and a teaser never previewed anything real.

What changed

  • modules/feed/slp-media-reuse.ts (pure): which earlier pictures a post may reuse — its own shoot, an older archive picture (≥3 days), or a recent locked picture (≤3 days) as a public preview — plus a deterministic pick and the preview crop window. A locked picture never reaches a public post except as a server-side crop.
  • features/media/slp-media-reuse-service.ts (exported through the media contract): finds candidates and loads the bytes. The preview is cut with sharp.extract on the bytes. Without sharp, there is no preview. Files that fail isAllowedImageBuffer or cannot be read return null.
  • slurpReuseDelivery (axes module): after the draw, a callback mostly shows its shoot (60%), a public teaser often shows a preview (50%), and other fitting intents occasionally repost (12%). It never applies to sets, Stories, or text posts.
  • Reused bytes are copied into the new post through the existing upload path. Deleting either post can never break the other.
  • Scheduled posts stage the copy in the prepared payload. The reserve promotes it or drops it like a generated image.
  • The plan records reuse_media as its workflow. Reuse is decided only from pictures that exist, and an unreadable file falls back to a new picture.
  • Shoots store the drop's picture brief (new brief column, default empty — old shoots stay unknown rather than invented). Posts are stamped with shootId, and reused posts with reusedFromPostId. A callback's new picture keeps the drop's clothes and light.
  • Planning moved out of slp-generation-service.ts into features/feed/slp-post-plan-service.ts. This also brings the generator back under the 800-line architecture limit.
  • Slurp2 0.1.27.

Validation

  • New tests/slurp-media-reuse.regression.ts:
    • locked pictures never reach public posts through archive or shoot reuse, and a locked post may use both;
    • archive pictures are old, never Stories, and always have a file;
    • a callback shows only its own shoot, and a preview is only a recent locked picture going into a public teaser;
    • bad dates are ignored, the pick is deterministic, and the crop stays inside the picture and under a quarter of it;
    • reuse only replaces a new picture when one exists, never touches sets, Stories, or text, and a preview is always a teaser;
    • callbacks mostly show their shoot and archive reposts stay occasional;
    • the shoot brief carries into the callback brief, and an unknown brief stays unknown;
    • source proof covers the copy-not-share path, the sharp gate, the file check, the fallback, and the scheduled staging.
  • Planner, strategy, and content-axes regressions updated for the moved planning code.
  • npm run check: 0 errors, no new warnings. Architecture, typecheck, locale, catalog lane, catalog, release-notes, and git diff --check pass.
  • Full Slurp sweep: 142 pass. No failure that the branch base does not already have.
  • Not done: live dev-Engine run with real media.
  • Not in this slice: multi_image_set. A post holds one picture, and several need a post media list plus a carousel. This is still marked ponytail: in the axes module.
  • Known red: the Slurp Remastered browser suite. The failing set is identical since before slice 1 (#996).

🔄 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/1002 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 9/21/2026 **Status:** ✅ Merged **Merged:** 9/21/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `producing-content` ← **Head:** `slice/05-media-reuse` --- ### 📝 Commits (1) - [`8621015`](https://github.com/Pasta-Devs/Marinara-Agents/commit/8621015d42ad608f9c3fb024f87d3a22da3a61fa) feat(slurp2): reuse real pictures for callbacks, reposts, and previews ### 📊 Changes **25 files changed** (+920 additions, -361 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/slurp2-0.1.27.zip` (+0 -0) 📝 `catalog/catalog.json` (+6 -6) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+6 -6) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+6 -6) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/slurp2/CHANGELOG.md` (+7 -0) 📝 `packages/slurp2/manifest.json` (+3 -3) 📝 `packages/slurp2/server.mjs` (+235 -235) 📝 `packages/slurp2/src/engine/packages/server/src/db/schema/slurp.ts` (+5 -0) 📝 `packages/slurp2/src/engine/packages/server/src/slp/data/feed/slp-shoot-storage.ts` (+13 -1) 📝 `packages/slurp2/src/engine/packages/server/src/slp/features/feed/reserve/slp-reserve-operation.ts` (+5 -1) 📝 `packages/slurp2/src/engine/packages/server/src/slp/features/feed/slp-generation-service.ts` (+75 -73) ➕ `packages/slurp2/src/engine/packages/server/src/slp/features/feed/slp-post-plan-service.ts` (+129 -0) 📝 `packages/slurp2/src/engine/packages/server/src/slp/features/media/slp-media-contract.ts` (+2 -0) ➕ `packages/slurp2/src/engine/packages/server/src/slp/features/media/slp-media-reuse-service.ts` (+79 -0) 📝 `packages/slurp2/src/engine/packages/server/src/slp/modules/feed/slp-content-axes.ts` (+39 -3) 📝 `packages/slurp2/src/engine/packages/server/src/slp/modules/feed/slp-image-brief.ts` (+3 -1) ➕ `packages/slurp2/src/engine/packages/server/src/slp/modules/feed/slp-media-reuse.ts` (+107 -0) _...and 5 more files_ </details> ### 📄 Description ## Why Slice 5 of `plan/concept.md`. "Old photo", "one more from that shoot", and "preview of the set" were prompt text only. The model was told a picture was older, and then a brand-new picture was generated. So a callback never showed the shoot it named, and a teaser never previewed anything real. ## What changed - `modules/feed/slp-media-reuse.ts` (pure): which earlier pictures a post may reuse — its own shoot, an older archive picture (≥3 days), or a recent locked picture (≤3 days) as a public preview — plus a deterministic pick and the preview crop window. **A locked picture never reaches a public post except as a server-side crop.** - `features/media/slp-media-reuse-service.ts` (exported through the media contract): finds candidates and loads the bytes. The preview is cut with `sharp.extract` on the bytes. Without `sharp`, there is no preview. Files that fail `isAllowedImageBuffer` or cannot be read return null. - `slurpReuseDelivery` (axes module): after the draw, a callback mostly shows its shoot (60%), a public teaser often shows a preview (50%), and other fitting intents occasionally repost (12%). It never applies to sets, Stories, or text posts. - Reused bytes are **copied** into the new post through the existing upload path. Deleting either post can never break the other. - Scheduled posts stage the copy in the prepared payload. The reserve promotes it or drops it like a generated image. - The plan records `reuse_media` as its workflow. Reuse is decided only from pictures that exist, and an unreadable file falls back to a new picture. - Shoots store the drop's picture brief (new `brief` column, default empty — old shoots stay unknown rather than invented). Posts are stamped with `shootId`, and reused posts with `reusedFromPostId`. A callback's new picture keeps the drop's clothes and light. - Planning moved out of `slp-generation-service.ts` into `features/feed/slp-post-plan-service.ts`. This also brings the generator back under the 800-line architecture limit. - Slurp2 0.1.27. ## Validation - New `tests/slurp-media-reuse.regression.ts`: - locked pictures never reach public posts through archive or shoot reuse, and a locked post may use both; - archive pictures are old, never Stories, and always have a file; - a callback shows only its own shoot, and a preview is only a recent locked picture going into a public teaser; - bad dates are ignored, the pick is deterministic, and the crop stays inside the picture and under a quarter of it; - reuse only replaces a new picture when one exists, never touches sets, Stories, or text, and a preview is always a teaser; - callbacks mostly show their shoot and archive reposts stay occasional; - the shoot brief carries into the callback brief, and an unknown brief stays unknown; - source proof covers the copy-not-share path, the sharp gate, the file check, the fallback, and the scheduled staging. - Planner, strategy, and content-axes regressions updated for the moved planning code. - `npm run check`: 0 errors, no new warnings. Architecture, typecheck, locale, catalog lane, catalog, release-notes, and `git diff --check` pass. - Full Slurp sweep: 142 pass. No failure that the branch base does not already have. - Not done: live dev-Engine run with real media. - Not in this slice: `multi_image_set`. A post holds one picture, and several need a post media list plus a carousel. This is still marked `ponytail:` in the axes module. - Known red: the Slurp Remastered browser suite. The failing set is identical since before slice 1 (#996). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-21 05:06:28 +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#1238
No description provided.