feat(rules): evaluate_character(components=...) — compose item modifiers onto the sheet#9
Merged
Merged
Conversation
…tem modifiers onto the sheet Adds a 'components' kwarg to evaluate_character: item/equipment dndwright Components (or component_from_dict-shaped spec dicts, as persisted on a storyflow GraphComponent) are compose()'d onto the ruleset before evaluate, so an allocated item's modifier lands on the computed sheet (e.g. a +1 armor_class item -> +1 AC). None/[] is a pure no-op. Enables the storyflow items/equipment workstream (inc-4: an equipped item composes onto the character sheet). compose had no shipping callers before; this is its first real use. Notes: item components MUST carry unique ids (dndwright namespaces by component.id; the component_from_content default 'item' collides across items). Only targets the sheet-reshape reads from computed nodes surface (armor_class, initiative confirmed); ability-score/resistance targets compose the node but need a sheet-reshape follow-up. Tests: +1 AC single + two-unique stack + serialized-dict + no-op; api-contract signature updated (additive kwarg).
… evaluate_character components compose) Greens the Lint(ruff) CI step (3 pre-existing auto-fixable errors: unused import, extraneous f-prefix) and bumps the version for the PyPI release that unblocks storyflow inc-4 (evaluate_character(components=...)). Compose tests 4/4 + full suite 1655 passed (worktree source). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…es_package_metadata) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Enables storyflow's items/equipment workstream (an allocated item composes onto the character sheet). Adds a
componentskwarg toevaluate_characterthatcompose()s item Component specs onto the ruleset beforeevaluate.None/[]= no-op (default behaviour unchanged).composehad no shipping callers before — this is its first real use.Verified: +1 armor_class item → +1 AC (base 12→13); two unique-id AC items stack to +2; serialized-dict (component_from_dict) path works; no-op default. 17 tests pass incl. the updated api-contract signature lock.
Boss notes (storyflow-side handled): components need unique ids (dndwright namespaces by
component.id;component_from_contentdefaults toitem→ collision — storyflow uses each owned GraphComponent's unique node id). Sheet surfacesarmor_class/initiative; ability-score/resistance targets compose the node but need a sheet-reshape follow-up (tracked).DNDWRIGHT_VERSION) — a user-gated publish step. Tested locally via worktree-install into gen_plus for inc-4.🤖 Generated with Claude Code