The repository task file
Each task in a repository repeats the same rules: what to run, what done
means, what not to touch. An optional, committed .agentd/tasks.toml says them
once. libraos-core new, the dashboard's new task sheet and the LibraOS Engine
Skill read it.
Example
# .agentd/tasks.toml: defaults for every task in this repository. All keys are optional.
# The command that says a task is finished. It must exit 0. It may not push or commit.
check = "go vet ./... && go test ./..."
# How long that check may run. Without it: [dispatch] check_timeout, else 10m.
check_timeout = "20m"
# Files the check runs besides its own text (a path, or a folder ending in /).
# A branch that changes one waits for your approval (see Approved checks).
# Without it: Makefile, GNUmakefile, makefile, justfile, Justfile,
# Taskfile.yml, Taskfile.yaml, package.json, scripts/, ci/ and
# .github/workflows/. .agentd/ always counts.
check_inputs = ["Makefile", "scripts/", ".github/workflows/"]
# Who does the work: claude or codex. Without it: [dispatch] default_tool.
worker = "codex"
# When the worker is told to deliver (85%) and stopped (100%):
# minutes, dollars or both, such as 90m, $5 or 90m,$5.
# Dollars need [budget.prices] in config.toml.
budget = "90m"
# Added to every task's acceptance criteria, ahead of its own --accept.
accept = [
"New behaviour has a test",
"No generated file was edited by hand",
]
# Told to the worker with the task. Guidance only: nothing enforces it.
do_not_touch = ["vendor/", "migrations/"]
How it is read
- A flag beats the file; the file beats config.
--verify,--no-check,--workerand--budgetreplace the file's value for that task. Replacing the check also drops the file'scheck_timeout, which was written for the file's command. Criteria add up: the file's, then each--accept. - A missing file changes nothing.
libraos-core newbehaves as if the repository had none, and asks for a verify command. - A malformed file is an error naming the file and line, and nothing
starts: bad TOML, a wrong type, an unknown key (a misspelt
checkwould otherwise leave a task with none), a badworker,budgetorcheck_timeout, or acheckthat would push or commit. - Only what is committed at
HEADcounts. An untracked file is not read; a file with uncommitted changes is read as committed.libraos-core newandlibraos-core doctorsay so in both cases. Commit an edit to use it. - It holds no secrets. It is committed with the rest of the repository,
and
libraos-core newrefuses a file with a line that looks like a credential, comments included. do_not_touchis guidance, not enforcement. The worker is told, and can still edit those paths. To refuse a command, use worker permission rules.
libraos-core doctor reports the task file of the repository it runs in as
task-file: pass with what it sets, fail with file and line when it is
malformed, optional when there is none or it is not committed.
A repository you do not trust
The check is a shell command from the repository. It runs as you, with your
files and credentials. Reading only committed content means a task runs what
the repository's history says, not what a worker or a script left in the
working tree. It does not make that history trustworthy: pulling a branch
brings its check with it.
Before running libraos-core new in a repository you do not trust, read
.agentd/tasks.toml (or run libraos-core doctor there, which prints the
check), and pass --verify CMD or --no-check to run nothing of the
repository's. libraos-core new prints the check and the commit it came from
before it starts anything. The refusal of a push or commit is a match on the
command's text, not a sandbox: a script the check calls can do anything.
Approved checks
A worker runs the repository's check only when its exact text is approved
for that repository. An approval belongs to the repository (OWNER/REPO from a
GitHub origin, else the main checkout's path), so every clone and worktree
of it shares it.
- Creating a task approves its check. When an owner creates a task with
libraos-core newor the dashboard's new task sheet, and its check comes from the file, that check is approved: they saw it before anything started. A task created by a worker or an agent session approves nothing. - An approved check runs without a prompt on any worker, in that repository.
- A branch that changes its own check waits for you. When a worker finishes, LibraOS Engine compares the task file at the worker's starting commit with the branch. If the branch changed the check, nothing runs: the task is parked, and the dashboard's Inbox shows the change as a diff. Approving it allows that command for that task only. Setting a check back to an older, weaker one is asked about like any other change.
- A branch that changes a file its check runs waits the same way. Those
files are the ones the command names and runs (
sh ci.sh,./check,make -f ci.mk, a script by its extension), a Python module run withpython -m, pytest'sconftest.pyandpytest.ini, files a named shell script sources directly, everything under.agentd/, andcheck_inputsfrom the task file at the starting commit (else the default list above). - The check runs at the commit that was approved. A file the check runs that is changed and not committed stops the run, naming the files. Commit them (then they are the branch's change, asked about as above) or put them back.
- A branch that removes or breaks its task file is parked with the reason, and an approval that runs the task's original check.
- A check typed for one task (
libraos-core new --verify, a changed field in the sheet) is its author's own word and is not gated.
What this does not cover. Test and source files are not inputs:
go test ./... runs whatever tests the branch wrote, and that is the point of
a check. A file reached only through another (a Makefile target calling a
script, a file sourced two levels down) and build files a tool reads by itself
(go.mod, pyproject.toml) are not seen either: name them in
check_inputs.
Who approves: a person, never a session. In the dashboard's Inbox, signed in as an owner; or at your own terminal:
libraos-core command list # approved, pending and rejected commands
libraos-core command approve --hash PREFIX # shows what it approves and asks [y/N]
libraos-core command approve refuses a worker's or an agent's shell, a
directory inside a worker's worktree, a process started by a worker or an agent
session, and input that is not a terminal.
The limit on one OS user. Every process of your account can read what you can, so a process set on getting around these refusals (one that detaches from its parents or edits the ledger itself) can still pass as you. The refusals stop a worker that takes the ordinary route. They are a seat belt, not a security boundary.
Every check result records the hash of the command that ran and the commit it
ran on. libraos-core handoff show ID lists them under verification, so a
result from a weakened check is visible.
Schedules
A [schedules.NAME] table starts the same task on a recurrence: a nightly
dependency update, a weekly triage, a flaky-test sweep. The repository says
what and when; an owner decides whether it runs.
[schedules.deps]
cron = "0 3 * * 1-5" # minute hour day month weekday, or @hourly, @daily, @weekly, @monthly, @yearly
timezone = "Europe/Berlin" # IANA name; default UTC
grace = "1h" # a missed run still starts within this long after it was due; default 1h
precheck = "go list -m -u all | grep -q '\\['" # optional: exit 0 to run; anything else skips it
precheck_timeout = "2m" # default 1m, at most 10m
goal = "Update the Go dependencies that have new minor versions"
accept = ["go.mod and go.sum name the new versions", "go test ./... passes"]
worker = "claude" # default: the file's worker, then claude
budget = "45m" # required: each run's budget, minutes and/or dollars
max_spend = "$20" # optional: no run once this schedule's runs spent this much ... (needs [budget.prices])
spend_window = "30d" # ... in this window (default 30d)
stuck_after = "24h" # optional: owners' Inbox says so when a run is still open this long; default 24h
project = "acme/api" # optional: must be the checkout's origin
The file's check, check_timeout, accept and do_not_touch apply to a
schedule that does not set its own check and accept.
libraos-core schedule list # the repository's schedules and their state
libraos-core schedule enable deps # an owner, at their own terminal
libraos-core schedule run deps # make an enabled schedule due now
libraos-core schedule runs deps # its runs, with skip reasons
libraos-core schedule disable deps # stop it; its history stays
The dashboard's Triggers page has the same Enable, Disable and Run now.
- Enabling pins what runs. LibraOS Engine keeps the definition that was
enabled and the commit and branch the checkout was on. A later commit that
changes the table, its precheck or check, or a file they run, makes runs
skipped_policyuntil an owner enables the schedule again. Other commits do not stop it. - Only an owner enables, changes or disables a schedule, with the same
refusals as
libraos-core command approve, except that no terminal is needed. - The clock is the watchdog: each pass takes the schedules that are due
(
libraos-core schedule tickruns one pass now). Each occurrence is taken once. - A run is an ordinary task, started like any other worker, with the schedule's check, criteria and budget. Nothing is pushed or merged.
- One run at a time. An occurrence that comes due while the previous run is still open waits, and is skipped if its grace passes first. Several missed occurrences make one run.
- Prechecks run in the background with a minimal environment (no tokens or keys from the watchdog's), under the same rules as a check.
Skips have named reasons, kept with each run:
| Reason | Why |
|---|---|
skipped_missed | Due longer ago than grace. |
skipped_overlap | The previous run was still open past this one's grace. |
skipped_precheck | The precheck exited non-zero or timed out. |
skipped_unavailable | The checkout, the committed table or the worker tool is gone. |
skipped_budget | The budget cannot be enforced (dollars with no [budget.prices]), or max_spend is reached. |
skipped_policy | The definition, what it runs or the branch changed since it was enabled, or its enabler is no longer an owner. |
A max_spend needs a price in [budget.prices] for the model the schedule's
worker runs on. The newest 100 runs of each schedule are kept, plus every run
still open and every run inside spend_window.
Resources
What the check uses besides the checkout, so two runs on one host do not break each other's port or cache:
[resources]
check = ["port:5447", "svc:postgres-5447"] # shared: both runs go ahead, each told of the other
check_exclusive = ["dir:/tmp/myapp-cache-$UID"] # exclusive: a run waits for the other to finish
wait = "10m" # how long a run waits (default 10m, at most 1h)
Names are dir:/abs/path, port:N and svc:NAME. $UID, $HOME and $REPO
(the checkout's top folder) are expanded; any other variable is refused. A run
takes all of them at once or none; past wait it fails with resource_busy,
naming who holds what, and the check does not run. The declaration is read
from the task file at the worker's starting commit, so a branch that changes it
waits for approval like a change to the check.
Environment setup
[environment] says what is done to a worker's new worktree before the worker
starts, such as installing dependencies:
[environment]
setup = "sh scripts/deps.sh" # runs once in the new worktree, before the worker
setup_inputs = ["tools/versions.txt"] # files the setup reads besides those its text names
setup_timeout = "5m" # default 5m for a local task
- The setup runs only once approved, through the same approval as checks
(kind
setupinlibraos-core command list). What is approved is its text together with each file it runs: a changed script needs a new approval. Until then the task is parked with an approval in the Inbox. - It is read from the commit the task starts from, never from the worker's branch.
- It runs with
sh -cin the worker's new worktree, withAGENTD_WORKTREE_PATH,AGENTD_CHECKOUT_PATHandAGENTD_TASKset. It never runs in your checkout. - A setup that fails or times out parks the task with the command, its exit
code and the end of its output in the history, and the worktree is removed.
libraos-core handoff dispatch ID --forceruns it again; nothing skips it. - Worker permission rules apply. A block or ask rule that matches the setup refuses it, as it refuses a check.