gitoriaLog in with ident

antcolony

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain3a4d0324antcolony#37: a too-long report gets up to 3 fix tries, finished work is never thrown away for lengthmremain/colony

1.6 KB

  1. #!/bin/bash
  2. # 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>
  3. # The `--` matters: the hybriel binary parses every `--x` after the script itself and refuses it
  4. # ("unexpected argument '--post'") unless it follows `--` (found in mission 015).
  5. here="$(cd "$(dirname "$0")" && pwd)"
  6. # COLONY_HOME: absolute path of this folder — `work` hands absolute paths to the worker's shell
  7. export COLONY_HOME="$here"
  8. if [ "$1" != run ] && [ "$1" != agent ]; then
  9. exec "$here/bin/hybriel" "$here/scheduler.hl" -- "$@"
  10. fi
  11. # `run` (mission 020): Hybriel has no signal handlers, so THIS script catches SIGTERM/SIGINT and tells the
  12. # scheduler through a stop file: 1st signal "finish" (start nothing more, let running sessions finish),
  13. # 2nd "park" (stop the running sessions and park them). The scheduler runs in its own session (setsid) so a
  14. # terminal's Ctrl-C reaches only this script — never the scheduler or its Claude sessions directly.
  15. stop="${COLONY_STOP_FILE:-$(mktemp -u "${TMPDIR:-/tmp}/colony-stop.XXXXXXXX")}"
  16. rm -f "$stop"
  17. export COLONY_STOP_FILE="$stop"
  18. signals=0
  19. on_signal() {
  20. signals=$((signals + 1))
  21. if [ "$signals" -ge 2 ]; then echo park > "$stop"; else echo finish > "$stop"; fi
  22. echo "colony run: signal $signals received → $(cat "$stop")"
  23. }
  24. trap on_signal TERM INT
  25. setsid "$here/bin/hybriel" "$here/scheduler.hl" -- "$@" &
  26. pid=$!
  27. echo "colony run: wrapper pid $$, scheduler pid $pid, stop file $stop"
  28. while kill -0 "$pid" 2>/dev/null; do
  29. wait "$pid"
  30. done
  31. rm -f "$stop"
  32. echo "colony run: scheduler pid $pid ended"

Branches

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