Repository navigation
Label every spell mode and give sibling modes their own prose - #348
Merged
Merged
Conversation
`SpellMode.display_name` is a stub with an empty default (#340). The compiled spells.json is regenerated for the new field, so every mode has an empty label until the compiler fills them. The docstrings of `SpellMode.prose` and `ReversedForm.prose` state how each mode of a passage that covers several usages gets its own part of the text. The tests in tests/test_spell_mode_names.py are marked xfail until the chunk lands. They pin the label of every mode of every form with more than one mode, the key-derived label of every other mode and of a mode written without one, distinct labels and distinct prose among sibling modes, the divided prose of darkness, continual darkness, charm monster, and silence 15' radius, and a save from osrlib 2.8.0, written by a scratch copy of that release, whose bundled spell is labelled from its keys. Two guards pass today: the reverse keeps its whole text, and the normal light modes keep their usages' prose. Claude-Session: https://claude.ai/code/session_01V7Ertq3gKJ46oFQD6635f3
A mode written without a display_name, or with an empty one, now takes a label made from its key, so
a spell, adventure, or save from 2.8.0 loads with a label on every mode. The SRD compiler labels each
mode of a multi-mode form from the lead-in of the usage it binds, turning a gerund into an
instruction ("Blinding a creature:" is "Blind a creature"). The modes whose page prints no lead-in,
or one that names a situation or a subject, have labels written in _SPELL_MECHANICS. The compiler
fails if a mode of a multi-mode form ends with no label or a sibling's label, or if a written label
stands in for a lead-in's.
The packet asked for those written labels in tools/srd_compile/overrides/spells.json. They are in
the mechanics table instead because tests/test_spell_data.py pins that no built-in spell has
overrides_applied entries, and apply_overrides records one for each path it sets.
The compiler divides the one passage of the reverses of light and continual light, of charm
monster, and of silence 15' radius among their modes in the page's words, and fails if a page no
longer matches the division. ReversedForm.prose keeps the whole text.
spells.json is regenerated: 149 modes gain a display_name and 15 modes change prose. No other
generated file and no golden file changes.
Claude-Session: https://claude.ai/code/session_01V7Ertq3gKJ46oFQD6635f3
The changelog names SpellMode.display_name and shows the old and new prose of darkness's blind mode. The custom content guide lists display_name among SpellMode's fields and says how a mode without one is labelled. Claude-Session: https://claude.ai/code/session_01V7Ertq3gKJ46oFQD6635f3
A label of only spaces now counts as missing, and a label made from a key with underscores at either end, a run of underscores, or a first character whose capital is two characters is pinned. The two sleep labels say which creatures each mode works on, in the page's words, because "Put a creature to sleep" read as any one creature. Claude-Session: https://claude.ai/code/session_01V7Ertq3gKJ46oFQD6635f3
A display_name of only whitespace now counts as missing. The label made from a key turns each run of underscores into one space, drops spaces at either end, and capitalizes the first character only when its capital is one character, so "ß_key" stays "ß key". A key of only underscores is its own label, so no label is empty. This follows the amended SpellMode.display_name contract in 2ea7921. The sleep labels now say which creatures each mode works on, in the page's words: "Put a creature with 4+1 Hit Dice to sleep" and "Put creatures of 4 Hit Dice or lower to sleep". spells.json is regenerated for those two labels, and no other generated or golden file changes. The changelog bullet and the custom content guide state the trimmed key rule. Claude-Session: https://claude.ai/code/session_01V7Ertq3gKJ46oFQD6635f3
# Conflicts: # CHANGELOG.md
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.
Closes #340.
A client's cast dialog could tell the three modes of a reversed light spell apart only by their keys, because all three had the whole text of the reversed form as their prose.
SpellMode.display_nameis a short label for a mode, an instruction in sentence case such as"Conjure darkness","Blind a creature", and"Cancel light". The SRD compiler fills it for every mode of the built-in catalog, from the SRD's lead-in where the page prints one and from a table in the compiler otherwise. No two modes of one form share a label.prosestays the whole text.Against 2.8.0, the compiled spell data changes only in the 149 new labels and 15 prose values. No golden file changes, and
SCHEMA_VERSIONstays 4.How it was checked
The acceptance tests in
tests/test_spell_mode_names.pywere written before the implementation by a different agent. An independent review diffed the compiled data against 2.8.0 and read each label against its mode. After it, the contract was amended: a label of only spaces counts as missing, labels from keys with stray underscores are trimmed, and the two sleep labels say which creatures each mode works on.Filed from this work: #342, #343, #344, #347.
https://claude.ai/code/session_01V7Ertq3gKJ46oFQD6635f3