Skip to content

feat(rules): evaluate_character(components=...) — compose item modifiers onto the sheet#9

Merged
sligara7 merged 3 commits into
mainfrom
feat/evaluate-character-components
Jul 1, 2026
Merged

feat(rules): evaluate_character(components=...) — compose item modifiers onto the sheet#9
sligara7 merged 3 commits into
mainfrom
feat/evaluate-character-components

Conversation

@sligara7

@sligara7 sligara7 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Enables storyflow's items/equipment workstream (an allocated item composes onto the character sheet). Adds a components kwarg to evaluate_character that compose()s item Component specs onto the ruleset before evaluate. None/[] = no-op (default behaviour unchanged). compose had 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_content defaults to item → collision — storyflow uses each owned GraphComponent's unique node id). Sheet surfaces armor_class/initiative; ability-score/resistance targets compose the node but need a sheet-reshape follow-up (tracked).

⚠️ This needs a dndwright release + a storyflow pin bump (DNDWRIGHT_VERSION) — a user-gated publish step. Tested locally via worktree-install into gen_plus for inc-4.

🤖 Generated with Claude Code

boss and others added 3 commits July 1, 2026 01:54
…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>
@sligara7
sligara7 merged commit 358eb3e into main Jul 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant