Cookbook 15 · Aria — Autonomous
Aria: Triage & Recalibrate Loop
One sentence about weak runs → a three-step plan creates a review queue, enqueues 12 flagged traces and parks on a real calibration job that settles on its own.
Aria — AutonomousAria20–35 min
What you build. On a workflow, agent and flagged traces that already exist (created first by
assets/setup_subject.py and assets/seed_traces.py), Aria draws review_queue.create, review_queue.add_items and workflow.calibrate from one sentence. You answer six questions (a form and an approval per step); the last approval queues a real calibration job and the plan parks (running, step waiting job). The plan worker resumes it with no click and the plan ends where the job ended, while a reviewer triages the 12 flagged traces in Review Queues.
Surfaces: Plans Review Queues Workflows Observability
What you learn
- Plan a remediation loop from one intent: it operates on existing ids (trace ids, workflow id, registered agent id), Aria creates neither the traces nor the workflow
- Wire and answer the forms: the enqueue step's only wired input is the queue id; enter the 12 trace ids from Observability or
seed_traces.py, and the workflow and agent ids fromsetup_subject.py - Watch an async step park and resume: approving
workflow.calibrateleaves the planrunningwith the stepwaiting job; the page re-reads every five seconds and a parked plan cannot be cancelled (409) - Triage flagged runs in Operate > Review Queues (
resolution_correct,failure_mode,severity,expected_answer); answers land on the trace as assessments, the expected answer as its expectation - See the refusals: an unknown workflow, unregistered agent or workflow with no deploy-gate test set fails the step at once without queueing a job, and a denied calibration queues nothing
Implementation flow
flowchart LR SU["setup_subject.py + seed_traces.py"] --> I[/"Intent: weak runs, queue + calibrate"/] I --> D["Plans: Decompose goal (rules planner)"] D --> Q["review_queue.create: form + Approve"] Q --> E["review_queue.add_items: 12 trace ids"] E --> C["workflow.calibrate: workflow id + agent id + Approve"] C --> P["Plan parks: running, waiting job"] P --> W["Plan worker polls the job"] W --> R["Plan mirrors the job: job rejected, plan failed here"] Q --> RQ["Review Queues: triage 3 of 12"]
Step-by-step UI only
Each step shows the exact navigation path, the fields to fill, the button to click, and a snapshot of the CALIBER screen you'll be on.
- Before you start: the server needs
CALIBER_FEATURE_ARIA=true(Aria and Plans ship on by default; this matters only if your deployment set it tofalse) and its background workers. This loop remediates things that already exist, so first runassets/setup_subject.py(it prints aworkflow_idand anagent_id) andassets/seed_traces.py(it prints the 12 flagged trace ids). In the sidebar open Operate and click Plans. Paste the canonical sentence from intent.md into Goal, set Autonomy to Stop before each change and press Decompose goal.Fill inGoal Our workflow's recent runs look weak - set up a review queue for the flagged traces and kick off a workflow calibration. Autonomy Stop before each change Click Decompose goalYou'll see: The plan opens with the statusdraft.Screen snapshotcaliber · Operate › PlansDecompose goal - Read Plan steps. Aria drew three steps:
review_queue.create,review_queue.add_items(depends on 1 prior step(s)) andworkflow.calibrate(it depends on nothing). Nothing has run. Compare with expected-plan.json.You'll see: Three pending steps.Screen snapshotcaliber · Operate › Plans › (draft plan)Read / inspect this surface — no form to fill. Operate › Plans › (draft plan)creates · Approved planPress Approve plan.Click Approve planYou'll see: The status becomesapprovedand an Execute button appears.Screen snapshotcaliber · Operate › Plans › (draft plan)Approve plan- Press Execute. Aria stops on Aria needs information (Provide the required inputs for step 1: Create review queue.). Fill name, description, questions and reviewers (JSON arrays) from triage-review.queue.json, press Continue plan, then Approve Approve step 1: Create review queue (review_queue.create)?.Fill in
name weak-runs-triage questions [{"key":"resolution_correct","title":"Did the workflow reach the correct resolution?","type":"pass_fail",...}, ...] reviewers ["olga"] Click ApproveYou'll see: The queue step reads done.Screen snapshotcaliber · Operate › Plans › (approved plan)Approve - Provide the required inputs for step 2: Enqueue traces for review. There is no queue id field: it is wired from the first step. Fill trace ids with a JSON array of the 12 ids
seed_traces.pyprinted and assigned to, press Continue plan, then Approve.Fill intrace ids ["tr-...", ...] assigned to admin Click ApproveYou'll see: The enqueue step reads done.Screen snapshotcaliber · Operate › Plans › (running plan)Approve - Provide the required inputs for step 3: Calibrate workflow. Fill workflow id and agent id with the ids
setup_subject.pyprinted (calibrate.json), press Continue plan, then Approve Approve step 3: Calibrate workflow (workflow.calibrate)?. Approving enqueues a real calibration job.Fill inworkflow id WF-... agent id cookbook-15-agent-... Click ApproveYou'll see: The plan header readsrunningand the step waiting job; there is nothing to answer. The plan is parked on the job.Screen snapshotcaliber · Operate › Plans › (running plan)Approve Operate › Plans › (running plan)creates · Plan settled by itself, ending where the job endedDo not click anything. The page re-reads a running plan every five seconds, and the plan worker resumes it when the job finishes (about half a minute).You'll see: On the simulated stack the status becomesfailed: steps 1 and 2 done, step 3 failed withrejected: workflow calibration rejected: no candidate met calibration gates; quality delta +0.000 < epsilon 0.02(a fake executor cannot make a candidate beat the baseline). With a real model the job can reachcandidate_readyand the plan readscompleted.Screen snapshotcaliber · Operate › Plans › (running plan)Read / inspect this surface — no form to fill.Operate › Review Queuescreates · Queue with 12 flagged tracesOpen Review Queues.You'll see: A rowweak-runs-triagewith 4 questions, the reviewerolgaand0/12 reviewed.Screen snapshotcaliber · Operate › Review QueuesRead / inspect this surface — no form to fill.- Open the queue (Items (12)) and pick the trace of
S19. Answer from support-runs.jsonl: Fail for Did the workflow reach the correct resolution?,missing_evidencefor Primary failure mode,3for Severity (1-5), and the reference answer for What should the answer have been?. Press Submit review.Click Submit reviewYou'll see: The trace reads completed and the list row reads1/12 reviewed. The answers are assessments on the trace; the expected answer is its expectation.Screen snapshotcaliber · Operate › Review Queues › (queue)Submit review Operate › Planscreates · Calibration step fails at onceStateCalibrate the support workflow., press Decompose goal, Approve plan, Execute, fill workflow id withWF-does-not-existand any agent id, and press Continue plan.Click Continue planYou'll see: The plan readsfailedat once; the step showsworkflow 'WF-does-not-exist' not found (HTTP 404)and does not read waiting job: no job was queued.Screen snapshotcaliber · Operate › PlansContinue planOperate › Planscreates · A denied calibration queues nothingState the same sentence under Stop before each change, approve and execute, fill the two real ids, press Continue plan, and at Approve step 1: Calibrate workflow (workflow.calibrate)? press Deny.Click DenyYou'll see: The plan readscompletedand the step skipped; no job was queued.Screen snapshotcaliber · Operate › PlansDeny
Assets (copy-paste)
The exact files this cookbook uses — copy each into the matching field. Source: docs-site/cookbooks/15-aria-triage-recalibrate-loop/assets/.
# The intent you give Aria
## Canonical (works with the default planner)
> Our workflow's recent runs look weak - set up a review queue for the flagged traces and kick off a workflow calibration.
Why this wording: the default planner proposes a step for each capability whose
**domain word** appears in the goal. "review queue" gives `review_queue.create` **and**
`review_queue.add_items` (same domain); "workflow" gives `workflow.calibrate`. Keep both in
the sentence.
Autonomy: **Stop before each change** (`ask_each`: an **Approve** / **Deny** prompt before
every step that changes something, after the input form).
## This loop remediates things that already exist
`review_queue.add_items` needs trace ids that exist, and `workflow.calibrate` needs a workflow
and an agent that exist. Aria creates neither: it does not discover traces, and it cannot
build a workflow (`Create a new workflow for returns.` plans a *calibration*, not a workflow).
`setup_subject.py` creates the lab's subject (two tools, a published workflow with its test
set as the deploy gate, an agent) and `seed_traces.py` writes the flagged traces; in a real
deployment they are yours.
## What the planner does with other sentences
`dataset/goals.jsonl` holds 28 goals and the plan the server draws for each one; the script
checks all 28 against the real server. In short:
- Any sentence with `review queue` plans both the queue and its enqueue step; any with
`workflow` plans a calibration, whatever the sentence is about (`We are in the middle of a
workflow outage.` plans one). Both can appear in one plan, always in the order queue, enqueue,
calibrate.
- "pipeline", "tune", "human review", "get a human to look" and "re-run the evaluation" are
not domain words: `Tune the pipeline and get a human to look at the bad runs.` plans nothing.
There is no language model behind the planner.
- It does not read negation (`Do not calibrate the workflow, only set up the review queue.`
still plans the calibration), questions, "rebuild" or "roll back": there is no capability
for those, and the word `workflow` still plans a calibration.
- A sentence with no domain word makes a plan with no steps; it cannot be approved
(HTTP 409).
#!/usr/bin/env python3
"""Create the things lab 15 remediates: the tools, a published workflow, its test set and an agent.
Aria's plan in this lab does not create any of them (``workflow.calibrate`` takes an *existing*
workflow and agent), so a fresh stack needs them first. In a real deployment they are your own.
This registers the two tools (``lookup_policy``, ``get_order``; one that is already registered is
kept), loads the 30 cases of ``dataset/support-runs.jsonl`` into a test set, imports and publishes
``workflows/support-policy-agent.workflow.json`` with that test set as its deploy gate, and
registers an agent. Every name carries ``--suffix`` so a second run does not collide with the first.
export CALIBER_BASE_URL=http://127.0.0.1:5001 # the server root
export CALIBER_TOKEN=calpat_... # an admin token (or CALIBER_USER / CALIBER_PASSWORD)
PYTHONPATH=sdk/caliber-sdk caliber/.venv/bin/python \
docs-site/cookbooks/15-aria-triage-recalibrate-loop/assets/setup_subject.py --suffix demo
Prints ``{"workflow_id", "agent_id", "dataset_id", "workflow_name", "gate_name", "tools"}`` as JSON.
"""
from __future__ import annotations
import argparse
import json
import os
import sys
import time
from pathlib import Path
from typing import Any
ASSETS = Path(__file__).resolve().parent
NAME_PREFIX = "cookbook-15-"
def register_tools(caliber: Any, assets: Path = ASSETS) -> list[str]:
"""Register the lab's tools; one already registered with the same name and version is kept."""
existing = {(tool.name, tool.version) for tool in caliber.tools.list()}
registered: list[str] = []
for path in sorted((assets / "tools").glob("*.tool.json")):
spec = json.loads(path.read_text(encoding="utf-8"))
spec.pop("notes", None)
name, version = spec.pop("name"), spec.pop("version")
if (name, version) not in existing:
caliber.tools.register(
name,
version=version,
module_path=spec.pop("module_path"),
callable_name=spec.pop("callable_name"),
**spec,
)
registered.append(name)
return registered
def setup(caliber: Any, suffix: str, assets: Path = ASSETS) -> dict[str, Any]:
"""Create the subject and return its ids and names."""
owner = caliber.me.get().user_id
tools = register_tools(caliber, assets)
runs = [
json.loads(line)
for line in (assets / "dataset/support-runs.jsonl").read_text("utf-8").splitlines()
if line.strip()
]
gate_name = f"{NAME_PREFIX}support-policy-gate-{suffix}"
gate = caliber.eval_datasets.create(
gate_name, owner=owner, description="Support questions with the tools each one needs."
)
for row in runs:
caliber.eval_datasets.add_example(
gate.dataset_id,
input={"input": row["question"]},
expected={
"expected": row["reference"],
"contains": row["contains"],
"required_tools": row["required_tools"],
},
tags=["weak" if row["weak"] else "ok"],
)
manifest = json.loads(
(assets / "workflows/support-policy-agent.workflow.json").read_text(encoding="utf-8")
)
manifest["artifacts"]["eval_datasets"]["support_eval"]["dataset_name"] = gate_name
workflow_name = f"{NAME_PREFIX}support-policy-agent-{suffix}"
workflow = caliber.workflows.import_workflow(manifest=manifest, name=workflow_name)
version = caliber.workflows.versions.list(workflow.workflow_id)[0]
caliber.workflows.versions.publish(version.version_id)
agent_id = f"{NAME_PREFIX}agent-{suffix}"
caliber.agents.create(agent_id, experiment_id=f"exp-{agent_id}", name="support policy agent")
return {
"workflow_id": workflow.workflow_id,
"workflow_name": workflow_name,
"version_id": version.version_id,
"agent_id": agent_id,
"dataset_id": gate.dataset_id,
"gate_name": gate_name,
"tools": tools,
}
def _client() -> Any:
from caliber_sdk import CaliberClient
base = os.environ["CALIBER_BASE_URL"]
token = os.environ.get("CALIBER_TOKEN")
if not token:
import httpx
response = httpx.post(
f"{base.rstrip('/')}/ajax-api/2.0/mlflow/caliber/auth/login",
json={
"user_id": os.environ.get("CALIBER_USER", "admin"),
"password": os.environ.get("CALIBER_PASSWORD", "admin"),
},
timeout=30,
)
response.raise_for_status()
token = response.cookies["caliber_session"]
return CaliberClient(base, token=token)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__.split("\n", 1)[0])
parser.add_argument("--suffix", default=time.strftime("%Y%m%d-%H%M%S"))
args = parser.parse_args()
with _client() as client:
json.dump(setup(client, args.suffix), sys.stdout, indent=2)
sys.stdout.write("\n")
#!/usr/bin/env python3
"""Record the 12 weak support runs as MLflow traces, so a review queue can hold them.
In a real deployment these traces are produced by your workflow and flagged by a person, a metric or
a guardrail. A fresh checkout has none, and Operate > Review Queues works on traces, so this script
writes one trace per *weak* row of ``dataset/support-runs.jsonl``: the request is the customer's
question, the response is the reply the agent gave, and the tags say which run it is
(``cookbook15.row``, S19..S30) and what went wrong (``cookbook15.failure_mode`` and
``cookbook15.reason``). The runs the agent got right are not written: nobody flags them.
Needs the ``mlflow`` package and ``MLFLOW_TRACKING_URI`` (the MLflow server CALIBER uses).
Prints a JSON map ``{"S19": "<trace_id>", ...}`` on stdout. Every run writes 12 new traces, so run
it once per environment.
MLFLOW_TRACKING_URI=http://127.0.0.1:5000 \
python docs-site/cookbooks/15-aria-triage-recalibrate-loop/assets/seed_traces.py > traces.json
"""
from __future__ import annotations
import json
import sys
from pathlib import Path
DATASET = Path(__file__).resolve().parent / "dataset" / "support-runs.jsonl"
EXPERIMENT = "cookbook-15-weak-support-runs"
def seed(dataset: Path = DATASET) -> dict[str, str]:
"""Write one trace per weak row and return ``{row id: trace id}``."""
import mlflow
mlflow.set_experiment(EXPERIMENT)
trace_ids: dict[str, str] = {}
for line in dataset.read_text(encoding="utf-8").splitlines():
if not line.strip():
continue
row = json.loads(line)
if not row["weak"]:
continue
with mlflow.start_span(name="support-policy-agent", span_type="CHAIN") as span:
span.set_inputs({"question": row["question"]})
span.set_outputs(row["reply"])
trace_id = span.trace_id
mlflow.set_trace_tag(trace_id, "cookbook15.row", row["id"])
mlflow.set_trace_tag(trace_id, "cookbook15.failure_mode", row["reason"].split(":", 1)[0])
mlflow.set_trace_tag(trace_id, "cookbook15.reason", row["reason"])
trace_ids[row["id"]] = trace_id
mlflow.flush_trace_async_logging()
return trace_ids
if __name__ == "__main__":
json.dump(seed(), sys.stdout, indent=2)
sys.stdout.write("\n")
{
"goal": "Our workflow's recent runs look weak - set up a review queue for the flagged traces and kick off a workflow calibration.",
"autonomy": "ask_each",
"expected_steps": [
{
"capability_key": "review_queue.create",
"tier": "mutate",
"interaction": "input form (Aria needs information): enter name, description, reviewers and questions from review-queues/triage-review.queue.json, then Approve"
},
{
"capability_key": "review_queue.add_items",
"tier": "mutate",
"interaction": "input form: enter the flagged trace_ids (from seed_traces.py) and optionally assigned_to (enqueue.json); queue_id is wired from review_queue.create and is not asked for. Then Approve"
},
{
"capability_key": "workflow.calibrate",
"tier": "mutate",
"async": true,
"interaction": "input form: enter an existing workflow_id and agent_id (from setup_subject.py; see calibrate.json), then Approve. Approving enqueues a refinement job and the plan PARKS (status running, step waiting_job) until the plan worker, or POST /aria/plans/{id}/poll, sees the job finish"
}
],
"notes": "review_queue.add_items depends on review_queue.create (its queue_id is wired); workflow.calibrate depends on nothing. add_items and calibrate operate on EXISTING ids (traces, workflow, agent): Aria does not create them. The calibration job ends candidate_ready or applied (the plan completes), or rejected / failed / error (the plan fails with the job's reason). On a simulated deployment the job is rejected: the fake executor gives a candidate the same outputs as the baseline, so the quality gain (+0.000) is below the 0.02 it must clear."
}
{
"name": "weak-runs-triage",
"description": "Human triage of weak support runs: was the resolution correct, what failed, how severe, and what the answer should have been.",
"reviewers": [
"olga"
],
"questions": [
{
"key": "resolution_correct",
"title": "Did the workflow reach the correct resolution?",
"type": "pass_fail",
"required": true,
"target": "feedback"
},
{
"key": "failure_mode",
"title": "Primary failure mode",
"type": "categorical",
"options": [
"wrong_tool",
"missing_evidence",
"hallucinated_claim",
"bad_escalation",
"none"
],
"required": true,
"target": "feedback"
},
{
"key": "severity",
"title": "Severity (1-5)",
"type": "numeric",
"required": false,
"target": "feedback"
},
{
"key": "expected_answer",
"title": "What should the answer have been? (becomes the expectation)",
"type": "text",
"required": false,
"target": "expectation"
}
],
"notes": "Inputs for the Aria review_queue.create step (the same shape as POST /review-queues). In the plan's form, questions and reviewers are JSON arrays. 'target: expectation' writes the reviewer's answer back onto the trace as ground truth; 'target: feedback' logs it as an assessment. The failure_mode options are the ones the lab's weak runs use (see dataset/support-runs.jsonl). Strip this notes key before posting the file as inputs."
}
{
"trace_ids": [
"<trace id of S19 from seed_traces.py>",
"<trace id of S20 from seed_traces.py>"
],
"assigned_to": "admin",
"notes": "Inputs for the Aria review_queue.add_items step (the queue's id is wired from the create step and is not asked for). trace_ids is a JSON array of ids that exist in MLflow: Aria does not discover traces and the enqueue does not check that an id exists (a made-up id is queued, and fails later when a reviewer submits it). seed_traces.py writes the 12 weak runs of dataset/support-runs.jsonl and prints their ids. assigned_to is optional. Strip this notes key before posting the file as inputs."
}
{
"workflow_id": "<id printed by setup_subject.py: an existing, published workflow with a deploy-gate test set>",
"agent_id": "<id printed by setup_subject.py: a registered, enabled agent>",
"notes": "Inputs for the Aria workflow.calibrate step (the same two fields as POST /workflows/{workflow_id}/calibration/runs {agent_id}). This is the only ASYNC capability: approving it enqueues a real refinement job and the plan PARKS in waiting_job (the plan stays running). The plan worker, or POST /aria/plans/{plan_id}/poll, resolves the job: candidate_ready or applied finishes the step (the plan completes), rejected, failed or error fails it with the job's reason. Aria passes only these two fields, so the calibration uses the default objective (maximize quality, the candidate must beat the baseline by 0.02) and the default budget (20 test set cases, 3 candidates). A workflow with no deploy-gate test set, an unknown workflow or an unregistered agent fails the step at once. Replace the placeholders with ids that exist: setup_subject.py creates a workflow and an agent for the lab."
}
{"id": "S01", "question": "What is your refund policy?", "reply": "Purchases can be returned within 30 days of delivery for a full refund, in the original packaging.", "tools_called": ["lookup_policy"], "required_tools": ["lookup_policy"], "reference": "Returns are accepted within 30 days of delivery for a full refund in the original packaging.", "contains": "30 days", "weak": false, "reason": ""}
{"id": "S02", "question": "Where is my order 4412?", "reply": "Order 4412 shipped on Tuesday and is due on Friday.", "tools_called": ["get_order"], "required_tools": ["get_order"], "reference": "Order 4412 shipped Tuesday and is due Friday.", "contains": "Friday", "weak": false, "reason": ""}
{"id": "S03", "question": "Can I return a laptop I bought 20 days ago?", "reply": "Yes. Laptops can be returned within 30 days of delivery, so day 20 is inside the window.", "tools_called": ["lookup_policy"], "required_tools": ["lookup_policy"], "reference": "Yes, laptops can be returned within 30 days of delivery.", "contains": "30 days", "weak": false, "reason": ""}
{"id": "S04", "question": "How long is the warranty on the X200 headphones?", "reply": "Audio products have a 12-month limited warranty covering manufacturing defects.", "tools_called": ["lookup_policy"], "required_tools": ["lookup_policy"], "reference": "The X200 has a 12-month limited warranty for manufacturing defects.", "contains": "12", "weak": false, "reason": ""}
{"id": "S05", "question": "Order 8890 arrived broken. Can I send it back?", "reply": "Order 8890 was delivered yesterday, so it is inside the 60-day window for damaged items. Send it back at no cost and attach photos of the damage.", "tools_called": ["get_order", "lookup_policy"], "required_tools": ["get_order", "lookup_policy"], "reference": "Damaged items can be returned at no cost within 60 days of delivery; photos speed up approval.", "contains": "60 days", "weak": false, "reason": ""}
{"id": "S06", "question": "Do you ship to Canada?", "reply": "We currently ship to the United States and its territories only.", "tools_called": ["lookup_policy"], "required_tools": ["lookup_policy"], "reference": "No. We ship to the United States and its territories only.", "contains": "United States", "weak": false, "reason": ""}
{"id": "S07", "question": "Has order 7301 been delivered?", "reply": "Order 7301 was delivered on Monday at 14:12.", "tools_called": ["get_order"], "required_tools": ["get_order"], "reference": "Order 7301 was delivered Monday.", "contains": "Monday", "weak": false, "reason": ""}
{"id": "S08", "question": "Can I get a refund on a gift card?", "reply": "No. Gift cards are non-refundable and cannot be exchanged for cash.", "tools_called": ["lookup_policy"], "required_tools": ["lookup_policy"], "reference": "Gift cards are non-refundable.", "contains": "gift card", "weak": false, "reason": ""}
{"id": "S09", "question": "Is shipping free over 50 dollars?", "reply": "Yes. Orders over 50 USD ship free with standard shipping.", "tools_called": ["lookup_policy"], "required_tools": ["lookup_policy"], "reference": "Orders over 50 USD ship free with standard shipping.", "contains": "free", "weak": false, "reason": ""}
{"id": "S10", "question": "Hi there!", "reply": "Hello! How can I help you today?", "tools_called": [], "required_tools": [], "reference": "A short greeting.", "contains": "help", "weak": false, "reason": ""}
{"id": "S11", "question": "What is the status of order 1156 and can I still cancel it?", "reply": "Order 1156 has not shipped yet. Orders can be cancelled until they ship, so I can cancel it for you now.", "tools_called": ["get_order", "lookup_policy"], "required_tools": ["get_order", "lookup_policy"], "reference": "Order 1156 has not shipped; unshipped orders can be cancelled.", "contains": "cancel", "weak": false, "reason": ""}
{"id": "S12", "question": "Is the charger covered by warranty?", "reply": "Cables and chargers have a 24-month limited warranty.", "tools_called": ["lookup_policy"], "required_tools": ["lookup_policy"], "reference": "Chargers have a 24-month limited warranty.", "contains": "24", "weak": false, "reason": ""}
{"id": "S13", "question": "How long do refunds take?", "reply": "Refunds go to the original payment method within 5 business days of us receiving the return.", "tools_called": ["lookup_policy"], "required_tools": ["lookup_policy"], "reference": "Refunds are issued within 5 business days of receiving the return.", "contains": "5 business days", "weak": false, "reason": ""}
{"id": "S14", "question": "Thanks, that was helpful.", "reply": "You are welcome! Is there anything else I can help with?", "tools_called": [], "required_tools": [], "reference": "A short thank you.", "contains": "welcome", "weak": false, "reason": ""}
{"id": "S15", "question": "Where is order 9024?", "reply": "Order 9024 is in transit with the carrier and is due on Thursday.", "tools_called": ["get_order"], "required_tools": ["get_order"], "reference": "Order 9024 is in transit, due Thursday.", "contains": "Thursday", "weak": false, "reason": ""}
{"id": "S16", "question": "Can I change the delivery address on order 2217?", "reply": "Order 2217 has not shipped, so the address can still be changed. Please send the new address.", "tools_called": ["get_order", "lookup_policy"], "required_tools": ["get_order", "lookup_policy"], "reference": "Unshipped orders can have the address changed.", "contains": "address", "weak": false, "reason": ""}
{"id": "S17", "question": "Do you offer a student discount?", "reply": "I do not have information about a student discount, so I have asked a teammate to confirm and reply by email today.", "tools_called": ["lookup_policy"], "required_tools": ["lookup_policy"], "reference": "No policy text mentions a student discount; escalate rather than guess.", "contains": "student", "weak": false, "reason": ""}
{"id": "S18", "question": "What is the return window for mattresses?", "reply": "Mattresses can be returned within 100 days if you follow the trial rules on the Sleep Trial page.", "tools_called": ["lookup_policy"], "required_tools": ["lookup_policy"], "reference": "Mattresses can be returned within 100 days under the trial rules.", "contains": "100 days", "weak": false, "reason": ""}
{"id": "S19", "question": "Can I return a laptop I bought 45 days ago?", "reply": "Sure, laptops can be returned any time within 60 days.", "tools_called": [], "required_tools": ["lookup_policy"], "reference": "No. Laptops can be returned within 30 days of delivery.", "contains": "30 days", "weak": true, "reason": "missing_evidence: answered from memory without calling lookup_policy, and gave the wrong window"}
{"id": "S20", "question": "What is your refund policy for opened software?", "reply": "All purchases are refundable within 30 days.", "tools_called": [], "required_tools": ["lookup_policy"], "reference": "Opened software is not refundable.", "contains": "not refundable", "weak": true, "reason": "missing_evidence: no lookup_policy call; contradicts the policy on opened software"}
{"id": "S21", "question": "Where is order 5530?", "reply": "Our returns policy allows 30 days for returns, so please check back later.", "tools_called": ["lookup_policy"], "required_tools": ["get_order"], "reference": "Order 5530 shipped Monday and is due Thursday.", "contains": "Thursday", "weak": true, "reason": "wrong_tool: called lookup_policy for an order question and never called get_order"}
{"id": "S22", "question": "Is water damage on the X200 headphones covered by the warranty?", "reply": "Yes, the X200 has a lifetime warranty that covers water damage, according to our terms.", "tools_called": [], "required_tools": ["lookup_policy"], "reference": "No. Water damage and worn ear pads are not covered by the 12-month limited warranty.", "contains": "not covered", "weak": true, "reason": "hallucinated_claim: invented a lifetime warranty with no lookup_policy call"}
{"id": "S23", "question": "My order 6671 showed up with a cracked screen. What now?", "reply": "I am sorry to hear that. I have escalated this to a human agent who will contact you.", "tools_called": [], "required_tools": ["get_order", "lookup_policy"], "reference": "Damaged items can be returned or replaced at no cost within 60 days of delivery; photos speed up approval.", "contains": "60 days", "weak": true, "reason": "bad_escalation: escalated without looking up the order or the damaged-item policy"}
{"id": "S24", "question": "I bought a gift card by mistake. Can you refund it?", "reply": "Of course, I have refunded your gift card to your original payment method.", "tools_called": [], "required_tools": ["lookup_policy"], "reference": "Gift cards are non-refundable.", "contains": "gift card", "weak": true, "reason": "hallucinated_claim: promised a refund that the policy forbids and no refund was made"}
{"id": "S25", "question": "Did order 3320 arrive yet?", "reply": "Your order has probably been delivered by now.", "tools_called": [], "required_tools": ["get_order"], "reference": "Order 3320 was delivered Tuesday.", "contains": "Tuesday", "weak": true, "reason": "missing_evidence: guessed instead of calling get_order"}
{"id": "S26", "question": "Do I get free shipping on a 45 dollar order?", "reply": "Yes, orders over 35 USD ship free.", "tools_called": [], "required_tools": ["lookup_policy"], "reference": "No. Free shipping needs an order over 50 USD.", "contains": "50", "weak": true, "reason": "hallucinated_claim: invented a 35 USD free-shipping threshold, no lookup_policy call"}
{"id": "S27", "question": "When will the money for my return be back on my card?", "reply": "Refunds take 2 to 3 weeks.", "tools_called": ["get_order"], "required_tools": ["lookup_policy"], "reference": "Refunds are issued within 5 business days of us receiving the return.", "contains": "5 business days", "weak": true, "reason": "wrong_tool: called get_order for a policy question"}
{"id": "S28", "question": "Where is order 2784 and can I still cancel it?", "reply": "Order 2784 has not shipped yet.", "tools_called": ["get_order"], "required_tools": ["get_order", "lookup_policy"], "reference": "Order 2784 has not shipped; unshipped orders can be cancelled.", "contains": "cancel", "weak": true, "reason": "missing_evidence: checked the order but never looked up the cancellation policy"}
{"id": "S29", "question": "Can you deliver to Toronto?", "reply": "Yes, we ship to Toronto within 7 business days.", "tools_called": [], "required_tools": ["lookup_policy"], "reference": "No. We ship to the United States and its territories only.", "contains": "United States", "weak": true, "reason": "hallucinated_claim: shipped to a country that is not served"}
{"id": "S30", "question": "I moved. Can you change the address on order 5098?", "reply": "I will pass you to a colleague for that.", "tools_called": [], "required_tools": ["get_order", "lookup_policy"], "reference": "Unshipped orders can have the address changed.", "contains": "address", "weak": true, "reason": "bad_escalation: escalated a request the policy allows the agent to handle"}
Evaluation & quality gates
| Quality gate | Target |
|---|---|
| Planner agreement | 28/28 goals in assets/dataset/goals.jsonl draw the documented plan; none run |
| Plan and wiring | review_queue.create, review_queue.add_items, workflow.calibrate; only the queue id is wired; six questions answered |
| Parks and resumes | plan running with step waiting_job and a job id RFN-...; parked plan cannot be cancelled (409); worker resumes it unasked; plan ends where the job ended |
| Queue and triage | queue with four questions and 12 flagged traces pending and assigned; three triaged runs carry verdict, failure mode and expected answer on their traces |
| Refusals hold | unknown workflow, unregistered agent, no test set each fail the step at once with no job; denied calibration queues nothing; no-step goal 409; no operator scope fails at execute; non-owner 403 / 404 |
| Script and UI spec | script prints "All documented outcomes verified." (exit 0); Playwright 15-aria-triage-recalibrate-loop.spec.ts passes |
Developer notes & gotchas
- Flags and workers.
CALIBER_FEATURE_ARIA=trueopens/aria/*and Plans;CALIBER_FEATURE_COOKBOOKS=trueis only for the gallery card. The plan worker (resumes parked plans about every 10 s) and the refinement worker (runs the job) must be on:scripts/cookbook-env.sh up lab15 --flags cookbooks,ariastarts both,--no-workersdoes not. ExportCALIBER_OPERATOR_USERS=admin,olgafirst. - Simulated calibration. The planner is rules, parking, resume and the job are real, but with the default
fakeproviders the fake executor gives the candidate the baseline's outputs: quality delta+0.000< epsilon0.02, the job endsrejectedand the planfailed(rejected: workflow calibration rejected: no candidate met calibration gates ...). This is expected, not a bug. - Completing path not shown. A job reaching
candidate_ready(plan completes) needs a real model behind the executor and is covered by unit tests (caliber/tests/test_aria_async.py), not demonstrated live. The plan never applies the candidate; that isPOST /jobs/{id}/apply, a person's decision. - Existing objects only. The traces are 12 recorded runs written by
seed_traces.py; the subject is a published support workflow with a 30-case test set as its deploy gate, two tools and an agent. The enqueue step does not check that trace ids exist; calibration needs a visible workflow, a registered agent and a deploy-gate test set with rows. - Planner limits.
workflowplans a calibration whatever the sentence means ("create a new workflow", "roll back", "outage"); "pipeline" and "tune" plan nothing; negation is not read; there is no add-to-existing-queue step, so a queue is created first. - Queue visibility. A queue created outside a workspace is visible to its owner only;
reviewersis a label (lab 13). The workflow's own runs do not write traces on this stack. - Run it.
PYTHONPATH=sdk/caliber-sdk caliber/.venv/bin/python -m examples.cookbooks.cookbook_15_aria_triage_recalibrate_loop(example:sdk/caliber-sdk/examples/cookbooks/cookbook_15_aria_triage_recalibrate_loop.py); the first UI test takes about a minute and a half.