Search docs
Docs searchValidation rule
Back to Rule CatalogAP-EVT-002Event ArchitectureCircular event chain risk
Flags event chains that may loop back to their starting workflow.
warningviolationNo auto-fix
How to fix
- Break the cycle with a clearer event boundary.
- Add idempotency and correlation guards.
- Document intentional event choreography.
What the rule validates
An event handler appears to publish an event that can trigger the original publisher path again.
Why it matters
Circular event chains can create duplicate processing, retry storms, or inconsistent state.
Common causes
- Handlers publish broad follow-up events.
- No idempotency guard exists.
- A workflow was converted from sync calls to events without reviewing cycles.
Typical violation example
PolicyUpdated triggers RepositoryRevalidated, which triggers PolicyUpdated again.Typical compliant example
Event handlers publish downstream events that do not re-enter the same state transition.Related rules
AP-EVT-001 - Published event has no handlerAP-EVT-003 - Synchronous dependency disguised as eventAP-EVT-004 - Event naming inconsistency
Adjacent categories
Related files/config
apps/api/srcpackages/contracts/src
Related CLI commands
archpilot validatearchpilot validate --ci