Skip to content

Latest commit

 

History

History
52 lines (33 loc) · 1.3 KB

File metadata and controls

52 lines (33 loc) · 1.3 KB

Validation

Purpose

Validation protects the architectural boundary of the package. Invalid event definitions fail immediately instead of being coerced into a registry or silently ignored.

The concrete validator is StrictEventValidator.

Valid Event Definition

A registrable event must be:

  • a concrete class
  • immutable
  • assigned to exactly one supported event family

In practice, that means the class must implement exactly one of:

  • KernelStateEventInterface
  • ProcessEventInterface

Because both family interfaces extend ImmutableEventInterface, family membership carries the immutability requirement.

Forbidden Definitions

Validation fails when a candidate:

  • implements only EventInterface
  • implements only ImmutableEventInterface
  • implements neither family interface
  • implements both family interfaces
  • is abstract
  • is an interface
  • is a trait
  • is an enum

Reflection-based validation also fails if the class cannot be reflected.

Hard-Fail Behavior

There is no fallback path. Invalid definitions raise EventClassificationException.

The same hard-fail approach applies after validation:

  • duplicate registrations fail
  • family mismatches fail
  • locked registries reject new registrations

Related: