How cacarico/pastor works
pastor is a self-hosted coding-agent orchestrator: users submit tasks or configure scheduled jobs, then a head queues work, selects machines, starts agents in herdr terminals, and retains task state and events. Job processing adds connector-produced items and rendered prompts; separate capabilities manage machine flocks, limits, event hooks, and long-running orchestrators. The README documents the overall runtime flow; source-index references support several internal links, but daemon, machine, and dispatch internals were not sampled, so their detailed interactions are not inferred.
Main entry points: scheduler.rs Job scheduler · cli.rs Pastor CLI · daemon.rs Head daemon · machine.rs Machine fleet
Components 22
User interface
- Pastor CLI
src/cli.rs - Head IPC
src/ipc.rs - Connector management
src/connector/cli.rs
Head control
- Head daemon
src/daemon.rs - Flock config
src/config/flock.rs
Job workflow
- Job config
src/config/job.rs - Connector catalog
src/connector/manifest.rs - Connector runtime
src/connector/process.rs - Job scheduler
src/scheduler.rs - Schedule rules
src/schedule.rs - Task lifecycle
src/task.rs - Orchestrators
src/orchestrator.rs - Connector manifest
src/connector/manifest.rs
Machines and agents
- Machine fleet
src/machine.rs - Herdr terminal
src/herdr/transport.rs - SSH transport
src/ssh.rs
State and events
- SQLite history
src/store.rs - Events and hooks
src/events.rs - Agent limits
src/limit.rs
Other components
- Developer
- Job sources
- Coding agent
Connections 30
- Developer → Pastor CLI: submits commands
- Job sources → Connector runtime: provides work items
- Pastor CLI → Head IPC: sends requests
src/cli.rs - Head IPC → Head daemon: routes requests
src/ipc.rs - Head daemon → Job scheduler: runs scheduling
src/scheduler.rs - Head daemon → Machine fleet: manages fleet
- Flock config → Machine fleet: configures machines
src/config/flock.rs - Job config → Job scheduler: defines jobs
src/config/job.rs - Job scheduler → Connector runtime: requests items
src/scheduler.rs - Connector catalog → Connector runtime: resolves sources
src/connector/mod.rs - Connector manifest → Connector runtime: describes connector
src/connector/manifest.rs - Connector management → Connector manifest: installs connectors
src/connector/cli.rs - Job scheduler → Schedule rules: uses schedule rules
src/scheduler.rs - Job scheduler → Task lifecycle: queues tasks
src/scheduler.rs - Job scheduler → SQLite history: records runs
src/scheduler.rs - Task lifecycle → Herdr terminal: uses terminal API
src/task.rs - Machine fleet → Herdr terminal: connects to terminals
- Herdr terminal → SSH transport: uses remote transport
src/herdr/transport.rs - Herdr terminal → Coding agent: hosts agent
- Head daemon → SQLite history: keeps history
- Events and hooks → SQLite history: records events
src/events.rs - Events and hooks → Head daemon: publishes runtime events
src/events.rs - Events and hooks → Task lifecycle: tracks task changes
src/events.rs - Events and hooks → Connector runtime: runs event hooks
- Job scheduler → Agent limits: checks capacity
src/scheduler.rs - Pastor CLI → Orchestrators: manages orchestrators
src/orchestrator_cli.rs - Orchestrators → Machine fleet: starts agent sessions
src/orchestrator.rs - Task lifecycle → SQLite history: persists task state
src/store.rs - Pastor CLI → Machine fleet: views fleet status
src/cli.rs - Pastor CLI → SQLite history: reads task history