#!/bin/sh # Dependency direction (CLAUDE.md ยง1): `relay` never depends on `client`; # `protocol` depends on nothing in this repository. set -eu cd "$(dirname "$0")/.." fail=0 tree() { cargo tree --quiet -p "$1" -e normal --prefix none --format '{p}' | awk '{print $1}' | sort -u; } if tree tabellarius-relay | grep -qx tabellarius-client; then echo "FAIL tabellarius-relay depends on tabellarius-client"; fail=1 else echo "ok tabellarius-relay does not depend on tabellarius-client" fi own=$(tree tabellarius-protocol | grep '^tabellarius-' | grep -vx tabellarius-protocol || true) if [ -n "$own" ]; then echo "FAIL tabellarius-protocol depends on: $own"; fail=1 else echo "ok tabellarius-protocol depends on nothing in this repository" fi exit $fail