73 lines
1.8 KiB
Bash
Executable File
73 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [[ $# -lt 2 ]]; then
|
|
echo "usage: $0 <openclaw-state-dir> <openclaw-dist-dir>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
STATE_DIR="$1"
|
|
DIST_DIR="$2"
|
|
MANIFEST_PATH="$(dirname "$0")/../reports/live-openclawtest-manifest.json"
|
|
|
|
echo "== reply-end-controls PoC verify =="
|
|
echo "state_dir=${STATE_DIR}"
|
|
echo "dist_dir=${DIST_DIR}"
|
|
|
|
echo
|
|
echo "== state files =="
|
|
for f in \
|
|
"${STATE_DIR}/reply-end-controls.json" \
|
|
"${STATE_DIR}/reply-end-debug.log" \
|
|
"${STATE_DIR}/governance/claims.jsonl"; do
|
|
if [[ -f "$f" ]]; then
|
|
echo "present: $f"
|
|
else
|
|
echo "missing: $f"
|
|
fi
|
|
done
|
|
|
|
echo
|
|
echo "== patch markers =="
|
|
python3 - <<'PY' "$DIST_DIR"
|
|
from pathlib import Path
|
|
import json, sys
|
|
|
|
live_dist = Path(sys.argv[1])
|
|
checks = {
|
|
'send-sxDwUGaO.js': {
|
|
'defaultButtonsInjected': 'buildInlineKeyboard(opts.buttons ??',
|
|
'continueCallback': 'rec:continue',
|
|
'stopCallback': 'rec:stop',
|
|
},
|
|
'bot-Ce301bOE.js': {
|
|
'stateFilePath': 'reply-end-controls.json',
|
|
'continueAck': 'reply-end-controls: continue received',
|
|
'stopAck': 'reply-end-controls: stop received',
|
|
'stopPolicy': 'Treat the previous thread as closed',
|
|
},
|
|
}
|
|
for name, markers in checks.items():
|
|
path = live_dist / name
|
|
text = path.read_text(encoding='utf-8') if path.exists() else ''
|
|
print(f'[{name}]')
|
|
for key, marker in markers.items():
|
|
print(f' {key}: {marker in text}')
|
|
PY
|
|
|
|
echo
|
|
echo "== latest state =="
|
|
cat "${STATE_DIR}/reply-end-controls.json" 2>/dev/null || true
|
|
|
|
echo
|
|
echo "== latest debug tail =="
|
|
tail -n 20 "${STATE_DIR}/reply-end-debug.log" 2>/dev/null || true
|
|
|
|
echo
|
|
echo "== reference manifest =="
|
|
if [[ -f "${MANIFEST_PATH}" ]]; then
|
|
cat "${MANIFEST_PATH}"
|
|
else
|
|
echo "missing manifest: ${MANIFEST_PATH}"
|
|
fi
|