mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6315] [MERGED] feat(game): ruleset schema, registry and Capability API 1.20 (rulesets slice 1) #7134
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#7134
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/6315
Author: @kolacheee
Created: 9/18/2026
Status: ✅ Merged
Merged: 9/18/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/rulesets-registry📝 Commits (2)
4d7816cfeat(game): add ruleset schema, registry and Capability API 1.2057ce70efix(game): require the ruleset kind wherever ruleset.json is listed📊 Changes
13 files changed (+2856 additions, -7 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)➕
docs/development/game-rulesets-and-sheets-implementation.md(+236 -0)📝
docs/development/optional-agent-packages.md(+48 -0)➕
docs/development/ruleset-5e-2014.example.json(+1109 -0)📝
packages/client/src/components/agents/AgentCatalogView.tsx(+1 -0)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+82 -0)➕
packages/server/src/services/game/ruleset-registry.service.ts(+125 -0)📝
packages/shared/src/index.ts(+1 -0)📝
packages/shared/src/schemas/capability-package.schema.ts(+20 -2)➕
packages/shared/src/schemas/ruleset.schema.ts(+854 -0)📝
packages/shared/src/types/chat.ts(+3 -0)📝
scripts/regressions/capability-package-lifecycle.regression.ts(+5 -5)➕
scripts/regressions/game-ruleset-registry.regression.ts(+371 -0)📄 Description
Linked issue
Part of #6314 (slice 1 of 7; it does not close the issue).
Why this change
What changed
packages/shared/src/schemas/ruleset.schema.ts): a strict zod schema forruleset.json. A ruleset picks a resolution kind from a closed, Engine-owned set (first kind:dice-sum) and declares a sheet from closed primitives. There are no expression strings. Every name a ruleset uses is checked to exist, derived values may only read values declared above them (so a cycle cannot be written), and all text that can reach the GM prompt follows the gm-verbs hygiene rules. Refusals come back aspath: messagelines an author can act on.docs/development/game-rulesets-and-sheets-implementation.md§ Format decisions lists each choice and why.chat.metadata.gameRuleset(RulesetRef), declared onChatMetadata. No pin resolves toengine-legacy.ruleset.jsonincontributions.assets.paths, declares the new kindruleset, and needs no permission and no entrypoint. Listing the asset requires 1.20, so an older Engine refuses the install cleanly. The lifecycle regression's version pin, message regexes and unsupported-minor probe moved together.ruleset-registry.service.tsplusrulesetSources()in the package manager): reads every ready package's ruleset with the same discipline asgm-verbs.json(declared, hash-pinned, refused on declared size above 256 KB before the read, re-verified against the install hash). A file it cannot use is dropped with one log line. Two packages claiming one id resolve by package-id order. A pin the install cannot honour (missing, or older than the pinned version) is reported as unavailable, never reinterpreted.ruleset-5e-2014.example.json, and § Capability API 1.20 inoptional-agent-packages.md.scripts/regressions/game-ruleset-registry.regression.tscovers the 5e file validating, a 2d6 system with its own names validating, sixteen refusal cases, registry drops with their log lines, pin resolution, and the manifest gate.Local CodeRabbit review: three findings fixed (hideWhen value typing, locale-free ordering, a regression message). One declined: memoizing the registry. It is re-read per call on purpose, like the GM verb table, so install, update, disable and uninstall need no invalidation and every read is re-verified against the install hash.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Commands run locally by the agent:
pnpm check(exit 0), and the regressionsgame-ruleset-registry,capability-package-lifecycle,capability-gm-verbs,capability-tool-runtimeandagent-catalog-kind-badges(all pass).Still to verify by hand:
ruleset.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Docs touched:
CHANGELOG.md,docs/development/optional-agent-packages.md, and two new files underdocs/development/. The[docs-i18n]follow-up will be filed as one batch for the ruleset slices.UI evidence (if applicable)
None. The only client change is the word "Rules" for the new package kind in the catalog.
Summary by CodeRabbit
New Features
ruleset.jsonpackages under Capability API 1.20.Documentation
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.