mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4798] [Feature]: CLI parity — expose selective/matchWholeWords/etc. on mari lorebooks add-entry/update-entry #2644
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#2644
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?
Originally created by @kolacheee on GitHub (Aug 9, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4798
Originally assigned to: @kolacheee on GitHub.
What problem does this solve?
#4791 / #4796 exposed the advanced lorebook entry fields (
selective,selectiveLogic,matchWholeWords,caseSensitive,useRegex) to Professor Mari'sapp_datalorebook.create/addEntry/updateEntryactions, which had previously been silently hardcoded. ThemariCLI is a separate code path that PR #4796 did not touch, so it still cannot set these fields:mari lorebooks add-entry(theexecuteCliadd-entryhandler inpackages/server/src/services/mari-db/mari-db.service.ts) builds its entry row inline and hardcodesselective: "false",selectiveLogic: "and",matchWholeWords: "false",caseSensitive: "false",useRegex: "false"(andsecondaryKeys: []), with no flags to override them.mari lorebooks update-entrysupports only--name/--content/--keys/--description/--tag/--outlet-name/--enable/--disable/--constant/--no-constant/--order/--folder-id. It has no--selective,--selective-logic,--match-whole-words,--case-sensitive,--use-regex, or--secondary-keys(and also no--position/--depth/--role/--group, which theapp_dataupdateEntrypath does accept).So a lorebook entry authored or edited via the CLI cannot be made Selective, whole-word, case-sensitive, or regex-matched, cannot carry secondary keys, and cannot be grouped/placed — an inconsistency with the
app_datasurface that now supports all of these.Severity: low / non-blocking. It is mitigated because Professor Mari is directed to use
app_data(not the CLI) for lorebook-entry writes, so the realistic exposure is small. This is a consistency/completeness gap for CLI users and any future CLI-driven automation. It was surfaced during the adversarial review of #4796.Proposed solution
Bring the CLI
lorebooks add-entry/update-entryhandlers to parity with theapp_dataentry-write surface:add-entry: read--selective,--selective-logic,--match-whole-words,--case-sensitive,--use-regex,--secondary-keys(and consider--position/--depth/--role/--group) instead of hardcoding, validating--selective-logicagainst the enum (and/and_all/or/not/not_all) the same waynormalizeSelectiveLogicnow does for theapp_datapath.update-entry: add the same flags to the field/flag handling.buildLorebookEntryCreateRow(which, after #4796, already reads all these fields from itsdataargument) rather than duplicating the row shape inline — so the two paths cannot silently drift apart again.add-entry/update-entryusage strings and add a regression covering the new flags.Alternatives considered
app_data), but the divergence will keep surprising CLI users and is exactly the kind of duplicated-row-shape that re-drifts.Additional context
app_datapath: #4796 (issue #4791). This issue is the CLI half, deliberately scoped out of that PR.executeClilorebooksadd-entry/update-entrycases inpackages/server/src/services/mari-db/mari-db.service.ts(the inlineentryRowbuild with the hardcodedselective/selectiveLogic/matchWholeWords/caseSensitive/useRegex, and theentryFieldMap+ flag handling inupdate-entry).buildLorebookEntryCreateRowalready reads all these fields, so CLIadd-entrycould delegate to it and drop the duplicated inline row.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: