Repository navigation
Add AddMember, a referee command that adds a party member - #191
Merged
Merged
Conversation
Issue #172 asks for a logged referee command that adds a member to a running party. This commit adds the contract and the tests. The handler is a stub that raises NotImplementedError, so the chunk's tests are marked xfail for chunk: add-member. The contract: - AddMember(character=...) is legal in town and exploring. Every other mode refuses it with session.command.wrong_mode. During an encounter or a battle, surprise, the chase pace, and who declares are already settled. Once the session has ended, a new member would restart play. - The character must have no id (party.add.id_assigned), no condition or stat modifier (party.add.under_effects), and no magic item or valuable (party.add.carries_instances). - The session adds a copy at the back of the marching order. Its id is the next character-NNNN from the allocator, passing over ids that members already have. - It emits a player-visible MemberAddedEvent with the code session.member.added. - Coins the new member brings into a dungeon are added to the treasure snapshot, so they earn no experience. - The command isn't an authored consequence, because adventure documents carry no characters. The spec's consequence exclusions now name it. Existing tests changed with the census: the referee command set, its mode carve-outs, the samples, and the consequence exclusions. The fuzz leaves AddMember out until the chunk merges, and test_add_member.py fuzzes it under the marker. The rejection-code docs gate is marked xfail until the handler emits the new codes. The catalog page check now ignores the JSON Schema pattern on Character.race, which it read as cross-reference markup. Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
…ing play The handler checks the character in the contract's order: no id, then no condition or stat modifier, then no magic item or valuable. A refusal returns before anything changes. An accepted command appends a deep copy of the command's character at the back of the marching order, gives it the next character id from the session's allocator (skipping any id a member already has), adds its coins to the treasure snapshot when a delve is under way, and emits MemberAddedEvent. It makes no draws and takes no time. The three rejection codes have descriptions in tools/docs/rejection_codes.json. The docstrings that said ReorderParty is the only command that changes the party, or that only GameSession.new assigns character ids, now name AddMember. The LLM referee page lists the command, and the changelog has an Added bullet. No golden file changed. Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
…e share The fuzz in test_crawl_properties now draws AddMember too, and the docs gate for rejection codes runs unmarked. Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
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.
A running session had no way to add a party member, so a game couldn't bring in a replacement for a character who died, or a retainer. This adds
AddMember, a logged referee command that adds a character to the party. It's the first part of #172. The retainer rules (the hiring roll, loyalty, and experience and treasure shares) come in a later pull request on top of it.What changed
AddMembertakes a character built withcreate_character. It's legal intownandexploring. During an encounter or a battle, or after the game ends, the session refuses it withsession.command.wrong_mode.character-NNNNid, and reports a player-visibleMemberAddedEvent(session.member.added).party.add.id_assigned), one with a condition or stat modifier (party.add.under_effects), and one who carries a magic item or a valuable (party.add.carries_instances). Those came from another game's effects ledger or id space and could clash with this one.What to check
GameSession.newstill doesn't skip a pre-set id when it allocates ids, so a starting party with a pre-setcharacter-0002on its second member can get a duplicate. That's older than this change. I'll fix it with the API hygiene items.https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD