dispositions Command
The dispositions command shows, for each action, what occurred to each record that a workflow processed. The command reads the record_disposition table in the durable store. Use it to see quickly where records succeeded, failed or left the stream. Use it before you use retry.
agac dispositions -w <workflow-name> [options]
Options
| Option | Description |
|---|---|
-w, --workflow TEXT | The workflow name: the name of its configuration file, with no path or extension (required). -a names the same option. |
--sandbox | Read the output of sandbox runs (agac run --sandbox) in place of the output of real runs. See Sandbox Runs |
-A, --action TEXT | Show the dispositions for only the specified action |
--quarantined | Show only the failed, exhausted and unprocessed records, with details |
--json | Print the counts as one JSON document, for a script. See JSON Output. --json does not take --quarantined. If you give the two flags together, the command stops with exit code 2. See the error below this table |
--record ID | Follow one record through the workflow. ID is its source_guid. See Follow One Record. With --json, the command prints the trail as JSON. --record does not take --quarantined |
This is the error for --json with --quarantined:
Error: --json prints the counts, so it takes no --quarantined. 'agac records --snapshots' prints the failed and exhausted records as JSON.
Output
The output has one row for each action, with a count for each disposition:
Dispositions: my_workflow
┃ Action ┃ Success ┃ Failed checks ┃ Failed ┃ Exhausted ┃ Guard skipped ┃ Unprocessed ┃ Passthrough ┃ Filtered ┃ Total ┃ Records ┃
│ extract │ 25 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 25 │ 25 │
│ rewrite │ 4 │ 0 │ 0 │ 0 │ 21 │ 0 │ 0 │ 0 │ 25 │ 25 │
│ split │ 1 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 1 │ 5 │
The command prints the table at its full width. In a narrower terminal, the lines of the table wrap. The command does not cut a count or an action name short.
| Disposition | Meaning |
|---|---|
| Success | The action processed the record |
| Failed checks | The action processed the record and sent it on with a failing expectations verdict. on_exhausted: return_last and repair: none send the record on in this way. The store keeps it as success with reason expectations_failed. It is not a failure. Nothing that reads it is blocked, and agac retry does not run it again. The summary counts it separately from Success, so that the columns still add up to Total |
| Failed | The processing of the record failed |
| Exhausted | The record failed and no retries remain for it |
| Guard skipped | The guard of the action skipped the record, and the record continues downstream with no change. The store keeps it as unprocessed (see below) |
| Unprocessed | The action never answered the record, for any other reason. An example is an upstream failure that cascaded |
| Passthrough | The model or the tool gave no answer, and on_empty: skip kept the record as a tombstone |
| Filtered | The action removed the record from the stream |
| Sent elsewhere | The guard of the action sent the record to another branch. The store keeps it as filtered with reason sent_elsewhere. The record was never the action's, so it is not in Filtered or Total. The table shows this column only when an action sent a record elsewhere, as the first action of each branch of a router does. --json always has this count, as sent_elsewhere. |
In the two run modes, the store keeps a guard skip as unprocessed. The reason is guard_skip.
For an action of granularity: file, the reason is guard_prefilter_skip.
In rare cases, a batch path writes an unprocessed row with no reason of its own. That row gets the reason guard_filter.
The disposition unprocessed keeps the record open. Thus, when the guard lets the record pass again, the action sends it to the model.
A terminal disposition would keep the tombstone permanently.
The summary counts the guard skip rows under Guard skipped, and the other unprocessed rows under Unprocessed. Thus the columns still add up to Total.
--quarantined does not separate guard skips. It lists them as unprocessed rows, and the Reason column shows guard_skip, guard_prefilter_skip or guard_filter.
Total and Records Can Differ
A disposition names the record that it accounts for. Total counts those rows.
Records counts the records that the store currently keeps under the action. For an
action that changes one record into one record, the two counts match. For other actions, the two counts can differ, and this difference is correct.
An action that merges records into one record shows more dispositions than records.
Each input that the action consumed has a disposition, although only one output contains
the inputs. Each input that the action consumed and that has no row of its own shows
reason=consumed_into_output. A FILE action that makes many records from one record also shows more dispositions.
The reason is that the action gives a new identity to each new row. The dispositions count these rows next to the inputs that made
them. Neither case is data loss.
For the same reason, retry
operates on inputs. To retry a record is to run the failed input again.
Records counts each record that the store keeps under the action. This count is not the same as
the number of records that the action produced successfully. The output of the action keeps a placeholder for each record that failed, or that a guard skip or a cascade skip
skipped. The placeholder lets downstream
actions still see the record. Records counts these placeholders. The rewrite
row above shows this: 4 successes and 21 guard skips, Records 25. The run line gives the
same data: ✓ rewrite 25 records in 1.2s — 21 skipped by guard. Thus a high
Records count alone does not prove that the action worked. Compare it with
the Failed checks, Failed, Guard skipped, Unprocessed and Passthrough columns. For
the details, use --quarantined.
Records also reads what is in the store now, not only the output of this run.
A second run of a workflow can use input files with different names. The records of the earlier
run then stay in the store. Records counts them too. agac run --fresh clears them. A
? means that the command could not read the count at all. A ? is not the same as zero.
An action with an action-level row shows in a second table, with the title Action-level state. An example is an action that halted after it used all its retries.
After the table, a hint tells you that agac run does not run a halted action again.
To resume a halted action, use agac retry. To start it again from the beginning, use agac run --fresh.
JSON Output
--json prints one JSON document on stdout, and nothing else. Warnings and progress lines go to stderr. Read the counts from this document. Do not read them from the lines of the table: the columns and the box characters of the table can change.
agac dispositions -w my_workflow --json
{
"workflow": "my_workflow",
"actions": [
{
"name": "extract",
"counts": {
"success": 120,
"failed_checks": 0,
"failed": 2,
"exhausted": 1,
"guard_skipped": 0,
"unprocessed": 0,
"passthrough": 0,
"filtered": 0,
"skipped": 0,
"deferred": 0
},
"total": 123,
"sent_elsewhere": 0,
"records": 123,
"action_level": []
}
]
}
The shape is stable. A later release can add a key, but it does not rename or remove one.
| Key | Value |
|---|---|
workflow | The workflow name |
actions | One object for each action, in execution order. The list has each action of the workflow, also an action with no disposition. With --action, the list has only that action |
actions[].name | The action name |
actions[].counts | The number of records for each count. The object always has each of the ten keys, with 0 for a count that has no record. The first eight keys are the columns of the table, in snake_case, with the same numbers. skipped and deferred are the two other dispositions that the store can keep for a record. The table has no column for them, but Total counts them. A deferred record waits for the result of a batch or for a review |
actions[].total | The Total column. It is the sum of the ten counts |
actions[].sent_elsewhere | The Sent elsewhere column: the records that the guard of the action sent to another branch. The key is always there, with 0 for an action that sent no record elsewhere, also when the table shows no such column. These records are not in counts or total |
actions[].records | The Records column. It is null where the table shows ? |
actions[].action_level | The rows of the Action-level state table for this action, or an empty list. Each row has state (the disposition, for example failed), halted (true when the action halted after it used all its retries) and reason |
For an action, the sum of failed and exhausted is the Records to retry value of agac retry --dry-run. This is true when the retry starts from that action and has no --record. There is one exception. If a retry stopped before its end, the dry run also counts the failures that the next retry restores. The store does not hold those failures yet. A failure in action_level is a failure of the action as a whole, not of a record. Thus the counts do not include it. agac retry --dry-run shows it on its Action status line.
This example counts the open failures of a workflow:
agac dispositions -w my_workflow --json | jq '[.actions[].counts | .failed + .exhausted] | add'
Examples
Full Workflow Overview
agac dispositions -w my_workflow
One Action Only
agac dispositions -w my_workflow --action extract_facts
Inspect Stuck Records
--quarantined lists each failed, exhausted or unprocessed record. For each record, it gives the action, the record ID, the disposition and the reason. Use this list to decide what to retry:
agac dispositions -w my_workflow --quarantined
retry operates on the failed and exhausted records. The list gives each unprocessed record with the
reason that no answer reached it. The reason tells you where to look. The reasons are:
- An upstream failure (
upstream_unprocessed) - A guard skip (
guard_skip) - A
granularity: filetool did not include the record (tool_missing_record) - A
granularity: filetool merged the record into the row of a different record (consumed_into_another_record)
When no record is stuck, the command reports No quarantined records found.
Follow One Record
--record shows what occurred to one record at each action, in run order. Use it to find why a record is not in the output of an action:
agac dispositions -w my_workflow --record 779f2584-0348-5abc-b217-4e9dc61bdbd1
┃ Action ┃ Disposition ┃ Reason ┃ Guard ┃
│ read │ success │ │ │
│ classify │ filtered │ guard_filter │ read.is_spam == false │
│ score │ — not reached │ │ │
│ reply │ — not reached │ │ │
For each action, the row gives the disposition of the record and its reason:
guard_skipped,filteredorsent_elsewhere: a guard stopped the record or sent it to a different branch. The Guard column shows the guard condition.failed_checks: the record continued with a verdict that did not pass.— not reached: the action has no row for the record. The run did not get to the action, or the record went down a different branch.
To get the record IDs, run agac records -w my_workflow --field source_guid. To see what each action stored for the record, run agac records -w my_workflow --source-guid <ID>.
With --json, the command prints the trail:
{
"workflow": "my_workflow",
"record": "779f2584-0348-5abc-b217-4e9dc61bdbd1",
"reached": 2,
"last": "classify",
"actions": [
{"name": "classify", "disposition": "filtered", "reason": "guard_filter", "detail": null, "guard": "read.is_spam == false"}
]
}
reached is the number of actions that have a row for the record. last is the last of those actions in run order. In actions, disposition is null for an action that has no row for the record.
Errors
| Message | Cause |
|---|---|
No store for workflow '<name>' at <path>. Has it been run? | The workflow did not run. Thus it has no store. The command exits 1 and creates no store. With --json, stdout is empty: the message goes to stderr. With --sandbox, <path> is the sandbox store, agent_io/store/<name>.sandbox.db. |
--json prints the counts, so it takes no --quarantined. ... | You gave --json with --quarantined. The command exits 2. |
--record follows one record, so it takes no --quarantined. | You gave --record with --quarantined. The command exits 2. |
No action of '<name>' holds a disposition for record '<ID>'. ... | No action has a row for the ID. Make sure that the ID is a source_guid. The command exits 1. |
You can run this command from any subdirectory in your project.