---
id: "sync-chain-too-deep"
type: "rule"
severity: "warning"
url: "https://localhost:3000/catalogue/rules/sync-chain-too-deep"
---

# Synchronous call chain too deep

| | |
|---|---|
| Severity | warning |
| Selects | every node of kind api-gateway |
| Components in scope | 41 |

## Why

Every consecutive synchronous hop from this entry point spends part of the stated p95 latency budget, and the chain's failures multiply. More than three hops is a budget nobody is tracking.

## What it checks

It looks at every node of kind api-gateway, and fires when:

- all of these hold:
  - the design requirement `latency.p95Ms` has a value
  - the longest chain of synchronous calls starting at the node is more than 3 hops long

Message template:

```
Entry point '{{node.id}}' starts a synchronous call chain deeper than 3 hops while the design states a p95 latency target.
```

## Applies to

- [API gateway](https://localhost:3000/catalogue/kinds/api-gateway.md) `api-gateway`

41 catalogue components fall under it.

## Tripped by

Reference designs whose broken twin names this rule in its header:

- [coinbase-exchange](https://localhost:3000/d/zeema/coinbase-exchange)
- [monzo-platform](https://localhost:3000/d/zeema/monzo-platform)
- [order-processing](https://localhost:3000/d/zeema/order-processing)
- [robinhood-trading](https://localhost:3000/d/zeema/robinhood-trading)
- [zerodha-kite](https://localhost:3000/d/zeema/zerodha-kite)

## Source (`rule` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../schema/rule.schema.json
# syncChainDepth is the longest path of consecutive sync edges starting at this node.
# With a stated p95 latency target, every extra synchronous hop eats into that budget.
# Tripped by designs/order-processing.broken.yaml.
schemaVersion: "1"
type: "rule"
id: "sync-chain-too-deep"
severity: "warning"
select:
  node:
    kind: "api-gateway"
when:
  all:
    - requirement: "latency.p95Ms"
      exists: true
    - syncChainDepth:
        gt: 3
message: "Entry point '{{node.id}}' starts a synchronous call chain deeper than 3 hops while the design states a p95 latency target."
```

Human page: https://localhost:3000/catalogue/rules/sync-chain-too-deep
