feat: task dispatcher — poll ops repo and launch runners #45

Closed
opened 2026-03-28 21:42:39 +00:00 by dev-bot · 0 comments
Collaborator

Part of #24. Depends on the edge container Dockerfile issue.

What

A script in the edge container that polls the ops repo for approved actions and launches task-runner containers.

Design

docker/edge/dispatcher.sh:

while true; do
  # Poll ops repo vault/actions/ for .json files without .result.json
  for action in vault/actions/*.json; do
    id=$(basename "$action" .json)
    [ -f "vault/actions/${id}.result.json" ] && continue
    
    # Launch runner
    docker compose run --rm runner "$id"
    
    # Result written by runner to vault/actions/<id>.result.json
  done
  sleep 60
done

The dispatcher:

  • Clones/pulls the ops repo from Forgejo
  • Scans vault/actions/ for new action files
  • Skips actions that already have a .result.json
  • Calls docker compose run --rm runner <id>
  • The runner writes its result file

Started from the edge container entrypoint alongside Caddy:

dispatcher.sh &
exec caddy run --config /etc/caddy/Caddyfile

Action JSON schema

{
  "id": "publish-skill-20260328",
  "formula": "clawhub-publish",
  "secrets": ["CLAWHUB_TOKEN"],
  "tools": ["clawhub"],
  "context": "SKILL.md bumped to 0.3.0",
  "model": "sonnet"
}

Acceptance criteria

  • Dispatcher polls ops repo for new actions
  • Launches runner with correct action ID
  • Skips already-completed actions
  • Runs alongside Caddy without interfering
Part of #24. Depends on the edge container Dockerfile issue. ## What A script in the edge container that polls the ops repo for approved actions and launches task-runner containers. ## Design `docker/edge/dispatcher.sh`: ```bash while true; do # Poll ops repo vault/actions/ for .json files without .result.json for action in vault/actions/*.json; do id=$(basename "$action" .json) [ -f "vault/actions/${id}.result.json" ] && continue # Launch runner docker compose run --rm runner "$id" # Result written by runner to vault/actions/<id>.result.json done sleep 60 done ``` The dispatcher: - Clones/pulls the ops repo from Forgejo - Scans `vault/actions/` for new action files - Skips actions that already have a `.result.json` - Calls `docker compose run --rm runner <id>` - The runner writes its result file Started from the edge container entrypoint alongside Caddy: ```bash dispatcher.sh & exec caddy run --config /etc/caddy/Caddyfile ``` ## Action JSON schema ```json { "id": "publish-skill-20260328", "formula": "clawhub-publish", "secrets": ["CLAWHUB_TOKEN"], "tools": ["clawhub"], "context": "SKILL.md bumped to 0.3.0", "model": "sonnet" } ``` ## Acceptance criteria - [ ] Dispatcher polls ops repo for new actions - [ ] Launches runner with correct action ID - [ ] Skips already-completed actions - [ ] Runs alongside Caddy without interfering
dev-bot added the
backlog
label 2026-03-28 21:42:39 +00:00
dev-qwen self-assigned this 2026-03-29 09:07:23 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-03-29 09:07:23 +00:00
dev-qwen removed their assignment 2026-03-29 11:09:31 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: johba/disinto#45
No description provided.