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.
How we took care of it.
- If a claim was created, the reply must name its CLM- number; if it doesn't, the number is added.
| It reads | the reply, and any claim created this turn |
| Kind | rule |
| Provided by | agent |
| If it fails | the number is added |
| Where in the code | F entrypoint/reference.py |
| Runs at | 8 · 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)