Repository navigation
pastor 0.7.0
Added
-
A website for pastor, a small terminal-style site built with Hugo from
docs/manual.mdand short pages underdocs/website. It deploys to
GitHub Pages from the public repo;make sitebuilds it andmake site-serveserves it locally. -
pastor watch: one line per change an orchestrator acts on, so it stops
building its own polling.TASK t-N <state> <machine> <job>for a task that
is blocked, done, failed or stale (--all: every state change), from the
head's numbered events;JOB <name> failing: ...andJOB <name> okfrom
job list;HEAD down,HEAD upandHEAD gap; and the lines of each
connector with a[watch]command, each printed once, withCONNECTOR <id> failingandokaround failed runs. A watcher keeps a cursor under
--namein the state dir, so one started again repeats nothing;--reset
starts at the end of the log.--nowprints what needs attention and
exits.--json,--intervaland--connector(else[[watch.connector]]
in pastor.toml). It only reads, so an agent may run it. A connector's
manifest takes[watch](command,timeout), whichconnector describe
shows andconnector try <id> watchruns. The head'sevents_since
answersnewesttoo, so a new watcher starts at the end without reading
the whole log. -
Profiles reach opencode tasks: an opencode agent under a profile gets the
lists asOPENCODE_PERMISSIONin its pane, in opencode's terms and denying
what they do not allow (underunrestricted, allowing it), withOPENCODE_CONFIG,OPENCODE_CONFIG_DIRand
OPENCODE_CONFIG_CONTENTset empty, so it never stops at a permission
prompt (a profiled opencode task wasagent_tools_unsupportedbefore).
A machine whose own opencode config has permission rules fails such a task
before anything is made there (opencode_permissions_conflict).
make smoke-profilesruns a live review task per agent through a head. -
Profiles reach Claude tasks:
profileon a[[flock]], a[[machine]],
a job's[dispatch],[defaults]andpastor task run --profile, settled
like the model (run or job, machine, flock,[defaults]). The profile's
lists go before the task's own, a deny anywhere wins, and a Claude agent
starts with--permission-mode dontAskand the lists as--allowedTools
and--disallowedTools, so it never stops at a permission prompt; args
that pick a permission mode are thenprofile_args_conflict. A task may
ask forunrestrictedonly on a machine whose own profile (machine, flock
or[defaults]) isunrestricted(profile_not_allowed; an unpinned task
waits for one). An unknown name isunknown_profile, and a profile dropped
while a task waits keeps it queued and says why.task describe(with
where it came from), the task's JSON,machine list(PROFILE),
machine describeandflock describeshow it. Every command that can
make the head queue a task refuses an older head (head_too_old). -
Descriptions: an optional one-line
descriptionat the top of a job
file and in each[[flock]]and[[machine]]entry of flock.toml
(pastor flock add --description,pastor machine add --description).
A task's ispastor task run --description, else its job's[dispatch] descriptiontemplate ({{ item.title }}by default), else the prompt's
first line;task retrycopies it.-w, --wideontask,job,
machine,flockandconnector listadds a DESCRIPTION column, cut to
the terminal's width; everydescribeshows it, and everylist --json
anddescribe --jsonhas adescriptionkey. fish completion shows
descriptions beside job, flock and machine names. The tasks table gains a
descriptioncolumn (schema 11), so the release that carries this needs
an -rc first.--descriptionis refused on an older head
(head_too_old). The IPC protocol goes to 14. -
Permission profiles:
[profiles.<name>]in pastor.toml, each an optional
description,extends,allowanddeny, beside the built-inreview,
developandunrestricted. A profile's lists add up along itsextends
chain, and a deny anywhere wins.pastor profile listandpastor profile describe <name>(both with--json) show them; an unknown name is
unknown_profile, and a bad profile fails pastor.toml's load. -
pastor queuelists the queued tasks in the order they will start: POS,
TASK, LEVEL, WHERE (the pinned machine or the flock), FROM (task runor
job <name>), WAITED and WHY NOT YET, from a dispatch pass played
through on the machines as they are;--flock,--machineand--json.
pastor queue move <task>with--top,--before <task>,--after <task>or--to <n>puts a queued task there; it takes the level of
where it lands (lifted in front of a higher task, lowered behind a lower
one,--toponly lifts), and the answer says when the level changed.
Refused withnot_queuedfor a task, or an anchor, that is not queued,
and from an agent pastor started. The IPC protocol goes to 14 (Queue,
QueueMove); both commands refuse an older head (head_too_old).
Completion offers the queued tasks afterqueue move. -
Task priority: a task has a level,
low,normal(the default),high
orcritical, and each dispatch pass takes queued tasks by level, then
position, then age, still skipping what does not fit. The level comes from
pastor task run --priority, a job's[dispatch] priority(a template;
rendered empty it falls through), thepriorityof the machine the task
is pinned to, of its flock, or[defaults] priority, settled when the task
is queued.pastor task priority <task> <level>changes a queued task's
level, refused withnot_queuedfor any other and from an agent pastor
started;task retrykeeps it. A word that is not a level is
unknown_priority.task describeshows the level and the layer that set
it,task lista PRIORITY column, and--jsonpriority,
priority_fromandqueue_pos. The store goes to schema 9 (columns
priority,priority_fromandqueue_pos; existing rows becomenormal,
placed by id), and the IPC protocol to 9:task run --priorityandtask priorityrefuse an older head (head_too_old). -
Job slots and burst: two keys on a flock.toml
[[machine]], next to
max_agents.job_slots(default 1) are extra slots only tasks from jobs
take, a free one before a shared one, so longtask runtasks no longer
keep a job's tasks from starting.burst(default 1) lets acritical
task start on a machine whose shared slots are full, while the live tasks
outside job slots are belowmax_agents + burst.0turns either off.
The picker takes the machine with the fewest live tasks among those with
room for the task.machine addtakes--job-slotsand--burst;
machine listshows the room as2+1j+1band--jsonhasjob_slots
andburst. -
Task roles.
pastor task run --role orchestratorstarts a task whose
agent may, from its own pane, run tasks, retry and send to them, and
disable a job; every other fleet change staysagent_refused, with a
message naming the role, unlessagents_change_fleet = true. Only a
person starts an orchestrator:--role orchestrator, or a retry of an
orchestrator, from any task's pane isrole_refused. A retry keeps its
task's role.task describeandtask list --jsonshowrole(agent
for every other task). The store goes to schema 10 (arolecolumn,agent
for existing rows) and the IPC protocol to 12;--role orchestrator
refuses an older head (head_too_old). A guard against mistakes, not a
boundary: the agent runs as the same user as pastor. -
Named models:
[models.<name>]in pastor.toml, each with a herdr agent
kindand theargsthat select it. A task runs one withpastor task run --model <name>, a job's[dispatch] model(a template, so
"{{ item.model }}"works), or themodelof its machine, its flock or
[defaults], in that order. The model's args go beforeagent_args. A
name[models]lacks isunknown_model; a model whose kind is not the
agent's ismodel_kind_mismatch, and an unpinned task only goes to
machines whose agent has the model's kind.task describe,task list
(MODEL, andmodelin--json),flock describe,machine describeand
task events show it. The IPC protocol goes to 8, and every command that can
make the head queue a task refuses an older head (head_too_old). -
An agent per kind:
agents = { <kind> = "<agent>" }on a[[machine]]
or[[flock]]in flock.toml, or under[defaults]in pastor.toml, names
the agent that runs a model whose kind differs from the default agent's.
The kind is looked up through the machine, the flock and[defaults]: a
layer's ownagentof that kind, else itsagentsentry. An agent found
this way getsagent_argsonly from layers whoseagentis that agent. An
unpinned task goes only to machines where the lookup finds one; with none
in the flock it waits andtask describesays why. An entry whose agent
has another kind, or one for the kind of the layer's own agent, fails the
load.task describeshows(from machine <m> agents.<kind>), and
machine describeandflock describelist the entry asby kind. An
older pastor refuses the key on a[[flock]]. -
docs/recommended-setup.md: how to set up a fleet you'll keep. It covers
flocks per account, least-privilege credentials for agent machines (a
deploy key and a fine-grained token for one repository, so they can't
merge), permissions for unattended agents, fresh code for every task, and
close_done_afterfor short tasks. The docs test checks its commands too. -
pastor task attachreopens a finished Claude task. Dispatch starts a
claudeagent with--session-id <uuid>after its other args (unless they
already choose a session) and records the id on the task (session:in
task describe,spec.session_idin JSON). Attaching to a closed or
failed task whose agent is gone opens a workspacet-N-resumeon the
task's machine, in its directory and with its agent definition's env, runs
claude --resume <uuid>there and attaches; the task does not change. A
worktree removed at close is re-created first on the task's branch
(branch_gonewhen the branch is gone too). Tasks of other agents keep the
old error, with a hint that only Claude tasks can be reopened. Closing done
panes early (close_done_after) no longer loses the conversation. -
A connector can declare a
[finish]command in its manifest (command,
and atimeoutthat defaults like a hook's). The head runs it once, with the
connector's env and secrets, when a task of one of its jobs reachesdone
orfailed, so the connector can act where the work came from. Stdin is
the task row with its item, the final state, the job, the branch and
last_output, the last lines read from the agent's pane. A failure or
timeout is logged, emitted asconnector.finish_failedand never changes
the task.connector describeshows the command. -
pastor head set <dest> [--pastor PATH] [--force],pastor head show [--json]andpastor head unset: the CLI can use a head on another
machine, over ssh andpastor bridge. The setting is[head]in
~/.config/pastor/client.toml;PASTOR_HEADand a global--head <dest>
override it.head setpings the head first and refuses with
head_unreachable,no_headorhead_too_oldunless--force. With a
remote head,taskcommands (butattach),machine list,tickand
job list|run|reloadgo to it; other commands that would act on local
files fail withremote_head_unsupported. -
pastor bridge --agent --machine <name>is a bridge locked to one
machine's agents: it passes onping, a task list cut to the machine's
flock, anddescribe,readanddonefor a task placed on that
machine, sets the request's task itself, and answers anything else
not_allowed_for_agentwithout reaching the head. -
pastor machine authorized-key <name> --key <file|->prints the
authorized_keysline that locks a machine's key to that bridge. It edits
no file. The manual's "Agents on other machines" has the steps. -
pastor trust add <machine> <repo>saves a folder trust without a blocked
task. -
head_addressinpastor.toml: the ssh destination other machines reach
the head by. When set, agents on machines other than the head's own start
withPASTOR_HEAD=<head_address>in their pane, whichpastor head
above already routes their CLI commands through. Agents on the head's
machine get none. -
With a head set,
pastor serveruns headless instead of refusing: it runs
this machine's jobs and connector hooks and nothing else. The new items a
job run finds go to the head in oneJobSubmit, with the job's
[dispatch]table as written, and the head renders, queues and dispatches
them as that job's tasks; keys it queued or had seen are marked seen here,
so a lost reply does not hold the job's cursor. A head that does not
answer fails the run withhead_unreachable, and a head with a job file
of that name withjob_name_taken: a failed run with backoff, and no item
kept, so the next run asks for them again. The head's events
come back each tick for the hooks here. It keeps job state, seen keys and
its event cursor inshepherd.db, and answersping(roleshepherd),
tickandjob list|run|reloadon the local socket,shepherd_unsupported
to the rest. An unreachable head is ashepherd_needs_headwarning in its
log, asked again each tick. It refuses to start beside a head
(head_running), and a head refuses to start beside it
(shepherd_running), as doeshead setpointed at it, even with
--force.pastor setup systemdinstalls it the same way. -
With a remote head,
pastor events(with--follow,--taskand
--json) reads the head's log throughevents_since: a page at a time
from the start, then a poll every second with--follow. Records rotated
out before they were read get one warning line on stderr. -
A headless serve's hooks decide
only_ownfrom this machine's job files,
so they hear the tasks of its own jobs, and a head event rotated out of
the head's log before it was read is ahead_events_gapwarning, after
which the hooks go on from the oldest record left. -
With a head set,
pastor job listshows the head's jobs underhead: <dest>and this machine's undershepherd: <host> (this machine), a side
with none sayingno jobs;--jsonis one flat array whose jobs carry
where(headorshepherd). This machine's jobs come from its headless
serve, or from the job files andshepherd.dbwhen it is down; a serve that
does not answer isshepherd_unresponsive.job run|enable|disable|describe|editgo to this machine when the job's file is
here, and to the head otherwise, so the last four no longer fail with
remote_head_unsupported.
Changed
- Publishing a release's draft on GitHub publishes the crate to crates.io
(pastor-cli) from the tag; a prerelease is skipped. It was a manual
cargo publishbefore. pastor flock defaultis split in two:pastor flock default showprints
the default flock, andpastor flock default set <name>makes another flock
the default. The oldpastor flock default <name>is gone.showreads
flock.toml only and never asks the head.- The CLI uses one verb per action, and the old names are gone with no
alias:pastor task showispastor task describe, like the other
nouns'describe;pastor connector runispastor connector try, since
it creates no tasks;pastor open <machine>ispastor machine open <name>. Every command and argument has a line of help, each--json
says the shape it prints,machine addrefuses more than one of an ssh
target,--localand--command, and a bad task id says both forms,
t-12and12. - With a head running,
pastor trust list|add|remove,pastor flock describeandpastor machine describeask it (new requests, IPC protocol
9) instead of reading the local store andflock.toml, so a CLI on
another machine gets the head's answer. The two describes show the flock
the head last applied. A head from before this is refused with
head_too_old; with no head the commands work as before.trust addand
trust removenow count as changing the fleet, so an agent pastor started
is refused them unlessagents_change_fleetis on.