mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8543] [MERGED] feat(characters): split a character's description into its fields #8663
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#8663
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/8543
Author: @Promansis
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @Promansis
Base:
staging← Head:feature(characters)/split-description-fields📝 Commits (10+)
463c3a1feat(characters): split description into fields (WIP)d49d9c4Merge upstream/staging into feature(characters)/split-description-fields83262e2feat(bot-browser): offer the description split on downloaded cardsef772fdfeat(characters): split one-line PList cards27db358feat(characters): save description splits as a new card version2643833feat(characters): show the split summary after imports and warn about keyword-sorted prose769277cfix(characters): split interview profiles, persona W++ prefixes, bare PLists and {{char}} chat linescd2f169Merge upstream/staging into feature(characters)/split-description-fields7f74a5afix(characters): keep the description splitter linear on crafted lines5d10daeMerge branch 'staging' into feature(characters)/split-description-fields📊 Changes
14 files changed (+2633 additions, -12 deletions)
View changed files
📝
packages/client/src/components/bot-browser/BotBrowserView.tsx(+101 -2)📝
packages/client/src/components/characters/CharacterEditor.tsx(+78 -3)➕
packages/client/src/components/characters/DescriptionSplitDialog.tsx(+165 -0)📝
packages/client/src/components/modals/ImportCharacterModal.tsx(+103 -2)➕
packages/client/src/lib/description-split-mari.ts(+15 -0)📝
packages/client/src/localization/locales/en.json(+44 -0)📝
packages/client/vite.config.ts(+4 -0)📝
packages/server/src/routes/characters.routes.ts(+11 -5)📝
packages/server/src/routes/import.routes.ts(+15 -0)📝
packages/server/src/services/import/st-character.importer.ts(+34 -0)📝
packages/shared/src/index.ts(+1 -0)➕
packages/shared/src/utils/character-description-split.ts(+1610 -0)➕
scripts/regressions/character-description-split-version.regression.ts(+99 -0)➕
scripts/regressions/character-description-split.regression.ts(+353 -0)📄 Description
Linked issue
Closes #8542
Why this change
What changed
packages/shared/src/utils/character-description-split.ts. It recognises labelled sections, Markdown headings, W++ and PList trait lists (bracketed or bare, one-line,{{char}}'s personaprefixes), JSON-style blocks, wrapper tags,{{user}}:/{{char}}:dialogue and<START>blocks. It moves text verbatim, and every line lands in exactly one field.{{user}}: Personality?/Appearance?/Past?interview, each answer goes to the field its question names. "Introduction?" names the description. A dialogue run with no field question becomes example dialogue.description-split, so the original stays one click away.PATCH /api/characters/personas/:idacceptsversionSource/versionReasonfor the Bot Browser persona path.vite.config.tsbecause the shared chunk was near its size budget. New UI copy uses localization keys inen.json.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run checks on
6ebbb0b65(currentstagingmerged at5d10dae89). The boxes above are left for the human contributor.Corpus checks with throwaway probes outside the repository:
{{char}}:chat and bare PLists are recognised. No lost text.ReDoS fixes (CodeQL #684–#686)
7f74a5a97replaces the three flagged regexes, plus further super-linear ones that fuzzing found: trailing-whitespace tidy, the#/==/[[ ]]/bold heading patterns and thename:scans. Output matches the old regexes on 400k random heading strings and an exhaustive bold-heading sweep. Library and Pygmalion results are unchanged.631ddd921fixes Dottore's three findings. The[Label:bracket heading regex was exponential on a run of{{macros}}(22 macros: 100 ms, doubling per macro). The spoken-quote check was cubic on an unclosed quote (2k words: 3.9 s). Text with no letters or digits (...,♡) was dropped or replaced as already present.a7395b3e7keeps a bare<START>marker out of that symbol fallback, so a stray marker does not leave an empty example block. The two code helpers match their regexes on 51M exhaustive and random strings. An A/B run over the 564 library cards and the Pygmalion cards shows no output change.=heading, 10k chars[+ 40{{a}}macrosx "+ 2k words, no closing quote</+ 20k spaces[+ 20k spaces<!--+ 20k spaces<+ 20k spaces (plainkey: value)Personality:+ 20k;(value trim)Name:+ 20k newlines (name scans)69cdec986fixes the last six padded-label patterns, which a full crafted-input scan found. These are the plainkey: valuelabel,</tag>,[Title],<!-- note -->, the value's trailing]});trim and the twoName:scans. Each is now read in code, or rewritten with a single padding run, and returns what the old regex returned: 60M exhaustive and random strings show no mismatch. The library and Pygmalion A/B runs show no output change. The scan, which tries 29 line prefixes × 40 fillers × 12 tails at 400 and 1.6k characters, now reports no super-linear pattern.6ebbb0b65replaces the two copies of theName:line regex (collectNamescapped values at 60 characters,skipReasonat 40) with one sharedNAME_LINE_REcapped at 60.skipReasonkeeps only the first word of each value, so the only possible change is a single word longer than 40 characters with no spaces. The A/B runs show no change.Manual verification notes
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)No files under
docs/change. No version bump and no CHANGELOG entry.Merge danger
Door: two-way. The split is opt-in at every entry point, and each split is a new card version that version history can restore.
Blast radius: contained. Imports without the checkbox behave as before. The shared touch points are the import route's new flag, the persona PATCH's optional version fields and a separate client chunk.
UI evidence (if applicable)
Screenshots still to add: the import checkbox, the Bot Browser checkbox, the editor preview and the applied summary with the warning.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.