gate-evidence: count trace frames correctly, archive the raw capture, observe FUT actions
Three fixes, all found while closing out gate 7.
1. Frame count was wrong. It counted lines matching '^conn-', which also
matches the OPEN/CLOSE lifecycle markers, inflating the figure by one or
two. Compared against the capture's record count that looked like a
capture/trace divergence (89 vs 88) when there was none: read at the same
instant, both report 99. Evidence tooling that miscounts is exactly what
this project cannot afford.
2. The raw capture is now copied into the evidence bundle (0600), so a gate's
forensic bytes travel with its report.
3. FUT actions are now observed on the UTAS side. 'Known FUT action succeeded'
is a client-side fact, but FUT actions go over UTAS -- which is never
switched -- so the UTAS log confirms them independently of anyone's
recollection. Gate 7's pack open shows up as:
STORE: opened pack Special Players Pack -> 11 items
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -104,8 +104,18 @@ both ""
|
||||
both "--- TRACE ---"
|
||||
if [[ -n "$TRACE" && -f "$TRACE" ]]; then
|
||||
cp "$TRACE" "$DEST/rust-blaze.trace"
|
||||
frames="$(grep -c '^conn-' "$TRACE" 2>/dev/null || echo 0)"
|
||||
both " $TRACE -> $DEST/rust-blaze.trace ($frames traced frames)"
|
||||
# Count FRAME lines only. `^conn-` also matches the OPEN/CLOSE markers, and
|
||||
# counting those inflated the figure by one or two — which then looked like a
|
||||
# capture/trace divergence when compared against the capture's record count.
|
||||
frames="$(grep -cE '^conn-[0-9]+ (RX|TX) ' "$TRACE" 2>/dev/null || echo 0)"
|
||||
markers="$(grep -cE '^conn-[0-9]+ (OPEN|CLOSE)' "$TRACE" 2>/dev/null || echo 0)"
|
||||
both " $TRACE -> $DEST/rust-blaze.trace ($frames traced frames, $markers lifecycle markers)"
|
||||
# Capture and trace are written continuously; on a LIVE session they are only
|
||||
# comparable if read at the same instant.
|
||||
if [[ -n "${OPENFUT_BLAZE_CAPTURE:-}" && -f "${OPENFUT_BLAZE_CAPTURE}" ]]; then
|
||||
cp "$OPENFUT_BLAZE_CAPTURE" "$DEST/raw.ofcap" 2>/dev/null && chmod 600 "$DEST/raw.ofcap"
|
||||
both " raw capture -> $DEST/raw.ofcap (0600, NEVER commit)"
|
||||
fi
|
||||
both " routes seen:"
|
||||
grep -o '^conn-[0-9]* \(RX\|TX\) [^ ]* [A-Za-z]*::[^ ]*' "$TRACE" 2>/dev/null \
|
||||
| awk '{print $2, $4}' | sort | uniq -c | sort -rn | head -20 \
|
||||
@@ -142,6 +152,26 @@ else
|
||||
both " python blaze log not readable (container not running?)"
|
||||
fi
|
||||
|
||||
# ------------------------------------------------- FUT actions (UTAS side)
|
||||
#
|
||||
# "Known FUT action succeeded" is a client-side fact, but it leaves an
|
||||
# independent trace: FUT actions go over UTAS (Python, never switched), so the
|
||||
# UTAS log confirms them without relying on anyone's recollection of what they
|
||||
# clicked.
|
||||
both ""
|
||||
both "--- FUT ACTIONS (observed on UTAS, which is always Python) ---"
|
||||
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
|
||||
else
|
||||
both " utas log not readable"
|
||||
fi
|
||||
|
||||
# ----------------------------------------------------------- python health
|
||||
both ""
|
||||
both "--- PYTHON BACKEND (must stay healthy throughout) ---"
|
||||
|
||||
Reference in New Issue
Block a user