binky-control/scripts/railiance-rhythm/run-mail.sh
tegwick c3ea150971
Some checks failed
Work Records / validate (push) Has been cancelled
BINKY-WP-0004 finished: retire workstation cron, Railiance rhythm timers
Complete T06 cutover: remove binky rhythm bridge crontab, install
scripts/railiance-rhythm systemd user timers on railiance01 (Europe/Berlin),
document residual continuous-intake gaps as BINKY-WP-0006. Three completion
event types verified (daily_brief, mail_intake on Railiance, weekly_review).
DEC-2026-003 marked resolved/executed.
2026-07-21 23:51:43 +02:00

27 lines
1 KiB
Bash
Executable file

#!/usr/bin/env bash
# Monday 09:37 Europe/Berlin — deterministic mail-scan then optional triage session.
set -euo pipefail
# shellcheck disable=SC1091
source "$(dirname "$0")/run-common.sh"
require_repo
log "START mail-scan"
# Deterministic pre-step (no Claude) — uses AppRole + OpenBao mail lane.
agent-harness mail-scan \
--target-repo "${BINKY_REPO}" \
--config "${BINKY_REPO}/integrations/mailbox-binky-company.yml" \
2>&1 | tee -a "${LOG_DIR}/mail.log"
scan_rc=${PIPESTATUS[0]}
log "mail-scan rc=${scan_rc}"
if [[ "${scan_rc}" -ne 0 ]]; then
exit "${scan_rc}"
fi
# Agentic triage if Claude present; otherwise scan+hub event is enough for intake idempotence.
if command -v claude >/dev/null 2>&1; then
log "START mail-triage session"
agent-harness run \
--task-file "${BINKY_REPO}/integrations/harness-tasks/mail-intake.json" \
2>&1 | tee -a "${LOG_DIR}/mail.log" || log "WARN: mail-triage session failed"
else
log "SKIP mail-triage session (no claude CLI); mail-scan hub event stands"
fi
log "END mail-intake"