[PR #6302] [MERGED] feat(game): add combat AI, companion control and GM boss reactions #7130

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6302
Author: @kolacheee
Created: 9/17/2026
Status: ✅ Merged
Merged: 9/17/2026
Merged by: @kolacheee

Base: staging ← Head: codex/combat-ai-overhaul


📝 Commits (6)

  • 04aafa5 feat(game): add combat AI, companion control and GM boss reactions
  • e528a12 chore: sync staging and record combat review dispositions
  • 2d5ba4e docs: adapt Codex guidance and complete PR readiness workflow
  • 6153721 Merge remote-tracking branch 'origin/staging' into codex/combat-ai-overhaul
  • 142511d fix(game): address combat review and regression failures
  • 0de3b24 fix(game): respect authored range for legacy healing

📊 Changes

102 files changed (+6730 additions, -420 deletions)

View changed files

➕ .agents/skills (+1 -0)
📝 .claude/skills/impeccable/SKILL.md (+0 -0)
📝 .claude/skills/impeccable/agents/openai.yaml (+0 -0)
📝 .claude/skills/impeccable/reference/adapt.md (+0 -0)
📝 .claude/skills/impeccable/reference/animate.md (+0 -0)
📝 .claude/skills/impeccable/reference/audit.md (+0 -0)
📝 .claude/skills/impeccable/reference/bolder.md (+0 -0)
📝 .claude/skills/impeccable/reference/brand.md (+0 -0)
📝 .claude/skills/impeccable/reference/clarify.md (+0 -0)
📝 .claude/skills/impeccable/reference/cognitive-load.md (+0 -0)
📝 .claude/skills/impeccable/reference/color-and-contrast.md (+0 -0)
📝 .claude/skills/impeccable/reference/colorize.md (+0 -0)
📝 .claude/skills/impeccable/reference/craft.md (+0 -0)
📝 .claude/skills/impeccable/reference/critique.md (+0 -0)
📝 .claude/skills/impeccable/reference/delight.md (+0 -0)
📝 .claude/skills/impeccable/reference/distill.md (+0 -0)
📝 .claude/skills/impeccable/reference/document.md (+0 -0)
📝 .claude/skills/impeccable/reference/extract.md (+0 -0)
📝 .claude/skills/impeccable/reference/harden.md (+0 -0)
📝 .claude/skills/impeccable/reference/heuristics-scoring.md (+0 -0)

...and 80 more files

📄 Description

Linked issue

Closes #6299. Translation follow-up: #6300. Builds on #6265.

Why this change

Classic and Tactical combat need enemies and companions that choose actions according to their abilities and temperament. Bosses need meaningful decisions between ordinary turns, with finite resources and safe recovery from reloads or late model replies. A permanent terrain description at game creation also cannot represent every later encounter.

What changed

  • Saved, seeded combat profiles for both modes, including Patient, Methodical and Coordinated; per-companion AI/manual control; proper Classic support targets, resource costs and cooldowns; Tactical pursuit and action scoring.
  • A server-owned combat director with legal GM boss choices, legendary budgets, activation-start anticipation and optional Counterspell/guard reactions. Manual units receive a costed choice; AI units weigh whether to spend. Accepted actions, inventory spending and decision state persist together with duplicate/stale-request protection.
  • Party capabilities, MP/slots and inventory enter the boss context; uncommitted player commands and future rolls do not. Explicit metadata grants reactions and boss capabilities.
  • Setup copy no longer names another game's IP or asks for permanent terrain guidance. Development handoffs cover additional adjective/class combinations, Summoning, an encounter-environment Agent, and versioned Traditional/5e/V20 rulesets.
  • A standalone AGENTS.md adapts the Claude guide for Codex with current OpenAI model choices, host-specific tools/permissions and an explicit draft-to-ready workflow. .agents/skills → .claude/skills shares all 52 byte-identical skill files. The shared workflow now marks completed, locally validated and reviewed work ready without another confirmation.

Named tabletop rulesets, Summoning and the environment Agent are documented follow-ups. This implementation is not full 5e; anticipation is an explicit game timing rule. Existing legacy battles retain their compatibility path. Their pre-existing separate inventory-write boundary is documented; new directed battles use the atomic server ledger.

Validation

Automated validation for the review/CI follow-up: pnpm check, all 294 Node regression suites plus the final attack/healing-range regression, and 26 desktop/mobile Chromium combat and battlefield browser checks pass. The follow-up local CodeRabbit review reports zero findings; focused final reviews of the browser and Linux regression corrections also report zero findings. The Node suite includes the prompt and hybrid-terrain proofs. WebKit cannot run on this host because system libraries are missing; its original CI trace was inspected, and the pushed branch will rerun the WebKit lane.

The route/provider fixtures cover legal windows, nested counters, depleted resources, cost-once behavior, inventory transactions, duplicate/stale commands, actual timeout, late replies, restore identity and bounded provider context. A local HTTP provider fixture proves integration, not real-model tactical quality. A 40-unit 64×64 synthetic ordinary phase measured about 428 ms on this host; this is not a worst-case or phone-performance claim.

All checkboxes remain unchecked for human verification:

  • 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

Manual verification notes

  • Manually verify companion control and ordinary turns in Classic and Tactical, including a defeated original leader.
  • Manually verify boss anticipation, React/Pass choices and last-slot spending with a configured real GM provider; assess pacing and strategy.
  • Manually verify save/reload and checkpoint restoration during a pending decision, and legacy saved battles.
  • Manually verify setup copy, light/dark layouts and physical mobile interaction. Current WebKit coverage is unavailable because required system libraries are missing; container runtime was not exercised.
  • An existing GameNarration hook warning remains; no new lint errors were introduced.

CodeRabbit review

The ten GitHub findings are handled: seven fixes cover item targeting copy, semantic keys, corrupt-save errors, enemy MP consistency, localized saved combat events, Methodical target focus and legacy attack/healing skill ranges. Three suggestions are dismissed with code-based explanations in their resolved threads: client requests already supply explicit party sides; default legacy cooldowns tick down before the next activation; forecast caching is an optional optimization without a demonstrated regression. Consecutive-round casts and omitted-side request compatibility have runnable regression coverage.

Earlier local review fixes and dispositions remain documented in docs/development/game-combat-ai-design.md. The final follow-up reviews of this patch report zero findings.

CI failure diagnosis

  • complete-node-regressions: Tactical's item Back button referenced a missing English key. It now uses the existing Tactical Back key.
  • Desktop Chromium shard 3/4: the battlefield reload fixture resolved dependencies from retained browser resource timings. A missing entry caused a .name exception. Clearing timings reproduced it; resolving exact dependency URLs from Vite's transformed entry removes that dependency. #6303 tracks the remaining fixtures using this pattern.
  • Both mobile shard 3/4 failures: the terrain inspection card covered Restart and intercepted taps. This was reproduced locally and confirmed in the original WebKit trace. The card now starts below the toolbar; the existing reload/restart test passes on desktop and mobile Chromium.
  • The three browser summary checks failed because of those shard failures; they are not separate defects.
  • The complete local run additionally exposed two pre-existing Linux-only fixture assumptions. The extension probe now targets the actual host PID rather than Bubblewrap's isolated supervisor; the secret-read proof accepts either an empty mask or explicit EACCES while rejecting leaked content. Both runtime sandbox restrictions remain intact.

Merged current staging and preserved both sets of changelog entries to resolve the conflict.

Docs and release impact

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

CHANGELOG.md and both development handoffs are included. Translation parity is tracked in #6300. No version bump, storage-format migration or downloadable Agent package is included.

UI evidence

Desktop/light and mobile/dark screenshots are attached as a self-contained HTML file containing the original fixture PNGs; download/open it in a browser. They show Classic companion controls and the pending manual Counterspell choice. Temporary images are not committed. Before-change screenshots were not retained.

Summary by CodeRabbit

  • New Features
    • Added directed combat for Classic and Tactical battles, including per-character AI or manual control.
    • Added GM-controlled boss decisions, legendary actions, reactions, anticipation windows, and persistent choices.
    • Added combat AI temperaments, improved companion behavior, tactical targeting, and resource-aware actions.
    • Added support for MP, spell slots, cooldowns, area attacks, healing, buffs, debuffs, and reaction skills.
  • Bug Fixes
    • Combat restoration now preserves encounter mechanics and state across reloads.
    • Items and spell slots are consumed only when actions are accepted and executed.
  • Changes
    • Removed tactical terrain guidance from game setup and summaries.

🔄 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/6302 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 9/17/2026 **Status:** ✅ Merged **Merged:** 9/17/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `codex/combat-ai-overhaul` --- ### 📝 Commits (6) - [`04aafa5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/04aafa53dc89e772ad298cfb1217a333d8cf2e6a) feat(game): add combat AI, companion control and GM boss reactions - [`e528a12`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e528a12a90ca19677e742863f88fc53fc60a87bf) chore: sync staging and record combat review dispositions - [`2d5ba4e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2d5ba4e88acfe4ae4a84e411557de39c12ea3a2c) docs: adapt Codex guidance and complete PR readiness workflow - [`6153721`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6153721ee94b51d9eefa1204e227f9102546272b) Merge remote-tracking branch 'origin/staging' into codex/combat-ai-overhaul - [`142511d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/142511d73ecf511d1c1645ca7a7d63d4e33011b6) fix(game): address combat review and regression failures - [`0de3b24`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0de3b240c4260d4d7ac3b24df995823f938628c2) fix(game): respect authored range for legacy healing ### 📊 Changes **102 files changed** (+6730 additions, -420 deletions) <details> <summary>View changed files</summary> ➕ `.agents/skills` (+1 -0) 📝 `.claude/skills/impeccable/SKILL.md` (+0 -0) 📝 `.claude/skills/impeccable/agents/openai.yaml` (+0 -0) 📝 `.claude/skills/impeccable/reference/adapt.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/animate.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/audit.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/bolder.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/brand.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/clarify.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/cognitive-load.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/color-and-contrast.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/colorize.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/craft.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/critique.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/delight.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/distill.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/document.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/extract.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/harden.md` (+0 -0) 📝 `.claude/skills/impeccable/reference/heuristics-scoring.md` (+0 -0) _...and 80 more files_ </details> ### 📄 Description ## Linked issue Closes #6299. Translation follow-up: #6300. Builds on #6265. ## Why this change Classic and Tactical combat need enemies and companions that choose actions according to their abilities and temperament. Bosses need meaningful decisions between ordinary turns, with finite resources and safe recovery from reloads or late model replies. A permanent terrain description at game creation also cannot represent every later encounter. ## What changed - Saved, seeded combat profiles for both modes, including Patient, Methodical and Coordinated; per-companion AI/manual control; proper Classic support targets, resource costs and cooldowns; Tactical pursuit and action scoring. - A server-owned combat director with legal GM boss choices, legendary budgets, activation-start anticipation and optional Counterspell/guard reactions. Manual units receive a costed choice; AI units weigh whether to spend. Accepted actions, inventory spending and decision state persist together with duplicate/stale-request protection. - Party capabilities, MP/slots and inventory enter the boss context; uncommitted player commands and future rolls do not. Explicit metadata grants reactions and boss capabilities. - Setup copy no longer names another game's IP or asks for permanent terrain guidance. Development handoffs cover additional adjective/class combinations, Summoning, an encounter-environment Agent, and versioned Traditional/5e/V20 rulesets. - A standalone `AGENTS.md` adapts the Claude guide for Codex with current OpenAI model choices, host-specific tools/permissions and an explicit draft-to-ready workflow. `.agents/skills → .claude/skills` shares all 52 byte-identical skill files. The shared workflow now marks completed, locally validated and reviewed work ready without another confirmation. Named tabletop rulesets, Summoning and the environment Agent are documented follow-ups. This implementation is not full 5e; anticipation is an explicit game timing rule. Existing legacy battles retain their compatibility path. Their pre-existing separate inventory-write boundary is documented; new directed battles use the atomic server ledger. ## Validation Automated validation for the review/CI follow-up: `pnpm check`, all 294 Node regression suites plus the final attack/healing-range regression, and 26 desktop/mobile Chromium combat and battlefield browser checks pass. The follow-up local CodeRabbit review reports zero findings; focused final reviews of the browser and Linux regression corrections also report zero findings. The Node suite includes the prompt and hybrid-terrain proofs. WebKit cannot run on this host because system libraries are missing; its original CI trace was inspected, and the pushed branch will rerun the WebKit lane. The route/provider fixtures cover legal windows, nested counters, depleted resources, cost-once behavior, inventory transactions, duplicate/stale commands, actual timeout, late replies, restore identity and bounded provider context. A local HTTP provider fixture proves integration, not real-model tactical quality. A 40-unit 64×64 synthetic ordinary phase measured about 428 ms on this host; this is not a worst-case or phone-performance claim. All checkboxes remain unchecked for human verification: - [ ] `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` ### Manual verification notes - Manually verify companion control and ordinary turns in Classic and Tactical, including a defeated original leader. - Manually verify boss anticipation, React/Pass choices and last-slot spending with a configured real GM provider; assess pacing and strategy. - Manually verify save/reload and checkpoint restoration during a pending decision, and legacy saved battles. - Manually verify setup copy, light/dark layouts and physical mobile interaction. Current WebKit coverage is unavailable because required system libraries are missing; container runtime was not exercised. - An existing `GameNarration` hook warning remains; no new lint errors were introduced. ## CodeRabbit review The ten GitHub findings are handled: seven fixes cover item targeting copy, semantic keys, corrupt-save errors, enemy MP consistency, localized saved combat events, Methodical target focus and legacy attack/healing skill ranges. Three suggestions are dismissed with code-based explanations in their resolved threads: client requests already supply explicit party sides; default legacy cooldowns tick down before the next activation; forecast caching is an optional optimization without a demonstrated regression. Consecutive-round casts and omitted-side request compatibility have runnable regression coverage. Earlier local review fixes and dispositions remain documented in `docs/development/game-combat-ai-design.md`. The final follow-up reviews of this patch report zero findings. ## CI failure diagnosis - `complete-node-regressions`: Tactical's item Back button referenced a missing English key. It now uses the existing Tactical Back key. - Desktop Chromium shard 3/4: the battlefield reload fixture resolved dependencies from retained browser resource timings. A missing entry caused a `.name` exception. Clearing timings reproduced it; resolving exact dependency URLs from Vite's transformed entry removes that dependency. #6303 tracks the remaining fixtures using this pattern. - Both mobile shard 3/4 failures: the terrain inspection card covered Restart and intercepted taps. This was reproduced locally and confirmed in the original WebKit trace. The card now starts below the toolbar; the existing reload/restart test passes on desktop and mobile Chromium. - The three browser summary checks failed because of those shard failures; they are not separate defects. - The complete local run additionally exposed two pre-existing Linux-only fixture assumptions. The extension probe now targets the actual host PID rather than Bubblewrap's isolated supervisor; the secret-read proof accepts either an empty mask or explicit EACCES while rejecting leaked content. Both runtime sandbox restrictions remain intact. Merged current `staging` and preserved both sets of changelog entries to resolve the conflict. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) `CHANGELOG.md` and both development handoffs are included. Translation parity is tracked in #6300. No version bump, storage-format migration or downloadable Agent package is included. ## UI evidence [Desktop/light and mobile/dark screenshots](https://gist.github.com/kolacheee/7488b6d5c869800c166e008eddb9fe25) are attached as a self-contained HTML file containing the original fixture PNGs; download/open it in a browser. They show Classic companion controls and the pending manual Counterspell choice. Temporary images are not committed. Before-change screenshots were not retained. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added directed combat for Classic and Tactical battles, including per-character AI or manual control. * Added GM-controlled boss decisions, legendary actions, reactions, anticipation windows, and persistent choices. * Added combat AI temperaments, improved companion behavior, tactical targeting, and resource-aware actions. * Added support for MP, spell slots, cooldowns, area attacks, healing, buffs, debuffs, and reaction skills. * **Bug Fixes** * Combat restoration now preserves encounter mechanics and state across reloads. * Items and spell slots are consumed only when actions are accepted and executed. * **Changes** * Removed tactical terrain guidance from game setup and summaries. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 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#7130
No description provided.