Search docs

Docs search
Back to Rule Catalog
AP-EVT-003Event Architecture

Synchronous dependency disguised as event

Flags events used like immediate synchronous calls between modules.

warningviolationNo auto-fix

How to fix

  1. Use an explicit service boundary for synchronous dependencies.
  2. Use events for post-commit or eventually consistent work.
  3. Document expected consistency and failure handling.

What it means

A publisher appears to require immediate handler completion to finish its own workflow.

Why it matters

Events should decouple workflows; using them synchronously hides dependencies and failure behavior.

Common causes

  • An event bus is used as a service locator.
  • Handlers return data needed by the publisher.
  • A synchronous dependency was renamed as an event without changing semantics.

Example bad pattern

Checkout publishes PriceCalculatedEvent and waits for the handler to return the price.

Example good pattern

Checkout calls PricingService synchronously, then publishes CheckoutStarted for async follow-up.

Related files/config

  • apps/api/src
  • packages/contracts/src

Related CLI commands

  • archpilot validate
  • archpilot validate --ci
AP-EVT-003 - Synchronous dependency disguised as event | ArchPilot Docs