Files
reply-end-controls/scripts/verify-openclaw-poc.sh

70 lines
1.9 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"
VERIFY_TARGETS_PATH="$(dirname "$0")/../generated/openclaw-verify-targets.json"
mkdir -p "$(dirname "${VERIFY_TARGETS_PATH}")"
npx -p tsx@4.20.6 -p typescript@5.9.3 tsx "$(dirname "$0")/render-openclaw-patch-contract.mjs" > "$(dirname "$0")/../generated/openclaw-telegram-patch-contract.json"
npx -p tsx@4.20.6 -p typescript@5.9.3 tsx "$(dirname "$0")/render-openclaw-verify-targets.mjs" > "${VERIFY_TARGETS_PATH}"
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 =="
sudo python3 - <<'PY' "$DIST_DIR" "$VERIFY_TARGETS_PATH"
from pathlib import Path
import json, sys
live_dist = Path(sys.argv[1])
targets = json.loads(Path(sys.argv[2]).read_text(encoding='utf-8'))
checks = {
'send-sxDwUGaO.js': targets['send'],
'bot-Ce301bOE.js': targets['bot'],
}
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