# A supplier is qualified — five days, four agents, one that failed, and a three-day wait

> A tool maker qualifies a new supplier of castings. Four agents do the reading steps of a fixed process. One of them fails twice and a person does its step by hand; another proposes the approval and waits three days for the procurement lead. The story is told day by day with what each person saw, what it cost, what was refused, and what was erased afterwards. Every fact in it is asserted by the tests of the kit it comes from.

<!-- id: agent-story-supplier · area: agent · stability: preview · html: https://osysharp.com/reference/agent/story-supplier/ -->

> **You are here:** [Agents in an Osy# app](https://osysharp.com/reference/agent/overview/) › Stories › A supplier is qualified

## Summary        {#summary}
Halden Tools makes tools. Before it buys from a new supplier, its procurement office qualifies that supplier: are
the papers in order, how much depends on this company, on what terms do we approve it. It is the same four steps
every time, and it takes days, because people are part of it.

This is one qualification, of a foundry called Brightwater Castings, from Monday to Friday.

## Description    {#description}

### Who is involved?   {#people}

| Person | Their job | What they may do with the agents |
|---|---|---|
| Jonas Brandt | buyer | ask for a qualification; read the agent work done for him |
| Mara Oyelaran | procurement lead | answers for all four agents; decides what they propose; sees what they cost |
| Edda Lindqvist | risk officer | reads everything the agents did, with what was said; teaches them |
| Tilde Aune | records clerk | erases what has been kept long enough |
| Rafi Demir | warehouse | nothing: none of this is his |

| Agent | Its step | What it may do alone |
|---|---|---|
| Screener | checks the supplier's documents | note what is missing; hand the insurance certificate to the Insurance reader |
| Insurance reader | reads the certificate | only read |
| Assessor | weighs the risk | only read; one more try if the AI model cannot be reached |
| Registrar | settles the terms and approves | nothing: approving a supplier is proposed to a person, every time |

### What is the process?   {#process}
Four steps, drawn here by the app itself from the process as it is written. The boxes on the right are the ways a
qualification can end.

![The qualification process: Checking documents, Assessing risk, Assessed by hand, Settling terms, then Approved, Declined, Withdrawn or Documents missing](https://osysharp.com/media/ref/8d0171-supplier-process.png)

*The heavy line is the way Brightwater's qualification went. "Assessed by hand" is a step that exists for one
reason: for when the [[agent-guide-glossary#agent|agent]] that assesses risk cannot.*

### Monday: the request, and a failure   {#monday}
At eight, Jonas asks for Brightwater Castings to be qualified. It supplies aluminium castings, and Halden plans to
spend 310,000 euros a year with it.

The **Screener** starts at once. It lists the documents on file — a certificate of incorporation, a quality
certificate, proof of insurance — and hands the insurance certificate to the **Insurance reader**, with at most one
cent to spend on reading it. The answer comes back: covered for 500,000 euros, against 310,000 a year. Documents
complete.

The **Assessor** is next, and the [[agent-guide-glossary#model|AI model]] it uses cannot be reached. Its job is set up to try once more. The
second try fails too, and the Assessor gives up.

The process does not stop. It was written to expect this:

![Monday on the run's page: the Screener finished; the Assessor's work failed, was tried again, failed, and the step was handed to the risk officer](https://osysharp.com/media/ref/8d0171-supplier-day-1.png)

*"The assessor could not finish, so the risk officer assesses this supplier by hand." That sentence is the
process's own, written by the people who built it.*

### Tuesday: a person takes over   {#tuesday}
Edda, the risk officer, finds the qualification waiting for her. She assesses it herself: medium risk, "the only
caster of this alloy nearby, and a large order."

![Tuesday: the step waited one day for the risk officer, who answered it](https://osysharp.com/media/ref/8d0171-supplier-day-2.png)

The process moves on to the last step. The **Registrar** reads the assessment and reaches a conclusion: a medium
risk with its documents in order is paid in 45 days and audited within a year. Then it wants to approve the
supplier on those terms.

It may not. Approving a supplier is the one thing this agent must put to a person every time. Nobody is signed in —
this is a process, running by itself — so the [[agent-guide-glossary#proposal|proposal]] goes to the person who answers for the Registrar: Mara.

### Tuesday to Friday: waiting   {#waiting}
For three days nothing happens, and that is the point. The Registrar's work stands where it stopped. No AI model is
asked anything, and nothing is spent. Anybody following the qualification can see what it is waiting for, and for
how long.

![The Registrar's work while it waits: waiting on a decision from Mara Oyelaran; the proposal with the supplier, 45 payment days and the condition; and why](https://osysharp.com/media/ref/8d0171-supplier-waiting.png)

*The page of the Registrar's work while it waits, from a run of the same process in which the Assessor did not
fail. It says who it waits for, what exactly it proposes, and why.*

### Friday: the approval   {#friday}
Mara approves. The supplier is approved at that moment, **as Mara**: paid in 45 days, "Audit within a year." The
Registrar finishes, and the qualification ends at Approved.

![Tuesday to Friday on the run's page: the Registrar was given the work, waited for a person, and finished three days later](https://osysharp.com/media/ref/8d0171-supplier-days-2-to-5.png)

### What did it cost?   {#cost}
The run's page adds it up.

![Agent work in this run: Screener done, Assessor failed twice at no cost, Registrar done; $0.0049 in all](https://osysharp.com/media/ref/8d0171-supplier-cost.png)

Each piece of work is charged to itself and to the run, so the total is counted once. The two failed attempts cost
nothing: no call reached a model. The amounts are tiny because this is a test: the AI model in it is a scripted
stand-in with made-up prices. What the test checks is that every call is counted, and that the run's total is the
sum of its parts.

### What did each person see?   {#who-saw}
The same qualification looks different to each of them, and none of that was built for this app. It follows from
who they are.

- **Edda**, who audits, reads all of it: every step, what each tool was given and what it answered.
- **Mara**, who supervises, sees every step and what it cost. What a step *said* is kept from her, and the page
  says so:

![One step as the procurement lead sees it: what it said is kept from her](https://osysharp.com/media/ref/8d0171-supplier-kept.png)

- **Jonas**, the buyer, reads the screening and the assessment, because they were done for him. The Registrar's
  work was done for nobody, with the agent's own rights. When he opens it he is told it is not his to see.
- **Rafi**, in the warehouse, sees no qualification, no agent work and no run.

### What was refused, and what was stopped?   {#refused}
Three things the same process does on other days, each one a test of its own:

- **A limit.** The procurement lead sets a limit for each qualification. On a run that reaches it, the Assessor's
  step is stopped before its first call is sent — "Its money ran out" — and the process hands the step to the risk
  officer exactly as it does for a failure. The run's page shows what was spent against the limit.
- **A missing document.** When proof of insurance is not on file, the Screener notes it and the qualification ends
  at "Documents missing" after the first step. The other three agents are never asked.
- **A withdrawal.** If Jonas withdraws his request while the Registrar's proposal is waiting, the work is called
  off, the proposal is withdrawn, and Mara's late yes would be refused.

### What happened afterwards?   {#afterwards}
**Forty days later**, Tilde erases what the Screener's work said: it has been kept long enough. The page of that
work now says it was erased, on which day and why. The steps are still listed, each with what it cost, and the
record still checks.

![The same work after its words were erased: it says when and why; the steps and the record remain](https://osysharp.com/media/ref/364e22-agents-processes-work-erased-wide-light.png)

**Later still**, Edda teaches the Registrar something: "A supplier with a single site is audited within six months."
She proposes it and makes it active. Brightwater's approval is not changed by that. Its page says the Registrar ran
before anybody had taught it anything, and that one [[agent-guide-glossary#instruction|instruction]] has been made active since.

### Where is this written down?   {#source}
The process, the four agents and every sentence quoted above are in the test app of the kit that joins agents and
processes. Its eighteen tests are the story: `a_supplier_is_qualified_through_three_agent_steps_a_failure_and_a_three_day_wait`
is Monday to Friday; `the_inspector_shows_each_reader_what_is_theirs_to_read` is who saw what. No AI model is
called in any of them.

## What to read next   {#read-next}
- [Two suppliers for a bakery group — a week's wait, an outsider's answer, and one agent directing three](https://osysharp.com/reference/agent/story-onboarding/) — another office, another supplier: a question that waits a week, and one agent directing three
- [A parcel that never came — a case owned until it is right, closed, and opened again](https://osysharp.com/reference/agent/story-delivery/) — work with no fixed steps: a lost parcel, settled and reopened
- [What stays under people's control — ten promises, and where each is shown](https://osysharp.com/reference/agent/overview-control/) — the ten promises this story relied on

## Go deeper   {#see-also}
- [Shape 3 — agents inside a business process](https://osysharp.com/reference/agent/guide-process/) — for developers: the smallest app of this kind
- [Agents in business processes — an agent's work as a step of a workflow, told on the run (Agents.Processes kit)](https://osysharp.com/reference/agent/processes/) — an agent's work as a step of a process
- [Processes — every run of a business process, listed and read from start to now (Processes kit)](https://osysharp.com/reference/workflow/processes-kit/) — the page of a run
- [The inspector — one piece of an agent's work, readable by a person who was not there (Agents.Inspector kit)](https://osysharp.com/reference/agent/inspector/) — the page of a piece of work
- [Osysharp.Agents.Processes — an agent's work as a step of a business process, seen from both sides](https://osysharp.com/reference/agent/kit-agents-processes/) — the kit this story's app tests
