Skip to content

SpellCastEvent: add a kind discriminator instead of growing the boolean pile #72

Closed

Description

@Mathih13

SpellCastEvent (spell/tables.rs:241-353) multiplexes five wire signals — cast-START, cast-GO, interrupt-failure, pushback, proc-log — discriminated by prose conventions: is_interrupted rows where "this is the ONLY field set" (290), delay_ms rows with the same only-field contract (305), is_proc_log rows that suppress START/GO (319), plus is_completion documented as "CURRENTLY UNUSED" (258). Nothing enforces the only-field invariants; the gateway decodes the union by convention; each new signal has added another boolean and another prose contract.

Fix: END-append one kind: u8 discriminator, stamp it at every insert site (trivial now that the typed SpellCastEvent constructors exist (shipped) — one line in the constructor), switch the gateway decode on it, and stop growing the boolean set (existing booleans stay for back-compat until the binding turns over). Decide is_completion's fate — an explicitly unused column in a subscribed table is contract noise.

Schema append + gateway decode change: needs the full 5-shard republish and a gateway binding regen, so not agent-safe.

Found by the 2026-08-06 whole-module audit.


Migrated 2026-08-11 from the private tracker (spacetime-core#389).

Activity

  1. Mathih13 commented on Sep 8, 2026

    @Mathih13
    ContributorAuthor

    PR #476 merged as 02a0662 after the requested human schema review, independent source review and all final-head CI passed.

    The source request is complete. SpellCastEvent now ends with a default-zero numeric kind; typed constructors stamp the five explicit kinds, and the Gateway dispatches on that value. Kind zero preserves the old branch order for existing rows. The legacy booleans remain populated for compatibility, and is_completion stays as a used wire payload field. Generated bindings and schema parity cover the appended column.

    The combined item GUID, Spell event and door source also passed Module and Gateway suites, all 13 new durable cases, all 995 binding checks and strict workspace lint. Deployment remains a separate operation and must publish the Module before starting the new Gateway. No live Realm was updated for this source change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2normalenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions