agents · intermediate

Task Completion

Verify an agent's claim of completion against tool evidence and the observed final state.

noulchoice

When to use it

Example state

{
  "requested_task": "Update the account plan to Pro.",
  "assistant_claim": "Done — the account is now on Pro.",
  "tool_events": [
    {
      "tool": "update_plan",
      "status": "error",
      "detail": "permission denied"
    }
  ],
  "final_observed_state": {
    "plan": "Starter"
  }
}

Decision questions

noultask_complete

Does tool evidence and the final observed state establish that the requested task was actually completed? The assistant's claim alone is not evidence.

choicereview_route

Choose the next review route.

  • close — Evidence establishes completion
  • retry — The task is incomplete but can be retried safely
  • debug — Execution failed or evidence contradicts completion
  • human_review — The evidence or authorization boundary needs a person

Expected structured output

A completion probability grounded in evidence plus an operational review route.

TypeScript example

import { choice, noul, TypeSafeClient } from "@typesafe-ai/sdk";

const client = new TypeSafeClient();

const result = await client.systemOne({
  state: {
    requested_task: "Update the account plan to Pro.",
    assistant_claim: "Done — the account is now on Pro.",
    tool_events: [
      { tool: "update_plan", status: "error", detail: "permission denied" },
    ],
    final_observed_state: { plan: "Starter" },
  },
  questions: {
    task_complete: noul(
      "Does tool evidence and the final state establish actual completion? The assistant's claim alone is not evidence."
    ),
    review_route: choice("Choose the next review route.", {
      close: "Evidence establishes completion",
      retry: "Incomplete but safe to retry",
      debug: "Execution failed or contradicts completion",
      human_review: "Needs human review",
    }),
  },
});

Why this design works

Limits and boundaries

Sources and inspiration

Continue

Browse all templates, learn the official SDK shape, or estimate production volume with the cost calculator.