Events Flow Up, Not Down
Hard About 45 min Katabench Pro
A stable events hub reaches DOWN into a feature for a helper, and one feature reaches SIDEWAYS into a sibling to send an SMS. Cleaning up the hub is the obvious move, but it leaves the feature-to-feature edge red; only routing the sibling call through a hub-published port turns everything green.
The full brief is part of Katabench Pro
Pro opens this kata's brief, its starter code and its grader. To see how the track works first, try Break the Checkout Cycle, which is free.
How it is graded
You work across multiple files, and architecture rules turn the design boundaries into executable feedback.
What it practices
- Stable dependencies
- Stable kernels and contracts must not depend on volatile features.
- Dependency inversion
- Point dependencies at abstractions the core owns, never at outer mechanisms.
- Integration events
- Publish what happened across a module or service boundary as a stable contract, separate from in-process domain events.
Related katas
- Contracts Don't Depend Back Hard Pro The stable shared-contracts module depends back on a volatile feature to build a label. Invert the arrow without changing what Describe returns, and don't just drag the feature's service into the contract.
- Break the Checkout Cycle Hard Free Orders, Pricing and Promotions import each other in a three-hop cycle while Pricing also reaches into Inventory's internals. Moving the obvious call only rotates the cycle; hoist the shared vocabulary into a kernel leaf and reach Inventory through its published port to turn every rule green.
- Config Is Infrastructure Medium Free The shipping core reads a framework configuration type directly, welding the domain to infrastructure. Invert it behind a core-owned options port, and don't just rename the framework wrapper into the core, which trips a second rule.
- Move the Port Home Medium Free A
*Portabstraction is declared beside its adapter, so the core reaches outward to see its own port. Move the single port into the core; duplicating it leaves a stray copy that fails the role-placement rule.