mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7973] [MERGED] feat(cards): apply field alternatives in selected chats #8034
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#8034
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/7973
Author: @SpicyMarinara
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/7969-card-field-alternatives📝 Commits (10+)
bf1f658feat: persist chat-scoped card field alternatives1e4276afeat(cards): apply alternatives consistently to chat prompt contexte4f6ad8feat(cards): generate individual sections from editor drafts75ea378feat(cards): edit alternatives and select eligible chats per fieldce56696fix(cards): preserve base cards during scoped background work25b2a15docs: explain card field wands and retain editor browser coveragecd69252Merge branch 'feat/7968-card-field-generation' into feat/7969-card-field-alternatives9c608f6fix(prompt): inject persona dialogue fallback once88970efdocs: explain chat-specific card alternatives and retain browser coverageb15522bMerge branch 'feat/7968-card-field-generation' into feat/7969-card-field-alternatives📊 Changes
52 files changed (+2055 additions, -136 deletions)
View changed files
📝
docs/characters/creating-and-editing-characters.md(+20 -1)📝
docs/characters/personas.md(+17 -1)📝
e2e/bot-browser-download.e2e.ts(+11 -0)➕
e2e/card-field-alternatives.e2e.ts(+438 -0)📝
packages/client/src/components/bot-browser/BotBrowserView.tsx(+2 -0)➕
packages/client/src/components/characters/CardFieldAlternatives.tsx(+240 -0)📝
packages/client/src/components/characters/CharacterEditor.tsx(+72 -24)📝
packages/client/src/components/personas/PersonaEditor.tsx(+47 -15)📝
packages/client/src/localization/locales/en.json(+17 -0)📝
packages/server/src/db/schema/characters.ts(+2 -0)📝
packages/server/src/routes/backup.routes.ts(+4 -0)📝
packages/server/src/routes/characters.routes.ts(+31 -2)📝
packages/server/src/routes/chats.routes.ts(+3 -3)📝
packages/server/src/routes/conversation.routes.ts(+4 -3)📝
packages/server/src/routes/encounter.routes.ts(+14 -5)📝
packages/server/src/routes/gallery.routes.ts(+7 -7)📝
packages/server/src/routes/game.routes.ts(+16 -12)📝
packages/server/src/routes/generate.routes.ts(+13 -7)📝
packages/server/src/routes/generate/dry-run-route.ts(+10 -8)📝
packages/server/src/routes/generate/retry-agents-route.ts(+4 -3)...and 32 more files
📄 Description
Linked issue
Closes #7969
Builds on #7972, which landed in
stagingase97c52fed4d1f931a911967474548d3cbb16a2f4. This PR contains the remaining alternatives feature.Why this change
Authors need different card details in different chats without duplicating an entire Character or Persona or changing the base card everywhere.
What changed
+ Add Alternative Fieldunder all seven Card fields in both editors. Each alternative starts as a copy, has its own text and wand, and can target zero, one, or many eligible chats. Its wand uses the alternative's text as the seed and the other card fields as references. There is no arbitrary alternative-count cap.Hosted review
The full Dottore examination completed on
ddb51c9b4against landed F1: all three packets scouted, seven candidates judged, zero unverified/failed/capped, $2.896 within the then-approved $3 limit. One code bundle was truncated; the walkthrough's visibility limitations remain disclosed. Subsequent genuine incremental examinations ona828a23adandec4854880recorded their exact SHAs without hitting the cap. Valid findings were repaired; source-based dispositions are in their review threads.The final repair
48c06a9fapreserves portable export content by clearing chat assignments before checking array-level assignment conflicts. Both Character export builders reuse one local helper: strict unassignment first, then a fallback only forZodErrorfrom malformed stored data. Unexpected errors are rethrown. The first export correction put normalization before unassignment; the next review and an actual failing API regression exposed that ordering mistake. The expanded proof now covers decoded and serialized conflicts, padded prose, empty overrides, malformed entries, null, object, duplicate-ID and absent/empty states in individual downloads and mixed ZIPs. No duplicate-ID salvage or rekeying is introduced; invalid stored shapes retain the declared fail-closed policy. Strict imports and direct saves remain unchanged.Other resolved review points:
success:falsefailure transport.leaveWithoutSavingfollows successful deletion.The final incremental examination completed on exact
48c06a9fafrom recordedec4854880: $0.444, 22 model calls, zero unverified/failed/capped. It explicitly verified the assignment-ordering correction. Its sole reported finding requested the already-declined duplicate-ID salvage policy, which existed unchanged at the parent; the source-based disposition and actual nine-shape API/ZIP proof are recorded. All review threads are resolved. This records a reported finding and its rejection, rather than claiming a finding-free hosted review. All eight required checks passed on the final head, and every review thread was resolved before the locked-head merge intostagingas73ee30f41b58c0aff8f1baaceb7abfbcf0a9a7a3. The source and merge commits are verified ancestors oforigin/staging. Post-merge pipelines are separate proof and were still starting at the delivery check. After delivery, the maintainer disabled the estimated spend cap by settingDOTTORE_COST_LIMIT_USD=0; the figures above record the earlier token-price estimates.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAutomated evidence
pnpm check: passed on final export repair48c06a9facf5632f1dd433a88af4f99240ed043f, including localization, formatting, types/lint, E2E types and production builds. The current alternatives-only diff is 52 files, +2055/−136. No new config, provider/model, version or installer changes are part of the feature repair.48c06a9facf5632f1dd433a88af4f99240ed043f, with all ten platform artifact jobs passing on their first attempt and all eight required status contexts successful. Native Windows includes installer prerequisite/integrity controls and Ctrl+C/graceful shutdown. No reruns were needed.48c06a9fa, including native/compatible individual downloads and complete mixed ZIP archives with healthy, conflicting-assignment and malformed stored cards. Valid prose, empty overrides, cleared assignments and exact raw source rows are checked; all strict malformed-import assertions remain. The existing native-export memory regression also passed with a 128 MB heap limit (119 MB measured peak heap).pnpm regression:promptsuites and five direct regressions (portable import, private projection diagnostics, alternatives API/prompt, schedule generation, and decoded Persona/identity reads) passed on exacta828a23ad.fe4ff9519. Creation failures were reproduced before the defaults/JSON-column fix; retained proof covers preview, apply, decoded reads, serialized storage and update restoration. F1 semantic summary/dialogue creation and updates, explicit empty/whitespace clearing, preserved trimming and omitted/non-string inputs are covered without changing other Persona fields. Every clearing shape reseeds the field and reads its own before/after state.6db44ca19, covering base/other-chat isolation, empty overrides, metadata summaries, supported entity roles, persistence/restore, portable cards and Game dialogue macros.6db44ca19, including 54 actual Peek requests across XML/Markdown/plain wrapping. It checks stochastic macros, final preset variables, Unicode case transformations including capital ẞ, disabled sections/groups, selected and unselected choices, false conditionals, complete quoted examples and partial first-line collisions. Complete existing examples avoid a duplicate fallback; a partial first line still receives the complete fallback. Schedule-generation and Game character-sheet regressions passed during earlier integration; schedule preservation and missed Game scopes have failing-before/passing-after provider/API proof.6db44ca19. The cross-section budget regression was reproduced before its repair. More than 2,000 tracked expansions across independent sections now resolve with deferral both off and on; variable values and fallback summaries keep their own allowance, the Persona example observer remains active, and nested expansions retain the existing runaway limit.db739d111, covering both editors across desktop Chromium, mobile Chromium and mobile WebKit. They verify neighboring base edits survive while target typing and deletion remain protected.19b35ea97, using real Persona POST/GET requests. Both authored/absent-summary fixtures retain alternative text and empty values and clear foreign chat assignments. The missing payload had a failing-before proof. Shell smoke: 7/7 passed after that correction; client lint and E2E types passed.2031ca907head, with 12 regenerated and inspected desktop/mobile dark/light screenshots.ec4854880; its missed ordering case was subsequently caught by hosted review and added to the regression matrix. The final ordering repair received a completed two-file local review with zero findings on48c06a9fa.Manual verification notes
Docs and release impact
English guides are included; #7975 tracks every translated documentation pack. No version bump or release changelog edit is part of this feature.
UI evidence (if applicable)
Retained Playwright coverage exercises both editors, all seven add controls, eligible and ineligible chats, zero/multiple assignments, moving a chat between alternatives, empty replacement, save/reopen, confirmed/cancelled deletion, eligibility refresh, generation and draft protection, with desktop/mobile dark/light screenshots.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.