mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5944] [MERGED] Let an Experience pass player-picked lorebook entries into world generation #7001
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7001
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5944
Author: @kolacheee
Created: 9/8/2026
Status: ✅ Merged
Merged: 9/8/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/experience-lore-entries📝 Commits (10+)
fd4ba68feat(lorebook): let a caller size the forced-entry budget and skip its roll82821defeat(game): let an Experience read the lorebook entries a player picked60df2acfix(game): keep an Experience's lore selection to exactly what was ticked (#5942)4798e45fix(game): keep a set-aside Experience lore entry out of the call (#5942)43eaeb6fix(game): always answer an Experience's lore selection, even at zero (#5942)f5715e5refactor(game): the lore party fallback reads the chat cast through the existing parser (#5942)2bdd3d6Merge remote-tracking branch 'origin/staging' into codex/review-pr-5944-sep86b611ebfix(lore): enforce exact selection budgets for recursive books611d839Merge remote-tracking branch 'origin/staging' into codex/review-pr-5944-sep877ca164test(ui): scope character action proof to its fixture📊 Changes
6 files changed (+1093 additions, -9 deletions)
View changed files
📝
CHANGELOG.md(+5 -0)📝
e2e/core-flows.e2e.ts(+2 -0)📝
packages/server/src/routes/game.routes.ts(+198 -3)📝
packages/server/src/services/lorebook/index.ts(+50 -6)📝
packages/server/src/services/lorebook/keyword-scanner.ts(+9 -0)➕
scripts/regressions/experience-lore-entries.regression.ts(+829 -0)📄 Description
Linked issue
Closes #5942
Why this change
What changed
experienceGenerationSchemagainslorebookEntryIds—z.array(z.string()).max(LIMITS.MAX_LOREBOOK_ENTRIES).optional(). Absent or empty is a byte-identical no-op: no storage read, no macro context, no appended content, no response key (the regression captures upstream messages against a baseline and asserts deep equality).processLorebookscall modeled on/setup's block (macro context re-derived from chat metadata, scope exclusions, the three-part worldInfo join, appended to the outbound content), passing the selection asforcedEntryIdswithgenerationTriggerssupplied explicitly.forcedEntriesOnlymode onprocessLorebooks: the ambient book filter and entry listing are suppressed, so a global book's constant entries cannot ride in on somebody else's tick; eligibility gates (enabled, character/tag/trigger filters, timing) still refuse. A set-aside entry also stays out of the call — the ordinary scan is skipped outright under this mode, closing the scan-then-merge re-admission for this route (the pre-existing shape on older callers is #5943, with a measured second door recorded there).ignoreProbabilityonScanOptions, read in exactly one place (passesForcedEntryActivationGates), set in exactly one spread, copying theignoreTimingprecedent; every existing caller byte-identical (all construction sites enumerated in review).applyCurrentLocationLoreBudget's existing defaulted parameter; drops follow the existing selection order (constants survive first) at whole-entry granularity;budgetSkippedEntriesis projected into the response aslorebook: { includedEntries, skippedEntries[] }.lorebookkey is present — all-refused is{ includedEntries: 0, skippedEntries: [...] }, cleanly distinguishable from an Engine that predates the feature (no key). This is what lets the client side avoid writing a false "all your picks were refused" record against an older server.scripts/regressions/experience-lore-entries.regression.ts— eleven scenarios, twelve pinned behaviors; every load-bearing line was mutation-tested across the review rounds (22 distinct seeded bugs killed).Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm checkexit 0; the feature regression green; full regression runner 220/221 (the one red is the knowngallery-previewsWindows EPERM teardown flake, reproduced on clean HEAD; note the full suite needs Git Bash — under PowerShelllauncher/format-guardcan't spawn bash); three independent adversarial review rounds with 22 seeded mutants killed, including one that re-implements the rejected design candidate and proves it leaks.Maintainer review follow-up: Fixed the exact-selection recursive re-admission in this PR:
forcedEntriesOnlynow skips recursive activation as well as the ordinary scan. A regression first reproduced ten entries entering a seven-entry budget while three were reported skipped; it now tests both recursive and non-recursive selected books and passes. Legacy/setupand spatial caller behavior is unchanged, so #5943 remains open for those paths.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG updated; no user-facing docs/ pages touched (the player-facing surface is the package's, documented in Agents PR #750).
UI evidence (if applicable)
Summary by CodeRabbit
New Features
Bug Fixes
Maintainer staging integration
Updated against current
staging.pnpm check,experience-lore-entries, and neighboring lorebook and prompt regressions pass locally. The recursive budget case was red before the fix and green after it. Validation uses local synthetic provider responses, not paid-provider or Experience-package UI proof. Human/manual validation checkboxes remain unchecked.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.