Skip to content

refactor(spells): give cast events an explicit kind - #476

Merged
Mathih13 merged 1 commit into
mainfrom
fix/spell-event-kind-72-sept8
Sep 8, 2026
Merged

Mathih13 merged 1 commit into
mainfrom
fix/spell-event-kind-72-sept8

Conversation

@Mathih13

@Mathih13 Mathih13 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

A Spell Cast Event used several payload fields as an implicit signal type. The Gateway depended on a fixed branch order, and another signal could add another boolean and another invalid field combination.

This change gives each new event an explicit Spell Cast Event Kind. The Module stamps START, GO, INTERRUPT, PUSHBACK, or PROC_LOG through the typed event constructors. The Gateway preserves the old field-based order for migrated rows whose kind is zero. It emits no packet for an unknown nonzero kind and logs the event identity.

The schema change end-appends kind: u8 with #[default(0u8)]. Existing columns remain in place for rolling compatibility and payload data. The complete private Gateway bindings were regenerated with the supported command.

Schema review

  • kind is the final game_spell_cast_event column.
  • Zero identifies rows written before this column existed.
  • Codes are append-only: 1 START, 2 GO, 3 INTERRUPT, 4 PUSHBACK, 5 PROC_LOG.
  • Existing Module writers keep the legacy discriminator fields populated so an older Gateway can decode new rows during a rolling update.
  • Publish the Module to every Realm database before restarting Gateways with the new binding.

Validation

  • python3 scripts/check-gateway-bindings.py
  • cargo test -p lyracore-importer
  • cargo test -p lyracore-module --lib --features=debug_reducers
  • cargo test -p lyracore-gateway
  • cargo test -p lyracore-shared
  • cargo build
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check
  • ./lyracore preflight

Refs #72.

Implemented with GPT-5.6 Sol at high reasoning effort using Codex.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 8de2cc96-484f-41ad-94cd-53adc38dfbb1

📥 Commits

Reviewing files that changed from the base of the PR and between 408f417 and af13d1e.

📒 Files selected for processing (13)
  • CONTEXT.md
  • gateway/src/stdb/bindings/spell_cast_event_type.rs
  • gateway/src/stdb/subscriptions.rs
  • gateway/src/stdb/world_view/cell_audience_tests.rs
  • gateway/src/stdb/world_view/relay_bench.rs
  • gateway/tests/schema_parity.rs
  • module/src/combat/swing.rs
  • module/src/spell/cast/resolve.rs
  • module/src/spell/cast/targeting.rs
  • module/src/spell/control.rs
  • module/src/spell/proc.rs
  • module/src/spell/scheduler.rs
  • module/src/spell/tables.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Mathih13

Mathih13 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Independent source review complete at 97678dd. All CI jobs passed. The PR remains held for human schema review and integration with the item GUID change.

Root checked that the numeric kind is appended with default 0, all constructors write explicit kinds, and kind 0 preserves the existing interrupt, delay, proc, cast-time and completion branch order. Known nonzero kinds dispatch explicitly; unknown values are logged and dropped. The legacy fields remain populated for the older Gateway reader. All 990 generated bindings match the supported private-generation output, and schema parity checks the appended field.

No remaining source review blocker found. The Module must publish before the new Gateway runs. The appended column needs human review under docs/danger-zones.md before shipping. CodeRabbit supplied a quota notice, so this is an independent review rather than a claimed CodeRabbit review.

@Mathih13
Mathih13 force-pushed the fix/spell-event-kind-72-sept8 branch from 97678dd to af13d1e Compare September 8, 2026 07:04
@Mathih13

Mathih13 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

The clean rebases onto main 408f417 preserve the reviewed patches. Root also merged all three final source changes together in an isolated checkout and verified the combined result:

  • Module: 1,508 tests passed.
  • Gateway: 1,448 tests passed; seven private tests excluded from that suite.
  • Private durable fixtures: all 12 item GUID cases and the door lifecycle case passed.
  • All 995 Gateway bindings match private generation.
  • Formatting and strict workspace Clippy passed.

No integration conflict or source correction was needed. The current rebased-head CI is running. Human schema review has been requested in the delivery thread; this PR stays held until that review and final CI complete.

@Mathih13

Mathih13 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

The user approved the concrete schema change in the delivery thread. Root rechecked final head af13d1e: all CI jobs pass, the independent review has no outstanding finding, and there are no unresolved threads. The combined source proof is recorded above. Proceeding with the source merge; rollout follows the documented Module-before-Gateway order.

@Mathih13
Mathih13 merged commit 02a0662 into main Sep 8, 2026
7 checks passed
@Mathih13
Mathih13 deleted the fix/spell-event-kind-72-sept8 branch October 11, 2026 18:20
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