[PR #804] [MERGED] fix(slurp2): repair ad pipeline, audience clocks, and operation locks #1145

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

📋 Pull Request Information

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

Base: staging ← Head: general-strike-on-ads


📝 Commits (2)

  • daf7bb5 fix(slurp2): repair ad pipeline, audience clocks, and operation locks
  • 5287b33 docs(slurp2): correct the ad ceiling and privacy copy

📊 Changes

36 files changed (+850 additions, -455 deletions)

View changed files

📝 artifacts/slurp2-0.0.2.zip (+0 -0)
📝 catalog/catalog.json (+8 -8)
📝 catalog/notes.json (+6 -0)
📝 catalog/v2/catalog.json (+8 -8)
📝 catalog/v2/notes.json (+6 -0)
📝 catalog/v3/catalog.json (+8 -8)
📝 catalog/v3/notes.json (+6 -0)
📝 packages/slurp2/CHANGELOG.md (+12 -0)
📝 packages/slurp2/client.js (+30 -30)
📝 packages/slurp2/manifest.json (+5 -5)
📝 packages/slurp2/server.mjs (+148 -148)
📝 packages/slurp2/src/engine/packages/client/src/components/slurp/SlurpHome.tsx (+6 -2)
📝 packages/slurp2/src/engine/packages/client/src/components/slurp/SlurpSettings.tsx (+93 -0)
📝 packages/slurp2/src/engine/packages/client/src/components/slurp/SlurpShell.tsx (+2 -2)
📝 packages/slurp2/src/engine/packages/client/src/components/slurp/SlurpSplash.tsx (+4 -3)
📝 packages/slurp2/src/engine/packages/client/src/components/slurp/slurp2-release.ts (+16 -1)
📝 packages/slurp2/src/engine/packages/client/src/hooks/use-slurp.ts (+18 -0)
📝 packages/slurp2/src/engine/packages/client/src/localization/locales/en.json (+27 -20)
📝 packages/slurp2/src/engine/packages/server/src/routes/slurp-messages.routes.ts (+1 -1)
📝 packages/slurp2/src/engine/packages/server/src/routes/slurp.routes.ts (+6 -2)

...and 16 more files

📄 Description

Pull request

Linked issue

Closes #803

Why this change

Slurp Remastered shipped several subsystems that fail silently rather than loudly, so none of them surfaced as a crash report. Three of them disable a whole feature:

  • Audience maintenance never ran. Churn, relationship arcs, subscription billing, renewals, and lapses sit behind a 12-hour gate measured against the general world-tick mark — but the world scheduler runs every 6 hours and a notifications read advances that same mark. The gate never opened on any box in normal use.
  • Promised follow-ups postponed forever. Creator-availability resolution received no lastPostedAt, read that as "never posted", and returned offline indefinitely, so the follow-up was re-postponed every hour.
  • Feed ads stopped after the first server batch, and the configured content ceiling was dropped before selection, so ads above the chosen rating could be shown.

Plus a payout hole: POST /noodler/viewer/ads/:id/action validated only the persona, so an id that was never served — or does not exist — still earned wallet coins.

The ad pool could also only be filled by generation or by importing a file. There was no way to write a single ad by hand.

What changed

Affected package: slurp2 (Slurp Remastered), 0.0.1 → 0.0.2, patch only.

Ads

  • Feed ad slots no longer index past the end of the server batch.
  • The content ceiling is carried into ad selection instead of being dropped.
  • An unexpected model rating falls back to tame rather than rejecting the whole generated batch.
  • Ad actions are rejected with 404 unless the ad was actually served to that viewer and is still active.

Audience and schedulers

  • Maintenance now runs off its own persisted mark (slurp2.world.maintenance) instead of the general tick mark. The mark is also written when it is absent — without that the fallback resolves to the previous tick forever and the clock never arms, which would have left this fix inert.
  • Creator availability receives the latest published post at every call site.
  • Read tracking advances on the default Following feed.
  • Creators no longer write first when proactive messages are turned off, and persona-operated Creators no longer act autonomously.

Locks

  • Backup, restore, and deletion now exclude world-tick and per-account mutations in both acquisition orders.

UI

  • Corrected the logo path and the welcome screen's close control and keyboard focus.
  • New: a form in Settings → Ads to write your own ad (brand, product, copy, content rating). This posts to the pre-existing POST /noodler/ads/pool route; no new endpoint or permission.

Note on the draft-post fix

The availability fix filters drafts in the query, not at the call sites. Filtering a limit 1 result afterwards returns nothing when the newest post happens to be a draft — which reads as a Creator who has never posted, i.e. the exact bug being fixed. Added getNoodlerLatestPublishedPost and routed all three availability call sites through it.

Package and security impact

  • Affected package IDs: slurp2
  • Engine compatibility impact: none; minEngineVersion unchanged at 2.4.5
  • New or changed permissions/entrypoints: none. The ad-creation form uses an existing route and its existing zod schema.
  • Restart, storage, update, or uninstall impact: standard package update. One new app-settings key, slurp2.world.maintenance; absent on existing installs and initialized on the first world tick.

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

Ran the full set of checks this repository's PR workflow runs, all passing locally: npm run check, npm run test:security, test-catalog-lanes.mjs, validate-package-locales.mjs, validate-package-locale-keys.mjs, validate-catalog.mjs, catalog-generatedat-determinism, catalog-release-notes, validate-pr-triage.mjs, test-owner-approval.mjs, plus npm run typecheck:packages.

Added tests/slurp2-bughunt.regression.ts, which exercises the lock exclusions against the real lock modules with promise barriers in both acquisition orders, and pins the source-level contracts for the ad, feed, availability, and maintenance-clock fixes. Updated tests/slurp-audience-arc.regression.ts for the new maintenance gate, including an assertion that the mark is written when absent — that assertion fails against the inert first version of this fix.

Test baseline. Eight slurp-* regressions are already failing on staging at a6bb9509 (slurp-alive, slurp-boundary, slurp-lifecycle-safety, slurp-phase1-durability, slurp-population, slurp-ppv-paywall, slurp-relationship-panel, slurp-stance). I verified this by running the suite in a separate worktree pinned to the base commit and comparing assertion text per test: all eight messages match byte-for-byte across both trees. This branch causes zero new failures and does not fix any of the eight. None are in this PR's scope.

Not verified: the two unticked boxes above are accurate. I have not installed this build through a Marinara Engine instance, so the new Settings form has not been exercised in a browser — the ad-creation path is verified only by the schema match between client payload and the server's existing zod schema. Worth a look before promotion to main.

Documentation impact

  • No documentation changes needed

UI evidence (if applicable)

None captured — see the "Not verified" note above.

Summary by CodeRabbit

  • New Features

    • Added the ability to create custom ads from Settings.
    • Added clearer advertising controls for content ratings, frequency, and promotion behavior.
    • Updated branding and release information for Slurp Remastered 0.0.2.
  • Bug Fixes

    • Improved ad rotation, feed visibility tracking, payouts, and read tracking.
    • Corrected content-rating handling and creator activity detection.
    • Improved world processing, messaging, backup/restore safety, and deletion handling.
    • Fixed welcome-screen focus, close-control behavior, and logo display.
    • Added clearer backup restoration warnings.

🔄 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/804 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 9/12/2026 **Status:** ✅ Merged **Merged:** 9/12/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `general-strike-on-ads` --- ### 📝 Commits (2) - [`daf7bb5`](https://github.com/Pasta-Devs/Marinara-Agents/commit/daf7bb5cd55e91c93a4211226b9eb88aff769338) fix(slurp2): repair ad pipeline, audience clocks, and operation locks - [`5287b33`](https://github.com/Pasta-Devs/Marinara-Agents/commit/5287b338e895572b0a52c938aba4ce94f81945e6) docs(slurp2): correct the ad ceiling and privacy copy ### 📊 Changes **36 files changed** (+850 additions, -455 deletions) <details> <summary>View changed files</summary> 📝 `artifacts/slurp2-0.0.2.zip` (+0 -0) 📝 `catalog/catalog.json` (+8 -8) 📝 `catalog/notes.json` (+6 -0) 📝 `catalog/v2/catalog.json` (+8 -8) 📝 `catalog/v2/notes.json` (+6 -0) 📝 `catalog/v3/catalog.json` (+8 -8) 📝 `catalog/v3/notes.json` (+6 -0) 📝 `packages/slurp2/CHANGELOG.md` (+12 -0) 📝 `packages/slurp2/client.js` (+30 -30) 📝 `packages/slurp2/manifest.json` (+5 -5) 📝 `packages/slurp2/server.mjs` (+148 -148) 📝 `packages/slurp2/src/engine/packages/client/src/components/slurp/SlurpHome.tsx` (+6 -2) 📝 `packages/slurp2/src/engine/packages/client/src/components/slurp/SlurpSettings.tsx` (+93 -0) 📝 `packages/slurp2/src/engine/packages/client/src/components/slurp/SlurpShell.tsx` (+2 -2) 📝 `packages/slurp2/src/engine/packages/client/src/components/slurp/SlurpSplash.tsx` (+4 -3) 📝 `packages/slurp2/src/engine/packages/client/src/components/slurp/slurp2-release.ts` (+16 -1) 📝 `packages/slurp2/src/engine/packages/client/src/hooks/use-slurp.ts` (+18 -0) 📝 `packages/slurp2/src/engine/packages/client/src/localization/locales/en.json` (+27 -20) 📝 `packages/slurp2/src/engine/packages/server/src/routes/slurp-messages.routes.ts` (+1 -1) 📝 `packages/slurp2/src/engine/packages/server/src/routes/slurp.routes.ts` (+6 -2) _...and 16 more files_ </details> ### 📄 Description # Pull request ## Linked issue Closes #803 ## Why this change Slurp Remastered shipped several subsystems that fail silently rather than loudly, so none of them surfaced as a crash report. Three of them disable a whole feature: - **Audience maintenance never ran.** Churn, relationship arcs, subscription billing, renewals, and lapses sit behind a 12-hour gate measured against the general world-tick mark — but the world scheduler runs every 6 hours and a notifications read advances that same mark. The gate never opened on any box in normal use. - **Promised follow-ups postponed forever.** Creator-availability resolution received no `lastPostedAt`, read that as "never posted", and returned offline indefinitely, so the follow-up was re-postponed every hour. - **Feed ads stopped after the first server batch**, and the configured content ceiling was dropped before selection, so ads above the chosen rating could be shown. Plus a payout hole: `POST /noodler/viewer/ads/:id/action` validated only the persona, so an id that was never served — or does not exist — still earned wallet coins. The ad pool could also only be filled by generation or by importing a file. There was no way to write a single ad by hand. ## What changed Affected package: `slurp2` (Slurp Remastered), `0.0.1` → `0.0.2`, patch only. **Ads** - Feed ad slots no longer index past the end of the server batch. - The content ceiling is carried into ad selection instead of being dropped. - An unexpected model rating falls back to `tame` rather than rejecting the whole generated batch. - Ad actions are rejected with 404 unless the ad was actually served to that viewer and is still active. **Audience and schedulers** - Maintenance now runs off its own persisted mark (`slurp2.world.maintenance`) instead of the general tick mark. The mark is also written when it is absent — without that the fallback resolves to the previous tick forever and the clock never arms, which would have left this fix inert. - Creator availability receives the latest published post at every call site. - Read tracking advances on the default Following feed. - Creators no longer write first when proactive messages are turned off, and persona-operated Creators no longer act autonomously. **Locks** - Backup, restore, and deletion now exclude world-tick and per-account mutations in both acquisition orders. **UI** - Corrected the logo path and the welcome screen's close control and keyboard focus. - **New:** a form in Settings → Ads to write your own ad (brand, product, copy, content rating). This posts to the pre-existing `POST /noodler/ads/pool` route; no new endpoint or permission. ### Note on the draft-post fix The availability fix filters drafts **in the query**, not at the call sites. Filtering a `limit 1` result afterwards returns nothing when the newest post happens to be a draft — which reads as a Creator who has never posted, i.e. the exact bug being fixed. Added `getNoodlerLatestPublishedPost` and routed all three availability call sites through it. ## Package and security impact - Affected package IDs: `slurp2` - Engine compatibility impact: none; `minEngineVersion` unchanged at `2.4.5` - New or changed permissions/entrypoints: none. The ad-creation form uses an existing route and its existing zod schema. - Restart, storage, update, or uninstall impact: standard package update. One new app-settings key, `slurp2.world.maintenance`; absent on existing installs and initialized on the first world tick. ## Validation - [x] `node scripts/validate-catalog.mjs` passes locally - [x] `git diff --check` passes locally - [x] 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 - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Ran the full set of checks this repository's PR workflow runs, all passing locally: `npm run check`, `npm run test:security`, `test-catalog-lanes.mjs`, `validate-package-locales.mjs`, `validate-package-locale-keys.mjs`, `validate-catalog.mjs`, `catalog-generatedat-determinism`, `catalog-release-notes`, `validate-pr-triage.mjs`, `test-owner-approval.mjs`, plus `npm run typecheck:packages`. Added `tests/slurp2-bughunt.regression.ts`, which exercises the lock exclusions against the real lock modules with promise barriers in both acquisition orders, and pins the source-level contracts for the ad, feed, availability, and maintenance-clock fixes. Updated `tests/slurp-audience-arc.regression.ts` for the new maintenance gate, including an assertion that the mark is written when absent — that assertion fails against the inert first version of this fix. **Test baseline.** Eight `slurp-*` regressions are already failing on `staging` at `a6bb9509` (`slurp-alive`, `slurp-boundary`, `slurp-lifecycle-safety`, `slurp-phase1-durability`, `slurp-population`, `slurp-ppv-paywall`, `slurp-relationship-panel`, `slurp-stance`). I verified this by running the suite in a separate worktree pinned to the base commit and comparing assertion text per test: all eight messages match byte-for-byte across both trees. This branch causes **zero** new failures and does not fix any of the eight. None are in this PR's scope. **Not verified:** the two unticked boxes above are accurate. I have not installed this build through a Marinara Engine instance, so the new Settings form has not been exercised in a browser — the ad-creation path is verified only by the schema match between client payload and the server's existing zod schema. Worth a look before promotion to `main`. ## Documentation impact - [x] No documentation changes needed ## UI evidence (if applicable) None captured — see the "Not verified" note above. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added the ability to create custom ads from Settings. * Added clearer advertising controls for content ratings, frequency, and promotion behavior. * Updated branding and release information for Slurp Remastered 0.0.2. * **Bug Fixes** * Improved ad rotation, feed visibility tracking, payouts, and read tracking. * Corrected content-rating handling and creator activity detection. * Improved world processing, messaging, backup/restore safety, and deletion handling. * Fixed welcome-screen focus, close-control behavior, and logo display. * Added clearer backup restoration warnings. <!-- 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:03:50 +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#1145
No description provided.