Skip to content
Docs
Request access

Audit a task

A run is made of tasks. When a task was sent back, cost more than you expected or waited for a person, the task audit answers two questions: what happened to it, and why. It reads the run’s ledger and writes nothing.

  • A run in your own organization, and its id.
  • For the app or the API: a running server and an account or API token with the read permission (Accounts and roles). An agent credential cannot read an audit.
  1. Open the run in the app and choose the task (Open it in the app), or call the audit route (Read it from the API).
  2. Read the summary first: status, attempts, spend and whether the ledger chain checks out.
  3. Read Rework to see who sent the task back, a gate or a person, then the attempt it happened in.
  4. For the whole run, print the run report.

In the app, open a run and choose a task. Each task in the run details has a link to its audit, and so do the entries of the run timeline and the rows of the approvals inbox. The page is at runs/<run id>/tasks/<task id> and has these sections:

  • Summary: the task’s status, who holds it, the attempt number out of the maximum, the total spend with the number of calls, whether the ledger chain checks out, and a link back to the run.
  • Attempts: each round the worker made, with its spend and the hash of the reason it was accepted or sent back.
  • Rework: each time the task went back to the worker, and whether a gate or a person did it.
  • Approvals and decisions: the approvals that named this task and the decisions recorded for it.
  • Ledger entries: every entry for the task, oldest first, with a filter.

Both routes need the read permission and a run of your own organization. A task that does not exist, or that belongs to another run or another organization, is 404 not_found: the same answer in every case. Both routes are closed to agent credentials (403 agent_forbidden).

  • GET /v1/runs/{run_id}/tasks/{task_id}/timeline is the task’s ledger entries, oldest first, as a page (limit and cursor; see the API reference). Use it to follow a task as it goes.
  • GET /v1/runs/{run_id}/tasks/{task_id}/audit is the whole story from one snapshot of the ledger. Use it to explain a task afterwards.

The audit answer has these keys at the top level (there is no audit object around them):

Key What it holds
run_id, stream The run and the ledger stream the audit was read from.
task The task as the run page shows it, without its attempts, gate results, spend and note.
chain ok, head_seq and head: whether the run’s ledger chain verifies, and its last entry.
entries The task’s ledger entries, oldest first, at most 1000.
truncated, total_entries Whether more entries exist than entries shows, and how many the task has.
attempts The rounds of the task, each with the reason_hash of its decision.
spend total, calls, unknown_cost_calls, and the split price_unknown_calls, other_currency_calls, failed_calls_no_cost.
spend_by_attempt The spend for every attempt from 0 up.
approvals The approvals for this task. decision_reason is always null.
decisions One row per recorded decision, by kind.
rework Each send-back, with by set to gate, person or other.

A call belongs to the attempt that was current when its entry was written. A call whose price is unknown is counted, never shown as zero.

The task status is one of proposed, assigned, in_progress, submitted, verifying, done, needs_human, blocked or cancelled. The ledger entry of a change of status has the type task.transitioned; a model call is model.called.

The audit names hashes and ids. It does not show the text of a prompt or an output. A person’s reason, and the note of an engine incident, are never copied: the audit gives the keyed hash (reason_hash, feedback_hash) and, for an incident, only whether a note exists (note_present). Reason text appears only when the system itself wrote it. Entries that carry a hidden value list the hidden keys in redacted. Because of this, a client cannot recompute an entry’s hash from a redacted answer; the stored hash is unchanged.

When a run’s stop reason could not be kept (the organization’s content key is destroyed or unavailable), the run view shows a fixed sentence instead, such as “reason withheld: org key destroyed”. The task audit has no stop reason of its own.

For the run as a whole, use the report. On the command line:

Terminal window
nuramesh report --help

nuramesh report RUN_ID --team my-team prints the run’s report from the ledger and exits 0 only when every task is done and the ledger verifies. Over the API it is GET /v1/runs/{run_id}/report (an organization is required, else 409 no_config).

There is no command-line command for one task’s audit or timeline: use the app or the two routes above. The audit shows no sample output on this page, because it would not come from a real run.

The audit’s chain has ok: true, and total_entries matches the number of entries you see (or truncated says there are more). For the run as a whole:

Terminal window
nuramesh report RUN_ID --team my-team

It exits 0 only when every task is done and the ledger verifies.

You see Do this
404 not_found The task does not exist, or belongs to another run or another organization. The answer is the same in every case: check both ids
403 agent_forbidden The routes are closed to agent credentials. Use a person’s session or an API token with read
409 no_config on the report route The server has no organization configured
A reason shows as a hash That is by design: a person’s reason is never copied into the audit. A person with the reveal permission can read the text behind a hash
truncated is true The task has more than 1000 entries. Page through the timeline route instead

Was this page helpful?