[PR #2230] [MERGED] Restore party morale prompt context #5492

Closed
opened 2026-10-22 04:16:47 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2230
Author: @cha1latte
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/4/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-2148-party-morale-context


📝 Commits (2)

  • 5a5e39b Restore party morale prompt context
  • f8d8abe Record party morale PR verification

📊 Changes

3 files changed (+89 additions, -143 deletions)

View changed files

📝 scratch/bugfix-verification.json (+66 -142)
📝 src/engine/generation/prompt-assembly.ts (+4 -1)
📝 src/engine/modes/game/mechanics/morale.service.ts (+19 -0)

📄 Description

Linked issue

Closes #2148

Why this change

  • Game-mode GM prompts regressed from the legacy tier-aware party morale context to a bare numeric line. This restores the <party_morale> block with the morale tier and narrative directive so GM narration can adapt tone to party morale again.

What changed

  • Restored formatMoraleContext in the game morale service using the legacy tier directive text.
  • Updated game prompt assembly to pass the normalized morale score through getMoraleTier() and inject the formatted morale context instead of Current party morale: N / 100.
  • Updated scratch/bugfix-verification.json with the #2148 proof record.

Refactor impact

Primary owner:

  • game mode / engine generation

Impact areas reviewed:

  • Game GM prompt assembly
  • Party morale mechanics service
  • GM prompt server-computed context insertion

Boundary notes:

  • Kept the change in src/engine; no React, shared API, Tauri, storage, schema, dependency, or feature UI changes.

Pressure points touched:

  • Game GM prompt assembly only.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Local ignored scratch repro before fix: pnpm exec vitest run --config scratch/vitest.issue-2148.config.ts --reporter verbose failed because the assembled game GM system prompt lacked <party_morale> and emitted Current party morale: 5 / 100.
  • Local ignored scratch repro after fix: same command passed with 7 rows covering broken, low, steady, high, inspired, and absent-morale cases.
  • pnpm typecheck passed.
  • pnpm check:architecture passed.
  • pnpm check passed.
  • Bunny pass completed before opening the draft.
  • Repo proof-gate helper named in local workflow notes was unavailable at C:/Users/celia/.codex/tools/marinara-proof-gate.mjs.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Bugfix only; no new discoverable feature or workflow.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

  • N/A: this is a backend/prompt-assembly bug. The direct proof is the before/after scratch harness output recorded in scratch/bugfix-verification.json.

🔄 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/2230 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2148-party-morale-context` --- ### 📝 Commits (2) - [`5a5e39b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5a5e39b7e3c1af54850f174791c62773e04c1c4f) Restore party morale prompt context - [`f8d8abe`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f8d8abe2029ccaa9da87442ecbb79786547682a6) Record party morale PR verification ### 📊 Changes **3 files changed** (+89 additions, -143 deletions) <details> <summary>View changed files</summary> 📝 `scratch/bugfix-verification.json` (+66 -142) 📝 `src/engine/generation/prompt-assembly.ts` (+4 -1) 📝 `src/engine/modes/game/mechanics/morale.service.ts` (+19 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #2148 ## Why this change - Game-mode GM prompts regressed from the legacy tier-aware party morale context to a bare numeric line. This restores the `<party_morale>` block with the morale tier and narrative directive so GM narration can adapt tone to party morale again. ## What changed - Restored `formatMoraleContext` in the game morale service using the legacy tier directive text. - Updated game prompt assembly to pass the normalized morale score through `getMoraleTier()` and inject the formatted morale context instead of `Current party morale: N / 100.` - Updated `scratch/bugfix-verification.json` with the #2148 proof record. ## Refactor impact Primary owner: - game mode / engine generation Impact areas reviewed: - Game GM prompt assembly - Party morale mechanics service - GM prompt server-computed context insertion Boundary notes: - Kept the change in `src/engine`; no React, shared API, Tauri, storage, schema, dependency, or feature UI changes. Pressure points touched: - Game GM prompt assembly only. ## Validation - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Local ignored scratch repro before fix: `pnpm exec vitest run --config scratch/vitest.issue-2148.config.ts --reporter verbose` failed because the assembled game GM system prompt lacked `<party_morale>` and emitted `Current party morale: 5 / 100.` - Local ignored scratch repro after fix: same command passed with 7 rows covering broken, low, steady, high, inspired, and absent-morale cases. - `pnpm typecheck` passed. - `pnpm check:architecture` passed. - `pnpm check` passed. - Bunny pass completed before opening the draft. - Repo proof-gate helper named in local workflow notes was unavailable at `C:/Users/celia/.codex/tools/marinara-proof-gate.mjs`. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [ ] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Bugfix only; no new discoverable feature or workflow. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence - N/A: this is a backend/prompt-assembly bug. The direct proof is the before/after scratch harness output recorded in `scratch/bugfix-verification.json`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:47 +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#5492
No description provided.