gate-evidence: window FUT-action counts to the gate, not the whole log

'pack opens recorded: 45' appeared in the gate 8 report. The UTAS log is
cumulative across the entire deployment, so a bare count reads as if 45 packs
were opened during that gate; the real number was 1.

Now reports both, labelled, windowed from the sidecar's start time (it is
restarted per gate, so that is the gate boundary). A bare count in a gate
report will be read as belonging to that gate, so it has to be the one that
does.

Third counting bug in this tooling: the trace frame counter matched OPEN/CLOSE
markers, the capture and trace were read seconds apart during a live session,
and now this. Evidence tooling gets the same scrutiny as the code under test.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
funman300
2026-08-11 02:31:55 +00:00
parent bfb7876ed4
commit b40adac3fc
+15 -4
View File
@@ -164,10 +164,21 @@ UTASLOG=/tmp/utas_server.log
if docker exec openfut-fut-backend test -f "$UTASLOG" 2>/dev/null; then
docker exec openfut-fut-backend sh -c "grep -E 'STORE:|SQUAD:|SBC:|TRADE:' $UTASLOG" \
> "$DEST/utas-actions.log" 2>/dev/null || true
packs="$(grep -c 'opened pack' "$DEST/utas-actions.log" 2>/dev/null || echo 0)"
both " pack opens recorded: $packs"
both " most recent actions:"
tail -5 "$DEST/utas-actions.log" 2>/dev/null | sed 's/^/ /' | tee -a "$DEST/summary.txt" || true
# Window to THIS gate. The UTAS log is cumulative across the whole
# deployment, so a raw count reads as if 45 packs were opened in this gate.
# The sidecar is restarted per gate, so its first log line is the window
# start. Both numbers are reported, labelled, because a bare count in a gate
# report is read as belonging to that gate.
since="$(head -1 "$LOGFILE" 2>/dev/null | sed -E 's/^\[([0-9]+)\..*/\1/')"
since_hm="$(date -d "@${since:-0}" '+%H:%M' 2>/dev/null || echo '00:00')"
all_packs="$(grep -c 'opened pack' "$DEST/utas-actions.log" 2>/dev/null || echo 0)"
gate_packs="$(awk -F'[][]' -v t="$since_hm" '$2>=t' "$DEST/utas-actions.log" 2>/dev/null \
| grep -c 'opened pack' || echo 0)"
both " pack opens THIS GATE (since $since_hm): $gate_packs"
both " pack opens in the whole log (cumulative, all deployments): $all_packs"
both " actions this gate:"
awk -F'[][]' -v t="$since_hm" '$2>=t' "$DEST/utas-actions.log" 2>/dev/null | tail -6 \
| sed 's/^/ /' | tee -a "$DEST/summary.txt" || true
else
both " utas log not readable"
fi