[GH-ISSUE #4931] [Feature]: Easy Viewer phase 4 — Peek-Prompt-fidelity character/preset render + true per-entry reject #2734

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

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

Originally assigned to: @kolacheee on GitHub.

What problem does this solve?

Phase 4 follow-up to the Professor Mari "Easy Viewer" (#4919). Two capabilities were deliberately deferred because they need server work, and the Easy Viewer PR shipped without them:

  1. Peek-Prompt-fidelity rendering of character and preset edits. In the Easy Viewer, character and preset changes render as a generic before/after field diff. The user asked for them to appear the way they would in Peek Prompt (the assembled prompt: XML / Markdown / brackets). That rendering is produced server-side by assemblePrompt, which reads persisted rows by id; apply:false returns before/after row objects, not a rendered prompt. So a faithful Peek-Prompt view needs a new server path.

  2. True per-entry reject (reverting a single row of a pending change). Today the per-entry control in the Easy Viewer is Dismiss — a client-only hide, since Mari's edits are already applied and the card's Keep/Restore governs the whole batch. Actually reverting one row of an approval touches the audited durable-undo/restore path (#4813 / #4828 / #4852) and referential ordering, so it was deferred.

Proposed solution

  1. Peek-Prompt render endpoint. Add a server endpoint that runs assemblePrompt twice for the affected character/preset with the target row overridden by approval.diffPreview.before and .after, returns the two messages[] arrays, and lets the client diff them and feed the result into the existing PeekPromptModal. Presets are the harder case (a preset.updateSection "after" is a single section that doesn't map to a whole assembled prompt without the rest of the preset/groups/choiceBlocks).

  2. Scoped per-entry reject. Add a server "reject-rows" path that reverts a dependency-closed subset of a pending approval: run restorePlan over the selected rows, shrink the pending record's plan.changes, recompute summary/diffPreview, rewrite the durable sidecar, and rework the whole-plan supersede guard / one-plan-per-history-entry model to be per-row. Smallest viable start: scope reject to lorebook.create inserts only (leaf lorebook_entries rows → clean single deletes with no FK fallout); forbid rejecting the parent lorebooks row (or treat it as reject-all). Note: diffPreview is capped at 50 rows and omits cascadeOf, so the endpoint must operate on the full server-side plan, not the client's lossy preview.

Alternatives considered

  • Client-only approximation of the Peek-Prompt wrap format (duplicating wrapContent's XML/Markdown output) — lower fidelity, drifts from the server wrap logic, and omits macro/persona/lorebook resolution. Rejected in favor of the true server render.
  • Keeping per-entry action as Dismiss-only (the current shipped behavior) — acceptable interim, but doesn't satisfy the "reject each individual entry" request.

Additional item: a lorebook entry's activation mode + vectorization are not obvious (folding into PR #4921 now)

Live-testing the Easy Viewer surfaced a third gap. Unlike the two capabilities above, this one is client-only (no server work), so it is being pulled forward into the Easy Viewer PR (#4921) rather than deferred here.

For a lorebook entry, the Easy Viewer does not make the entry's activation mode obvious at a glance. A reviewer cannot tell whether an entry is:

  • Constant — always inserted (constant: true),
  • Normal — keyword-triggered (constant: false with keys), or
  • Disabled — off entirely (enabled: false),

and it does not surface whether the entry is Vectorized (retrieved by embedding similarity) unless that specific field happens to change in Mari's edit.

Today constant only appears as a small "Constant: on/off" chip when it changes, enabled shows as a Disabled/Enabled badge, and vectorization falls through to the generic field diff only on change. The baseline state of a present-but-unchanged property is invisible — so an entry Mari just created as Constant + Vectorized reads like a plain entry.

Wanted: an always-visible status indicator on each lorebook-entry card in the Easy Viewer showing its activation mode (Constant / Normal / Disabled) plus a Vectorized marker, matching the engine's own lorebook-editor visual language, with a before → after shown when Mari's edit changes that state. This is the "most destructive/most important should be loudest" principle applied to activation semantics, not just deletes.

Additional context

Follow-up to #4919 (Easy Viewer, PR #4921). The investigation for that feature already scoped the first two items (server assemblePrompt override for the render; restorePlan-over-a-subset for reject) and recommended shipping phases 1–3 first, which is done. The activation/vectorization indicator (third item) is being addressed in #4921.

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 11, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4931 Originally assigned to: @kolacheee on GitHub. ## What problem does this solve? Phase 4 follow-up to the Professor Mari "Easy Viewer" (#4919). Two capabilities were deliberately deferred because they need server work, and the Easy Viewer PR shipped without them: 1. **Peek-Prompt-fidelity rendering of character and preset edits.** In the Easy Viewer, character and preset changes render as a generic before/after field diff. The user asked for them to appear the way they would in **Peek Prompt** (the assembled prompt: XML / Markdown / brackets). That rendering is produced server-side by `assemblePrompt`, which reads persisted rows by id; `apply:false` returns before/after row objects, not a rendered prompt. So a faithful Peek-Prompt view needs a new server path. 2. **True per-entry reject** (reverting a single row of a pending change). Today the per-entry control in the Easy Viewer is **Dismiss** — a client-only hide, since Mari's edits are already applied and the card's Keep/Restore governs the whole batch. Actually reverting one row of an approval touches the audited durable-undo/restore path (#4813 / #4828 / #4852) and referential ordering, so it was deferred. ## Proposed solution 1. **Peek-Prompt render endpoint.** Add a server endpoint that runs `assemblePrompt` twice for the affected character/preset with the target row overridden by `approval.diffPreview.before` and `.after`, returns the two `messages[]` arrays, and lets the client diff them and feed the result into the existing `PeekPromptModal`. Presets are the harder case (a `preset.updateSection` "after" is a single section that doesn't map to a whole assembled prompt without the rest of the preset/groups/choiceBlocks). 2. **Scoped per-entry reject.** Add a server "reject-rows" path that reverts a dependency-closed subset of a pending approval: run `restorePlan` over the selected rows, shrink the pending record's `plan.changes`, recompute `summary`/`diffPreview`, rewrite the durable sidecar, and rework the whole-plan supersede guard / one-plan-per-history-entry model to be per-row. Smallest viable start: scope reject to `lorebook.create` inserts only (leaf `lorebook_entries` rows → clean single deletes with no FK fallout); forbid rejecting the parent `lorebooks` row (or treat it as reject-all). Note: `diffPreview` is capped at 50 rows and omits `cascadeOf`, so the endpoint must operate on the full server-side plan, not the client's lossy preview. ## Alternatives considered - Client-only approximation of the Peek-Prompt wrap format (duplicating `wrapContent`'s XML/Markdown output) — lower fidelity, drifts from the server wrap logic, and omits macro/persona/lorebook resolution. Rejected in favor of the true server render. - Keeping per-entry action as Dismiss-only (the current shipped behavior) — acceptable interim, but doesn't satisfy the "reject each individual entry" request. ## Additional item: a lorebook entry's activation mode + vectorization are not obvious (folding into PR #4921 now) Live-testing the Easy Viewer surfaced a third gap. Unlike the two capabilities above, this one is **client-only** (no server work), so it is being pulled forward into the Easy Viewer PR (#4921) rather than deferred here. For a lorebook entry, the Easy Viewer does not make the entry's **activation mode** obvious at a glance. A reviewer cannot tell whether an entry is: - **Constant** — always inserted (`constant: true`), - **Normal** — keyword-triggered (`constant: false` with keys), or - **Disabled** — off entirely (`enabled: false`), and it does not surface whether the entry is **Vectorized** (retrieved by embedding similarity) unless that specific field happens to change in Mari's edit. Today `constant` only appears as a small "Constant: on/off" chip *when it changes*, `enabled` shows as a Disabled/Enabled badge, and vectorization falls through to the generic field diff *only on change*. The baseline state of a present-but-unchanged property is invisible — so an entry Mari just created as Constant + Vectorized reads like a plain entry. **Wanted:** an always-visible status indicator on each lorebook-entry card in the Easy Viewer showing its activation mode (Constant / Normal / Disabled) plus a Vectorized marker, matching the engine's own lorebook-editor visual language, with a before → after shown when Mari's edit changes that state. This is the "most destructive/most important should be loudest" principle applied to activation semantics, not just deletes. ## Additional context Follow-up to #4919 (Easy Viewer, PR #4921). The investigation for that feature already scoped the first two items (server `assemblePrompt` override for the render; `restorePlan`-over-a-subset for reject) and recommended shipping phases 1–3 first, which is done. The activation/vectorization indicator (third item) is being addressed in #4921. ## 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#2734
No description provided.