The dialect is Starlark with assignments, if, for, comprehensions, def, lambda, load(), at the top level or inside a def. Every one of them runs at compile time: the compiled plan is a static graph, so a loop in the source unrolls into tasks rather than becoming a cycle.
prompt_file(), schema_file(), and load() are the only file access, all confined below the pack directory or a library it vendors (@name//path), and a loaded module cannot re-export what it loaded. The surface has no processes, network access, clock, or randomness.
For what the engine does with the compiled graph, see Work graphs; for the normative rules, see the implementation contract.
Available in every workflow type, playbooks included.
An agent turn driven by a prompt.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
prompt |
str |
The turn's prompt. |
harness |
str |
Agent harness, overriding [agent]. |
model |
str |
Model, overriding [agent]. |
effort |
str |
Reasoning effort, overriding [agent]. |
sandbox |
str |
An [agent.sandbox.<name>]: its image, and only the secrets, relay files, broker reach, and egress it lists. Unset runs in the [agent] sandbox. |
session |
session | str |
Join a durable conversation. A task in a session cannot be isolated. |
repair |
int |
Repair turns, up to 3. When a passing turn's output misses a declared field or file, or breaks its type or schema, the same session is resumed with the masked validation notes and asked to fix it in place, then checked again. Repairs share the attempt's timeout and cost. Default 0; refused on command and evaluate. |
depends_on |
list[task | optional(task) | others()] |
Dependencies. Readiness decides execution order; declaration order does not. A task named by over, keyed, or when is a dependency without being listed. |
needs |
str |
The substrate capability the task needs, such as "decision". The default "any" runs everywhere. A required task whose capability is unavailable truncates the plan before dispatch; an advisory one is skipped with its dependents. |
join |
"all" | "passed" | "settled" |
Which dependencies must have passed: all every one, passed at least one and only those are forwarded, settled none — it dispatches once every dependency is terminal, whatever it settled as, unless the run has already halted, and forwards each one as {status, note, output, files}. |
required |
bool |
False makes the task advisory: it blocks dependents but cannot invalidate the run. |
isolated |
bool |
Run in a disposable worktree. File changes are discarded; only JSON output continues. |
emits |
list[str] | dict[str, type] |
Result fields the task promises in its JSON output. The dict form also promises each field's type: "string", "integer", "number", "boolean", "list", "object", "link", "links", or a list of labels the value is one of. A passing output missing a field, or holding one of the wrong type, fails the task. Types are checked where the graph reads them: over needs a list, a top_k or grade score a number, and a route(decider = output(...)) question labels it can answer. A link is one http(s) url and links a list of them, each naming a result the task produced outside the run (a pull request, a pushed branch, an issue), which the run and task views then link out to. A schema_file(...) promises a value its JSON Schema admits, and is checked against each consumer exactly: over needs "type": "array" with string items (by type, const or enum), a score a numeric type with no non-number in its enum, and a route a const, enum or boolean whose every value it can answer. A when label such a source can never give is refused. |
emits_files |
list[str] | dict[str, schema | None] |
Workspace files the task produces. A task is staged with the declared files of every ancestor that passed, not only its direct dependencies, under inputs/<producer>/; a join = "settled" task also gets those of a direct dependency that failed. JSON outputs, unlike files, come from direct dependencies only. The dict form maps a path to schema_file(...) or None; a file with a schema must hold JSON the schema admits when the task passes, or the task fails. |
over |
each(producer.field, max = N) |
Map the task over a task's emitted list, one instance per item, up to max. |
max_fanout |
int |
Deprecated. Write over = each(producer.field, max = N). |
keyed |
list[producer.field] |
Object fields of unmapped dependencies, keyed by item. Each instance receives only its own item's entry in place of the whole field. Needs over. |
revise |
send_back(tasks, rounds = N) |
The tasks this task sends back when it settles failing. They run again, in dependency order, with the verdict under revision, then this task does, until this task stops failing or the rounds are spent. Every task on a path between them and this task is sent back with them. Playbooks only; not with over. |
max_rounds |
int |
Deprecated. Write revise = send_back(tasks, rounds = N). |
timeout |
str |
How long one attempt may run, as 90s, 10m, or 2h. At the limit the attempt's whole process group is killed and the task settles failed with a note naming the limit; it is not retried. The run's --max-time bounds every attempt as well, and a playbook refuses a timeout longer than it before dispatching anything. |
stage |
"iteration" | "epilogue" |
epilogue runs once after the loop concludes, and only if the run kept a candidate. |
history |
int |
Read this many earlier runs of the launch series, from 1 to the engine's ceiling of 30, under history. A run launched outside a series gets an empty list. Playbooks only. |
when |
question.any_of(...) | question.otherwise() | question |
Run only on some answers to one question. A question is one a route() asks, named gate.<id>, or a field a task emits typed "boolean" or as a list of labels, named task.<field>; a field needs no route, and answers no when reads lead nowhere. .any_of("a", "b") lists the answers: labels the question declares, or "uncertain". .otherwise() is every answer no other task lists and the question does not drop, "uncertain" included; it is expanded at compile time, an unreachable one is an error, and on a choice whose options come from a field it also stands for every option the choice resolves to and is the only way to route them. A bare yes/no question means "yes". Otherwise the task settles not_taken: no dispatch, no spend, no effect on validity, and every all-join dependent is not taken with it unless it lists the task as optional(...). Rejoin branches with join = "passed" or join = "settled". Playbook and custom workflows only. |
answers |
str | list[str] |
Deprecated. Write when = question.any_of(...). |
otherwise |
bool |
Deprecated. Write when = question.otherwise(). |
An agent turn whose prompt is a skill's instructions plus its arguments.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
skill |
str |
Skill directory below the pack; its instructions become the prompt. |
args |
dict |
Arguments appended to the instructions. |
harness |
str |
Agent harness, overriding [agent]. |
model |
str |
Model, overriding [agent]. |
effort |
str |
Reasoning effort, overriding [agent]. |
sandbox |
str |
An [agent.sandbox.<name>]: its image, and only the secrets, relay files, broker reach, and egress it lists. Unset runs in the [agent] sandbox. |
session |
session | str |
Join a durable conversation. A task in a session cannot be isolated. |
repair |
int |
Repair turns, up to 3. When a passing turn's output misses a declared field or file, or breaks its type or schema, the same session is resumed with the masked validation notes and asked to fix it in place, then checked again. Repairs share the attempt's timeout and cost. Default 0; refused on command and evaluate. |
depends_on |
list[task | optional(task) | others()] |
Dependencies. Readiness decides execution order; declaration order does not. A task named by over, keyed, or when is a dependency without being listed. |
needs |
str |
The substrate capability the task needs, such as "decision". The default "any" runs everywhere. A required task whose capability is unavailable truncates the plan before dispatch; an advisory one is skipped with its dependents. |
join |
"all" | "passed" | "settled" |
Which dependencies must have passed: all every one, passed at least one and only those are forwarded, settled none — it dispatches once every dependency is terminal, whatever it settled as, unless the run has already halted, and forwards each one as {status, note, output, files}. |
required |
bool |
False makes the task advisory: it blocks dependents but cannot invalidate the run. |
isolated |
bool |
Run in a disposable worktree. File changes are discarded; only JSON output continues. |
emits |
list[str] | dict[str, type] |
Result fields the task promises in its JSON output. The dict form also promises each field's type: "string", "integer", "number", "boolean", "list", "object", "link", "links", or a list of labels the value is one of. A passing output missing a field, or holding one of the wrong type, fails the task. Types are checked where the graph reads them: over needs a list, a top_k or grade score a number, and a route(decider = output(...)) question labels it can answer. A link is one http(s) url and links a list of them, each naming a result the task produced outside the run (a pull request, a pushed branch, an issue), which the run and task views then link out to. A schema_file(...) promises a value its JSON Schema admits, and is checked against each consumer exactly: over needs "type": "array" with string items (by type, const or enum), a score a numeric type with no non-number in its enum, and a route a const, enum or boolean whose every value it can answer. A when label such a source can never give is refused. |
emits_files |
list[str] | dict[str, schema | None] |
Workspace files the task produces. A task is staged with the declared files of every ancestor that passed, not only its direct dependencies, under inputs/<producer>/; a join = "settled" task also gets those of a direct dependency that failed. JSON outputs, unlike files, come from direct dependencies only. The dict form maps a path to schema_file(...) or None; a file with a schema must hold JSON the schema admits when the task passes, or the task fails. |
over |
each(producer.field, max = N) |
Map the task over a task's emitted list, one instance per item, up to max. |
max_fanout |
int |
Deprecated. Write over = each(producer.field, max = N). |
keyed |
list[producer.field] |
Object fields of unmapped dependencies, keyed by item. Each instance receives only its own item's entry in place of the whole field. Needs over. |
revise |
send_back(tasks, rounds = N) |
The tasks this task sends back when it settles failing. They run again, in dependency order, with the verdict under revision, then this task does, until this task stops failing or the rounds are spent. Every task on a path between them and this task is sent back with them. Playbooks only; not with over. |
max_rounds |
int |
Deprecated. Write revise = send_back(tasks, rounds = N). |
timeout |
str |
How long one attempt may run, as 90s, 10m, or 2h. At the limit the attempt's whole process group is killed and the task settles failed with a note naming the limit; it is not retried. The run's --max-time bounds every attempt as well, and a playbook refuses a timeout longer than it before dispatching anything. |
stage |
"iteration" | "epilogue" |
epilogue runs once after the loop concludes, and only if the run kept a candidate. |
history |
int |
Read this many earlier runs of the launch series, from 1 to the engine's ceiling of 30, under history. A run launched outside a series gets an empty list. Playbooks only. |
when |
question.any_of(...) | question.otherwise() | question |
Run only on some answers to one question. A question is one a route() asks, named gate.<id>, or a field a task emits typed "boolean" or as a list of labels, named task.<field>; a field needs no route, and answers no when reads lead nowhere. .any_of("a", "b") lists the answers: labels the question declares, or "uncertain". .otherwise() is every answer no other task lists and the question does not drop, "uncertain" included; it is expanded at compile time, an unreachable one is an error, and on a choice whose options come from a field it also stands for every option the choice resolves to and is the only way to route them. A bare yes/no question means "yes". Otherwise the task settles not_taken: no dispatch, no spend, no effect on validity, and every all-join dependent is not taken with it unless it lists the task as optional(...). Rejoin branches with join = "passed" or join = "settled". Playbook and custom workflows only. |
answers |
str | list[str] |
Deprecated. Write when = question.any_of(...). |
otherwise |
bool |
Deprecated. Write when = question.otherwise(). |
A deterministic shell task in the candidate workspace.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
run |
str |
The command, run through sh -c. |
depends_on |
list[task | optional(task) | others()] |
Dependencies. Readiness decides execution order; declaration order does not. A task named by over, keyed, or when is a dependency without being listed. |
needs |
str |
The substrate capability the task needs, such as "decision". The default "any" runs everywhere. A required task whose capability is unavailable truncates the plan before dispatch; an advisory one is skipped with its dependents. |
join |
"all" | "passed" | "settled" |
Which dependencies must have passed: all every one, passed at least one and only those are forwarded, settled none — it dispatches once every dependency is terminal, whatever it settled as, unless the run has already halted, and forwards each one as {status, note, output, files}. |
required |
bool |
False makes the task advisory: it blocks dependents but cannot invalidate the run. |
isolated |
bool |
Run in a disposable worktree. File changes are discarded; only JSON output continues. |
emits |
list[str] | dict[str, type] |
Result fields the task promises in its JSON output. The dict form also promises each field's type: "string", "integer", "number", "boolean", "list", "object", "link", "links", or a list of labels the value is one of. A passing output missing a field, or holding one of the wrong type, fails the task. Types are checked where the graph reads them: over needs a list, a top_k or grade score a number, and a route(decider = output(...)) question labels it can answer. A link is one http(s) url and links a list of them, each naming a result the task produced outside the run (a pull request, a pushed branch, an issue), which the run and task views then link out to. A schema_file(...) promises a value its JSON Schema admits, and is checked against each consumer exactly: over needs "type": "array" with string items (by type, const or enum), a score a numeric type with no non-number in its enum, and a route a const, enum or boolean whose every value it can answer. A when label such a source can never give is refused. |
emits_files |
list[str] | dict[str, schema | None] |
Workspace files the task produces. A task is staged with the declared files of every ancestor that passed, not only its direct dependencies, under inputs/<producer>/; a join = "settled" task also gets those of a direct dependency that failed. JSON outputs, unlike files, come from direct dependencies only. The dict form maps a path to schema_file(...) or None; a file with a schema must hold JSON the schema admits when the task passes, or the task fails. |
over |
each(producer.field, max = N) |
Map the task over a task's emitted list, one instance per item, up to max. |
max_fanout |
int |
Deprecated. Write over = each(producer.field, max = N). |
keyed |
list[producer.field] |
Object fields of unmapped dependencies, keyed by item. Each instance receives only its own item's entry in place of the whole field. Needs over. |
revise |
send_back(tasks, rounds = N) |
The tasks this task sends back when it settles failing. They run again, in dependency order, with the verdict under revision, then this task does, until this task stops failing or the rounds are spent. Every task on a path between them and this task is sent back with them. Playbooks only; not with over. |
max_rounds |
int |
Deprecated. Write revise = send_back(tasks, rounds = N). |
timeout |
str |
How long one attempt may run, as 90s, 10m, or 2h. At the limit the attempt's whole process group is killed and the task settles failed with a note naming the limit; it is not retried. The run's --max-time bounds every attempt as well, and a playbook refuses a timeout longer than it before dispatching anything. |
stage |
"iteration" | "epilogue" |
epilogue runs once after the loop concludes, and only if the run kept a candidate. |
history |
int |
Read this many earlier runs of the launch series, from 1 to the engine's ceiling of 30, under history. A run launched outside a series gets an empty list. Playbooks only. |
when |
question.any_of(...) | question.otherwise() | question |
Run only on some answers to one question. A question is one a route() asks, named gate.<id>, or a field a task emits typed "boolean" or as a list of labels, named task.<field>; a field needs no route, and answers no when reads lead nowhere. .any_of("a", "b") lists the answers: labels the question declares, or "uncertain". .otherwise() is every answer no other task lists and the question does not drop, "uncertain" included; it is expanded at compile time, an unreachable one is an error, and on a choice whose options come from a field it also stands for every option the choice resolves to and is the only way to route them. A bare yes/no question means "yes". Otherwise the task settles not_taken: no dispatch, no spend, no effect on validity, and every all-join dependent is not taken with it unless it lists the task as optional(...). Rejoin branches with join = "passed" or join = "settled". Playbook and custom workflows only. |
answers |
str | list[str] |
Deprecated. Write when = question.any_of(...). |
otherwise |
bool |
Deprecated. Write when = question.otherwise(). |
A measurement command. Its last non-empty stdout line is a JSON object; pass = false vetoes the result and numeric score feeds grade() and top_k().
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
run |
str |
The command, run through sh -c. |
threshold |
at_least(n) | at_most(n) |
Grade the emitted score against this bound. pass = false fails a score within it; pass cannot pass a score outside it. |
direction |
"lower" | "higher" |
Deprecated. Write threshold = at_least(n) or at_most(n). |
depends_on |
list[task | optional(task) | others()] |
Dependencies. Readiness decides execution order; declaration order does not. A task named by over, keyed, or when is a dependency without being listed. |
needs |
str |
The substrate capability the task needs, such as "decision". The default "any" runs everywhere. A required task whose capability is unavailable truncates the plan before dispatch; an advisory one is skipped with its dependents. |
join |
"all" | "passed" | "settled" |
Which dependencies must have passed: all every one, passed at least one and only those are forwarded, settled none — it dispatches once every dependency is terminal, whatever it settled as, unless the run has already halted, and forwards each one as {status, note, output, files}. |
required |
bool |
False makes the task advisory: it blocks dependents but cannot invalidate the run. |
isolated |
bool |
Run in a disposable worktree. File changes are discarded; only JSON output continues. |
emits |
list[str] | dict[str, type] |
Result fields the task promises in its JSON output. The dict form also promises each field's type: "string", "integer", "number", "boolean", "list", "object", "link", "links", or a list of labels the value is one of. A passing output missing a field, or holding one of the wrong type, fails the task. Types are checked where the graph reads them: over needs a list, a top_k or grade score a number, and a route(decider = output(...)) question labels it can answer. A link is one http(s) url and links a list of them, each naming a result the task produced outside the run (a pull request, a pushed branch, an issue), which the run and task views then link out to. A schema_file(...) promises a value its JSON Schema admits, and is checked against each consumer exactly: over needs "type": "array" with string items (by type, const or enum), a score a numeric type with no non-number in its enum, and a route a const, enum or boolean whose every value it can answer. A when label such a source can never give is refused. |
emits_files |
list[str] | dict[str, schema | None] |
Workspace files the task produces. A task is staged with the declared files of every ancestor that passed, not only its direct dependencies, under inputs/<producer>/; a join = "settled" task also gets those of a direct dependency that failed. JSON outputs, unlike files, come from direct dependencies only. The dict form maps a path to schema_file(...) or None; a file with a schema must hold JSON the schema admits when the task passes, or the task fails. |
over |
each(producer.field, max = N) |
Map the task over a task's emitted list, one instance per item, up to max. |
max_fanout |
int |
Deprecated. Write over = each(producer.field, max = N). |
keyed |
list[producer.field] |
Object fields of unmapped dependencies, keyed by item. Each instance receives only its own item's entry in place of the whole field. Needs over. |
revise |
send_back(tasks, rounds = N) |
The tasks this task sends back when it settles failing. They run again, in dependency order, with the verdict under revision, then this task does, until this task stops failing or the rounds are spent. Every task on a path between them and this task is sent back with them. Playbooks only; not with over. |
max_rounds |
int |
Deprecated. Write revise = send_back(tasks, rounds = N). |
timeout |
str |
How long one attempt may run, as 90s, 10m, or 2h. At the limit the attempt's whole process group is killed and the task settles failed with a note naming the limit; it is not retried. The run's --max-time bounds every attempt as well, and a playbook refuses a timeout longer than it before dispatching anything. |
stage |
"iteration" | "epilogue" |
epilogue runs once after the loop concludes, and only if the run kept a candidate. |
history |
int |
Read this many earlier runs of the launch series, from 1 to the engine's ceiling of 30, under history. A run launched outside a series gets an empty list. Playbooks only. |
when |
question.any_of(...) | question.otherwise() | question |
Run only on some answers to one question. A question is one a route() asks, named gate.<id>, or a field a task emits typed "boolean" or as a list of labels, named task.<field>; a field needs no route, and answers no when reads lead nowhere. .any_of("a", "b") lists the answers: labels the question declares, or "uncertain". .otherwise() is every answer no other task lists and the question does not drop, "uncertain" included; it is expanded at compile time, an unreachable one is an error, and on a choice whose options come from a field it also stands for every option the choice resolves to and is the only way to route them. A bare yes/no question means "yes". Otherwise the task settles not_taken: no dispatch, no spend, no effect on validity, and every all-join dependent is not taken with it unless it lists the task as optional(...). Rejoin branches with join = "passed" or join = "settled". Playbook and custom workflows only. |
answers |
str | list[str] |
Deprecated. Write when = question.any_of(...). |
otherwise |
bool |
Deprecated. Write when = question.otherwise(). |
A fan-out for over: the list to map over and how wide it may get.
Takes one positional argument, list.
| Argument | Type | Purpose |
|---|---|---|
list |
producer.field |
A list field a dependency emits; each item is one instance's key. |
max |
int |
Instance cap, within the engine's ceiling of 256. A longer list fails the task. |
An entry of depends_on that stands for every main-graph task no others() task feeds. With join = "settled" the task reads how each of them settled. Not in the epilogue, where outcome already carries that.
Defaults for workflow(defaults = ...).
| Argument | Type | Purpose |
|---|---|---|
required |
bool |
False makes every task advisory unless it sets required = True. |
isolated |
bool |
Default isolated for agent, skill, command, and evaluate tasks. |
timeout |
str |
Default per-attempt timeout (e.g. 10m) for agent, skill, command, and evaluate tasks. |
repair |
int |
Default repair turns (0 to 3) for agent and skill tasks. |
sandbox |
str |
Default [agent.sandbox.<name>] for agent and skill tasks. |
join |
"all" | "passed" | "settled" |
Default dependency join for agent, skill, command, evaluate, and route tasks. |
A bounded send-back for revise: the tasks a failing reviewer runs again and how many rounds the loop may take.
Takes one positional argument, tasks.
| Argument | Type | Purpose |
|---|---|---|
tasks |
task | list[task] |
Where the send-back starts. Every task between these and the reviewer runs again with them. |
rounds |
int |
Round cap, counting the first, from 2 to the engine's ceiling of 5. |
A bound for evaluate(threshold = ...) that a score at or above passes.
Takes one positional argument, bound.
| Argument | Type | Purpose |
|---|---|---|
bound |
number |
The bound. |
A bound for evaluate(threshold = ...) that a score at or below passes.
Takes one positional argument, bound.
| Argument | Type | Purpose |
|---|---|---|
bound |
number |
The bound. |
Publish a rendered template to a controller-configured destination. The workflow selects a destination key, never an endpoint or a credential.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
destination |
dict |
The sink to publish to, as {"kind": "slack"}. The controller holds its endpoint and credential. |
template |
str |
Pack file rendered into the card body. Reads verdict, spent_usd, passed, failed, tasks (first 20), run, run_url, and result. Every inserted value is escaped for Slack. |
result |
task |
The task whose declared fields the card and result.output carry; result.status alone when it did not pass. |
severity_field |
str |
A declared field of result whose value ("good", "warning", "danger") picks the card accent; any other value is neutral. |
required |
bool |
False makes the report advisory. |
Declare a durable agent conversation. Tasks that share one run serially under one agent config, across dependency order and loop iterations.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Session identity, referenced by session =. |
harness |
str |
Default harness for tasks in the session. |
model |
str |
Default model for tasks in the session. |
effort |
str |
Default effort for tasks in the session. |
Read a launch parameter. The params block must come before every statement but calls, and a source that declares one compiles per run. A supplied value may reach a prompt, with + and inside a region marked as external input, or a skill argument; str(), %, .format(), and string methods on it are refused, as is a value carrying the marker text. A command or evaluate task reads it from params in the inputs JSON at CRUCIBLE_INPUTS_FILE instead of its command line. A json or file parameter binds a call's parameter, or reaches an agent's prompt or a skill argument only inside the external-input markers: a json value as JSON, a file as its read-only copy under inputs/params/<name>/.
Takes one positional argument, name.
Embed a UTF-8 file below the pack directory. Absolute paths, .., symlinks, non-files, and oversized inputs are refused.
Takes one positional argument, path.
Read a JSON Schema (draft 2020-12) below the pack directory, for a field type in emits or a file in emits_files. Its content, not its path, is compiled into the plan. Paths are confined as for prompt_file; a file that is not a valid 2020-12 schema, declares another $schema, or references a remote $ref is refused.
Takes one positional argument, path.
The source's final expression: the lane, the tasks that ship, and the result. A task constructed but not listed is a compile error.
Takes one positional argument, tasks.
| Argument | Type | Purpose |
|---|---|---|
type |
"autoresearch" | "custom" | "playbook" |
The lane, which decides which constructors exist. |
tasks |
list[task] |
Every task that ships. |
defaults |
task_defaults(...) |
What each agent, skill, command, evaluate, and route task takes for an argument it does not set. |
result |
task |
The task whose output is the workflow's result. |
history_record |
task |
The task each run records for the later runs of its launch series: its status, and the fields it declares in emits when it passed. Not a mapped task; an epilogue task records even when the main graph failed. Playbooks only. |
Available to type = "autoresearch" and type = "custom". A playbook does not have these in scope at all, so naming one is an unknown-name error and a did-you-mean never offers one.
The loop's candidate-producing agent turn.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
session |
session | str |
The conversation the turn belongs to. |
depends_on |
list[task] |
Dependencies. |
Make the candidate live through the configured world. A failure means unscoreable, not worse.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
depends_on |
list[task] |
Dependencies. |
Run the manifest's frozen judge as one opaque measurement task.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
depends_on |
list[task] |
Dependencies. |
Fold evaluation evidence into a measurement. Evidence includes tasks that failed or never ran, which is what the score source alone cannot see.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
score |
task |
The task whose score the decision uses. |
tiebreak |
task |
Secondary score that breaks primary-score ties. |
evidence |
list[task] |
Tasks folded into the measurement. |
join |
"all" | "passed" |
Which evidence must have passed. |
Apply the engine's keep-or-discard rule to a measurement. An autoresearch workflow must end here.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
measurement |
task |
The measurement being ruled on. |
depends_on |
list[task] |
Dependencies, defaulting to the measurement. |
Engine-owned reducer: the best k dependency outputs by numeric score.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
k |
int |
How many dependencies survive. |
direction |
"lower" | "higher" |
Which score wins. |
depends_on |
list[task] |
The candidates being reduced. |
required |
bool |
False makes the reducer advisory. |
Expand the built-in propose/apply/measure/decide loop into visible nodes, plus the tasks passed to it.
Takes one positional argument, extra_tasks.
Available to type = "playbook" and type = "custom". An autoresearch workflow keeps or discards on a frozen measure, so it has neither these nor when.
Engine-owned decision: answers typed questions about its dependencies' outputs and records one label per question, which other tasks branch on with when. Every label of a question some when refers to, "uncertain" included, must be listed by a when or by the question's drop.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
questions |
dict[str, question] |
Question id to noul(), choice(), or score(). gate.<id> names one for when. |
decider |
model(...) | human(...) | output(task) |
What answers the questions: a decision model, a person, or a dependency's output. |
min_confidence |
number |
Deprecated. Write decider = model(min_confidence = N). |
source |
task |
Deprecated. Write decider = output(task). |
human |
bool |
Deprecated. Write decider = human(). |
review |
path |
Deprecated. Write decider = human(review = path). |
timeout |
duration |
Deprecated. Write decider = human(timeout = duration). |
files |
list[str] |
Deprecated. Write decider = model(files = [...]). |
over |
each(producer.field, max = N) |
Decide once per item. A task mapped over the same list reads each item's answer with when; one mapped over another list, or not mapped, cannot. |
max_fanout |
int |
Deprecated. Write over = each(producer.field, max = N). |
keyed |
list[producer.field] |
Object fields of unmapped dependencies, keyed by item. Each instance receives only its own item's entry in place of the whole field. Needs over. |
depends_on |
list[task] |
Dependencies. Their outputs are the state the questions are asked about. |
required |
bool |
False makes the route advisory. |
join |
"all" | "passed" | "settled" |
Which dependency outputs form the state, as on any task. |
stage |
"iteration" | "epilogue" |
As on any task. |
when |
question.any_of(...) | question.otherwise() | question |
Run only on some answers to one question. A question is one a route() asks, named gate.<id>, or a field a task emits typed "boolean" or as a list of labels, named task.<field>; a field needs no route, and answers no when reads lead nowhere. .any_of("a", "b") lists the answers: labels the question declares, or "uncertain". .otherwise() is every answer no other task lists and the question does not drop, "uncertain" included; it is expanded at compile time, an unreachable one is an error, and on a choice whose options come from a field it also stands for every option the choice resolves to and is the only way to route them. A bare yes/no question means "yes". Otherwise the task settles not_taken: no dispatch, no spend, no effect on validity, and every all-join dependent is not taken with it unless it lists the task as optional(...). Rejoin branches with join = "passed" or join = "settled". Playbook and custom workflows only. |
answers |
str | list[str] |
Deprecated. Write when = question.any_of(...). |
otherwise |
bool |
Deprecated. Write when = question.otherwise(). |
Engine-owned dispatch of a target from @crucible//calls, as a run of its own, compiled against the pack's calls.lock. The call waits for the target run and settles as it ended; its output is the target's result and its files are the target's result files.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
target |
playbook(...) | github_workflow(...) | gitlab_pipeline(...) |
The target, written here or bound to a top-level name. |
params |
dict[str, value] |
The target's parameters, each bound to a literal, param(name), producer.field, producer.files["path"], or in a mapped call item(). A producer is made a dependency. Every binding is checked against the lock's interface: an unknown name, an unbound required parameter, a field of another type, or a file to a non-file parameter is refused. |
over |
each(producer.field, max = N) |
Dispatch one target run per item, at most 64. |
max_fanout |
int |
Deprecated. Write over = each(producer.field, max = N). |
budget |
budget(cost = usd, wall_clock = duration) |
The target run's own ceilings, in place of the controller's launch defaults. The caller's ceilings keep running while it waits. |
depends_on |
list[task] |
Dependencies besides the producers its params read. |
required |
bool |
False makes the call advisory. |
join |
"all" | "passed" | "settled" |
As on any task. |
stage |
"iteration" | "epilogue" |
As on any task. |
when |
question.any_of(...) | question.otherwise() | question |
Run only on some answers to one question. A question is one a route() asks, named gate.<id>, or a field a task emits typed "boolean" or as a list of labels, named task.<field>; a field needs no route, and answers no when reads lead nowhere. .any_of("a", "b") lists the answers: labels the question declares, or "uncertain". .otherwise() is every answer no other task lists and the question does not drop, "uncertain" included; it is expanded at compile time, an unreachable one is an error, and on a choice whose options come from a field it also stands for every option the choice resolves to and is the only way to route them. A bare yes/no question means "yes". Otherwise the task settles not_taken: no dispatch, no spend, no effect on validity, and every all-join dependent is not taken with it unless it lists the task as optional(...). Rejoin branches with join = "passed" or join = "settled". Playbook and custom workflows only. |
answers |
str | list[str] |
Deprecated. Write when = question.any_of(...). |
otherwise |
bool |
Deprecated. Write when = question.otherwise(). |
Engine-owned wait for the runs a commit started on a target's system, such as the Pipelines-as-Code PipelineRuns a push or pull request triggered. The target is a tekton(...) from @crucible//calls. The watch adds every run that appears within appear, passes once every matched run passed, fails as soon as one fails, and never cancels a run. Its output has runs and, per expected run, the results it declares.
Takes one positional argument, name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
Task identity, unique within the workflow. |
target |
tekton(...) |
The target, written here or bound to a top-level name. |
commit |
str |
The full commit id, as a literal, param(name), or producer.field. |
timeout |
duration |
How long the watch waits in all before it fails. |
appear |
duration |
How long runs may take to appear; 10m when unset. |
depends_on |
list[task] |
Dependencies besides the producer its commit reads. |
required |
bool |
False makes the watch advisory. |
join |
"all" | "passed" | "settled" |
As on any task. |
stage |
"iteration" | "epilogue" |
As on any task. |
when |
question.any_of(...) | question.otherwise() | question |
Run only on some answers to one question. A question is one a route() asks, named gate.<id>, or a field a task emits typed "boolean" or as a list of labels, named task.<field>; a field needs no route, and answers no when reads lead nowhere. .any_of("a", "b") lists the answers: labels the question declares, or "uncertain". .otherwise() is every answer no other task lists and the question does not drop, "uncertain" included; it is expanded at compile time, an unreachable one is an error, and on a choice whose options come from a field it also stands for every option the choice resolves to and is the only way to route them. A bare yes/no question means "yes". Otherwise the task settles not_taken: no dispatch, no spend, no effect on validity, and every all-join dependent is not taken with it unless it lists the task as optional(...). Rejoin branches with join = "passed" or join = "settled". Playbook and custom workflows only. |
answers |
str | list[str] |
Deprecated. Write when = question.any_of(...). |
otherwise |
bool |
Deprecated. Write when = question.otherwise(). |
A call's ceilings for its target run.
| Argument | Type | Purpose |
|---|---|---|
cost |
number |
The target run's cost ceiling in dollars. |
wall_clock |
duration |
The target run's wall-clock ceiling, such as "30m". |
A mapped call's own item, as a value in params.
A route decider: a decision model answers, through the broker's decision capability.
| Argument | Type | Purpose |
|---|---|---|
min_confidence |
number |
An answer whose probability is below this, in (0, 1], is recorded as "uncertain". |
files |
list[str] |
Declared JSON files of dependencies the model reads, under files in its state, by dependency and path. Each must be declared by a dependency with a schema_file(...). |
A route decider: a person allowed to approve the run answers, from the controller UI, after seeing the dependencies' declared outputs and files. Needs the human capability. Tasks that do not depend on the route keep running while it waits.
| Argument | Type | Purpose |
|---|---|---|
review |
path |
A Markdown template in the pack, rendered over the evidence (inputs, run, gated) and shown above it. Every inserted value is escaped. |
timeout |
duration |
How long the request stays open, from when it opens; the run's wall-clock ceiling by default. An unanswered request records every question as "uncertain". |
A route decider: a dependency's output answers. It emits one declared label (or a boolean, for a noul) under each question id. Deterministic, free, and needs no capability. Any other value fails the route. When the dependency types its emits, each question's field must be typed with labels the question answers, or "boolean" for a noul.
Takes one positional argument, task.
| Argument | Type | Purpose |
|---|---|---|
task |
task |
The dependency whose output answers. |
A yes/no question for route(). It answers "yes" or "no".
| Argument | Type | Purpose |
|---|---|---|
ask |
str |
What to decide. |
drop |
str | list[str] |
Answers that deliberately lead nowhere, so no when has to list them. |
A one-of-N question for route().
| Argument | Type | Purpose |
|---|---|---|
ask |
str |
What to decide. |
options |
list[str] | dict[str, str | None] | producer.field |
At least two distinct identifier labels, optionally each with a description the model sees. "uncertain" is reserved. Or an unmapped dependency's field, read at each decision: the list itself, or, on a route with over, an object keyed by item holding each item's list. Each entry is a label or {"value": label, "description": str}; at most 64, a repeated label keeps its first entry, and fewer than two fails that decision. The answer records the options it chose among. Needs a model(...) decider. |
multiple |
bool |
Take one or more labels. Only a route decided by human(...) asks it; a when runs if any listed label was chosen. |
drop |
str | list[str] |
Answers that deliberately lead nowhere, so no when has to list them. |
A question for a route decided by human(...) whose options are a list a dependency produced. The route's output holds the picked values under the question id, so over = gate.question fans out over them. No when routes on it.
| Argument | Type | Purpose |
|---|---|---|
ask |
str |
What to pick. |
source |
producer.field |
A list of strings in the output of a task the route depends on, read when the route opens its request. |
multiple |
bool |
Take one or more values rather than one. |
An ordinal question for route(). It answers its most probable level, the lowest on a tie, and records a score in [0, 1]: the expected level position over the normalized distribution, 0 for the lowest level and 1 for the highest. A source answers one level label, scored by its position, and "uncertain" records no score.
| Argument | Type | Purpose |
|---|---|---|
ask |
str |
What to decide. |
levels |
list[str] | dict[str, str | None] |
At least two distinct identifier labels, lowest first in the order written, optionally each with a description the model sees. "uncertain" is reserved. |
drop |
str | list[str] |
Answers that deliberately lead nowhere, so no when has to list them. |
Mark an entry of depends_on that may settle not_taken. Under join = "all" the task dispatches past it as though it passed, and its inputs carry no entry for it; one that failed or was blocked still blocks. Refused under another join, on a dependency that can never settle not_taken, and on a task the reviewer revises.
Takes one positional argument, task.
Imported with load(), like a pack's own modules. A name a module exports is not in scope until it is loaded, and it can be renamed on import: load("@crucible//calls", gl = "gitlab_pipeline").
The targets call() and watch() take. Each is written in workflow.star, inline in the call or bound to a top-level name, from literals and other values of this module, so the controller can pin it in calls.lock without running the source. An inline target is pinned under its task's name, a bound one under the name it is bound to, which lets several calls share one pin.
Another playbook, run as a child of this one.
Takes ref positionally or by name.
| Argument | Type | Purpose |
|---|---|---|
ref |
str |
A registered playbook id, or draft:<id> for a draft's head (draft packs only). |
A GitHub Actions workflow, dispatched with its inputs.
| Argument | Type | Purpose |
|---|---|---|
repo |
str |
owner/name. |
workflow |
str |
The workflow file, under .github/workflows/. |
ref |
str |
The branch or tag it runs on. |
outputs |
artifact_outputs(...) |
Where the run's result is read from. |
A GitLab pipeline, created with typed spec:inputs.
| Argument | Type | Purpose |
|---|---|---|
host |
str |
The GitLab host; it must be one the controller serves. |
project |
str |
The project path, group/project. |
ref |
str |
The branch or tag the pipeline runs on. |
outputs |
job_outputs(...) |
Where the pipeline's result is read from. Unset, the call reads none. |
token |
str |
A [[secret]] of kind gitlab_token the controller reaches the project with, in place of its own token. The playbook binds it with projection call; the run never receives it. |
Pipelines-as-Code runs on a Tekton cluster, for watch() only.
| Argument | Type | Purpose |
|---|---|---|
cluster |
str |
A cluster the controller is configured to watch. |
namespace |
str |
The namespace the runs start in. |
repository |
str |
The Pipelines-as-Code Repository name. |
event |
event.push | event.pull_request |
Which runs to follow. Unset, both. |
expected |
list[pipeline_run(...)] |
The runs the watch waits for, and the results each declares. |
kubeconfig |
str |
A [[secret]] of kind tekton_kubeconfig the controller watches with, in place of its own. Its server must be the cluster's, and it must hold its token inline. The playbook binds it with projection call; the run never receives it. |
A GitHub run's result: an uploaded artifact holding result.json.
| Argument | Type | Purpose |
|---|---|---|
artifact |
str |
The artifact name. |
fields |
dict[str, type] |
The typed fields of the JSON object the run writes as its result. |
files |
list[str] |
Further paths the call stages for its dependents. |
A GitLab pipeline's result: a job's artifacts holding result.json.
| Argument | Type | Purpose |
|---|---|---|
job |
str |
The job whose artifacts hold it. |
fields |
dict[str, type] |
The typed fields of the JSON object the run writes as its result. |
files |
list[str] |
Further paths the call stages for its dependents. |
One PipelineRun a Tekton watch waits for.
Takes name positionally or by name.
| Argument | Type | Purpose |
|---|---|---|
name |
str |
The PipelineRun's name. |
results |
list[str] |
Task results the watch outputs for it. |
The Pipelines-as-Code event a Tekton watch follows. Members: event.push, event.pull_request.
Names the engine reads and writes for itself. They are not constructor arguments; they appear in a task's own JSON output and in the inputs it receives.
Read out of the object the task returns.
| Field | Type | Meaning |
|---|---|---|
status |
"pass" | "fail" | "skipped" |
"fail" or "skipped" settles the task that way, whatever its exit status, pass or threshold. "pass" cannot pass a task that exited nonzero or did not pass its grade. Any other value is ignored. |
note |
str |
Why the task failed or was skipped, recorded as its note when it is a non-blank string: after the exit status in place of the stderr tail when a command exits nonzero, before the threshold and log handles when an evaluation does not pass, and in place of the default note when status is "fail" or "skipped". The control plane shows it as a parked run's reason. Read only from a result that fails or skips. |
complete |
bool |
true on a passing main-graph command or evaluate task of a playbook ends the run early and valid: nothing else in the main graph dispatches, undispatched tasks stay unsettled, and epilogue tasks still run. The shutdown outcome is complete. Any other task's true is refused on its row and the run continues. A task may not list it in emits. |
reason |
str |
Why the run completed early, recorded with the shutdown. A task may not list it in emits. |
Present alongside the dependency entries, never wrapped in one.
| Field | Type | Meaning |
|---|---|---|
history |
object |
Earlier terminal runs of the launch series, as {"records": [record], "dropped": int}, oldest first by end time, at most the task's history depth. Each record is {"run", "started_at", "ended_at", "outcome", "verdict", "revision", "link", "entry": {"task", "status", "output"}}. dropped counts records the operator's size limit removed from the oldest end. In a task that declares history only; an agent reads it as marked external input. |
item |
str |
This mapped instance's key, one per item of the list over names. |
kept |
object |
The kept candidate, in an epilogue task only. |
outcome |
object |
How the main graph ended and what each of its tasks settled as, as {"exit": str, "tasks": {name: {"status", "note", "output", "files"}}}, in an epilogue task only: each entry is what a settled join receives, per_instance included for a mapped task. files says whether that task's declared files, passing or failing, are staged under inputs/<name>/. |
params |
object |
Every declared parameter's bound value under its name, in its declared type, and {} where the source declares none, in a command or evaluate task only. |
revision |
object |
The verdict that sent this task back, as {"round": int, "max_rounds": int, "reviewer": str, "review": {"status", "note", "output", "files"}}, from the second round of a revise loop on. |