Update HIL verification for hop-marked repeats

This commit is contained in:
Lars Nolden
2026-09-21 12:31:19 +02:00
parent a11a4b3b89
commit 8c44c54131
13 changed files with 525 additions and 309 deletions
+11 -3
View File
@@ -33,15 +33,23 @@ for i in $(seq 1 "$SEGS"); do
V=$(./result-py/bin/python3 hil/meter_anchored.py \
--iq "$D/iq.raw" --serial "$D/serial.log" --json 2>"$D/verdict.err")
RC=$?
STATE=""
if [ -n "$V" ]; then
echo "$V" | ./result-py/bin/python3 -c \
STATE=$(printf '%s\n' "$V" | ./result-py/bin/python3 -c \
"import json,sys; print(json.load(sys.stdin).get('rf_state','unknown'))")
printf '%s\n' "$V" | ./result-py/bin/python3 -c \
"import json,sys,time; d=json.load(sys.stdin); d['seg']=$i; d['rc']=$RC; d['t']=int(time.time()); print(json.dumps(d))" \
>> "$OUT/soak.jsonl"
else
echo "{\"seg\":$i,\"rc\":$RC,\"error\":\"no_verdict\",\"t\":$(date +%s)}" >> "$OUT/soak.jsonl"
fi
# keep disk bounded: drop IQ after verdict, keep serial
rm -f "$D/iq.raw"
# Strong segments are summarized and discarded. Retain every weak,
# absent, or unclassified segment so a hardware conclusion is auditable.
if [ "$STATE" = "strong" ] && [ "$RC" = "0" ]; then
rm -f "$D/iq.raw"
else
echo "{\"seg\":$i,\"note\":\"iq_retained\",\"rf_state\":\"$STATE\",\"t\":$(date +%s)}" >> "$OUT/soak.jsonl"
fi
if grep -q "lost at least" "$D/rtl_sdr.err" 2>/dev/null; then
echo "{\"seg\":$i,\"note\":\"sample_drops\",\"t\":$(date +%s)}" >> "$OUT/soak.jsonl"
fi