diff --git a/agents.py b/agents.py index ae57517..3420856 100755 --- a/agents.py +++ b/agents.py @@ -757,6 +757,93 @@ def token_phase_flush(cfg, next_phase_id): fh.write(json.dumps(rec) + "\n") parts = ", ".join(f"{n}={per_agent[n]['total']:,}" for n in per_agent) log(f"[log_tokens] phase {rec['phase_id']}: {total['total']:,} tok in {dur}s ({parts})") + +# ── token logging granularity: per phase, or also per GATE (log_tokens) ──────────── +# Phases are tracked per phase (token_phase_begin/flush). With token_granularity="gate" (the default) +# tokens are ALSO attributed to each gate. A "gate" is a claimed unit — any `claim(