mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5098] [MERGED] feat(game): Experience combat seam — combatActive, combatStyle, requestCombat (Capability API 1.11) #6628
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#6628
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/5098
Author: @kolacheee
Created: 8/15/2026
Status: ✅ Merged
Merged: 8/15/2026
Merged by: @kolacheee
Base:
staging← Head:feat/5094-experience-combat-signal📝 Commits (5)
e2b76c2feat(game): Experience combat seam — combatActive/combatStyle/requestCombat (Capability API 1.11, #5094)8f98ed9fix(game): scope combat-generation in-flight lock to the active chat (#5094)1ab0134fix(game): scope combat error + visuals + toast to the request (#5094)e6d2c4dfix(game): invalidate combat requests by monotonic id, not just chat (#5094)af29c34fix(game): gate combat visual apply on request being current📊 Changes
5 files changed (+267 additions, -81 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/development/optional-agent-packages.md(+22 -0)📝
packages/client/src/components/game/GameSurface.tsx(+236 -75)📝
packages/shared/src/schemas/capability-package.schema.ts(+3 -1)📝
scripts/regressions/capability-package-lifecycle.regression.ts(+5 -5)📄 Description
Closes #5094
Why
A
game-surfaceExperience has no trustworthy combat signal: the only thing a package can watch ischatMeta.gameActiveState, the GM's narrative scene state — it lags the actual combat-UI flip (written by a separate metadata transition) and can say "combat" when no encounter was generated at all. And an Experience with its own world (an encounter tile in a pixel RPG) cannot request a fight without the player re-confirming through a modal that duplicates the intent they just expressed in the Experience's own UI.What changed (Capability API 1.11 — client-only, additive, zero combat mechanics touched)
packages/client/src/components/game/GameSurface.tsx:experienceSurfacePropsgainscombatActive(the already-computedcombatUiActive— true the instant the combat UI actually mounts),combatStyle(the effective style,classic/tactical), andrequestCombat().startCombatGeneration), andrequestCombatcalls that same core — one path into the vanillagenerateCombatStateForMessagepass, so a package can never trigger side effects the button would not. The confirm dialog is skipped on the package path because the Experience's own interface already expressed the intent; the guards (combat already active, generation pending, no turn yet) still apply.startCombat(party, enemies)or any way to inject combat state — the vanilla LLM pass still decides what the encounter is. Combat stays Engine-owned.experienceSurfacePropsmemo moved below the combat declarations it now consumes (its only consumer is the surface mount further down; nothing between the old and new positions referenced it). The Classic-game guard is untouched: the props are still not built at all unless the surface is active.requestCombat()is identity-stable (reads current state through refs, matching the stability contract of every other function in the props — a package may safely cache it), silent on the package path (returns"started" | "combat-active" | "pending" | "no-turn" | "unavailable"instead of painting Engine toasts over the package UI), and gated: concluded sessions and replay refuse with"unavailable", mirroring the sendMessage seam.requestCombat) cannot fan out concurrent/encounter/initgenerations.combatPending/combatErrormirror generation progress and failure, so a package is never left waiting oncombatActiveafter a failed generation.packages/shared/src/schemas/capability-package.schema.ts:supportedCapabilityApi→{1, 11}(a package requiring the seam declares 1.11 and older engines refuse it with the versioned message; packages that feature-detect keep working everywhere). Lifecycle-regression pins updated.Docs: Capability API 1.11 section in
docs/development/optional-agent-packages.md; CHANGELOG entry under Unreleased.Note on
requestCombat(opts): the issue sketched ahintparameter; it is deferred — the encounter generator (/encounter/init) takes no steering context today, so accepting-and-ignoring a hint would be dishonest. If steering lands server-side later, the callback can grow the option compatibly.Validation
pnpm checkpnpm version:checkcombatActiveflip the instant combat mounts, andrequestCombat()generates an encounter through the same vanilla pass (no confirm dialog).experienceSurfacePropsat all.Docs note: the
docs/development/optional-agent-packages.mdedit needs a docs-i18n mirror — batched with the pending round-8 catch-up.Summary by CodeRabbit
New Features
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.