feat(scrape): operator-handoff KotOR catch-up hint (plan 085)

Print run-kotor-yes-general-catchup.sh next steps when KotOR_discord_msgs
is enabled; extend handoff smoke with KotOR fixture assertion.
This commit is contained in:
Copilot 2026-06-03 12:29:40 -05:00
parent 02d58a20b7
commit a59cff774c
4 changed files with 107 additions and 0 deletions

View file

@ -0,0 +1,52 @@
---
title: "feat: operator-handoff KotOR catch-up hint"
type: feat
status: complete
date: 2026-06-04
origin: /lfg — plan 084 synced docs; handoff still omits KotOR wrapper from post-complete next steps
---
# feat: operator-handoff KotOR catch-up hint
## Summary
When `KotOR_discord_msgs` is enabled in scrape config, `operator-handoff.sh` prints a post-complete hint pointing at `run-kotor-yes-general-catchup.sh`. Refresh merge-readiness HEAD and PR #1538 Latest for plans 070085.
## Problem Frame
Operators run `operator-handoff.sh` before first scrape or cron install. After plan 083, the KotOR yes_general path lives in a dedicated wrapper, but handoff only suggests generic `run-documents-scrape.sh`.
## Requirements
| ID | Requirement |
|----|-------------|
| R1 | After successful handoff (dry-run or salvage-only), if `KotOR_discord_msgs` is enabled, print KotOR wrapper hint |
| R2 | Hint includes `run-kotor-yes-general-catchup.sh` and summary inspect line |
| R3 | No hint when KotOR target disabled or absent |
| R4 | `operator-handoff-smoke.sh` covers hint with KotOR fixture config |
| R5 | Merge-readiness HEAD + plan 085 bullet |
| R6 | PR #1538 Latest → plans 070085 |
| R7 | `DCE_MIN_FREE_MB=0 ./scripts/run-all-smokes.sh` → 24/24 |
## Implementation Units
### U1. Handoff hint + smoke
**Files:** `scripts/operator-handoff.sh`, `scripts/tests/operator-handoff-smoke.sh`
### U2. Docs + PR
**Files:** `docs/recurring-scrape-merge-readiness.md`, PR #1538 body via `gh pr edit`
## Verification
```bash
DCE_MIN_FREE_MB=0 ./scripts/run-all-smokes.sh
```
## Scope Boundaries
### Deferred
- Live KotOR catch-up on operator host
- Auto-sync GUI zip `RECURRING-SCRAPE.md` (operator runs `sync-gui-bridge-doc.sh`)

View file

@ -206,6 +206,8 @@ DCE_MIN_FREE_MB=0 ./scripts/run-operator-validation.sh \
**Plan 084 (2026-06-04):** GUI bridge + troubleshooting cite KotOR wrapper; merge-readiness HEAD synced; bridge sync smoke asserts wrapper + 24/24. **Plan 084 (2026-06-04):** GUI bridge + troubleshooting cite KotOR wrapper; merge-readiness HEAD synced; bridge sync smoke asserts wrapper + 24/24.
**Plan 085 (2026-06-04):** `operator-handoff.sh` prints KotOR catch-up hint when `KotOR_discord_msgs` is enabled.
**Disk:** ~65 GiB free on `/home` (2026-05-30); large channel merges still need headroom. **Disk:** ~65 GiB free on `/home` (2026-05-30); large channel merges still need headroom.
## CI note (fork PRs) ## CI note (fork PRs)

View file

@ -60,6 +60,19 @@ require_command() {
command -v "$1" >/dev/null 2>&1 || die "Required command '$1' is missing." command -v "$1" >/dev/null 2>&1 || die "Required command '$1' is missing."
} }
kotor_catchup_enabled() {
require_command jq
jq -e '.targets[] | select(.name == "KotOR_discord_msgs" and (.enabled // true) == true)' \
"$CONFIG_PATH" >/dev/null 2>&1
}
print_kotor_catchup_hint() {
kotor_catchup_enabled || return 0
printf '\nKotOR yes_general catch-up (channel 221726893064454144):\n'
printf ' ./scripts/run-kotor-yes-general-catchup.sh\n'
printf ' ./scripts/print-scrape-summary.sh logs/kotor-yes-general.summary.json\n'
}
main() { main() {
while (($#)); do while (($#)); do
case "$1" in case "$1" in
@ -141,6 +154,7 @@ main() {
if (( ! SALVAGE_ONLY )); then if (( ! SALVAGE_ONLY )); then
printf ' ./scripts/setup-cron.sh --dry-run\n' printf ' ./scripts/setup-cron.sh --dry-run\n'
fi fi
print_kotor_catchup_hint
} }
main "$@" main "$@"

View file

@ -91,4 +91,43 @@ grep -q 'salvage completed' <<<"$salvage_output" || {
exit 1 exit 1
} }
KOTOR_CONFIG="$TMP_DIR/kotor-config.json"
KOTOR_ARCHIVE="$TMP_DIR/archive/kotor"
mkdir -p "$KOTOR_ARCHIVE"
printf '{"messages":[{"id":"1"}],"channel":{"id":"221726893064454144"}}\n' \
>"$KOTOR_ARCHIVE/Guild - yes_general [221726893064454144].json"
cat >"$KOTOR_CONFIG" <<JSON
{
"archive_root": "$TMP_DIR/archive",
"targets": [
{
"name": "KotOR_discord_msgs",
"kind": "guild",
"output_dir": "$KOTOR_ARCHIVE",
"enabled": true
}
]
}
JSON
set +e
kotor_output=$(
DCE_MIN_FREE_MB=0 \
DCE_CONFIG_FILE="$KOTOR_CONFIG" \
DCE_ENV_FILE="$ENV_PATH" \
"$HANDOFF" --config "$KOTOR_CONFIG" --skip-df 2>&1
)
kotor_status=$?
set -e
if [[ "$kotor_status" -ne 0 ]] || ! grep -q 'Handoff complete' <<<"$kotor_output"; then
printf 'operator-handoff KotOR hint failed (status=%s)\n' "$kotor_status" >&2
printf '%s\n' "$kotor_output" >&2
exit 1
fi
grep -q 'run-kotor-yes-general-catchup.sh' <<<"$kotor_output" || {
printf 'operator-handoff missing KotOR catch-up hint\n' >&2
exit 1
}
printf 'operator-handoff-smoke: ok\n' printf 'operator-handoff-smoke: ok\n'