#!/usr/bin/env bash
# Phase 1 fan-out study notes — how to measure WG time-to-last-spoke vs clear-WLAN.
#
# Baseline (before / with TID-unicast):
#   1. Run hub with N=2 then N=4 spoke gretaps in ETH_PORTS.
#   2. Force a flood path (EDGE_TID_UNICAST=0) and grep events.jsonl for eth_fanout.
#   3. Record wall_us at port_count=2 and port_count=4 (time-to-last-spoke).
#
# After Phase 2b (clear WLAN):
#   1. EDGE_TID_UNICAST=1 EDGE_BANK_WLAN=1 on hub + spokes.
#   2. Confirm eth_fanout mode=unicast stays flat as N grows.
#   3. Measure bank_wlan_rx kind=meter_0a freshness and jackpot announce latency
#      on a non-winning spoke — should be independent of WG spoke count.
#
# Example (on hub Pi after a soak):
#   jq -r 'select(.event=="eth_fanout")|[.ts,.port_count,.wall_us,.mode]|@tsv' \
#     ~/EtherGold/logs/<pos>/data/events.jsonl | tail -50
#   jq -r 'select(.event=="bank_wlan_rx" or .event=="bank_wlan_tx")' \
#     ~/EtherGold/logs/<pos>/data/events.jsonl | tail -50

set -euo pipefail
cat <<'EOF'
EG 2.2.2.71 fan-out study
  eth_fanout: wall_us / port_count / mode (flood|unicast)
  bank_wlan_*: clear-WLAN meter + jackpot path (soft deadline)
  EDGE_TID_UNICAST=0 → flood baseline; =1 → TID unicast (gameplay)
See EDGE_HUB.md § Fan-out metrics.
EOF
