feat(scrape): run plan, channel ledger, and all-target proof

Log scrape plan/summary with per-file message deltas in the core script.
Host wrappers and operator entrypoints print target lists; operator-proof
defaults to all enabled targets when --target is omitted.
This commit is contained in:
Copilot
2026-05-29 20:34:22 -05:00
parent 0b242ddfc4
commit 71a443267e
10 changed files with 406 additions and 13 deletions

View File

@@ -11,8 +11,9 @@ cleanup() {
trap cleanup EXIT
FAKE_REPO="$TMP_DIR/fake-repo"
mkdir -p "$FAKE_REPO/scripts"
mkdir -p "$FAKE_REPO/scripts/lib"
cp "$REPO_ROOT/scripts/run-discord-scrape-host.sh" "$FAKE_REPO/scripts/"
cp "$REPO_ROOT/scripts/lib/scrape-run-plan.sh" "$FAKE_REPO/scripts/lib/"
chmod +x "$FAKE_REPO/scripts/run-discord-scrape-host.sh"
COMPOSE_FILE="$TMP_DIR/docker-compose.yml"
@@ -73,7 +74,12 @@ DCE_REPO_ROOT="$REPO_ROOT" \
DISCORD_TOKEN=dummy \
"$PROVE" --config "$TMP_DIR/config.json" --target demo >/dev/null
"$REPO_ROOT/scripts/run-documents-scrape.sh" --dry-run --config "$TMP_DIR/config.json" >/dev/null
DOC_OUT="$TMP_DIR/documents-dry-run.log"
"$REPO_ROOT/scripts/run-documents-scrape.sh" --dry-run --config "$TMP_DIR/config.json" >"$DOC_OUT" 2>&1
grep -q 'Documents scrape run plan' "$DOC_OUT" || {
echo "expected Documents scrape run plan in dry-run output" >&2
exit 1
}
DCE_MIN_FREE_MB=0 DCE_CONFIG_FILE="$TMP_DIR/config.json" \
"$REPO_ROOT/scripts/verify-operator-ready.sh" --disk-only --config "$TMP_DIR/config.json" \

View File

@@ -210,7 +210,20 @@ run_wrapper() {
"$REPO_ROOT/scripts/run-discord-scrape.sh" scrape --target "$target_name"
}
run_wrapper demo initial
SCRAPE_LOG="$TMP_DIR/scrape.log"
run_wrapper demo initial 2>"$SCRAPE_LOG"
grep -q 'Scrape run plan' "$SCRAPE_LOG" || {
echo "expected Scrape run plan in scrape output" >&2
exit 1
}
grep -q 'Scrape run summary' "$SCRAPE_LOG" || {
echo "expected Scrape run summary in scrape output" >&2
exit 1
}
grep -qE 'CREATED|MERGED|UNCHANGED' "$SCRAPE_LOG" || {
echo "expected channel result line in scrape output" >&2
exit 1
}
DEST="$ARCHIVE_ROOT/demo/$DEFAULT_FILE_NAME"
[[ -f "$DEST" ]] || { echo "expected destination archive missing" >&2; exit 1; }

View File

@@ -49,5 +49,9 @@ if [[ "$status" -ne 0 ]] || ! grep -q 'Dry run complete' <<<"$output"; then
printf '%s\n' "$output" >&2
exit 1
fi
grep -q 'Operator proof run plan' <<<"$output" || {
echo "expected Operator proof run plan in dry-run output" >&2
exit 1
}
printf 'run-operator-proof-smoke: ok\n'