- add crucible_mcp_server.py with Z3-backed proof tools - ship scheduling, dependency ordering, and capacity templates - log SAT/UNSAT proof trails to ~/.hermes/logs/crucible/ - wire crucible MCP server into config.yaml - teach deploy.sh to ensure z3-solver is installed - add verified-logic playbook and docs for first cut
136 lines
3.9 KiB
Bash
Executable File
136 lines
3.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# deploy.sh — Apply timmy-config as sidecar overlay onto ~/.hermes/
|
|
# This is the canonical way to deploy Timmy's configuration.
|
|
# Hermes-agent is the engine. timmy-config is the driver's seat.
|
|
#
|
|
# Usage: ./deploy.sh [--restart-loops] [--restart-gateway] [--restart-all]
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
HERMES_HOME="$HOME/.hermes"
|
|
TIMMY_HOME="$HOME/.timmy"
|
|
RESTART_LOOPS=false
|
|
RESTART_GATEWAY=false
|
|
|
|
for arg in "$@"; do
|
|
case "$arg" in
|
|
--restart-loops) RESTART_LOOPS=true ;;
|
|
--restart-gateway) RESTART_GATEWAY=true ;;
|
|
--restart-all)
|
|
RESTART_LOOPS=true
|
|
RESTART_GATEWAY=true
|
|
;;
|
|
*)
|
|
echo "Unknown argument: $arg" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
log() { echo "[deploy] $*"; }
|
|
|
|
# === Sanity checks ===
|
|
if [ ! -f "$SCRIPT_DIR/SOUL.md" ]; then
|
|
echo "ERROR: Run from timmy-config root" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# === Create directories ===
|
|
mkdir -p "$HERMES_HOME/bin"
|
|
mkdir -p "$HERMES_HOME/skins"
|
|
mkdir -p "$HERMES_HOME/playbooks"
|
|
mkdir -p "$HERMES_HOME/memories"
|
|
mkdir -p "$TIMMY_HOME"
|
|
|
|
# === Deploy SOUL ===
|
|
cp "$SCRIPT_DIR/SOUL.md" "$TIMMY_HOME/SOUL.md"
|
|
log "SOUL.md -> $TIMMY_HOME/"
|
|
|
|
# === Deploy config ===
|
|
cp "$SCRIPT_DIR/config.yaml" "$HERMES_HOME/config.yaml"
|
|
log "config.yaml -> $HERMES_HOME/"
|
|
|
|
# === Deploy channel directory ===
|
|
if [ -f "$SCRIPT_DIR/channel_directory.json" ]; then
|
|
cp "$SCRIPT_DIR/channel_directory.json" "$HERMES_HOME/channel_directory.json"
|
|
log "channel_directory.json -> $HERMES_HOME/"
|
|
fi
|
|
|
|
# === Deploy memories ===
|
|
for f in "$SCRIPT_DIR"/memories/*; do
|
|
[ -f "$f" ] && cp "$f" "$HERMES_HOME/memories/"
|
|
done
|
|
log "memories/ -> $HERMES_HOME/memories/"
|
|
|
|
# === Deploy skins ===
|
|
for f in "$SCRIPT_DIR"/skins/*; do
|
|
[ -f "$f" ] && cp "$f" "$HERMES_HOME/skins/"
|
|
done
|
|
log "skins/ -> $HERMES_HOME/skins/"
|
|
|
|
# === Deploy playbooks ===
|
|
for f in "$SCRIPT_DIR"/playbooks/*; do
|
|
[ -f "$f" ] && cp "$f" "$HERMES_HOME/playbooks/"
|
|
done
|
|
log "playbooks/ -> $HERMES_HOME/playbooks/"
|
|
|
|
# === Deploy cron ===
|
|
if [ -d "$SCRIPT_DIR/cron" ]; then
|
|
mkdir -p "$HERMES_HOME/cron"
|
|
for f in "$SCRIPT_DIR"/cron/*; do
|
|
[ -f "$f" ] && cp "$f" "$HERMES_HOME/cron/"
|
|
done
|
|
log "cron/ -> $HERMES_HOME/cron/"
|
|
fi
|
|
|
|
# === Deploy bin (operational scripts) ===
|
|
for f in "$SCRIPT_DIR"/bin/*; do
|
|
[ -f "$f" ] && cp "$f" "$HERMES_HOME/bin/"
|
|
done
|
|
chmod +x "$HERMES_HOME/bin/"*.sh "$HERMES_HOME/bin/"*.py 2>/dev/null || true
|
|
log "bin/ -> $HERMES_HOME/bin/"
|
|
|
|
# === Ensure Crucible dependency is installed ===
|
|
HERMES_PY="$HERMES_HOME/hermes-agent/venv/bin/python"
|
|
if [ -x "$HERMES_PY" ]; then
|
|
if "$HERMES_PY" -c 'import z3' >/dev/null 2>&1; then
|
|
log "z3-solver already present in Hermes venv"
|
|
else
|
|
log "Installing z3-solver into Hermes venv..."
|
|
"$HERMES_PY" -m pip install z3-solver
|
|
fi
|
|
fi
|
|
|
|
# === Restart loops if requested ===
|
|
if [ "$RESTART_LOOPS" = true ]; then
|
|
log "Killing existing loops..."
|
|
pkill -f 'claude-loop.sh' 2>/dev/null || true
|
|
pkill -f 'gemini-loop.sh' 2>/dev/null || true
|
|
pkill -f 'timmy-orchestrator.sh' 2>/dev/null || true
|
|
sleep 2
|
|
|
|
log "Clearing stale locks..."
|
|
rm -rf "$HERMES_HOME/logs/claude-locks/"* 2>/dev/null || true
|
|
rm -rf "$HERMES_HOME/logs/gemini-locks/"* 2>/dev/null || true
|
|
|
|
log "Relaunching loops..."
|
|
nohup bash "$HERMES_HOME/bin/timmy-orchestrator.sh" >> "$HERMES_HOME/logs/timmy-orchestrator.log" 2>&1 &
|
|
nohup bash "$HERMES_HOME/bin/claude-loop.sh" 2 >> "$HERMES_HOME/logs/claude-loop.log" 2>&1 &
|
|
nohup bash "$HERMES_HOME/bin/gemini-loop.sh" 1 >> "$HERMES_HOME/logs/gemini-loop.log" 2>&1 &
|
|
sleep 1
|
|
log "Loops relaunched."
|
|
fi
|
|
|
|
# === Restart gateway if requested (required for new MCP servers/tools) ===
|
|
if [ "$RESTART_GATEWAY" = true ]; then
|
|
log "Restarting Hermes gateway..."
|
|
pkill -f 'hermes_cli.main gateway run' 2>/dev/null || true
|
|
sleep 2
|
|
nohup "$HERMES_PY" -m hermes_cli.main gateway run --replace >> "$HERMES_HOME/logs/gateway.log" 2>&1 &
|
|
sleep 2
|
|
log "Gateway restarted."
|
|
fi
|
|
|
|
log "Deploy complete. timmy-config applied to $HERMES_HOME/"
|