Skip to content

Watcher: InnerPeace effect fix#5

Open
JackSwitzer wants to merge 1 commit intomainfrom
work/cards-watcher
Open

Watcher: InnerPeace effect fix#5
JackSwitzer wants to merge 1 commit intomainfrom
work/cards-watcher

Conversation

@JackSwitzer
Copy link
Owner

@JackSwitzer JackSwitzer commented Feb 4, 2026

Summary

  • Fix InnerPeace effect key mismatch
  • Added backwards-compatible alias
  • if_calm_draw_else_calm now works correctly

Test Results

7 InnerPeace tests passing

Files Changed

  • packages/engine/content/cards.py (effect key fix)
  • packages/engine/effects/executor.py (alias)

🤖 Generated with Claude Code


Note

Low Risk
Low-risk change scoped to Watcher effect naming and test setup; main risk is any remaining references to the old effect key, mitigated by keeping an alias in both the registry and executor dispatch table.

Overview
Fixes a Watcher InnerPeace effect key mismatch by standardizing on if_calm_draw_else_calm (draw 3/4 in Calm, otherwise enter Calm) and updating the card-to-effects mapping to use the canonical name.

Adds a backwards-compatible alias so existing callers of if_calm_draw_3_else_calm continue to work (implemented in both effects/cards.py registration and effects/executor.py handler table), and expands tests to cover the canonical effect while making pytest imports path-independent.

Written by Cursor Bugbot for commit acec475. This will update automatically on new commits. Configure here.

- Add canonical effect key `if_calm_draw_else_calm` for InnerPeace card
- Keep `if_calm_draw_3_else_calm` as backwards-compatible alias
- Update WATCHER_CARD_EFFECTS mapping to use canonical key
- Add comprehensive tests for canonical effect:
  - Test: In Calm stance draws 3 cards (base)
  - Test: In Calm stance draws 4 cards (upgraded)
  - Test: From Neutral/Wrath enters Calm stance
- Fix conftest.py to use dynamic project root path for worktrees

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

# Calm/Wrath conditionals
"if_calm_draw_3_else_calm": lambda s, c, cd, r: c.draw_cards(4 if c.is_upgraded else 3) if c.stance == "Calm" else c.change_stance("Calm"),
"if_calm_draw_else_calm": lambda s, c, cd, r: c.draw_cards(4 if c.is_upgraded else 3) if c.stance == "Calm" else c.change_stance("Calm"),
"if_calm_draw_3_else_calm": lambda s, c, cd, r: c.draw_cards(4 if c.is_upgraded else 3) if c.stance == "Calm" else c.change_stance("Calm"), # Alias
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated lambda logic for alias instead of delegation

Low Severity

The if_calm_draw_3_else_calm alias duplicates the entire lambda logic instead of referencing the canonical if_calm_draw_else_calm handler. In cards.py, the alias correctly delegates to the main function, but here the logic is copy-pasted. Consider using _EFFECT_HANDLERS.get("if_calm_draw_else_calm") or a shared reference.

Fix in Cursor Fix in Web

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