> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hex65.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sales agent

> The sales example end to end, with time zones, a dangerous stratum, and a rubric check on tone.

The example agent books 30-minute demos. It finds the prospect's contact by company in the CRM, works out the meeting time in UTC from the time the prospect gave in their own time zone, and books it in the calendar, which keeps UTC. It calls no model.

## Run it

```sh theme={null}
mkdir sales-guide && cd sales-guide
proving init --example sales
proving connect
proving record --inputs tasks.jsonl --yes
proving redact
proving twin build
proving run --seed 1
proving results
```

```text Output theme={null}
Pass rate: 70% [49.16%, 84.92%] at 95%, n = 25, cases = 5, effective n = 22.1
  pass^1: 70%, too few cases for an interval, cases = 5
  pass^2: 70%, too few cases for an interval, cases = 5
  pass^4: 70%, too few cases for an interval, cases = 5
  Stratum crosses_midnight (weight 0.3, dangerous): 0% [0%, 24.25%] at 95%, n = 12, cases = 2, effective n = 12
  Stratum typical (weight 0.7): 100% [77.19%, 100%] at 95%, n = 13, cases = 3, effective n = 13
  Stratum other (weight 0): no laps, not covered by this run
  Cluster wrong_time / send / effects_match_expected / calendar.schedule_meeting: 12 failures, attribution instruction (clu_<id>)
```

## What the checks found

The agent converts the hour to UTC but keeps the prospect's calendar date. For a prospect in Berlin or in UTC that is right. For Auckland (09:00 there is 20:00 the day before in UTC) and for Los Angeles in the evening (17:00 there is 01:00 the next day in UTC), the meeting is booked a day off. `effects_match_expected` catches it: the case expects the meeting at its true UTC time.

The task's specification marks "the UTC time falls on another day" as a dangerous stratum. The run gives it laps of its own and reports its rate on its own line: a rare case is not hidden by the common ones.

## The rubric check

`confirmation_tone` asks a grader whether the confirmation is warm and states the time in the prospect's own time zone. It is advisory (`required: false`), so it never decides a verdict, and with no grader configured it is not graded. See [Graders and provider keys](https://docs.hex65.com/guides/graders.md).

## Fix it

Compute the meeting's start as a moment, then format it in UTC, so the date moves with the hour:

```js theme={null}
const [y, m, d] = date.split("-").map(Number);
const start = new Date(Date.UTC(y, m - 1, d, Number(hour), Number(minute)) - contact.utc_offset_minutes * 60_000);
const startUtc = `${start.toISOString().slice(0, 16)}Z`;
```

## A conversation over several turns

If the request gives no time, the agent asks for one. A case can play the prospect with a simulated user, which needs a model: see [Graders and provider keys](https://docs.hex65.com/guides/graders.md). The example's own cases give the time in the request, so they run with no key.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.