#!/usr/bin/env bash # Shared env for Railiance host-side Binky rhythm (BINKY-WP-0004-T06 interim). # activity-core schedules remain the source of cadence truth; this host timer # is the *executor* until a continuous harness poller consumes emissions # (ISSUE_SINK_TYPE=state-hub currently writes progress only — not claimable issues). set -euo pipefail : "${HOME:=/home/tegwick}" export PATH="${HOME}/.local/agent-harness/venv/bin:${HOME}/.local/bin:${PATH}" # shellcheck disable=SC1091 source "${HOME}/.local/agent-harness/env" export STATE_HUB_URL="${STATE_HUB_URL:-http://127.0.0.1:18000}" export PYTHONPATH="${HOME}/agent-harness:${HOME}/llm-connect${PYTHONPATH:+:$PYTHONPATH}" export BINKY_REPO="${BINKY_REPO:-${HOME}/binky-control}" export LOG_DIR="${LOG_DIR:-${HOME}/.cache/binky-control/rhythm}" mkdir -p "${LOG_DIR}" log() { echo "$(date -Iseconds) $*" | tee -a "${LOG_DIR}/railiance-rhythm.log"; } require_repo() { if [[ ! -d "${BINKY_REPO}/.git" ]]; then log "ERROR: binky-control missing at ${BINKY_REPO}; clone via forgejo-agent-harness deploy key" exit 1 fi git -C "${BINKY_REPO}" fetch --quiet origin main || true git -C "${BINKY_REPO}" checkout --quiet main git -C "${BINKY_REPO}" pull --ff-only --quiet origin main || log "WARN: pull failed (continuing on local)" } require_claude() { if ! command -v claude >/dev/null 2>&1; then log "ERROR: claude CLI not on PATH — agentic rhythm cannot run on this host" log " residual: install Claude Code (or swap in a hosted agentic adapter) on railiance01" exit 2 fi }