mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4811] [MERGED] feat(server): CLI parity for lorebook entry keyword/selective fields #6504
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#6504
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/4811
Author: @kolacheee
Created: 8/9/2026
Status: ✅ Merged
Merged: 8/9/2026
Merged by: @kolacheee
Base:
staging← Head:feat/4798-cli-lorebook-parity📝 Commits (2)
c3ae8dbfeat(server): CLI parity for lorebook entry keyword/selective fieldsb2a7c94fix(server): list the new lorebook entry flags inmari lorebooks --help📊 Changes
2 files changed (+128 additions, -49 deletions)
View changed files
📝
packages/server/src/services/mari-db/mari-db.service.ts(+71 -49)📝
scripts/regressions/open-issues.regression.ts(+57 -0)📄 Description
Linked issue
Closes #4798
Why this change
The
mariCLI'slorebooks add-entry/update-entryhandlers silently hardcoded the advanced lorebook entry fields (selective,selectiveLogic,matchWholeWords,caseSensitive,useRegex) and offered no flags for them — so a lorebook entry authored or edited via the CLI could not be made Selective, whole-word, case-sensitive, or regex-matched, and could not carry secondary keys. That left the CLI behind theapp_dataentry-write path, which was brought to parity in #4796. This gap was surfaced by the adversarial review of #4796.What changed
--selective,--selective-logic,--match-whole-words,--case-sensitive,--use-regex, and--secondary-keysonmari lorebooks add-entry, and the paired presence flags (--selective/--no-selective,--match-whole-words/--no-match-whole-words,--case-sensitive/--no-case-sensitive,--use-regex/--no-use-regex) plus--selective-logicand--secondary-keysonupdate-entry.--selective-logicis validated against the stored enum (and/and_all/or/not/not_all) on both subcommands.add-entryto build its row viabuildLorebookEntryCreateRow(the sharedapp_databuilder) instead of a duplicated inline row shape, then apply the CLI-onlyfolderId— so the CLI andapp_dataentry shapes cannot drift apart again.BOOLEAN_FLAGSand update theadd-entry/update-entryusage strings.add-entry/update-entrycoverage: field round-trip through both, and invalid--selective-logicrejection on both subcommands.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Automated (run locally, green — boxes left unticked for the human to confirm):
pnpm check(tsc + eslint + client build) passes.open-issuesregression passes, including the new CLIadd-entry/update-entryassertions (fields round-trip through the realexecuteClipath; invalid--selective-logicis rejected on both subcommands).Still worth a manual pass (NOT yet done):
mari lorebooks add-entry <lorebook-id> --name X --keys foo --selective --selective-logic and_all --match-whole-words --use-regex --apply, then read the entry back (mari lorebooks entries/ the editor) and confirm the fields persisted.mari lorebooks update-entry <entry-id> --no-match-whole-words --selective-logic not --applyand confirm the patch applied.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)No
docs/files change in this PR, so nodocs-i18nmirroring is required. No version bump.Summary by CodeRabbit
New Features
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.