mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7808] [MERGED] feat(decision): let Choice options carry criteria for the Decision model #7935
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#7935
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/7808
Author: @SpicyMarinara
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/7791-decision-criteria📝 Commits (2)
7c72055feat(decision): let Choice options carry criteria for the Decision model520fdb5docs(decision): say what happens when criteria quotes differ📊 Changes
6 files changed (+377 additions, -40 deletions)
View changed files
📝
docs/prompts/conditional-prompts.md(+10 -0)📝
packages/server/src/services/decision/decision-default.ts(+3 -1)📝
packages/server/src/services/decision/prompt-decisions.ts(+30 -12)📝
packages/server/src/services/decision/system-one.client.ts(+9 -5)📝
packages/shared/src/utils/macro-engine.ts(+75 -22)➕
scripts/regressions/decision-choice-criteria.regression.ts(+250 -0)📄 Description
Linked issue
Closes #7791
Why this change
decision_choice:option is only a word like "angry", so the Decision model has to guess what it means from its own preconceptions. Authors wanted to tell the model what each answer means in their story, without rewording the question or renaming the options.What changed
"option":"criteria", e.g.{{#if decision_choice:"Kaelen's mood in the latest message" == "angry":"Kaelen raises his voice, makes threats or breaks something"}}. It works on either side of the comparison, with==/!=/is/is not, and in the short form (== "rain":"..." || "snow":"..."). Both parts are quoted with the same kind of quote and escape like any other quoted value.criteriadescription (they used to be empty strings); a chat-model backend asks each option asstatement: option (criteria). Options without criteria are sent exactly as before. The prompt stays visible in debug mode through the existinglogDebugOverriderequest logging and the Decision debug inspection trace.{{char}}statement gets per-character criteria. If one option has criteria in several places, the first non-empty ones count. Edited criteria change the turn's Choice cache key, so they are asked again rather than reusing an answer to the old wording."option":"criteria"keeps its old meaning (a colon inside one quoted value, unescaped inner quotes, mixed quote kinds, a trailing colon). Only comparisons against adecision_choice:operand read criteria; every other comparison is untouched. The only syntax whose meaning changes is a decision_choice literal of the exact form"x":"y", which used to be offered to the model as the single optionx":"y.docs/prompts/conditional-prompts.md(English only; translations follow in the release docs sweep).scripts/regressions/decision-choice-criteria.regression.ts.Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands actually run in this branch:
pnpm build:shared && node ./scripts/run-regressions.mjs --filter decision-choice-criteria: passed. It covers old syntax unchanged, new syntax parsed (both sides, short form, escapes, curly and single quotes,&&/||inside criteria), malformed input falling back, evaluation and settled-branch planning comparing the option alone, criteria merged and macro-resolved per character, criteria in the System One request body and in the chat-model per-option statement, and edited criteria re-asking the turn.origin/stagingbuild ofmacro-engine.tsand hold there, so they pin the old behaviour, not just the new one.node ./scripts/run-regressions.mjs --filter decision: 17/17 passed.node ./scripts/run-regressions.mjs --filter macro,--filter conditional,--filter lorebook: all passed.pnpm regression:prompt: passed.pnpm check: passed.Manual verification notes
decision_choice:"..." == "angry":"..."sends the criteria (check the request with debug mode on in the server log or the Decision debug panel) and that theangrybranch is still selected when the model answers "angry".statement: angry (criteria)in the debug log.decision_choice:"..." == "angry"syntax picks the same branches as before.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Changed English docs:
docs/prompts/conditional-prompts.md(translations are handled in the release docs sweep).UI evidence (if applicable)
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.