antcolony
All repositories: gitoria
1.6 KB
#!/bin/bash# colony — run the scheduler: ./colony next [--post] | brief <project> <n> [...] | report <file> [--post] | work <project> <n> [...] | check <run dir> [--post] | cycle [--post] [--dry-run] | run [...] | leases [--expire] | ready | deployed <project> <n># The `--` matters: the hybriel binary parses every `--x` after the script itself and refuses it# ("unexpected argument '--post'") unless it follows `--` (found in mission 015).here="$(cd "$(dirname "$0")" && pwd)"# COLONY_HOME: absolute path of this folder — `work` hands absolute paths to the worker's shellexport COLONY_HOME="$here"if [ "$1" != run ] && [ "$1" != agent ]; thenexec "$here/bin/hybriel" "$here/scheduler.hl" -- "$@"fi# `run` (mission 020): Hybriel has no signal handlers, so THIS script catches SIGTERM/SIGINT and tells the# scheduler through a stop file: 1st signal "finish" (start nothing more, let running sessions finish),# 2nd "park" (stop the running sessions and park them). The scheduler runs in its own session (setsid) so a# terminal's Ctrl-C reaches only this script — never the scheduler or its Claude sessions directly.stop="${COLONY_STOP_FILE:-$(mktemp -u "${TMPDIR:-/tmp}/colony-stop.XXXXXXXX")}"rm -f "$stop"export COLONY_STOP_FILE="$stop"signals=0on_signal() {signals=$((signals + 1))if [ "$signals" -ge 2 ]; then echo park > "$stop"; else echo finish > "$stop"; fiecho "colony run: signal $signals received → $(cat "$stop")"}trap on_signal TERM INTsetsid "$here/bin/hybriel" "$here/scheduler.hl" -- "$@" &pid=$!echo "colony run: wrapper pid $$, scheduler pid $pid, stop file $stop"while kill -0 "$pid" 2>/dev/null; dowait "$pid"donerm -f "$stop"echo "colony run: scheduler pid $pid ended"
Branches
- mainmain branch
Latest commits
- 3a4d0324antcolony#37: a too-long report gets up to 3 fix tries, finished work is never thrown away for lengthmre
- a6af7883tracker: worker box sees calendar.worldapi.org (login to copy)mre
- c613d26btemplates: bridges to external components (login.js for ident's selector) are allowed (creator 2026-09-27)mre
- 9062978ctracker: worker box sees /media/STORAGE/projects/old-tracker read-only (tracker#2 source data)mre
- 7f9660eeState of 2026-09-27, before the move to gitoriamre