[PR #7679] [MERGED] refactor(generate): move the hidden command anchor save into generate/hidden-command-anchor.ts #7878

Closed
opened 2026-10-24 04:08:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7679
Author: @Gunterlie
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @Gunterlie

Base: staging ← Head: chore/7573-hidden-command-anchor


📝 Commits (1)

  • 0cdeb0d refactor(generate): move the hidden command anchor save into generate/hidden-command-anchor.ts (#7573)

📊 Changes

3 files changed (+62 additions, -27 deletions)

View changed files

📝 packages/server/src/routes/generate.routes.ts (+9 -20)
➕ packages/server/src/routes/generate/hidden-command-anchor.ts (+45 -0)
📝 scripts/regressions/maintenance-lifecycle.regression.ts (+8 -7)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Part of #7573 (eighth slice).

Why this change

A turn that has only commands (or GM verbs, game state tool calls, a spatial move) and no visible prose still needs a message to anchor them: a blank swipe on regenerate, otherwise a blank assistant message, marked command-only and hidden. The route built that message inline in the empty-response branch. As saveHiddenCommandAnchor it is one named step with its own inputs, and the empty-response branch reads as gate → save anchor → run the turn's work.

No behaviour change.

What changed

  • New packages/server/src/routes/generate/hidden-command-anchor.ts with saveHiddenCommandAnchor(chats, anchor). Same storage calls in the same order, same extra fields (hiddenFromUser, hiddenFromAI, commandOnly, sceneRequest, conversationCommandContent, isGenerated, encryptedReasoning), and the same return value when no message was saved.
  • generate.routes.ts calls it. The gate, the GM verb run, the game state persistence, the spatial step and the return stay in the route.
  • scripts/regressions/maintenance-lifecycle.regression.ts: the anchor source pin now reads the new file and pins the route call.

Proof: scripts/regressions/command-only-regenerate.regression.ts runs the real route through a fixture provider and checks the anchor's swipes and extra. Two mutations of the helper (always hide from the user; skip the blank swipe on regenerate) each fail it. scripts/regressions/game-tool-outcomes.regression.ts covers the new-message branch through the real route: the anchor is hidden and the turn's state writes land on it.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Agent-run results (not a substitute for the boxes above):

  • pnpm check: passed.
  • Regressions passed: command-only-regenerate, maintenance-lifecycle, capability-gm-verb-runtime, spatial-only-message-visibility, game-tool-outcomes.
  • Local CodeRabbit was rate-limited, so the GitHub CodeRabbit review is the CodeRabbit pass here. A separate agent review compared the helper with the old block and found no behaviour change. Its one low note (no runtime assert for hiddenFromAI / conversationCommandContent) is a gap from before the move and is left out of this pure move.

Manual verification notes

  • Manually verify a Conversation reply that is only a reaction command (for example [react: …]): the reaction applies and no blank bubble shows.
  • Manually verify a regenerate of that reply: a new blank swipe is added.
  • Manually verify a Conversation scene invitation with no prose: the invitation card shows.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7679 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `chore/7573-hidden-command-anchor` --- ### 📝 Commits (1) - [`0cdeb0d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0cdeb0da8259b72fa4b956155b0bc248d23977f3) refactor(generate): move the hidden command anchor save into generate/hidden-command-anchor.ts (#7573) ### 📊 Changes **3 files changed** (+62 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/generate.routes.ts` (+9 -20) ➕ `packages/server/src/routes/generate/hidden-command-anchor.ts` (+45 -0) 📝 `scripts/regressions/maintenance-lifecycle.regression.ts` (+8 -7) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Part of #7573 (eighth slice). ## Why this change A turn that has only commands (or GM verbs, game state tool calls, a spatial move) and no visible prose still needs a message to anchor them: a blank swipe on regenerate, otherwise a blank assistant message, marked command-only and hidden. The route built that message inline in the empty-response branch. As `saveHiddenCommandAnchor` it is one named step with its own inputs, and the empty-response branch reads as gate → save anchor → run the turn's work. No behaviour change. ## What changed - New `packages/server/src/routes/generate/hidden-command-anchor.ts` with `saveHiddenCommandAnchor(chats, anchor)`. Same storage calls in the same order, same extra fields (`hiddenFromUser`, `hiddenFromAI`, `commandOnly`, `sceneRequest`, `conversationCommandContent`, `isGenerated`, `encryptedReasoning`), and the same return value when no message was saved. - `generate.routes.ts` calls it. The gate, the GM verb run, the game state persistence, the spatial step and the return stay in the route. - `scripts/regressions/maintenance-lifecycle.regression.ts`: the anchor source pin now reads the new file and pins the route call. Proof: `scripts/regressions/command-only-regenerate.regression.ts` runs the real route through a fixture provider and checks the anchor's swipes and extra. Two mutations of the helper (always hide from the user; skip the blank swipe on regenerate) each fail it. `scripts/regressions/game-tool-outcomes.regression.ts` covers the new-message branch through the real route: the anchor is hidden and the turn's state writes land on it. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Agent-run results (not a substitute for the boxes above): - `pnpm check`: passed. - Regressions passed: `command-only-regenerate`, `maintenance-lifecycle`, `capability-gm-verb-runtime`, `spatial-only-message-visibility`, `game-tool-outcomes`. - Local CodeRabbit was rate-limited, so the GitHub CodeRabbit review is the CodeRabbit pass here. A separate agent review compared the helper with the old block and found no behaviour change. Its one low note (no runtime assert for `hiddenFromAI` / `conversationCommandContent`) is a gap from before the move and is left out of this pure move. ### Manual verification notes - Manually verify a Conversation reply that is only a reaction command (for example `[react: …]`): the reaction applies and no blank bubble shows. - Manually verify a regenerate of that reply: a new blank swipe is added. - Manually verify a Conversation scene invitation with no prose: the invitation card shows. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:08:24 +07:00
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#7878
No description provided.