Repository Public License
1<!--2ORIX OS Automation3File: docs/workflows/language-reference.md4Author: Simon-Pierre Boucher5Contact: contact@spboucher.ai6-->7# Workflow language reference89This document describes what `Packages/ORIXWorkflowEngine` implements, nothing more. The same model (`WorkflowDocument`)10backs the agent, visual and code views; the text form below is what the code view edits and what `WorkflowCodec.emit` writes.1112- Schema of the canonical form: `Workflows/Schemas/automation.v1.schema.json` (`WorkflowSchema.automationV1()`). It uses no13 `$ref`: nested steps are described to 2 container levels (1 under `spec.onError`); deeper steps are accepted as any object.14- Examples: `Workflows/Examples/*.yaml` (also shipped as package resources, `BuiltInWorkflows.all()`).1516## 1. Document1718```yaml19apiVersion: orix.ai/v1 # required value20kind: Automation # required value21metadata:22 id: weekly-report # [A-Za-z_][A-Za-z0-9_-]*; defaults to a slug of `name`23 name: Weekly report24 description: …25 tags: [reports]26spec:27 triggers: […] # optional; `trigger:` (one mapping or a list) is accepted and normalised28 parameters: […]29 permissions: {…}30 budget: {…}31 variables: {…}32 steps: […]33 onError: […] # workflow-level handler steps34 layout: {stepId: {x: 0, y: 0}}35```3637Unknown fields are errors (`unknown-field`), with line and column.3839### Triggers4041| `type` | Fields | Notes |42|---|---|---|43| `manual` | — | may be written as the bare string `manual` |44| `schedule` | `cron`, `timezone?` | five-field cron; IANA time zone |45| `once` | `at` | ISO 8601 date-time |46| `interval` | `seconds` | > 0 |47| `fileChange` | `path`, `glob?`, `debounceSeconds?` | absolute or `~/` path |48| `login` | — | may be written as the bare string `login` |49| `appLaunch` | `bundleID` | |5051The engine does not fire triggers (that is `ORIXScheduler`); it validates them and carries them in the model.5253### Parameters5455`name` (`[A-Za-z_][A-Za-z0-9_]*`), `type` (`string`, `number`, `integer`, `boolean`, `path`, `array`, `object`; default56`string`), `default?`, `description?`, `required?`. At run time supplied values are type-checked, unknown names are57refused, defaults are interpolated (they may read earlier parameters and `env`), and a missing required parameter fails58the run before anything executes. Parameters are read as `params.<name>`.5960### Permissions6162```yaml63permissions:64 filesystem: {read: [paths], write: [paths], delete: [paths]}65 processes: [git] # executables66 scripts: [bash, python] # bash python swift javascript applescript jxa (`runtimes:` accepted)67 apps: {automation: [bundle ids], accessibility: [bundle ids], control: [bundle ids]}68 network: [api.example.com, "*.example.org"] # hosts only (`{hosts: […]}` accepted)69 browser: [localhost]70 secrets: [smtp-password] # Keychain reference names71 clipboard: {read: true, write: true} # `clipboard: true` accepted72 notifications: true73 screen: [display, "window:com.apple.Safari"] # `screen: true` accepted (= [display])74```7576Paths must be absolute or start with `~/`; `~user` and relative paths are errors. An entry may contain77`${{ params.<name> }}` and nothing else from the expression language (permissions cannot depend on run-time values).78`doc.declaredCapabilities(home:parameters:)` expands `~` against the given home, substitutes parameters (defaults when not79supplied), canonicalises paths with `PathResolver` and returns Core `Capability` values; unresolvable entries are left80out. `doc.proposedGrants(workflowID:)` turns them into `PermissionGrant`s of scope `.workflow`. Each grant carries the81highest tier of a tool call it may take part in: 1 for file write, move to Trash, clipboard read/write, notifications and82screen capture; 2 for everything else, **including file read**. A read permission is an input of write and consequential83calls (copy, move, archive, convert, running a script in a folder), and the policy engine compares the grant's ceiling with84the tier of the whole call; the write, process, runtime or network side of such a call still needs its own declared85permission. Tier 3 is never proposed. Declaring a permission grants nothing by itself: the policy engine decides.8687### Budget8889`maxDurationSeconds`, `maxProviderCostUSD`, `maxToolCalls`, `maxTokens` (all optional). See §6 for enforcement.9091## 2. Steps9293Every step has `id` (unique in the whole document, nested steps included; `[A-Za-z_][A-Za-z0-9_-]*`) and exactly one94kind key. Common fields:9596| Field | Meaning |97|---|---|98| `name` | display name |99| `needs: [ids]` | steps of the **same list** that must finish first. Must form a DAG |100| `when` | expression; falsy → the step is skipped |101| `retry: {maxAttempts, backoffSeconds, backoffMultiplier, force}` | `retry: 3` is shorthand for `maxAttempts: 3` |102| `timeoutSeconds` | real-time limit for one attempt |103| `continueOnError` | a failure does not stop the list |104| `onError: <id>` | step of the same list that handles the failure |105106**Scheduling.** A step list is a dependency graph, not a script: every step whose `needs` are satisfied starts at once,107so steps without `needs` run concurrently. Order steps with `needs`.108109| Kind key | Other fields | Behaviour and output (`steps.<id>.output`) |110|---|---|---|111| `tool: <tool id>` | `with: {…}` | invokes the tool through `ToolInvoking`; output = the tool's output |112| `agent: <profile>` or `agent: {instructions, model?, tools?}` | `objective`, `inputs`, `expect` | runs an agent through `AgentRunning`; output `{text, result, status}`. `model` is `provider/model`; inline `tools` defaults to none |113| `if: <expr>` | `then: [ids]`, `else: [ids]` | output `{result, branch}`; listed steps of the same list run only on their branch |114| `switch: <expr>` | `cases: [{value, steps: [ids]}]`, `default: [ids]` | first case whose value equals the expression; output `{value, matched, steps}` |115| `foreach: <expr or list>` | `as` (default `item`), `concurrency` (default 1), `collect?`, `steps` | runs the body once per item, `index` available; output `{results, count}`; a result is the output of the `collect` step or an object of all body outputs |116| `parallel: [{name, steps}]` | — | branches run concurrently, implicit join; output `{<branch>: {<step id>: output}}` |117| `while: <expr>` | `maxIterations` (required, ≥ 1), `steps` | condition checked before each iteration; `loop.index` available; body steps and the condition see the previous iteration's body results; output `{iterations, exhausted}` |118| `approval: <message>` | — | manual gate; output `{approved: true}` |119| `delay: <seconds or expr>` | — | waits |120| `set: {name: value}` | — | assigns workflow variables; output = the assigned values |121| `transform: <expr>` | `into?` | output = the value; `into` also stores it in a variable |122| `verify: [assertions]` | — | output `{passed, failed}`; any failed assertion fails the step |123| `subworkflow: <id or name>` | `inputs` | runs another workflow inline; output = its outputs |124| `notify: <message>` | `title?` | calls the tool `notifications.post` with `{title, body}` |125| `fail: <message>` | — | fails explicitly |126| `output: {name: value}` | `artifacts: [paths]` | declares workflow outputs and artifact files |127128Shorthand accepted from the product brief and normalised: `verifier: <name>` becomes a `verify` step asserting129`stepSucceeded` for each of its `needs` (the verifier name is not kept).130131### Assertions (`verify`, and `expect` of agent steps)132133`fileExists: path`, `fileNonEmpty: path`, `fileContains: path` + `text:`, `dirNonEmpty: path`, `equals: [a, b]`,134`truthy: <expr or value>`, `stepSucceeded: <id>`. Agent `expect` accepts only the four file assertions (they are passed to135the agent runtime as Core `Expectation`s).136137File assertions are evaluated by the engine against the real filesystem. A path is inspected only when it lies under the138workflow's declared `filesystem` permissions or the run's artifacts directory, and never when `PathResolver.isProtected`;139otherwise the assertion fails with that reason as evidence. `fileContains` reads at most 16 MiB.140141### Errors142143- A step that fails without `continueOnError` or `onError` stops its list: nothing new starts there, steps already running144 finish, and the failure becomes the failure of the enclosing container (which may itself have `continueOnError` /145 `onError`) or of the run.146- `continueOnError: true`: dependents run and can read `steps.<id>.status` / `.error`.147- `onError: h`: `h` is a **handler-only** step (it never runs in the normal flow, must not have `needs`, must not be in a148 branch list). It runs with `error = {stepID, message, status, code}`. If it succeeds the failure counts as handled149 (dependents run); if it fails the original failure stands.150- `spec.onError` steps run after the workflow failed (not after cancel, timeout or budget stop), with the same `error`151 value and read access to top-level step results. They do not change the final status.152- Skips propagate: a step whose `needs` was skipped, or whose condition/switch did not select it, is skipped.153154### Retries155156A step is retried only when `retry.maxAttempts > 1`, the attempt ended `failed` or `timedOut` with a retryable cause,157**and** the step is idempotent (tool manifest `idempotent: true`; pure steps such as `verify`) or `retry.force: true`.158Otherwise a `retry` event says the step was not retried and why. Agents, `notify` (unless the manifest says otherwise) and159containers count as not idempotent. Delay before attempt *n+1* = `backoffSeconds × backoffMultiplier^(n−1)`, no jitter.160161## 3. Expressions162163Used in `when`, `if`, `while`, `switch`, `foreach`, `delay`, `transform`, `truthy` (the whole text is an expression, with164or without `${{ }}`) and, as `${{ … }}` interpolations, in every string of `with`, `inputs`, `set`, `output`, messages,165paths and case values.166167- A string that is exactly one `${{ … }}` yields the typed value; otherwise the results are concatenated into a string.168- `$${{` writes a literal `${{`.169- Interpolation is single-pass: text produced by an expression is data and is never scanned again.170171```172expr := or173or := and ("||" and)*174and := equality ("&&" equality)*175equality := compare (("==" | "!=") compare)*176compare := sum (("<" | "<=" | ">" | ">=") sum)*177sum := product (("+" | "-") product)*178product := unary (("*" | "/" | "%") unary)*179unary := ("!" | "-") unary | postfix180postfix := primary ("." name | "[" expr "]")*181primary := number | string | "true" | "false" | "null" | name | name "(" args ")" | "(" expr ")" | "[" exprs "]"182arg := expr | name "=>" expr | "(" name ("," name)* ")" "=>" expr183```184185Strings use single or double quotes with `\n \t \r \0 \\ \' \" \/ \uXXXX`. Lambdas exist only as function arguments.186There is no assignment, no statement, no object literal and no call on a value.187188**Names.** `params.x`, `vars.x`, `steps.<id>.output…`, `steps.<id>.status`, `steps.<id>.error`, `steps.<id>.attempts`,189`env.<NAME>` with NAME in `HOME USER TMPDIR DATE TIME DATETIME TIMESTAMP` (date values are fixed at run start), and the190loop variables in scope: the `as` name and `index` in `foreach`, `loop.index` in `while`, `error` in handlers. After191`steps.` a name may contain dashes (`steps.fetch-data.output`); put spaces around a binary minus there.192193**Semantics.** Missing properties and out-of-range indexes are `null`; unknown steps, parameters, `env` names and bare194names are errors. `+` adds numbers, concatenates lists, and concatenates as text when either side is a string. Integer195arithmetic stays integral and falls back to floating point on overflow; `/` yields an integer only when exact; division196by zero is an error. `==` compares structurally (`1 == 1.0`). `<` etc. compare numbers or strings. `&&`/`||`197short-circuit and return booleans. Truthiness: `null`, `false`, `0`, `""`, `[]`, `{}` are falsy.198199**Functions.**200201| Function | Result |202|---|---|203| `len(x)` | length of a string, list or object (`null` → 0) |204| `contains(x, y)` | substring, list member or object key |205| `startsWith(s, p)`, `endsWith(s, p)`, `lower(s)`, `upper(s)`, `trim(s)` | strings |206| `split(s, sep)`, `join(list, sep = ",")`, `replace(s, a, b)` | |207| `basename(p)`, `dirname(p)`, `extname(p)` (with the dot), `joinPath(a, b, …)` | lexical path helpers |208| `toJSON(v)`, `fromJSON(s)`, `number(v)`, `string(v)` | conversions |209| `default(a, b, …)` | first non-null |210| `keys(o)`, `values(o)` | sorted by key |211| `map(list, f)`, `filter(list, f)`, `count(list, f?)`, `sum(list, f?)` | `f` is `x => …`, `(x, i) => …` or a property path string |212| `reduce(list, (acc, x) => …, initial)` | |213| `first(list)`, `last(list)`, `slice(x, start, end?)` | negative indexes count from the end |214| `now()` | ISO 8601 UTC |215| `formatDate(value, pattern, timezone?)` | value = ISO 8601 string or Unix seconds; `DateFormatter` pattern |216| `secret("ref")` | the placeholder object `{"$secret": "ref"}` — never a value. The argument must be a literal |217218**Bounds.** Source ≤ 16 384 characters, nesting ≤ 64, ≤ 256 chained operators, ≤ 200 000 evaluation steps, strings ≤ 1 MiB, lists ≤ 100 000219elements. An evaluation error fails the step (`errorCode: expression`) and is reported in `WorkflowOutcome.diagnostics`220with the step id.221222## 4. YAML subset223224`WorkflowCodec.parse` reads this subset (JSON is inside it and goes through the same parser, so both report positions):225226- Block mappings and block sequences, including `- key: value` compact items and sequences at the indentation of their key.227- Flow sequences and mappings (`[a, b]`, `{a: 1}`), nested, possibly over several lines, with quoted keys.228- Plain, single-quoted (`''` escape) and double-quoted scalars (`\0 \a \b \t \n \v \f \r \e \" \/ \\ \N \_ \L \P \xXX229 \uXXXX \UXXXXXXXX`, surrogate pairs). Quoted scalars must end on the line where they start.230- Literal `|` and folded `>` block scalars with `-`/`+` chomping and an optional indentation digit.231- Comments (`# …` at the start of a line or after a space), blank lines, CRLF, one leading `---`.232- Plain scalar typing: `null`/`Null`/`NULL`/`~`/empty → null; `true`/`false` (three spellings) → booleans; decimal233 integers; decimals and exponents → numbers; `.inf`, `-.inf`, `.nan`. Everything else is a string: `yes`, `no`, `on`,234 `off`, `0x1F` and numbers with leading zeros (`007`) are strings. Mapping keys are always strings.235236Rejected with a positioned error: anchors and aliases (`&`, `*`), tags (`!`), merge keys (`<<`), several documents or237`...`, directives (`%YAML`), complex keys (`? `), tabs in indentation, multi-line plain or quoted scalars, duplicate keys,238single-pair mappings inside flow sequences, plain scalars starting with `@`, `` ` `` or `%`.239240### Canonical emission241242`WorkflowCodec.emit` is deterministic: fixed key order (the order of this document), two-space indentation, defaults243omitted, free-form objects (`with`, `variables`, …) sorted by key, lists of scalars in flow style when they fit in 80244characters, strings unquoted when that is unambiguous and double-quoted otherwise, multi-line text as `|` / `|-` blocks245when it can be read back exactly. `parse(emit(doc)) == doc` for every document and `emit(parse(text))` is idempotent246(property-tested). JSON emission uses the same key order; non-finite numbers become `null` there.247248The model does not keep comments or formatting. `WorkflowCodec.roundTripLoss(source:)` lists what rewriting the text from249the model would drop — comments (with lines), a leading `---`, shorthand forms that get normalised, non-canonical250formatting — so the UI can warn before a visual edit rewrites the code.251252## 5. Diagnostics253254`WorkflowDiagnostic {severity, code, message, line, column, stepID?, path}`. Parser and decoder diagnostics carry255positions; validator diagnostics carry a document path (`spec.steps[2].with.path`) that `WorkflowCodec.locate` or256`WorkflowCodec.diagnose` turns into a position.257258| Code | Severity | Meaning |259|---|---|---|260| `syntax` | error | YAML/JSON syntax |261| `type-mismatch`, `missing-field`, `unknown-field`, `conflicting-fields`, `invalid-value` | error | structure |262| `invalid-step-kind`, `invalid-assertion` | error | zero or several kind keys; malformed assertion |263| `unsupported-version`, `unsupported-kind` | error | |264| `invalid-id`, `duplicate-id`, `duplicate-parameter`, `duplicate-branch` | error | identifiers |265| `self-need`, `unknown-need`, `unknown-branch-step`, `dependency-cycle` | error | graph; the cycle path is reported |266| `unknown-tool`, `invalid-argument` | error | tool id; literal `with` values against the tool's `inputSchema` |267| `unknown-agent`, `invalid-model`, `unknown-workflow`, `recursive-subworkflow` | error | |268| `expression-syntax`, `unknown-function`, `unknown-name`, `env-not-allowed`, `missing-parameter` | error | expressions |269| `unknown-step-reference`, `step-not-upstream` | error | `steps.x` must be upstream (through `needs`, a gate, the container, or the previous loop iteration) |270| `unbounded-loop` | error / warning | `maxIterations` missing or < 1; constant condition or huge bound |271| `invalid-cron`, `invalid-timezone`, `invalid-trigger` | error | |272| `parameter-default-type` | error | |273| `invalid-permission-path`, `invalid-permission-host`, `invalid-permission-expression` | error | |274| `invalid-handler` | error / warning | bad `onError` target |275| `invalid-budget` | error | non-positive limits |276| `unreachable-step` | error / warning | needs a handler-only step; comes after an unconditional `fail`; constant condition |277| `permission-missing` | warning | a literal path, host, executable, runtime, app, secret or notification is not covered by `permissions` |278| `broad-permission` | warning | `/`, `~` or `*` |279| `retry-not-idempotent` | warning | the declared retry will not happen |280| `unset-variable`, `missing-objective`, `empty-workflow`, `empty-body`, `empty-branches`, `empty-verify`, `ambiguous-branch`, `duplicate-case`, `stale-layout` | warning | |281| `budget-missing-cost-limit`, `budget-timeout-exceeds-duration`, `budget-too-small` | warning | |282| `budget-unused`, `parameter-required-default` | info | |283284Permission sufficiency is a static, best-effort check on literal arguments (and `${{ params.x }}` substituted by its285default); the policy engine remains the authority at run time.286287## 6. Execution288289`WorkflowEngine` (actor) runs a document with injected `ToolInvoking`, `AgentRunning`, `RunEventSink`,290`WorkflowCheckpointStoring`, `SubworkflowLoading`, approval handler, agent-profile resolver and `WorkflowClock`.291292- **Concurrency.** Independent steps really run in parallel. `maxConcurrentSteps` (default 4) bounds leaf steps (tool293 calls, agents) across all nesting levels; `foreach.concurrency` bounds iterations.294- **Timeouts** use real time and cancel the running attempt. `delay`, retry backoff, timestamps and the between-steps295 duration check use the injected clock.296- **Budget.** `maxToolCalls` is checked before each tool call; cost and tokens are taken from agent outcomes;297 `maxDurationSeconds` is enforced by a watchdog and before each step. An agent receives what is left of the workflow298 budget. Tool calls and cost stop the run with `BUDGET_EXCEEDED`; duration with `TIMED_OUT`.299- **Approval.** An `approval` step asks the injected handler: approved → continue; denied → the step fails; unanswered300 (or no handler) → `WAITING_APPROVAL`, resumable from the checkpoint.301- **Dry run** (`options.dryRun`). A tool whose manifest has `supportsDryRun` is invoked with `dryRun: true`; any other tool302 is **not executed** and reported as `simulated: not executed`. Agents are not run, approvals not requested, delays not303 waited, `verify` not evaluated, a `while` body walked at most once, a `foreach` over unknown items not entered. Pure304 steps (`set`, `transform`, `if`, `switch`, `output`) are evaluated. `WorkflowOutcome.simulations` lists one line per305 simulated step; the status says how the simulation went, not how a real run would.306- **Cancellation** cancels the run's task tree (tools and agents see task cancellation) and releases every waiter.307- **Debugger.** `WorkflowRun.pause()`, `resume()`, `stepOver()`, `cancel()`, `setBreakpoints(_:)`, `variables()`,308 `setVariable(_:to:)`, `inspect(_:)`, `state`, `states()`. A paused run holds steps before they start; running steps309 finish. `stepOver` releases one waiting step.310- **Checkpoints** are saved when a step starts and when it finishes (a `checkpoint` event follows each finish).311 `resume(from:)` does not run completed steps again, re-enters containers where they stopped (`foreach` items and the312 `while` iteration are stored), re-runs a step that was mid-flight only if it is idempotent, and otherwise ends at once313 with `RECOVERY_REQUIRED` until the caller supplies `inFlightResolutions` (`.rerun` or `.markSucceeded(output:)`).314- **Subworkflows** run inline with their own parameters, variables and step namespace; nesting is limited by315 `maxSubworkflowDepth` (default 8).316- **Events.** `statusChanged`, `stepStarted`, `stepFinished`, `retry`, `verification`, `checkpoint`,317 `approvalRequested`/`approvalResolved`, `usage`, `log`, all with `stepID` where one applies.318319### Final status320321| Situation | `RunStatus` |322|---|---|323| every step succeeded or was skipped, every executed `verify` passed | `SUCCEEDED` |324| some step failed but was continued (`continueOnError`) or handled (`onError`) | `PARTIALLY_SUCCEEDED` |325| unhandled failure (tool `failed`, `denied`, `invalidInput`, `unsupported`; failed `verify`; `fail`; denied approval) | `FAILED` |326| tool `notApproved`, or unanswered approval step | `WAITING_APPROVAL` |327| tool `blockedPermission` | `BLOCKED_PERMISSION` |328| unhandled step timeout, or `maxDurationSeconds` exceeded | `TIMED_OUT` |329| `maxToolCalls`, `maxProviderCostUSD` or `maxTokens` exceeded | `BUDGET_EXCEEDED` |330| `cancel()` | `CANCELED` |331| non-idempotent step was mid-flight in the resumed checkpoint | `RECOVERY_REQUIRED` |332333Step instance keys identify repeated steps: `each[2]/copy` (foreach), `par(left)/a` (parallel), `poll#3/check` (while),334`call>/inner` (subworkflow), `!onError/alert` (workflow-level handler).335336## 7. Graph projection, edits and diff337338`WorkflowGraph(document:)` derives nodes and edges for the visual editor.339340- Node ids are step ids; triggers are `trigger:<index>`. Categories: `tool`, `agent`, `parallelism` (`parallel`), `logic`341 (`condition`, `switch`, `foreach`, `loop`, `transform`, `subworkflow`), `data` (`set`, `verify`), `control`342 (`approval`, `delay`, `fail`), `output` (`notify`, `output`), `error` (any `onError` target and every `spec.onError`343 step), `trigger`.344- Ports: `in`; `out`; `then`/`else`; `case:<i>`/`default`; `body` for containers; `error` when the step has `onError`.345- Edges: `dependency` (`needs`), `branch` (labelled), `error`, `trigger` (to root steps without `needs` that are neither346 gated nor handlers). Container membership is `parentID` + `branch`.347- Positions come from `spec.layout` when present, else from a deterministic layered layout348 (`WorkflowGraph.autoLayout`): layer = longest path inside the list, rows in document order, nested steps relative to349 their container, triggers in a column at negative x.350351`WorkflowEdit` operations return a new document or throw `WorkflowEditError`; none returns a structurally invalid352document: `addStep`, `removeStep`, `renameStep`, `connect`, `disconnect`, `moveNode`, `updateStep`, `setField`,353`duplicateStep`, `groupIntoParallel`, `wrapInForeach`, `reorder`.354355- `renameStep` rewrites `needs`, branch lists, `onError`, `collect`, `stepSucceeded`, the layout key and356 `steps.<old>` / `steps["old"]` references in every expression.357- `removeStep` removes structural references; expressions that still read the step are left for the validator.358- `groupIntoParallel` / `wrapInForeach` move steps into a container; expressions outside that read a moved step become359 `step-not-upstream` errors (read the container's output instead).360- Every edit round-trips through the code view (`parse(emit(doc)) == doc`, property-tested over random edit sequences).361362`WorkflowDiff.diff(old, new)` returns `WorkflowChange`s (steps matched by id; added, removed, modified with field names,363moved; metadata, triggers, parameters, permissions, budget, variables, `onError`, layout). `permissionsChanged` is the364change flagged `isSecurityRelevant`.365366## 8. Limitations367368- Triggers are data here; firing them is the scheduler's job.369- Step timeouts wait for the running tool to honour cancellation before the step is reported.370- The static permission check knows the argument names of the canonical tools only (`path`, `source`, `destination`,371 `paths`, `url`, `executable`, `bundleID`, `cwd`). `filesystem.move` is checked for read and write on the source and372 write on the destination, which is what the tool asks for.373- A subworkflow's own `permissions` and `budget` are not enforced separately: the calling run's budget and the policy374 engine apply.375- On resume the duration budget restarts from zero.376- Checkpoints hold the full result set; very large `foreach` runs make each save proportionally larger.377