Skip to content

Commit 01a2588

Browse files
Thomas TupperThomas Tupper
authored andcommitted
debug: add remote evidence collector for r720 write-search failures
1 parent 4e24ef6 commit 01a2588

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

scripts/r720-debug-collect.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Collect remote runtime evidence for foxmemory-store write->search failures.
5+
# Usage:
6+
# SSH_TARGET=kite@192.168.0.118 BASE_URL=http://192.168.0.118:8082 ./scripts/r720-debug-collect.sh
7+
8+
SSH_TARGET="${SSH_TARGET:-}"
9+
BASE_URL="${BASE_URL:-http://192.168.0.118:8082}"
10+
STORE_CONTAINER="${STORE_CONTAINER:-foxmemory-store}"
11+
VECTOR_CONTAINER="${VECTOR_CONTAINER:-qdrant}"
12+
ART_ROOT="${ART_ROOT:-artifacts/r720}"
13+
TS="$(date +%Y%m%d-%H%M%S)"
14+
OUT_DIR="${ART_ROOT}/debug-${TS}"
15+
16+
mkdir -p "$OUT_DIR"
17+
18+
if [[ -z "$SSH_TARGET" ]]; then
19+
echo "ERROR: SSH_TARGET is required (e.g. kite@192.168.0.118 or ssh alias)." >&2
20+
exit 2
21+
fi
22+
23+
MARKER="foxprobe-${TS}"
24+
25+
{
26+
echo "timestamp=$(date -Iseconds)"
27+
echo "ssh_target=${SSH_TARGET}"
28+
echo "base_url=${BASE_URL}"
29+
echo "store_container=${STORE_CONTAINER}"
30+
echo "vector_container=${VECTOR_CONTAINER}"
31+
echo "marker=${MARKER}"
32+
} > "${OUT_DIR}/context.env"
33+
34+
# 1) Remote logs
35+
ssh "$SSH_TARGET" "docker logs --since 15m ${STORE_CONTAINER} 2>&1 | tail -n 500" > "${OUT_DIR}/store.log" || true
36+
ssh "$SSH_TARGET" "docker logs --since 15m ${VECTOR_CONTAINER} 2>&1 | tail -n 500" > "${OUT_DIR}/vector.log" || true
37+
ssh "$SSH_TARGET" "docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'" > "${OUT_DIR}/docker-ps.txt" || true
38+
39+
# 2) Probe write/search path against live endpoint
40+
curl -sS "${BASE_URL}/health" > "${OUT_DIR}/health.json" || true
41+
42+
curl -sS -X POST "${BASE_URL}/memory.write" \
43+
-H 'content-type: application/json' \
44+
-d "{\"messages\":[{\"role\":\"user\",\"content\":\"${MARKER}\"}],\"user_id\":\"r720-acceptance\"}" \
45+
> "${OUT_DIR}/write.json" || true
46+
47+
curl -sS -X POST "${BASE_URL}/memory.search" \
48+
-H 'content-type: application/json' \
49+
-d "{\"query\":\"${MARKER}\",\"user_id\":\"r720-acceptance\"}" \
50+
> "${OUT_DIR}/search.json" || true
51+
52+
# 3) Run acceptance capture (remote-target mode)
53+
BASE_URL="$BASE_URL" DO_RESTART=0 bash scripts/r720-capture-acceptance.sh > "${OUT_DIR}/acceptance-wrapper.log" 2>&1 || true
54+
55+
echo "DEBUG_ARTIFACTS=${OUT_DIR}"

0 commit comments

Comments
 (0)