[PR #943] [MERGED] feat(ruleset-5e-2014): a battle block and healing spells, so fights start from the sheet (0.3.0) #1205

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/943
Author: @kolacheee
Created: 9/19/2026
Status: ✅ Merged
Merged: 9/19/2026
Merged by: @kolacheee

Base: staging ← Head: feat/ruleset-5e-battle


📝 Commits (6)

  • 0a33ba9 feat(ruleset-5e-2014): the battle block and healing spells (0.3.0)
  • b267144 fix(ruleset-5e-2014): refuse alwaysWhen without onlyWhen, as the Engine does
  • 3a37cb6 build(ruleset-5e-2014): 0.3.0 against the Engine commit that merged the battle bridge
  • 41e7f81 docs(ruleset-5e-2014): say that Pact Magic slots do not go into a battle
  • 1d91c28 Merge remote-tracking branch 'origin/staging' into feat/ruleset-5e-battle
  • a4d6a75 docs(ruleset-5e-2014): the description says cantrips come into a battle too

📊 Changes

20 files changed (+635 additions, -83 deletions)

View changed files

📝 CONTRIBUTING.md (+2 -0)
📝 README.md (+1 -1)
➕ artifacts/ruleset-5e-2014-0.3.0.zip (+0 -0)
📝 catalog/preview/catalog.json (+11 -11)
📝 catalog/preview/notes.json (+6 -0)
📝 catalog/preview/v2/catalog.json (+11 -11)
📝 catalog/preview/v2/notes.json (+6 -0)
📝 catalog/preview/v3/catalog.json (+11 -11)
📝 catalog/preview/v3/notes.json (+6 -0)
📝 packages/ruleset-5e-2014/CHANGELOG.md (+8 -0)
📝 packages/ruleset-5e-2014/README.md (+54 -15)
📝 packages/ruleset-5e-2014/catalogs/spells.json (+53 -9)
📝 packages/ruleset-5e-2014/locales/en.json (+1 -1)
📝 packages/ruleset-5e-2014/manifest.json (+8 -8)
📝 packages/ruleset-5e-2014/ruleset.json (+25 -1)
📝 scripts/build-5e-srd-catalogs.mjs (+86 -13)
📝 scripts/build-ruleset-packages.mjs (+4 -1)
📝 scripts/ruleset-package-checks.mjs (+121 -1)
📝 scripts/tests/ruleset-package.regression.mjs (+217 -0)
📝 scripts/validate-catalog.mjs (+4 -0)

📄 Description

Pull request

Important

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

Linked issue

Closes #942

Why this change

  • A game on the 5e ruleset keeps hit points, spell slots, prepared spells and weapons on the sheet, but a battle ignored all of it. The Engine's combat bridge (Capability API 1.22, Pasta-Devs/Marinara-Engine#6348, merged to staging as d71106851) lends a sheet to Marinara's combat for any ruleset that declares a battle block. The 5e package had none.

What changed

  • ruleset-5e-2014 0.3.0, Capability API 1.22, builtAgainst.engineCommit d71106851b8ffd6b963542601901387b4269fb34.
  • ruleset.json gains a hand-authored battle block: hp as health, slots_1 to slots_9 with their levels, skills from spells (onlyWhen: prepared, alwaysWhen: level = 0 so cantrips always come) and from attacks. Pact Magic slots are left out on purpose: their level follows the character, and a fixed list of levels cannot say that. The ruleset version is 3.
  • The converter (scripts/build-5e-srd-catalogs.mjs) gets a small hand-checked HEALING_SPELLS table: eight SRD healing spells become kind: "heal" with their dice, each row citing the SRD sentence it came from. The battle block sits before catalogs in the file because the converter rewrites from catalogs to the end, and it now fails loudly if that order is ever broken.
  • scripts/ruleset-package-checks.mjs gains assertRulesetBattle, wired into the builder and validate-catalog.mjs: the Engine's own rules restated at the block's narrow shape (declared live pools only, health may not start empty, energy is not health, slot pools and levels used once and 1 to 9, onlyWhen names a boolean column, alwaysWhen needs onlyWhen and a value its column can hold, 1.22 declared). Regression cases for each in scripts/tests/ruleset-package.regression.mjs.
  • README and the package changelog say what a bridged battle is and is not: health is carried as a share of the maximum, the damage is Marinara's own combat math, attack rolls, saving throws and concentration are not applied.
  • Rebuilt: the manifest hashes, artifacts/ruleset-5e-2014-0.3.0.zip, and the preview overlay entries (catalog/preview/**). The package stays staging-only.

Package and security impact

  • Affected package IDs: ruleset-5e-2014
  • Engine compatibility impact: needs Capability API 1.22 (Engine staging at or after d71106851). An older Engine refuses the update cleanly and keeps 0.2.0.
  • New or changed permissions/entrypoints: none. The package is pure data: no code, no permissions, no agent.
  • Restart, storage, update, or uninstall impact: none. No restart; games pinned to the ruleset pick up the newer definition (the pin accepts a newer installed version); uninstall is unchanged.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

Commands run locally by the agent, all passing: node scripts/validate-catalog.mjs, node scripts/tests/ruleset-package.regression.mjs, node scripts/test-catalog-lanes.mjs, node scripts/validate-package-locale-keys.mjs, the generatedAt determinism and release notes regressions, npm run check (0 errors), and npm run build:rulesets twice with a byte-identical artifact. A local CodeRabbit review returned one trivial suggestion, declined: refusing a list named twice in battle.skills would be a rule the Engine itself does not have, and these checks only restate the Engine's.

Proof against the Engine's own code (its shared package built from the bridge branch before it merged): the shipped ruleset.json and both catalog files parse; a level 5 wizard with Fire Bolt, Fireball and Cure Wounds prepared and a Longsword picked gets those four as combat skills (Fireball as a slot 3 area attack, Cure Wounds as a slot 1 heal), Shield stays out because reactions are not used, and 10 of 20 hit points seed 30 of 60 health.

Still to verify by hand:

  • The agent will install 0.3.0 through a scratch Engine on the staging channel once this PR is merged (the staging channel reads the preview overlay from this repository's staging branch, so it cannot see a PR branch), and post the result here.
  • Manually play a bridged battle with a real model on a 5e game: slots spent in the fight are gone on the sheet afterwards, a prepared catalog spell shows up as a skill, and the toast at the start says where the numbers come from.
  • Manually confirm an Engine older than Capability API 1.22 refuses the update and keeps 0.2.0.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

The package README and changelog are updated. The Engine side is documented in Pasta-Devs/Marinara-Engine#6348 (docs/game/combat.md, the authoring guide).

UI evidence (if applicable)

None: the package ships no UI.

Summary by CodeRabbit

  • New Features

    • Battles can now start from a 5e character sheet using hit points, spell slots, prepared spells, cantrips, and selected weapons.
    • Battle results write damage and spent spell slots back to the character sheet; Pact Magic slots are excluded.
    • Health carries over as a percentage of maximum hit points.
    • Eight SRD healing spells now restore health, including applicable higher-level scaling.
  • Enhancements

    • Updated the 5e ruleset to version 0.3.0, requiring Capability API 1.22.
    • Clarified that attack rolls, saving throws, concentration, and other unsupported higher-slot effects are not applied.

🔄 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-Agents/pull/943 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 9/19/2026 **Status:** ✅ Merged **Merged:** 9/19/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `feat/ruleset-5e-battle` --- ### 📝 Commits (6) - [`0a33ba9`](https://github.com/Pasta-Devs/Marinara-Agents/commit/0a33ba921d4a68bb15035bf09254a32fd6011bc6) feat(ruleset-5e-2014): the battle block and healing spells (0.3.0) - [`b267144`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b267144cedcf3691fd1282561d6f69cc110dcaa7) fix(ruleset-5e-2014): refuse alwaysWhen without onlyWhen, as the Engine does - [`3a37cb6`](https://github.com/Pasta-Devs/Marinara-Agents/commit/3a37cb674e2f82ab62f6f6b9b80ffd791d46734a) build(ruleset-5e-2014): 0.3.0 against the Engine commit that merged the battle bridge - [`41e7f81`](https://github.com/Pasta-Devs/Marinara-Agents/commit/41e7f819cc6e28a793a054a9ada307d51fb1e282) docs(ruleset-5e-2014): say that Pact Magic slots do not go into a battle - [`1d91c28`](https://github.com/Pasta-Devs/Marinara-Agents/commit/1d91c286cc4e50405fca2c1104a046e848a546e0) Merge remote-tracking branch 'origin/staging' into feat/ruleset-5e-battle - [`a4d6a75`](https://github.com/Pasta-Devs/Marinara-Agents/commit/a4d6a75bd24c87d3baebcdbed34606bdf96da61c) docs(ruleset-5e-2014): the description says cantrips come into a battle too ### 📊 Changes **20 files changed** (+635 additions, -83 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTING.md` (+2 -0) 📝 `README.md` (+1 -1) ➕ `artifacts/ruleset-5e-2014-0.3.0.zip` (+0 -0) 📝 `catalog/preview/catalog.json` (+11 -11) 📝 `catalog/preview/notes.json` (+6 -0) 📝 `catalog/preview/v2/catalog.json` (+11 -11) 📝 `catalog/preview/v2/notes.json` (+6 -0) 📝 `catalog/preview/v3/catalog.json` (+11 -11) 📝 `catalog/preview/v3/notes.json` (+6 -0) 📝 `packages/ruleset-5e-2014/CHANGELOG.md` (+8 -0) 📝 `packages/ruleset-5e-2014/README.md` (+54 -15) 📝 `packages/ruleset-5e-2014/catalogs/spells.json` (+53 -9) 📝 `packages/ruleset-5e-2014/locales/en.json` (+1 -1) 📝 `packages/ruleset-5e-2014/manifest.json` (+8 -8) 📝 `packages/ruleset-5e-2014/ruleset.json` (+25 -1) 📝 `scripts/build-5e-srd-catalogs.mjs` (+86 -13) 📝 `scripts/build-ruleset-packages.mjs` (+4 -1) 📝 `scripts/ruleset-package-checks.mjs` (+121 -1) 📝 `scripts/tests/ruleset-package.regression.mjs` (+217 -0) 📝 `scripts/validate-catalog.mjs` (+4 -0) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- Open as a draft while implementation is in progress. Mark Ready for review only after validation and self-review. --> ## Linked issue Closes #942 ## Why this change - A game on the 5e ruleset keeps hit points, spell slots, prepared spells and weapons on the sheet, but a battle ignored all of it. The Engine's combat bridge (Capability API 1.22, Pasta-Devs/Marinara-Engine#6348, merged to `staging` as d71106851) lends a sheet to Marinara's combat for any ruleset that declares a `battle` block. The 5e package had none. ## What changed - `ruleset-5e-2014` **0.3.0**, Capability API 1.22, `builtAgainst.engineCommit` d71106851b8ffd6b963542601901387b4269fb34. - `ruleset.json` gains a hand-authored `battle` block: `hp` as health, `slots_1` to `slots_9` with their levels, skills from `spells` (`onlyWhen: prepared`, `alwaysWhen: level = 0` so cantrips always come) and from `attacks`. Pact Magic slots are left out on purpose: their level follows the character, and a fixed list of levels cannot say that. The ruleset `version` is 3. - The converter (`scripts/build-5e-srd-catalogs.mjs`) gets a small hand-checked `HEALING_SPELLS` table: eight SRD healing spells become `kind: "heal"` with their dice, each row citing the SRD sentence it came from. The `battle` block sits before `catalogs` in the file because the converter rewrites from `catalogs` to the end, and it now fails loudly if that order is ever broken. - `scripts/ruleset-package-checks.mjs` gains `assertRulesetBattle`, wired into the builder and `validate-catalog.mjs`: the Engine's own rules restated at the block's narrow shape (declared live pools only, health may not start empty, energy is not health, slot pools and levels used once and 1 to 9, `onlyWhen` names a boolean column, `alwaysWhen` needs `onlyWhen` and a value its column can hold, 1.22 declared). Regression cases for each in `scripts/tests/ruleset-package.regression.mjs`. - README and the package changelog say what a bridged battle is and is not: health is carried as a share of the maximum, the damage is Marinara's own combat math, attack rolls, saving throws and concentration are not applied. - Rebuilt: the manifest hashes, `artifacts/ruleset-5e-2014-0.3.0.zip`, and the preview overlay entries (`catalog/preview/**`). The package stays staging-only. ## Package and security impact - Affected package IDs: `ruleset-5e-2014` - Engine compatibility impact: needs Capability API 1.22 (Engine `staging` at or after d71106851). An older Engine refuses the update cleanly and keeps 0.2.0. - New or changed permissions/entrypoints: none. The package is pure data: no code, no permissions, no agent. - Restart, storage, update, or uninstall impact: none. No restart; games pinned to the ruleset pick up the newer definition (the pin accepts a newer installed version); uninstall is unchanged. ## Validation <!-- These are human tasks. Never tick a box for a check that was not actually performed. --> - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Commands run locally by the agent, all passing: `node scripts/validate-catalog.mjs`, `node scripts/tests/ruleset-package.regression.mjs`, `node scripts/test-catalog-lanes.mjs`, `node scripts/validate-package-locale-keys.mjs`, the generatedAt determinism and release notes regressions, `npm run check` (0 errors), and `npm run build:rulesets` twice with a byte-identical artifact. A local CodeRabbit review returned one trivial suggestion, declined: refusing a list named twice in `battle.skills` would be a rule the Engine itself does not have, and these checks only restate the Engine's. Proof against the Engine's own code (its shared package built from the bridge branch before it merged): the shipped `ruleset.json` and both catalog files parse; a level 5 wizard with Fire Bolt, Fireball and Cure Wounds prepared and a Longsword picked gets those four as combat skills (Fireball as a slot 3 area attack, Cure Wounds as a slot 1 heal), Shield stays out because reactions are not used, and 10 of 20 hit points seed 30 of 60 health. Still to verify by hand: - The agent will install 0.3.0 through a scratch Engine on the staging channel once this PR is merged (the staging channel reads the preview overlay from this repository's `staging` branch, so it cannot see a PR branch), and post the result here. - Manually play a bridged battle with a real model on a 5e game: slots spent in the fight are gone on the sheet afterwards, a prepared catalog spell shows up as a skill, and the toast at the start says where the numbers come from. - Manually confirm an Engine older than Capability API 1.22 refuses the update and keeps 0.2.0. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation The package README and changelog are updated. The Engine side is documented in Pasta-Devs/Marinara-Engine#6348 (`docs/game/combat.md`, the authoring guide). ## UI evidence (if applicable) None: the package ships no UI. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Battles can now start from a 5e character sheet using hit points, spell slots, prepared spells, cantrips, and selected weapons. - Battle results write damage and spent spell slots back to the character sheet; Pact Magic slots are excluded. - Health carries over as a percentage of maximum hit points. - Eight SRD healing spells now restore health, including applicable higher-level scaling. - **Enhancements** - Updated the 5e ruleset to version 0.3.0, requiring Capability API 1.22. - Clarified that attack rolls, saving throws, concentration, and other unsupported higher-slot effects are not applied. <!-- 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-21 05:05:30 +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-Agents#1205
No description provided.