cleandataengineering.aiAgent Harness, drawn simply
You are here: End to end › Checks › 8 · Before the reply › name the reference

Agent Harness Tutorial · End to end · Zoom level 3

How we take care of it: name the reference

name the reference catches a new claim without its CLM- number.

Open: 11before loopopen ›Open: 22before modelopen ›Open: 33after modelopen ›Open: 44before toolopen ›Open: 55the toolopen ›Open: 66after toolopen ›Open: 77after loopopen ›Open: 88before replyopen ›It readsthe reply, and any claim createdthis turnname the referencerule · agentpassCarries onfailIf it failsthe number is addedWHERE IN THE CODE: F entrypoint/reference.py
The strip at the top shows every check point where this check runs, in dark.

How we took care of it.

  1. If a claim was created, the reply must name its CLM- number; if it doesn't, the number is added.
It readsthe reply, and any claim created this turn
Kindrule
Provided byagent
If it failsthe number is added
Where in the codeF entrypoint/reference.py
Runs at8 · Before the reply
Real exampleFlow 2: "Claim reference: CLM-019002".

More on this: 2 · Reporting a claim, across two turns.

How it is done: the real code

Cut from the live repositories each time the site is built, so it always matches what runs.

"""P-FNOL's reference: a claim registered this turn is named, whatever the model said.

The AOAS says a new claim's policyholder "is given the claim reference" — an
obligation on the turn, not a hope about the model's wording. The claims system
returns the reference it made (`created`, AOAS `register_claim.creates`), and
the harness's loop keeps only the row each write acted on, so the reference
would be lost between the tool and the reply (FINDINGS F-8). This per-turn view
of the tool client keeps it, and `given` names it when the reply did not.
"""

from __future__ import annotations

from dataclasses import dataclass, field

from claims_fnol.contracts import (
    Completed,
    IdempotencyKey,
    Identity,
    ToolClient,
    ToolRegistry,
    ToolResult,
    TurnResult,
)

GIVEN = "Your claim reference is {refs}."


@dataclass
class Created:
    """The tool client, for one turn, remembering every reference it created."""

    inner: ToolClient
    made: list[str] = field(default_factory=list)