[GH-ISSUE #5080] [Feature]: Mari creates preset variables but never references them in a section, so they do nothing #2812

Closed
opened 2026-10-21 05:56:02 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @kolacheee on GitHub (Aug 15, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5080

Originally assigned to: @kolacheee on GitHub.

What problem does this solve?

Professor Mari can create preset variables, but the prompt she builds never uses them, so they have no effect.

A preset variable is a "choice block" — { variableName, question, options[] } that the user picks a value for per chat. Its value only reaches the model where a prompt section's content references it with the {{variableName}} macro (packages/shared/src/types/prompt.ts: "A preset-level variable ... referenced via {{variableName}} in prompts"; the assembler resolves {{varName}} from the per-chat selection in packages/server/src/services/prompt/assembler.ts). If no section references the variable, the choice block is inert: the user can pick "Warm" vs "Sharp" and nothing changes in the assembled prompt.

Mari's workspace guidance in packages/server/src/services/professor-mari/workspace-agent.service.ts tells her to create preset variables as data.choiceBlocks (variableName / question / options), but nothing tells her the variable only takes effect when a section references {{variableName}}. Her own worked example demonstrates the anti-pattern — it creates a tone choice block next to a section whose content is "You are {{char}}.", so {{tone}} never appears and the variable does nothing. Users then see a variable in the preset UI that has no visible effect, which reads as broken.

Proposed solution

Add authoring guidance (and fix the worked example) so that whenever Mari defines a preset variable she also inserts its {{variableName}} macro into at least one section's content:

  • In the preset.create / addChoiceBlock guidance, state that a choice block only takes effect when a section references it via {{variableName}}, and that Mari must add that reference when she creates a variable. When she adds a variable to an existing preset, she should also update a section (updateSection) to reference it.
  • Update the worked example so the section actually uses the variable, e.g. "You are {{char}}. Speak in a {{tone}} tone." for the tone example.

This is guidance-only (prompt/example), no engine or schema change.

Alternatives considered

  • Auto-inserting the macro on the engine side when a choice block is created — rejected: where a variable belongs (which section, where in the text) is a semantic authoring decision, not a blind append. Guidance keeps Mari in control and matches how her other authoring heuristics work.

Additional context

  • Variable reference + resolution: packages/shared/src/types/prompt.ts (ChoiceBlock, {{variableName}}), packages/server/src/services/prompt/assembler.ts (chatChoices → variableValues → {{varName}}).
  • Mari guidance + the tone worked example: packages/server/src/services/professor-mari/workspace-agent.service.ts (the preset.create guidance line and the example command).
  • This is a Professor Mari authoring-guidance change, to be worked alongside the broader Mari work in #5073.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @kolacheee on GitHub (Aug 15, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5080 Originally assigned to: @kolacheee on GitHub. ## What problem does this solve? Professor Mari can create preset variables, but the prompt she builds never uses them, so they have no effect. A preset variable is a "choice block" — `{ variableName, question, options[] }` that the user picks a value for per chat. Its value only reaches the model where a prompt section's content references it with the `{{variableName}}` macro (`packages/shared/src/types/prompt.ts`: "A preset-level variable ... referenced via `{{variableName}}` in prompts"; the assembler resolves `{{varName}}` from the per-chat selection in `packages/server/src/services/prompt/assembler.ts`). If no section references the variable, the choice block is inert: the user can pick "Warm" vs "Sharp" and nothing changes in the assembled prompt. Mari's workspace guidance in `packages/server/src/services/professor-mari/workspace-agent.service.ts` tells her to create preset variables as `data.choiceBlocks` (`variableName` / `question` / `options`), but nothing tells her the variable only takes effect when a section references `{{variableName}}`. Her own worked example demonstrates the anti-pattern — it creates a `tone` choice block next to a section whose content is `"You are {{char}}."`, so `{{tone}}` never appears and the variable does nothing. Users then see a variable in the preset UI that has no visible effect, which reads as broken. ## Proposed solution Add authoring guidance (and fix the worked example) so that whenever Mari defines a preset variable she also inserts its `{{variableName}}` macro into at least one section's content: - In the `preset.create` / `addChoiceBlock` guidance, state that a choice block only takes effect when a section references it via `{{variableName}}`, and that Mari must add that reference when she creates a variable. When she adds a variable to an *existing* preset, she should also update a section (`updateSection`) to reference it. - Update the worked example so the section actually uses the variable, e.g. `"You are {{char}}. Speak in a {{tone}} tone."` for the `tone` example. This is guidance-only (prompt/example), no engine or schema change. ## Alternatives considered - Auto-inserting the macro on the engine side when a choice block is created — rejected: where a variable belongs (which section, where in the text) is a semantic authoring decision, not a blind append. Guidance keeps Mari in control and matches how her other authoring heuristics work. ## Additional context - Variable reference + resolution: `packages/shared/src/types/prompt.ts` (`ChoiceBlock`, `{{variableName}}`), `packages/server/src/services/prompt/assembler.ts` (chatChoices → variableValues → `{{varName}}`). - Mari guidance + the `tone` worked example: `packages/server/src/services/professor-mari/workspace-agent.service.ts` (the `preset.create` guidance line and the example command). - This is a Professor Mari authoring-guidance change, to be worked alongside the broader Mari work in #5073. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2812
No description provided.