Files
rune/scripts/dispatch_check.sh
Nick 76f7b535a1
CI Pipeline / documentation (push) Canceled after 0s
CI Pipeline / canary (push) Canceled after 10s
CI Pipeline / type-check (push) Canceled after 0s
CI Pipeline / gitea-offline (push) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (push) Canceled after 0s
CI Pipeline / required-checks (push) Canceled after 0s
CI Pipeline / unit-tests (push) Canceled after 11s
CI Pipeline / go-surface (push) Canceled after 11s
CI Pipeline / rust-surface (push) Canceled after 11s
CI Pipeline / best-practices (push) Canceled after 10s
Auto-version and Release / release (push) Canceled after 30s
CI Pipeline / lint (push) Canceled after 19s
deploy / deploy (push) Canceled after 33s
feat(dispatch-classifier): the DISPATCH CLASSIFIER — solo vs parallel vs queue decided, never specified (red-first)
Stdlib-only Go module deciding each wave's lane so the owner stops
specifying: hot-state registry ~/.rune/hot/dispatch_registry.json
(lock/unlock/show, 4h STALE + --prune), classify with the one
data-driven keyword->surface map, prefix-overlap queue-behind (owner
-> PRIORITY-QUEUE with landing-boundary yield), owner-origin solo
latency, disjoint-surface parallel split suggestion, --apply lock take
atomic and fail-loud on locked/stale/changed; scripts/dispatch_check.sh
wraps the pre-spawn discipline. go test -race green, vet + gofmt clean.
Contract ADMIT-wave-dispatch-classifier.
2026-10-22 18:32:53 +01:00

29 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
# dispatch_check.sh — the session agent's pre-spawn discipline.
#
# Run this before spawning ANY wave. It reads the brief file, asks the
# dispatch-classifier for the verdict, and prints it. Follow it:
# SOLO spawn one agent, full attention
# PARALLEL spawn one lane per suggested split surface
# QUEUE-BEHIND do NOT spawn onto those surfaces yet
# PRIORITY-QUEUE owner wave: the lock-holder yields at its next
# landing boundary; wait for it, then go
#
# Usage:
# scripts/dispatch_check.sh <brief-file> [--paths p1,p2] [--owner-origin]
# scripts/dispatch_check.sh <brief-file> --apply [--agent X]
#
# --apply takes the lock for you (fails loud if anything is locked or
# stale — prune with `dispatch-classifier show --prune`). Every exit 0
# prints the verdict JSON on stdout; exit 1 means do not spawn.
set -e
repo_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
brief=$1
if [ -z "$brief" ]; then
echo "usage: $0 <brief-file> [--paths p1,p2] [--owner-origin] [--apply]" >&2
exit 2
fi
shift
cd "$repo_root/src/go/dispatch-classifier"
exec go run . classify --brief "$brief" "$@"