Repository navigation
fix: close two server-kill paths and three combat integrity gaps from the engine audit - #113
Merged
Merged
Conversation
…e server An exploding one-sided die (1d1!) never stopped exploding, and dice counts were unbounded, so one math_manage call could freeze or kill the process for every campaign. Dice are now capped at 1000 dice of 1000 sides at every parser, exploding dice need at least 2 sides, and exact distributions are refused when too large to compute. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FWeViVwVRAxVuCWaf7UQS
subscribe_to_events left a callback pointing at the per-request HTTP transport. The next combat event in any campaign made it reject with 'Not connected'; the unhandled rejection shut the process down, and the shutdown path exited 0, so the host never restarted it. - Crashes now exit 1; requested stops still exit 0. - A subscriber whose connection is gone is dropped, not left to reject. - Subscribers only receive events from their own campaign. - On the stateless HTTP transport, where nothing can be pushed after the response, subscribe_to_events makes no subscription and points the caller at poll_events. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FWeViVwVRAxVuCWaf7UQS
- Moves are validated (destination, path, remaining movement) before opportunity attacks resolve. A refused move used to cost the mover hit points and the attacker its reaction, then report success. It is now an error, so the call rolls back. - Negative damage is rejected; it was subtracted as healing with no cap at max HP (a 7 HP goblin reached 107). Dice damage with a penalty floors at zero, and applyDamage/heal ignore negative amounts. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FWeViVwVRAxVuCWaf7UQS
npm audit fix: clears the advisories in @modelcontextprotocol/sdk and its transitive dependencies. The remaining zod advisory needs a breaking move to zod 4 and is left for a separate change. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FWeViVwVRAxVuCWaf7UQS
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Mnehmos
marked this pull request as ready for review
November 9, 2026 22:52
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Mnehmos
pushed a commit
that referenced
this pull request
Nov 9, 2026
The earlier commits on this branch were squash-merged as #113. This merge keeps the current tree exactly as it is; it only records that history so the branch can be pushed without rewriting it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FWeViVwVRAxVuCWaf7UQS
Mnehmos
pushed a commit
that referenced
this pull request
Nov 10, 2026
Tree unchanged. The earlier commits on this branch were squash-merged as #113 and #114. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FWeViVwVRAxVuCWaf7UQS
Mnehmos
pushed a commit
that referenced
this pull request
Nov 10, 2026
Tree unchanged. The earlier commits on this branch were squash-merged as #113, #114 and #115. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FWeViVwVRAxVuCWaf7UQS
Mnehmos
pushed a commit
that referenced
this pull request
Nov 10, 2026
Tree unchanged. The earlier commits on this branch were squash-merged as #113 to #116. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FWeViVwVRAxVuCWaf7UQS
Mnehmos
pushed a commit
that referenced
this pull request
Nov 10, 2026
Tree unchanged. The earlier commits on this branch were squash-merged as #113 to #117. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FWeViVwVRAxVuCWaf7UQS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes from an audit of the engine. Each was reproduced against a local HTTP server before the fix and re-checked after.
What was wrong
One tool call could take the hosted server down for every campaign
subscribe_to_eventsover HTTP left a callback pointing at the per-request transport. The next combat event in any campaign made it reject withNot connected; the unhandled rejection shut the process down. The shutdown path exited0, andrailway.jsonrestarts onlyON_FAILURE, so the service would stay down.math_manageroll with1d1!never stopped exploding and ran until the heap was exhausted (exit 134). Dice counts were also unbounded (99999999d6).Combat applied consequences it should not have
What changed
fix(math)math_manage, combat damage, spells, auras, improvisation). Exploding dice need at least 2 sides. Exact probability distributions are refused when too large to compute.fix(server)subscribe_to_eventsmakes no subscription and points the caller atpoll_events.fix(combat)fix(deps)@modelcontextprotocol/sdk1.29.0 → 1.32.2 vianpm audit fix(lockfile only).Contract changes for
rpg-mcp-livesubscribe_to_eventsover HTTP still returns a non-error response, but its text now says no subscription was made. It could never deliver over stateless HTTP.combat_actionmoveto an unreachable square now returnsisError: trueinstead of a success-shaped response containing "cannot move".combat_actionattackwith a negativedamagenumber now returnsisError: true.isError: true.Not in this PR
attackBonus/damage. Enforcing those is a larger contract change.zodadvisory needs a breaking move to zod 4.Testing
tests/math/dice-limits.test.ts,tests/server/events-safety.test.ts,tests/server/shutdown.test.ts,tests/server/combat-integrity.test.ts(28 tests, written failing first).tests/server/spatial-combat.test.tsupdated: a blocked move now rejects rather than returning "cannot move" text.tests/server/websocket.test.tsand are pre-existing in the sandbox this was run in, which has no IPv6 (listen EAFNOSUPPORT ::); they fail identically onmainthere.Generated by Claude Code