Skip to content

Fix Lighthouse Chronologist level trigger condition#5535

Merged
matthewevans merged 3 commits into
phase-rs:mainfrom
mike-theDude:fix/issue-4728-lighthouse-chronologist-extra-turn-condition
Jul 11, 2026
Merged

Fix Lighthouse Chronologist level trigger condition#5535
matthewevans merged 3 commits into
phase-rs:mainfrom
mike-theDude:fix/issue-4728-lighthouse-chronologist-extra-turn-condition

Conversation

@mike-theDude

Copy link
Copy Markdown
Collaborator

Summary

Fixes the level-trigger condition composition for Lighthouse Chronologist.

Closes #4728.

The LEVEL 7+ trigger now keeps both required gates: the creature must have at least seven level counters, and the printed intervening-if condition (if it's not your turn) must also be true. Previously the level-block reparse replaced the printed condition with the level-counter gate, allowing the extra-turn trigger to fire on the controller's own end step.

Files changed

  • crates/engine/src/parser/oracle.rs
  • crates/engine/src/parser/oracle_trigger_tests.rs

CR references

  • CR 711.2a
  • CR 711.2b
  • CR 603.4

Track

Developer

LLM

Model: codex-5
Thinking: high
Tier: Standard

Gate A

./scripts/check-parser-combinators.sh exited 0 with no output.

Anchored on

  • crates/engine/src/parser/oracle_trigger.rs:6964 - existing trigger-condition composition helper wraps an existing condition and a new gate in TriggerCondition::And.
  • crates/engine/src/parser/oracle_trigger_tests.rs:16796 - existing regression test for composing a trigger gate with a printed intervening-if condition.

Verification

  • cargo fmt --all -- --check - clean
  • ./scripts/check-parser-combinators.sh - clean
  • git diff --check origin/main...HEAD - clean
  • cargo test -p engine level_trigger_preserves_printed_intervening_if_condition - 1 passed / 0 failed
  • cargo clippy -p engine --all-targets -- -D warnings - clean

Tilt was not running, so direct cargo fallback was used.

Scope Expansion

None.

Validation Failures

Independent fresh-context subagent review was not run because subagent delegation was not explicitly requested; local doc-guardian and code-reviewer checklist passes found no findings.

CI Failures

None.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot added the needs-maintainer AI-contribution PR requires human triage (Non-dev track or unresolved gaps) label Jul 10, 2026
@mike-theDude mike-theDude added the ai-contribution PR opened via docs/AI-CONTRIBUTOR.md flow label Jul 10, 2026

@matthewevans matthewevans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed and verified — holding only on CI (5 checks still running); will approve on settled green.

Correct, and on the general seam. The bug is in the level-block reparsing pass, which was unconditionally overwriting each trigger's condition with the level-counter gate — so for LEVEL 7+, the printed intervening-if if it's not your turn was dropped and the extra-turn trigger would fire at the controller's own end step. AND-composing the level gate with any existing condition is the right fix, and because it lives on the shared reparsing path it covers every leveler with a printed intervening-if, not just Lighthouse Chronologist.

Verified:

  • Oracle text matches live Scryfall exactly (At the beginning of each end step, if it's not your turn, take an extra turn after this one.).
  • CR citations grep-verified against the Comprehensive Rules: 711.2a/711.2b (level symbols are static abilities active while in the counter range) and 603.4 (intervening-if). All accurate.
  • Test is discriminating: it destructures TriggerCondition::And and asserts both the HasCounters{level, minimum:7} gate and the Not{DuringPlayersTurn{Controller}} gate are present — before the fix the And wouldn't exist at all, so the test fails closed.

Nice fix. Enqueue is pending only on the rollup settling green.

@github-actions

Copy link
Copy Markdown

Parse changes introduced by this PR · 1 card(s), 1 signature(s) (baseline: main eb0a44f31f29)

1 card(s) · trigger/Phase · field condition: has 7+ countersnot (during you's turn) and has 7+ counters

Examples: Lighthouse Chronologist

2 card(s) had Oracle-text changes (errata/reprint) — excluded as non-parser.

@matthewevans matthewevans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving. The fix AND-composes the level-counter gate with the printed intervening-if on the shared level-block reparse path (TriggerCondition::And { conditions: vec![existing, trigger_condition] }), so it covers every leveler with a printed condition, not just Lighthouse Chronologist. Pre-fix, the reparse unconditionally overwrote the condition, dropping if it's not your turn and firing the extra-turn trigger at the controller's own end step. CR 711.2a/711.2b/603.4 verified; the test destructures the And and asserts both gates (fails closed pre-fix). CI green, merge CLEAN.

@matthewevans matthewevans added the bug Bug fix label Jul 10, 2026
@matthewevans
matthewevans added this pull request to the merge queue Jul 10, 2026
Merged via the queue into phase-rs:main with commit 2ba0ad0 Jul 11, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-contribution PR opened via docs/AI-CONTRIBUTOR.md flow bug Bug fix needs-maintainer AI-contribution PR requires human triage (Non-dev track or unresolved gaps)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lighthouse chronologist infinite turns — When Lighthouse chronologist hits level 7 you are supposed to to take an extra…

3 participants