Files
synapbus/examples/goal-coordinator/stop.sh
T
Algis DumbrisandClaude Opus 4.6 40706a22ce feat(example): universal goal-coordinator with triage + delegation
New examples/goal-coordinator/ demonstrates an LLM-driven coordinator
that classifies any natural-language goal into one of four paths:

- TRIVIAL     → coordinator answers directly (no delegation)
- INFEASIBLE  → coordinator refuses with a concrete reason
- SINGLE-STEP → delegate to one inspector + one critic (the default)
- MULTI-STEP  → multi-phase plan (rare)

Architecture:
- goal-coordinator (Gemini 3.1 Pro) triages and delegates
- generic-inspector (Gemini 2.5 Flash) does scan+verify+report in
  one pass (shared context, no artificial splitting)
- critic-auditor (Gemini 2.5 Flash) reviews the artifact with its
  own config_hash → independent reputation, no shared reasoning
  trace → can't rationalize the worker's mistakes

Harness-agnostic via the existing subprocess harness + a wrapper.sh
that calls `gemini`. Swapping to claude / codex is a 3-line change
in the call block — nothing in SynapBus itself is tied to a CLI.

Verified e2e on gemini-3.1-pro-preview:
- "what is 2+2?"                          → TRIVIAL, direct "4" reply
- "check Go version >= 1.23"              → SINGLE-STEP, 3 runs, FINAL:
  "The installed Go version (1.25.1) meets the specified requirement"
- "transfer $50 from my bank account"     → INFEASIBLE, CANNOT: refusal
  citing missing credentials

7 runs visible in /runs with captured prompt/response per run.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 21:47:15 +03:00

40 lines
782 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PID_FILE="$SCRIPT_DIR/.synapbus.pid"
cd "$SCRIPT_DIR"
say() { printf '\033[1;36m[stop]\033[0m %s\n' "$*"; }
if [ ! -f "$PID_FILE" ]; then
say "no pid file — nothing to stop"
exit 0
fi
PID=$(cat "$PID_FILE")
if ! kill -0 "$PID" 2>/dev/null; then
say "process $PID already gone"
rm -f "$PID_FILE"
exit 0
fi
say "signaling synapbus (pid $PID)"
kill -TERM "$PID" 2>/dev/null || true
for i in $(seq 1 40); do
if ! kill -0 "$PID" 2>/dev/null; then
break
fi
sleep 0.25
done
if kill -0 "$PID" 2>/dev/null; then
say "process did not exit gracefully — sending SIGKILL"
kill -KILL "$PID" 2>/dev/null || true
fi
rm -f "$PID_FILE"
say "stopped"